@intlayer/api 9.7.0 → 9.7.2
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 +2 -3
- package/dist/cjs/cms/createIntlayerCMS.cjs +2 -3
- package/dist/cjs/cms/index.cjs +2 -2
- package/dist/cjs/distantDictionary/fetchDistantDictionaries.cjs +3 -4
- package/dist/cjs/distantDictionary/fetchDistantDictionary.cjs +3 -4
- package/dist/cjs/distantDictionary/index.cjs +2 -2
- package/dist/cjs/fetcher.cjs +2 -3
- package/dist/cjs/getIntlayerAPI/ai.cjs +38 -43
- package/dist/cjs/getIntlayerAPI/ai.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/analytics.cjs +32 -4
- package/dist/cjs/getIntlayerAPI/analytics.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/asset.cjs +3 -4
- package/dist/cjs/getIntlayerAPI/audit.cjs +3 -4
- package/dist/cjs/getIntlayerAPI/bitbucket.cjs +3 -4
- package/dist/cjs/getIntlayerAPI/codeberg.cjs +3 -4
- package/dist/cjs/getIntlayerAPI/dictionary.cjs +3 -4
- package/dist/cjs/getIntlayerAPI/editor.cjs +3 -4
- package/dist/cjs/getIntlayerAPI/environment.cjs +3 -4
- package/dist/cjs/getIntlayerAPI/forge.cjs +2 -3
- package/dist/cjs/getIntlayerAPI/gitee.cjs +3 -4
- package/dist/cjs/getIntlayerAPI/github.cjs +3 -4
- package/dist/cjs/getIntlayerAPI/gitlab.cjs +3 -4
- package/dist/cjs/getIntlayerAPI/index.cjs +25 -26
- package/dist/cjs/getIntlayerAPI/newsletter.cjs +3 -4
- package/dist/cjs/getIntlayerAPI/oAuth.cjs +2 -3
- package/dist/cjs/getIntlayerAPI/organization.cjs +3 -4
- package/dist/cjs/getIntlayerAPI/project.cjs +3 -4
- package/dist/cjs/getIntlayerAPI/readServerSentEvents.cjs +70 -0
- package/dist/cjs/getIntlayerAPI/readServerSentEvents.cjs.map +1 -0
- package/dist/cjs/getIntlayerAPI/reviewer.cjs +3 -4
- package/dist/cjs/getIntlayerAPI/search.cjs +3 -4
- package/dist/cjs/getIntlayerAPI/showcaseProject.cjs +3 -4
- package/dist/cjs/getIntlayerAPI/status.cjs +3 -4
- package/dist/cjs/getIntlayerAPI/stripe.cjs +3 -4
- package/dist/cjs/getIntlayerAPI/tag.cjs +3 -4
- package/dist/cjs/getIntlayerAPI/translate.cjs +3 -4
- package/dist/cjs/getIntlayerAPI/user.cjs +3 -4
- package/dist/cjs/index.cjs +33 -33
- package/dist/cjs/proxy.cjs +26 -27
- package/dist/cjs/public/createPublicClient.cjs +1 -2
- package/dist/cjs/public/index.cjs +1 -1
- package/dist/cjs/resolveInternalBackendUrl.cjs +1 -2
- package/dist/esm/cms/createAuthManager.mjs +1 -2
- package/dist/esm/cms/createIntlayerCMS.mjs +1 -2
- package/dist/esm/distantDictionary/fetchDistantDictionaries.mjs +1 -2
- package/dist/esm/distantDictionary/fetchDistantDictionary.mjs +1 -2
- package/dist/esm/fetcher.mjs +1 -2
- package/dist/esm/getIntlayerAPI/ai.mjs +37 -42
- package/dist/esm/getIntlayerAPI/ai.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/analytics.mjs +31 -3
- package/dist/esm/getIntlayerAPI/analytics.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/asset.mjs +2 -3
- package/dist/esm/getIntlayerAPI/audit.mjs +2 -3
- package/dist/esm/getIntlayerAPI/bitbucket.mjs +2 -3
- package/dist/esm/getIntlayerAPI/codeberg.mjs +1 -2
- package/dist/esm/getIntlayerAPI/dictionary.mjs +2 -3
- package/dist/esm/getIntlayerAPI/editor.mjs +2 -3
- package/dist/esm/getIntlayerAPI/environment.mjs +2 -3
- package/dist/esm/getIntlayerAPI/forge.mjs +1 -2
- package/dist/esm/getIntlayerAPI/gitee.mjs +1 -2
- package/dist/esm/getIntlayerAPI/github.mjs +2 -3
- package/dist/esm/getIntlayerAPI/gitlab.mjs +2 -3
- package/dist/esm/getIntlayerAPI/index.mjs +2 -3
- package/dist/esm/getIntlayerAPI/newsletter.mjs +2 -3
- package/dist/esm/getIntlayerAPI/oAuth.mjs +1 -2
- package/dist/esm/getIntlayerAPI/organization.mjs +2 -3
- package/dist/esm/getIntlayerAPI/project.mjs +2 -3
- package/dist/esm/getIntlayerAPI/readServerSentEvents.mjs +68 -0
- package/dist/esm/getIntlayerAPI/readServerSentEvents.mjs.map +1 -0
- package/dist/esm/getIntlayerAPI/reviewer.mjs +2 -3
- package/dist/esm/getIntlayerAPI/search.mjs +2 -3
- package/dist/esm/getIntlayerAPI/showcaseProject.mjs +2 -3
- package/dist/esm/getIntlayerAPI/status.mjs +2 -3
- package/dist/esm/getIntlayerAPI/stripe.mjs +2 -3
- package/dist/esm/getIntlayerAPI/tag.mjs +2 -3
- package/dist/esm/getIntlayerAPI/translate.mjs +2 -3
- package/dist/esm/getIntlayerAPI/user.mjs +2 -3
- package/dist/esm/index.mjs +7 -7
- package/dist/esm/proxy.mjs +2 -3
- package/dist/esm/public/createPublicClient.mjs +1 -2
- package/dist/esm/resolveInternalBackendUrl.mjs +1 -2
- package/dist/types/cms/createAuthManager.d.ts +1 -2
- package/dist/types/cms/createAuthManager.d.ts.map +1 -1
- package/dist/types/cms/createIntlayerCMS.d.ts +0 -2
- package/dist/types/cms/createIntlayerCMS.d.ts.map +1 -1
- package/dist/types/distantDictionary/fetchDistantDictionaries.d.ts +1 -3
- package/dist/types/distantDictionary/fetchDistantDictionaries.d.ts.map +1 -1
- package/dist/types/distantDictionary/fetchDistantDictionary.d.ts +1 -3
- package/dist/types/distantDictionary/fetchDistantDictionary.d.ts.map +1 -1
- package/dist/types/fetcher.d.ts +0 -2
- package/dist/types/fetcher.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/ai.d.ts +9 -5
- package/dist/types/getIntlayerAPI/ai.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/analytics.d.ts +7 -5
- package/dist/types/getIntlayerAPI/analytics.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/asset.d.ts +2 -4
- package/dist/types/getIntlayerAPI/asset.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/audit.d.ts +2 -4
- package/dist/types/getIntlayerAPI/audit.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/bitbucket.d.ts +2 -4
- package/dist/types/getIntlayerAPI/bitbucket.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/codeberg.d.ts +42 -6
- package/dist/types/getIntlayerAPI/codeberg.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/dictionary.d.ts +3 -5
- package/dist/types/getIntlayerAPI/dictionary.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/editor.d.ts +2 -4
- package/dist/types/getIntlayerAPI/editor.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/environment.d.ts +2 -4
- package/dist/types/getIntlayerAPI/environment.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/forge.d.ts +21 -4
- package/dist/types/getIntlayerAPI/forge.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/gitee.d.ts +42 -6
- package/dist/types/getIntlayerAPI/gitee.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/github.d.ts +2 -4
- package/dist/types/getIntlayerAPI/github.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/gitlab.d.ts +2 -4
- package/dist/types/getIntlayerAPI/gitlab.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/index.d.ts +2 -3
- package/dist/types/getIntlayerAPI/index.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/newsletter.d.ts +2 -4
- package/dist/types/getIntlayerAPI/newsletter.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/oAuth.d.ts +0 -2
- package/dist/types/getIntlayerAPI/oAuth.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/organization.d.ts +2 -4
- package/dist/types/getIntlayerAPI/organization.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/project.d.ts +3 -5
- package/dist/types/getIntlayerAPI/project.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/readServerSentEvents.d.ts +18 -0
- package/dist/types/getIntlayerAPI/readServerSentEvents.d.ts.map +1 -0
- package/dist/types/getIntlayerAPI/reviewer.d.ts +2 -4
- package/dist/types/getIntlayerAPI/reviewer.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/search.d.ts +2 -4
- package/dist/types/getIntlayerAPI/search.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/showcaseProject.d.ts +2 -4
- package/dist/types/getIntlayerAPI/showcaseProject.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/status.d.ts +2 -4
- package/dist/types/getIntlayerAPI/status.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/stripe.d.ts +2 -4
- package/dist/types/getIntlayerAPI/stripe.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/tag.d.ts +2 -4
- package/dist/types/getIntlayerAPI/tag.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/translate.d.ts +2 -4
- package/dist/types/getIntlayerAPI/translate.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/user.d.ts +2 -4
- package/dist/types/getIntlayerAPI/user.d.ts.map +1 -1
- package/dist/types/index.d.ts +5 -5
- package/dist/types/proxy.d.ts +0 -2
- package/dist/types/proxy.d.ts.map +1 -1
- package/dist/types/public/createPublicClient.d.ts +1 -3
- package/dist/types/public/createPublicClient.d.ts.map +1 -1
- package/dist/types/resolveInternalBackendUrl.d.ts +0 -2
- package/dist/types/resolveInternalBackendUrl.d.ts.map +1 -1
- package/dist/types/types.d.ts +2 -2
- package/package.json +110 -110
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { fetcher } from "../fetcher.mjs";
|
|
2
1
|
import { createEndpoint } from "../cms/createIntlayerCMS.mjs";
|
|
2
|
+
import { fetcher } from "../fetcher.mjs";
|
|
3
3
|
import { editor } from "@intlayer/config/built";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/getIntlayerAPI/editor.ts
|
|
6
6
|
const getEditorAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
7
7
|
const EDITOR_API_ROUTE = `${intlayerConfig?.editor?.editorURL ?? editor.editorURL}/api`;
|
|
8
8
|
/**
|
|
@@ -39,6 +39,5 @@ const getEditorAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
|
39
39
|
*/
|
|
40
40
|
const editorEndpoint = createEndpoint(getEditorAPI);
|
|
41
41
|
|
|
42
|
-
//#endregion
|
|
43
42
|
export { editorEndpoint, getEditorAPI };
|
|
44
43
|
//# sourceMappingURL=editor.mjs.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { fetcher } from "../fetcher.mjs";
|
|
2
1
|
import { createEndpoint } from "../cms/createIntlayerCMS.mjs";
|
|
2
|
+
import { fetcher } from "../fetcher.mjs";
|
|
3
3
|
import { editor } from "@intlayer/config/built";
|
|
4
4
|
import { buildRouteURL } from "@intlayer/backend-contract/defineRoute";
|
|
5
5
|
import { BACKEND_URL } from "@intlayer/config/defaultValues";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/getIntlayerAPI/environment.ts
|
|
8
8
|
/** Prefix of the routes, checked against the backend contract. */
|
|
9
9
|
const environmentGroup = { prefix: "/api/project/environment" };
|
|
10
10
|
/**
|
|
@@ -71,6 +71,5 @@ const getEnvironmentAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
|
71
71
|
*/
|
|
72
72
|
const environmentEndpoint = createEndpoint(getEnvironmentAPI);
|
|
73
73
|
|
|
74
|
-
//#endregion
|
|
75
74
|
export { environmentEndpoint, getEnvironmentAPI };
|
|
76
75
|
//# sourceMappingURL=environment.mjs.map
|
|
@@ -3,7 +3,7 @@ import { editor } from "@intlayer/config/built";
|
|
|
3
3
|
import { buildRouteURL } from "@intlayer/backend-contract/defineRoute";
|
|
4
4
|
import { BACKEND_URL } from "@intlayer/config/defaultValues";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/getIntlayerAPI/forge.ts
|
|
7
7
|
/**
|
|
8
8
|
* Method and path of every route of a Gitea-compatible forge, checked
|
|
9
9
|
* against the backend contract at compile time.
|
|
@@ -58,6 +58,5 @@ const createForgeAPI = (group) => (authAPIOptions = {}, intlayerConfig) => {
|
|
|
58
58
|
};
|
|
59
59
|
};
|
|
60
60
|
|
|
61
|
-
//#endregion
|
|
62
61
|
export { createForgeAPI };
|
|
63
62
|
//# sourceMappingURL=forge.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createEndpoint } from "../cms/createIntlayerCMS.mjs";
|
|
2
2
|
import { createForgeAPI } from "./forge.mjs";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/getIntlayerAPI/gitee.ts
|
|
5
5
|
/** Prefix of the routes, checked against the backend contract. */
|
|
6
6
|
const giteeGroup = { prefix: "/api/gitee" };
|
|
7
7
|
/** Gitee repositories of the linked account. */
|
|
@@ -14,6 +14,5 @@ const getGiteeAPI = createForgeAPI(giteeGroup);
|
|
|
14
14
|
*/
|
|
15
15
|
const giteeEndpoint = createEndpoint(getGiteeAPI);
|
|
16
16
|
|
|
17
|
-
//#endregion
|
|
18
17
|
export { getGiteeAPI, giteeEndpoint };
|
|
19
18
|
//# sourceMappingURL=gitee.mjs.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { fetcher } from "../fetcher.mjs";
|
|
2
1
|
import { createEndpoint } from "../cms/createIntlayerCMS.mjs";
|
|
2
|
+
import { fetcher } from "../fetcher.mjs";
|
|
3
3
|
import { editor } from "@intlayer/config/built";
|
|
4
4
|
import { buildRouteURL } from "@intlayer/backend-contract/defineRoute";
|
|
5
5
|
import { BACKEND_URL } from "@intlayer/config/defaultValues";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/getIntlayerAPI/github.ts
|
|
8
8
|
/** Prefix of the routes, checked against the backend contract. */
|
|
9
9
|
const githubGroup = { prefix: "/api/github" };
|
|
10
10
|
/**
|
|
@@ -112,6 +112,5 @@ const getGithubAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
|
112
112
|
*/
|
|
113
113
|
const githubEndpoint = createEndpoint(getGithubAPI);
|
|
114
114
|
|
|
115
|
-
//#endregion
|
|
116
115
|
export { getGithubAPI, githubEndpoint };
|
|
117
116
|
//# sourceMappingURL=github.mjs.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { fetcher } from "../fetcher.mjs";
|
|
2
1
|
import { createEndpoint } from "../cms/createIntlayerCMS.mjs";
|
|
2
|
+
import { fetcher } from "../fetcher.mjs";
|
|
3
3
|
import { editor } from "@intlayer/config/built";
|
|
4
4
|
import { buildRouteURL } from "@intlayer/backend-contract/defineRoute";
|
|
5
5
|
import { BACKEND_URL } from "@intlayer/config/defaultValues";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/getIntlayerAPI/gitlab.ts
|
|
8
8
|
/** Prefix of the routes, checked against the backend contract. */
|
|
9
9
|
const gitlabGroup = { prefix: "/api/gitlab" };
|
|
10
10
|
/**
|
|
@@ -117,6 +117,5 @@ const getGitlabAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
|
117
117
|
*/
|
|
118
118
|
const gitlabEndpoint = createEndpoint(getGitlabAPI);
|
|
119
119
|
|
|
120
|
-
//#endregion
|
|
121
120
|
export { getGitlabAPI, gitlabEndpoint };
|
|
122
121
|
//# sourceMappingURL=gitlab.mjs.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { getOAuthAPI } from "./oAuth.mjs";
|
|
2
1
|
import { getAiAPI } from "./ai.mjs";
|
|
3
2
|
import { getAnalyticsAPI } from "./analytics.mjs";
|
|
4
3
|
import { getAssetAPI } from "./asset.mjs";
|
|
@@ -12,6 +11,7 @@ import { getGiteeAPI } from "./gitee.mjs";
|
|
|
12
11
|
import { getGithubAPI } from "./github.mjs";
|
|
13
12
|
import { getGitlabAPI } from "./gitlab.mjs";
|
|
14
13
|
import { getNewsletterAPI } from "./newsletter.mjs";
|
|
14
|
+
import { getOAuthAPI } from "./oAuth.mjs";
|
|
15
15
|
import { getOrganizationAPI } from "./organization.mjs";
|
|
16
16
|
import { getProjectAPI } from "./project.mjs";
|
|
17
17
|
import { getReviewerAPI } from "./reviewer.mjs";
|
|
@@ -25,7 +25,7 @@ import { getUserAPI } from "./user.mjs";
|
|
|
25
25
|
import { editor } from "@intlayer/config/built";
|
|
26
26
|
import { defu } from "defu";
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
// src/getIntlayerAPI/index.ts
|
|
29
29
|
const getIntlayerAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
30
30
|
const resolvedConfig = defu(intlayerConfig ?? {}, { editor });
|
|
31
31
|
return {
|
|
@@ -56,6 +56,5 @@ const getIntlayerAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
|
56
56
|
};
|
|
57
57
|
};
|
|
58
58
|
|
|
59
|
-
//#endregion
|
|
60
59
|
export { getIntlayerAPI };
|
|
61
60
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { fetcher } from "../fetcher.mjs";
|
|
2
1
|
import { createEndpoint } from "../cms/createIntlayerCMS.mjs";
|
|
2
|
+
import { fetcher } from "../fetcher.mjs";
|
|
3
3
|
import { editor } from "@intlayer/config/built";
|
|
4
4
|
import { buildRouteURL } from "@intlayer/backend-contract/defineRoute";
|
|
5
5
|
import { BACKEND_URL } from "@intlayer/config/defaultValues";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/getIntlayerAPI/newsletter.ts
|
|
8
8
|
/** Prefix of the routes, checked against the backend contract. */
|
|
9
9
|
const newsletterGroup = { prefix: "/api/newsletter" };
|
|
10
10
|
/**
|
|
@@ -64,6 +64,5 @@ const getNewsletterAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
|
64
64
|
*/
|
|
65
65
|
const newsletterEndpoint = createEndpoint(getNewsletterAPI);
|
|
66
66
|
|
|
67
|
-
//#endregion
|
|
68
67
|
export { getNewsletterAPI, newsletterEndpoint };
|
|
69
68
|
//# sourceMappingURL=newsletter.mjs.map
|
|
@@ -3,7 +3,7 @@ import { editor } from "@intlayer/config/built";
|
|
|
3
3
|
import { buildRouteURL } from "@intlayer/backend-contract/defineRoute";
|
|
4
4
|
import { BACKEND_URL } from "@intlayer/config/defaultValues";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/getIntlayerAPI/oAuth.ts
|
|
7
7
|
/** OAuth2 routes, checked against the backend contract. */
|
|
8
8
|
const oAuth2Group = { prefix: "/oauth2" };
|
|
9
9
|
const oAuth2Endpoints = {
|
|
@@ -60,6 +60,5 @@ const getOAuthAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
|
60
60
|
};
|
|
61
61
|
};
|
|
62
62
|
|
|
63
|
-
//#endregion
|
|
64
63
|
export { getOAuthAPI };
|
|
65
64
|
//# sourceMappingURL=oAuth.mjs.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { fetcher } from "../fetcher.mjs";
|
|
2
1
|
import { createEndpoint } from "../cms/createIntlayerCMS.mjs";
|
|
2
|
+
import { fetcher } from "../fetcher.mjs";
|
|
3
3
|
import { editor } from "@intlayer/config/built";
|
|
4
4
|
import { buildRouteURL } from "@intlayer/backend-contract/defineRoute";
|
|
5
5
|
import { BACKEND_URL } from "@intlayer/config/defaultValues";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/getIntlayerAPI/organization.ts
|
|
8
8
|
/** Prefix of the routes, checked against the backend contract. */
|
|
9
9
|
const organizationGroup = { prefix: "/api/organization" };
|
|
10
10
|
/**
|
|
@@ -163,6 +163,5 @@ const getOrganizationAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
|
163
163
|
*/
|
|
164
164
|
const organizationEndpoint = createEndpoint(getOrganizationAPI);
|
|
165
165
|
|
|
166
|
-
//#endregion
|
|
167
166
|
export { getOrganizationAPI, organizationEndpoint };
|
|
168
167
|
//# sourceMappingURL=organization.mjs.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { fetcher } from "../fetcher.mjs";
|
|
2
1
|
import { createEndpoint } from "../cms/createIntlayerCMS.mjs";
|
|
2
|
+
import { fetcher } from "../fetcher.mjs";
|
|
3
3
|
import { editor } from "@intlayer/config/built";
|
|
4
4
|
import { buildRouteURL } from "@intlayer/backend-contract/defineRoute";
|
|
5
5
|
import { BACKEND_URL } from "@intlayer/config/defaultValues";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/getIntlayerAPI/project.ts
|
|
8
8
|
/** Prefix of the project routes, checked against the backend contract. */
|
|
9
9
|
const projectGroup = { prefix: "/api/project" };
|
|
10
10
|
/**
|
|
@@ -252,6 +252,5 @@ const getProjectAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
|
252
252
|
*/
|
|
253
253
|
const projectEndpoint = createEndpoint(getProjectAPI);
|
|
254
254
|
|
|
255
|
-
//#endregion
|
|
256
255
|
export { getProjectAPI, projectEndpoint };
|
|
257
256
|
//# sourceMappingURL=project.mjs.map
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
// src/getIntlayerAPI/readServerSentEvents.ts
|
|
2
|
+
/**
|
|
3
|
+
* Error raised when the server emits an `event: error` frame mid-stream.
|
|
4
|
+
* `message` is the serialized payload, matching the `fetcher` convention so
|
|
5
|
+
* callers can match backend error codes with `error.message.includes(code)`.
|
|
6
|
+
*/
|
|
7
|
+
var ServerSentEventError = class extends Error {
|
|
8
|
+
payload;
|
|
9
|
+
constructor(payload) {
|
|
10
|
+
super(JSON.stringify(payload));
|
|
11
|
+
this.name = "ServerSentEventError";
|
|
12
|
+
this.payload = payload;
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Reads a `text/event-stream` response and calls `onData` with each parsed
|
|
17
|
+
* `data:` payload of the default event type.
|
|
18
|
+
*
|
|
19
|
+
* Throws a {@link ServerSentEventError} as soon as an `event: error` frame is
|
|
20
|
+
* received, so stream failures reject the caller instead of resolving silently.
|
|
21
|
+
*/
|
|
22
|
+
const readServerSentEvents = async (response, onData) => {
|
|
23
|
+
const reader = response.body?.getReader();
|
|
24
|
+
if (!reader) throw new Error("No reader available");
|
|
25
|
+
const decoder = new TextDecoder();
|
|
26
|
+
let buffer = "";
|
|
27
|
+
let currentEventName = "message";
|
|
28
|
+
const handleLine = (line) => {
|
|
29
|
+
if (line === "") {
|
|
30
|
+
currentEventName = "message";
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
if (line.startsWith("event:")) {
|
|
34
|
+
currentEventName = line.slice(6).trim();
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (!line.startsWith("data:")) return;
|
|
38
|
+
const rawData = line.slice(5).trimStart();
|
|
39
|
+
let parsedData;
|
|
40
|
+
try {
|
|
41
|
+
parsedData = JSON.parse(rawData);
|
|
42
|
+
} catch {
|
|
43
|
+
if (currentEventName === "error") throw new ServerSentEventError({ message: rawData });
|
|
44
|
+
console.error("Failed to parse SSE data:", rawData);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
if (currentEventName === "error") throw new ServerSentEventError(parsedData);
|
|
48
|
+
onData(parsedData);
|
|
49
|
+
};
|
|
50
|
+
try {
|
|
51
|
+
while (true) {
|
|
52
|
+
const { done, value } = await reader.read();
|
|
53
|
+
if (done) break;
|
|
54
|
+
buffer += decoder.decode(value, { stream: true });
|
|
55
|
+
const lines = buffer.split("\n");
|
|
56
|
+
buffer = lines.pop() ?? "";
|
|
57
|
+
for (const line of lines) handleLine(line.replace(/\r$/, ""));
|
|
58
|
+
}
|
|
59
|
+
buffer += decoder.decode();
|
|
60
|
+
if (buffer !== "") handleLine(buffer.replace(/\r$/, ""));
|
|
61
|
+
} catch (error) {
|
|
62
|
+
await reader.cancel().catch(() => void 0);
|
|
63
|
+
throw error;
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export { ServerSentEventError, readServerSentEvents };
|
|
68
|
+
//# sourceMappingURL=readServerSentEvents.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"readServerSentEvents.mjs","names":[],"sources":["../../../src/getIntlayerAPI/readServerSentEvents.ts"],"sourcesContent":["/**\n * Error raised when the server emits an `event: error` frame mid-stream.\n * `message` is the serialized payload, matching the `fetcher` convention so\n * callers can match backend error codes with `error.message.includes(code)`.\n */\nexport class ServerSentEventError<\n Payload = Record<string, unknown>,\n> extends Error {\n readonly payload: Payload;\n\n constructor(payload: Payload) {\n super(JSON.stringify(payload));\n this.name = 'ServerSentEventError';\n this.payload = payload;\n }\n}\n\n/**\n * Reads a `text/event-stream` response and calls `onData` with each parsed\n * `data:` payload of the default event type.\n *\n * Throws a {@link ServerSentEventError} as soon as an `event: error` frame is\n * received, so stream failures reject the caller instead of resolving silently.\n */\nexport const readServerSentEvents = async <Data>(\n response: Response,\n onData: (data: Data) => void\n): Promise<void> => {\n const reader = response.body?.getReader();\n\n if (!reader) {\n throw new Error('No reader available');\n }\n\n const decoder = new TextDecoder();\n let buffer = '';\n let currentEventName = 'message';\n\n const handleLine = (line: string): void => {\n // A blank line terminates the current event: reset its type\n if (line === '') {\n currentEventName = 'message';\n return;\n }\n\n if (line.startsWith('event:')) {\n currentEventName = line.slice('event:'.length).trim();\n return;\n }\n\n if (!line.startsWith('data:')) return;\n\n const rawData = line.slice('data:'.length).trimStart();\n\n let parsedData: unknown;\n\n try {\n parsedData = JSON.parse(rawData);\n } catch {\n if (currentEventName === 'error') {\n throw new ServerSentEventError({ message: rawData });\n }\n\n console.error('Failed to parse SSE data:', rawData);\n return;\n }\n\n if (currentEventName === 'error') {\n throw new ServerSentEventError(parsedData);\n }\n\n onData(parsedData as Data);\n };\n\n try {\n while (true) {\n const { done, value } = await reader.read();\n\n if (done) break;\n\n buffer += decoder.decode(value, { stream: true });\n const lines = buffer.split('\\n');\n buffer = lines.pop() ?? '';\n\n for (const line of lines) {\n handleLine(line.replace(/\\r$/, ''));\n }\n }\n\n buffer += decoder.decode();\n\n if (buffer !== '') {\n handleLine(buffer.replace(/\\r$/, ''));\n }\n } catch (error) {\n await reader.cancel().catch(() => undefined);\n throw error;\n }\n};\n"],"mappings":";;;;;;AAKA,IAAa,uBAAb,cAEU,MAAM;CACd,AAAS;CAET,YAAY,SAAkB;EAC5B,MAAM,KAAK,UAAU,OAAO,CAAC;EAC7B,KAAK,OAAO;EACZ,KAAK,UAAU;CACjB;AACF;;;;;;;;AASA,MAAa,uBAAuB,OAClC,UACA,WACkB;CAClB,MAAM,SAAS,SAAS,MAAM,UAAU;CAExC,IAAI,CAAC,QACH,MAAM,IAAI,MAAM,qBAAqB;CAGvC,MAAM,UAAU,IAAI,YAAY;CAChC,IAAI,SAAS;CACb,IAAI,mBAAmB;CAEvB,MAAM,cAAc,SAAuB;EAEzC,IAAI,SAAS,IAAI;GACf,mBAAmB;GACnB;EACF;EAEA,IAAI,KAAK,WAAW,QAAQ,GAAG;GAC7B,mBAAmB,KAAK,MAAM,CAAe,CAAC,CAAC,KAAK;GACpD;EACF;EAEA,IAAI,CAAC,KAAK,WAAW,OAAO,GAAG;EAE/B,MAAM,UAAU,KAAK,MAAM,CAAc,CAAC,CAAC,UAAU;EAErD,IAAI;EAEJ,IAAI;GACF,aAAa,KAAK,MAAM,OAAO;EACjC,QAAQ;GACN,IAAI,qBAAqB,SACvB,MAAM,IAAI,qBAAqB,EAAE,SAAS,QAAQ,CAAC;GAGrD,QAAQ,MAAM,6BAA6B,OAAO;GAClD;EACF;EAEA,IAAI,qBAAqB,SACvB,MAAM,IAAI,qBAAqB,UAAU;EAG3C,OAAO,UAAkB;CAC3B;CAEA,IAAI;EACF,OAAO,MAAM;GACX,MAAM,EAAE,MAAM,UAAU,MAAM,OAAO,KAAK;GAE1C,IAAI,MAAM;GAEV,UAAU,QAAQ,OAAO,OAAO,EAAE,QAAQ,KAAK,CAAC;GAChD,MAAM,QAAQ,OAAO,MAAM,IAAI;GAC/B,SAAS,MAAM,IAAI,KAAK;GAExB,KAAK,MAAM,QAAQ,OACjB,WAAW,KAAK,QAAQ,OAAO,EAAE,CAAC;EAEtC;EAEA,UAAU,QAAQ,OAAO;EAEzB,IAAI,WAAW,IACb,WAAW,OAAO,QAAQ,OAAO,EAAE,CAAC;CAExC,SAAS,OAAO;EACd,MAAM,OAAO,OAAO,CAAC,CAAC,YAAY,MAAS;EAC3C,MAAM;CACR;AACF"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { fetcher } from "../fetcher.mjs";
|
|
2
1
|
import { createEndpoint } from "../cms/createIntlayerCMS.mjs";
|
|
2
|
+
import { fetcher } from "../fetcher.mjs";
|
|
3
3
|
import { editor } from "@intlayer/config/built";
|
|
4
4
|
import { buildRouteURL } from "@intlayer/backend-contract/defineRoute";
|
|
5
5
|
import { BACKEND_URL } from "@intlayer/config/defaultValues";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/getIntlayerAPI/reviewer.ts
|
|
8
8
|
/** Prefix of the routes, checked against the backend contract. */
|
|
9
9
|
const reviewerGroup = { prefix: "/api/reviewer" };
|
|
10
10
|
/**
|
|
@@ -246,6 +246,5 @@ const getReviewerAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
|
246
246
|
*/
|
|
247
247
|
const reviewerEndpoint = createEndpoint(getReviewerAPI);
|
|
248
248
|
|
|
249
|
-
//#endregion
|
|
250
249
|
export { getReviewerAPI, reviewerEndpoint };
|
|
251
250
|
//# sourceMappingURL=reviewer.mjs.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { fetcher } from "../fetcher.mjs";
|
|
2
1
|
import { createEndpoint } from "../cms/createIntlayerCMS.mjs";
|
|
2
|
+
import { fetcher } from "../fetcher.mjs";
|
|
3
3
|
import { editor } from "@intlayer/config/built";
|
|
4
4
|
import { buildRouteURL } from "@intlayer/backend-contract/defineRoute";
|
|
5
5
|
import { BACKEND_URL } from "@intlayer/config/defaultValues";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/getIntlayerAPI/search.ts
|
|
8
8
|
/** Prefix of the routes, checked against the backend contract. */
|
|
9
9
|
const searchGroup = { prefix: "/api/search" };
|
|
10
10
|
/**
|
|
@@ -36,6 +36,5 @@ const getSearchAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
|
36
36
|
*/
|
|
37
37
|
const searchEndpoint = createEndpoint(getSearchAPI);
|
|
38
38
|
|
|
39
|
-
//#endregion
|
|
40
39
|
export { getSearchAPI, searchEndpoint };
|
|
41
40
|
//# sourceMappingURL=search.mjs.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { fetcher } from "../fetcher.mjs";
|
|
2
1
|
import { createEndpoint } from "../cms/createIntlayerCMS.mjs";
|
|
2
|
+
import { fetcher } from "../fetcher.mjs";
|
|
3
3
|
import { editor } from "@intlayer/config/built";
|
|
4
4
|
import { buildRouteURL } from "@intlayer/backend-contract/defineRoute";
|
|
5
5
|
import { BACKEND_URL } from "@intlayer/config/defaultValues";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/getIntlayerAPI/showcaseProject.ts
|
|
8
8
|
/** Prefix of the routes, checked against the backend contract. */
|
|
9
9
|
const showcaseProjectGroup = { prefix: "/api/showcase-project" };
|
|
10
10
|
/**
|
|
@@ -108,6 +108,5 @@ const getShowcaseProjectAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
|
108
108
|
*/
|
|
109
109
|
const showcaseProjectEndpoint = createEndpoint(getShowcaseProjectAPI);
|
|
110
110
|
|
|
111
|
-
//#endregion
|
|
112
111
|
export { getShowcaseProjectAPI, showcaseProjectEndpoint };
|
|
113
112
|
//# sourceMappingURL=showcaseProject.mjs.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { fetcher } from "../fetcher.mjs";
|
|
2
1
|
import { createEndpoint } from "../cms/createIntlayerCMS.mjs";
|
|
2
|
+
import { fetcher } from "../fetcher.mjs";
|
|
3
3
|
import { editor } from "@intlayer/config/built";
|
|
4
4
|
import { buildRouteURL } from "@intlayer/backend-contract/defineRoute";
|
|
5
5
|
import { BACKEND_URL } from "@intlayer/config/defaultValues";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/getIntlayerAPI/status.ts
|
|
8
8
|
/** Routes used here, checked against the backend contract. */
|
|
9
9
|
const userGroup = { prefix: "/api/user" };
|
|
10
10
|
const setupStatusEndpoint = {
|
|
@@ -54,6 +54,5 @@ const getStatusAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
|
54
54
|
*/
|
|
55
55
|
const statusEndpoint = createEndpoint(getStatusAPI);
|
|
56
56
|
|
|
57
|
-
//#endregion
|
|
58
57
|
export { getStatusAPI, statusEndpoint };
|
|
59
58
|
//# sourceMappingURL=status.mjs.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { fetcher } from "../fetcher.mjs";
|
|
2
1
|
import { createEndpoint } from "../cms/createIntlayerCMS.mjs";
|
|
2
|
+
import { fetcher } from "../fetcher.mjs";
|
|
3
3
|
import { editor } from "@intlayer/config/built";
|
|
4
4
|
import { buildRouteURL } from "@intlayer/backend-contract/defineRoute";
|
|
5
5
|
import { BACKEND_URL } from "@intlayer/config/defaultValues";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/getIntlayerAPI/stripe.ts
|
|
8
8
|
/** Prefix of the routes, checked against the backend contract. */
|
|
9
9
|
const stripeGroup = { prefix: "/api/stripe" };
|
|
10
10
|
/**
|
|
@@ -286,6 +286,5 @@ const getStripeAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
|
286
286
|
*/
|
|
287
287
|
const stripeEndpoint = createEndpoint(getStripeAPI);
|
|
288
288
|
|
|
289
|
-
//#endregion
|
|
290
289
|
export { getStripeAPI, stripeEndpoint };
|
|
291
290
|
//# sourceMappingURL=stripe.mjs.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { fetcher } from "../fetcher.mjs";
|
|
2
1
|
import { createEndpoint } from "../cms/createIntlayerCMS.mjs";
|
|
2
|
+
import { fetcher } from "../fetcher.mjs";
|
|
3
3
|
import { editor } from "@intlayer/config/built";
|
|
4
4
|
import { buildRouteURL } from "@intlayer/backend-contract/defineRoute";
|
|
5
5
|
import { BACKEND_URL } from "@intlayer/config/defaultValues";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/getIntlayerAPI/tag.ts
|
|
8
8
|
/** Prefix of the routes, checked against the backend contract. */
|
|
9
9
|
const tagGroup = { prefix: "/api/tag" };
|
|
10
10
|
/**
|
|
@@ -75,6 +75,5 @@ const getTagAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
|
75
75
|
*/
|
|
76
76
|
const tagEndpoint = createEndpoint(getTagAPI);
|
|
77
77
|
|
|
78
|
-
//#endregion
|
|
79
78
|
export { getTagAPI, tagEndpoint };
|
|
80
79
|
//# sourceMappingURL=tag.mjs.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { fetcher } from "../fetcher.mjs";
|
|
2
1
|
import { createEndpoint } from "../cms/createIntlayerCMS.mjs";
|
|
2
|
+
import { fetcher } from "../fetcher.mjs";
|
|
3
3
|
import { editor } from "@intlayer/config/built";
|
|
4
4
|
import { buildRouteURL } from "@intlayer/backend-contract/defineRoute";
|
|
5
5
|
import { BACKEND_URL } from "@intlayer/config/defaultValues";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/getIntlayerAPI/translate.ts
|
|
8
8
|
/** Prefix of the routes, checked against the backend contract. */
|
|
9
9
|
const translationGroup = { prefix: "/api/translate" };
|
|
10
10
|
/**
|
|
@@ -69,6 +69,5 @@ const getTranslateAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
|
69
69
|
*/
|
|
70
70
|
const translateEndpoint = createEndpoint(getTranslateAPI);
|
|
71
71
|
|
|
72
|
-
//#endregion
|
|
73
72
|
export { getTranslateAPI, translateEndpoint };
|
|
74
73
|
//# sourceMappingURL=translate.mjs.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { fetcher } from "../fetcher.mjs";
|
|
2
1
|
import { createEndpoint } from "../cms/createIntlayerCMS.mjs";
|
|
2
|
+
import { fetcher } from "../fetcher.mjs";
|
|
3
3
|
import { editor } from "@intlayer/config/built";
|
|
4
4
|
import { buildRouteURL } from "@intlayer/backend-contract/defineRoute";
|
|
5
5
|
import { BACKEND_URL } from "@intlayer/config/defaultValues";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/getIntlayerAPI/user.ts
|
|
8
8
|
/** Prefix of the routes, checked against the backend contract. */
|
|
9
9
|
const userGroup = { prefix: "/api/user" };
|
|
10
10
|
/**
|
|
@@ -151,6 +151,5 @@ const getUserAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
|
151
151
|
*/
|
|
152
152
|
const userEndpoint = createEndpoint(getUserAPI);
|
|
153
153
|
|
|
154
|
-
//#endregion
|
|
155
154
|
export { getUserAPI, userEndpoint };
|
|
156
155
|
//# sourceMappingURL=user.mjs.map
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
import { BACKEND_INTERNAL_URL_ENVIRONMENT_VARIABLE, resolveInternalBackendUrl } from "./resolveInternalBackendUrl.mjs";
|
|
2
1
|
import { FetcherError, fetcher, fetcherOptions } from "./fetcher.mjs";
|
|
3
|
-
import {
|
|
2
|
+
import { getIntlayerAPI } from "./getIntlayerAPI/index.mjs";
|
|
3
|
+
import { aiEndpoint, getAiAPI } from "./getIntlayerAPI/ai.mjs";
|
|
4
4
|
import { clearAccessTokenCache, createAuthManager } from "./cms/createAuthManager.mjs";
|
|
5
5
|
import { createEndpoint, createIntlayerCMS } from "./cms/createIntlayerCMS.mjs";
|
|
6
|
-
import { aiEndpoint, getAiAPI } from "./getIntlayerAPI/ai.mjs";
|
|
7
6
|
import { analyticsEndpoint, getAnalyticsAPI } from "./getIntlayerAPI/analytics.mjs";
|
|
7
|
+
import { fetchDistantDictionaries } from "./distantDictionary/fetchDistantDictionaries.mjs";
|
|
8
|
+
import { fetchDistantDictionary } from "./distantDictionary/fetchDistantDictionary.mjs";
|
|
8
9
|
import { assetEndpoint, getAssetAPI } from "./getIntlayerAPI/asset.mjs";
|
|
9
10
|
import { auditEndpoint, getAuditAPI } from "./getIntlayerAPI/audit.mjs";
|
|
10
11
|
import { bitbucketEndpoint, getBitbucketAPI } from "./getIntlayerAPI/bitbucket.mjs";
|
|
11
|
-
import { createForgeAPI } from "./getIntlayerAPI/forge.mjs";
|
|
12
12
|
import { codebergEndpoint, getCodebergAPI } from "./getIntlayerAPI/codeberg.mjs";
|
|
13
13
|
import { dictionaryEndpoint, getDictionaryAPI } from "./getIntlayerAPI/dictionary.mjs";
|
|
14
14
|
import { editorEndpoint, getEditorAPI } from "./getIntlayerAPI/editor.mjs";
|
|
15
15
|
import { environmentEndpoint, getEnvironmentAPI } from "./getIntlayerAPI/environment.mjs";
|
|
16
|
+
import { createForgeAPI } from "./getIntlayerAPI/forge.mjs";
|
|
16
17
|
import { getGiteeAPI, giteeEndpoint } from "./getIntlayerAPI/gitee.mjs";
|
|
17
18
|
import { getGithubAPI, githubEndpoint } from "./getIntlayerAPI/github.mjs";
|
|
18
19
|
import { getGitlabAPI, gitlabEndpoint } from "./getIntlayerAPI/gitlab.mjs";
|
|
19
20
|
import { getNewsletterAPI, newsletterEndpoint } from "./getIntlayerAPI/newsletter.mjs";
|
|
21
|
+
import { getOAuthAPI } from "./getIntlayerAPI/oAuth.mjs";
|
|
20
22
|
import { getOrganizationAPI, organizationEndpoint } from "./getIntlayerAPI/organization.mjs";
|
|
21
23
|
import { getProjectAPI, projectEndpoint } from "./getIntlayerAPI/project.mjs";
|
|
22
24
|
import { getReviewerAPI, reviewerEndpoint } from "./getIntlayerAPI/reviewer.mjs";
|
|
@@ -28,8 +30,6 @@ import { getTagAPI, tagEndpoint } from "./getIntlayerAPI/tag.mjs";
|
|
|
28
30
|
import { getTranslateAPI, translateEndpoint } from "./getIntlayerAPI/translate.mjs";
|
|
29
31
|
import { getUserAPI, userEndpoint } from "./getIntlayerAPI/user.mjs";
|
|
30
32
|
import { getIntlayerAPIProxy } from "./proxy.mjs";
|
|
31
|
-
import {
|
|
32
|
-
import { fetchDistantDictionary } from "./distantDictionary/fetchDistantDictionary.mjs";
|
|
33
|
-
import { getIntlayerAPI } from "./getIntlayerAPI/index.mjs";
|
|
33
|
+
import { BACKEND_INTERNAL_URL_ENVIRONMENT_VARIABLE, resolveInternalBackendUrl } from "./resolveInternalBackendUrl.mjs";
|
|
34
34
|
|
|
35
35
|
export { BACKEND_INTERNAL_URL_ENVIRONMENT_VARIABLE, FetcherError, aiEndpoint, analyticsEndpoint, assetEndpoint, auditEndpoint, bitbucketEndpoint, clearAccessTokenCache, codebergEndpoint, createAuthManager, createEndpoint, createForgeAPI, createIntlayerCMS, dictionaryEndpoint, editorEndpoint, environmentEndpoint, fetchDistantDictionaries, fetchDistantDictionary, fetcher, fetcherOptions, getAiAPI, getAnalyticsAPI, getAssetAPI, getAuditAPI, getBitbucketAPI, getCodebergAPI, getDictionaryAPI, getEditorAPI, getEnvironmentAPI, getGiteeAPI, getGithubAPI, getGitlabAPI, getIntlayerAPI, getIntlayerAPIProxy, getNewsletterAPI, getOAuthAPI, getOrganizationAPI, getProjectAPI, getReviewerAPI, getSearchAPI, getShowcaseProjectAPI, getStatusAPI, getStripeAPI, getTagAPI, getTranslateAPI, getUserAPI, giteeEndpoint, githubEndpoint, gitlabEndpoint, newsletterEndpoint, organizationEndpoint, projectEndpoint, resolveInternalBackendUrl, reviewerEndpoint, searchEndpoint, showcaseProjectEndpoint, statusEndpoint, stripeEndpoint, tagEndpoint, translateEndpoint, userEndpoint };
|
package/dist/esm/proxy.mjs
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { getOAuthAPI } from "./getIntlayerAPI/oAuth.mjs";
|
|
2
1
|
import { createIntlayerCMS } from "./cms/createIntlayerCMS.mjs";
|
|
3
2
|
import { getAiAPI } from "./getIntlayerAPI/ai.mjs";
|
|
4
3
|
import { getAnalyticsAPI } from "./getIntlayerAPI/analytics.mjs";
|
|
@@ -13,6 +12,7 @@ import { getGiteeAPI } from "./getIntlayerAPI/gitee.mjs";
|
|
|
13
12
|
import { getGithubAPI } from "./getIntlayerAPI/github.mjs";
|
|
14
13
|
import { getGitlabAPI } from "./getIntlayerAPI/gitlab.mjs";
|
|
15
14
|
import { getNewsletterAPI } from "./getIntlayerAPI/newsletter.mjs";
|
|
15
|
+
import { getOAuthAPI } from "./getIntlayerAPI/oAuth.mjs";
|
|
16
16
|
import { getOrganizationAPI } from "./getIntlayerAPI/organization.mjs";
|
|
17
17
|
import { getProjectAPI } from "./getIntlayerAPI/project.mjs";
|
|
18
18
|
import { getReviewerAPI } from "./getIntlayerAPI/reviewer.mjs";
|
|
@@ -25,7 +25,7 @@ import { getTranslateAPI } from "./getIntlayerAPI/translate.mjs";
|
|
|
25
25
|
import { getUserAPI } from "./getIntlayerAPI/user.mjs";
|
|
26
26
|
import { editor } from "@intlayer/config/built";
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
// src/proxy.ts
|
|
29
29
|
const sectionFactories = {
|
|
30
30
|
asset: getAssetAPI,
|
|
31
31
|
organization: getOrganizationAPI,
|
|
@@ -95,6 +95,5 @@ const getIntlayerAPIProxy = (baseAuthOptions = {}, intlayerConfig = { editor },
|
|
|
95
95
|
});
|
|
96
96
|
};
|
|
97
97
|
|
|
98
|
-
//#endregion
|
|
99
98
|
export { getIntlayerAPIProxy };
|
|
100
99
|
//# sourceMappingURL=proxy.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { editor } from "@intlayer/config/built";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/public/createPublicClient.ts
|
|
4
4
|
/**
|
|
5
5
|
* Browser-safe Intlayer client, authenticated without any confidential
|
|
6
6
|
* credential.
|
|
@@ -137,6 +137,5 @@ const createPublicClient = ({ intlayerConfig } = {}) => {
|
|
|
137
137
|
};
|
|
138
138
|
};
|
|
139
139
|
|
|
140
|
-
//#endregion
|
|
141
140
|
export { createPublicClient };
|
|
142
141
|
//# sourceMappingURL=createPublicClient.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { editor } from "@intlayer/config/built";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/resolveInternalBackendUrl.ts
|
|
4
4
|
/**
|
|
5
5
|
* Server-only override for the backend origin.
|
|
6
6
|
*
|
|
@@ -44,6 +44,5 @@ const resolveInternalBackendUrl = (url, publicBackendUrl = editor.backendURL) =>
|
|
|
44
44
|
}
|
|
45
45
|
};
|
|
46
46
|
|
|
47
|
-
//#endregion
|
|
48
47
|
export { BACKEND_INTERNAL_URL_ENVIRONMENT_VARIABLE, resolveInternalBackendUrl };
|
|
49
48
|
//# sourceMappingURL=resolveInternalBackendUrl.mjs.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { FetcherOptions } from "../fetcher.js";
|
|
2
2
|
import { IntlayerConfig } from "@intlayer/types/config";
|
|
3
|
-
//#region src/cms/createAuthManager.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Any asynchronous API method exposed by a domain section
|
|
6
5
|
* (e.g. `getDictionaries`, `pushDictionaries`).
|
|
@@ -99,5 +98,5 @@ export type AuthManager = {
|
|
|
99
98
|
* @param options - Optional session token and base fetcher options.
|
|
100
99
|
*/
|
|
101
100
|
export declare const createAuthManager: (intlayerConfig?: Pick<IntlayerConfig, 'editor'>, options?: AuthManagerOptions) => AuthManager;
|
|
102
|
-
|
|
101
|
+
export {};
|
|
103
102
|
//# sourceMappingURL=createAuthManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createAuthManager.d.ts","names":[],"sources":["../../../src/cms/createAuthManager.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"createAuthManager.d.ts","names":[],"sources":["../../../src/cms/createAuthManager.ts"],"mappings":";;;;;;KAuBK,YAAY,6BAA6B,cACzC,MAAM,cACN,QAAQ;;;;;KAMR,eAAe,gBAAgB,4BAClC,gBAAgB,gBAChB,gBAAgB,mBACb;;qBAsBQ;;;;YA6ED;;;;EAIV,qBAAqB;;;;;;EAMrB;;;;;YAMU;;;;;EAKV;;;;;;;;;;YAWU;;;;;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;;;;;;;;;;;;;qBAcM,oBAAiB,iBACZ,KAAK,2BAAyB,UACrC,uBACR"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { FetcherOptions } from "../fetcher.js";
|
|
2
2
|
import { AuthManager, AuthManagerOptions, BindSectionOptions } from "./createAuthManager.js";
|
|
3
3
|
import { IntlayerConfig } from "@intlayer/types/config";
|
|
4
|
-
//#region src/cms/createIntlayerCMS.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* Options accepted when creating the Intlayer CMS authenticator.
|
|
7
6
|
*/
|
|
@@ -74,5 +73,4 @@ export type CMSEndpoint<Section extends Record<string, unknown>> = (cms?: Intlay
|
|
|
74
73
|
* ```
|
|
75
74
|
*/
|
|
76
75
|
export declare const createEndpoint: <Section extends Record<string, unknown>>(factory: (fetcherOptions: FetcherOptions, intlayerConfig: IntlayerConfig) => Section, options?: BindSectionOptions) => CMSEndpoint<Section>;
|
|
77
|
-
//#endregion
|
|
78
76
|
//# sourceMappingURL=createIntlayerCMS.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createIntlayerCMS.d.ts","names":[],"sources":["../../../src/cms/createIntlayerCMS.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"createIntlayerCMS.d.ts","names":[],"sources":["../../../src/cms/createIntlayerCMS.ts"],"mappings":";;;;;;YAaY,qBAAqB;;;;;;;;YASrB,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAqCb,oBAAiB,iBACZ,KAAK,2BAAyB,UACrC,uBACR;;;;;;YAOS,YAAY,gBAAgB,4BACtC,MAAM,gBACH;;;;;;;;;;;;;;;;;;qBAmBQ,iBACV,gBAAgB,yBAAuB,UAEpC,gBAAgB,gBAChB,gBAAgB,mBACb,SAAO,UACF,uBACT,YAAY"}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { IntlayerConfig } from "@intlayer/types/config";
|
|
2
1
|
import { DictionaryAPI } from "@intlayer/backend-contract/dictionary";
|
|
3
|
-
|
|
2
|
+
import { IntlayerConfig } from "@intlayer/types/config";
|
|
4
3
|
/**
|
|
5
4
|
* Fetch distant dictionary
|
|
6
5
|
*/
|
|
7
6
|
export declare const fetchDistantDictionaries: (intlayerConfig: IntlayerConfig) => Promise<DictionaryAPI[] | null | undefined>;
|
|
8
|
-
//#endregion
|
|
9
7
|
//# sourceMappingURL=fetchDistantDictionaries.d.ts.map
|
|
@@ -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":";;;;;qBAQa,2BAAwB,gBACnB,mBACf,QAAQ"}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { IntlayerConfig } from "@intlayer/types/config";
|
|
2
1
|
import { DictionaryAPI } from "@intlayer/backend-contract/dictionary";
|
|
3
|
-
|
|
2
|
+
import { IntlayerConfig } from "@intlayer/types/config";
|
|
4
3
|
/**
|
|
5
4
|
* Fetch distant dictionary
|
|
6
5
|
*/
|
|
7
6
|
export declare const fetchDistantDictionary: (dictionaryKey: string, intlayerConfig: IntlayerConfig) => Promise<DictionaryAPI | undefined>;
|
|
8
|
-
//#endregion
|
|
9
7
|
//# sourceMappingURL=fetchDistantDictionary.d.ts.map
|