@intlayer/api 8.1.2 → 8.1.3-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/_virtual/_rolldown/runtime.cjs +1 -29
- package/dist/cjs/distantDictionary/fetchDistantDictionaries.cjs +1 -20
- package/dist/cjs/distantDictionary/fetchDistantDictionaries.cjs.map +1 -1
- package/dist/cjs/distantDictionary/fetchDistantDictionary.cjs +1 -22
- package/dist/cjs/distantDictionary/fetchDistantDictionary.cjs.map +1 -1
- package/dist/cjs/distantDictionary/index.cjs +1 -6
- package/dist/cjs/fetcher.cjs +1 -122
- package/dist/cjs/fetcher.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/ai.cjs +2 -166
- package/dist/cjs/getIntlayerAPI/ai.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/audit.cjs +1 -41
- package/dist/cjs/getIntlayerAPI/audit.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/bitbucket.cjs +1 -74
- package/dist/cjs/getIntlayerAPI/bitbucket.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/dictionary.cjs +1 -72
- package/dist/cjs/getIntlayerAPI/dictionary.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/editor.cjs +1 -40
- package/dist/cjs/getIntlayerAPI/editor.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/github.cjs +1 -74
- package/dist/cjs/getIntlayerAPI/github.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/gitlab.cjs +1 -88
- package/dist/cjs/getIntlayerAPI/gitlab.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/index.cjs +1 -38
- package/dist/cjs/getIntlayerAPI/index.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/newsletter.cjs +1 -43
- package/dist/cjs/getIntlayerAPI/newsletter.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/oAuth.cjs +1 -29
- package/dist/cjs/getIntlayerAPI/oAuth.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/organization.cjs +1 -96
- package/dist/cjs/getIntlayerAPI/organization.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/project.cjs +1 -144
- package/dist/cjs/getIntlayerAPI/project.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/search.cjs +1 -25
- package/dist/cjs/getIntlayerAPI/search.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/stripe.cjs +1 -41
- package/dist/cjs/getIntlayerAPI/stripe.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/tag.cjs +1 -50
- package/dist/cjs/getIntlayerAPI/tag.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/user.cjs +1 -82
- package/dist/cjs/getIntlayerAPI/user.cjs.map +1 -1
- package/dist/cjs/index.cjs +1 -43
- package/dist/cjs/proxy.cjs +1 -101
- package/dist/cjs/proxy.cjs.map +1 -1
- package/dist/esm/distantDictionary/fetchDistantDictionaries.mjs +1 -19
- package/dist/esm/distantDictionary/fetchDistantDictionaries.mjs.map +1 -1
- package/dist/esm/distantDictionary/fetchDistantDictionary.mjs +1 -21
- package/dist/esm/distantDictionary/fetchDistantDictionary.mjs.map +1 -1
- package/dist/esm/distantDictionary/index.mjs +1 -4
- package/dist/esm/fetcher.mjs +1 -119
- package/dist/esm/fetcher.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/ai.mjs +2 -163
- package/dist/esm/getIntlayerAPI/ai.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/audit.mjs +1 -38
- package/dist/esm/getIntlayerAPI/audit.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/bitbucket.mjs +1 -71
- package/dist/esm/getIntlayerAPI/bitbucket.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/dictionary.mjs +1 -69
- package/dist/esm/getIntlayerAPI/dictionary.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/editor.mjs +1 -37
- package/dist/esm/getIntlayerAPI/editor.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/github.mjs +1 -71
- package/dist/esm/getIntlayerAPI/github.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/gitlab.mjs +1 -85
- package/dist/esm/getIntlayerAPI/gitlab.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/index.mjs +1 -37
- package/dist/esm/getIntlayerAPI/index.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/newsletter.mjs +1 -40
- package/dist/esm/getIntlayerAPI/newsletter.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/oAuth.mjs +1 -26
- package/dist/esm/getIntlayerAPI/oAuth.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/organization.mjs +1 -93
- package/dist/esm/getIntlayerAPI/organization.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/project.mjs +1 -141
- package/dist/esm/getIntlayerAPI/project.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/search.mjs +1 -22
- package/dist/esm/getIntlayerAPI/search.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/stripe.mjs +1 -38
- package/dist/esm/getIntlayerAPI/stripe.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/tag.mjs +1 -47
- package/dist/esm/getIntlayerAPI/tag.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/user.mjs +1 -79
- package/dist/esm/getIntlayerAPI/user.mjs.map +1 -1
- package/dist/esm/index.mjs +1 -22
- package/dist/esm/proxy.mjs +1 -100
- package/dist/esm/proxy.mjs.map +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github.mjs","names":[],"sources":["../../../src/getIntlayerAPI/github.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { type FetcherOptions, fetcher } from '../fetcher';\n\nexport type GitHubRepository = {\n id: number;\n name: string;\n full_name: string;\n owner: {\n login: string;\n id: number;\n };\n html_url: string;\n default_branch: string;\n private: boolean;\n};\n\nexport type GitHubAuthCallbackBody = {\n code: string;\n};\n\nexport type GitHubAuthCallbackResult = {\n data: {\n token: string;\n };\n};\n\nexport type GitHubListReposResult = {\n data: GitHubRepository[];\n};\n\nexport type GitHubCheckConfigBody = {\n token?: string;\n owner: string;\n repository: string;\n branch?: string;\n};\n\nexport type GitHubCheckConfigResult = {\n data: {\n hasConfig: boolean;\n };\n};\n\nexport type GitHubGetConfigFileBody = {\n token?: string;\n owner: string;\n repository: string;\n branch?: string;\n path?: string;\n};\n\nexport type GitHubGetConfigFileResult = {\n data: {\n content: string;\n };\n};\n\nexport type GitHubGetAuthUrlResult = {\n data: {\n authUrl: string;\n };\n};\n\nexport const getGithubAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const backendURL =\n intlayerConfig?.editor?.backendURL ?? configuration?.editor?.backendURL;\n\n if (!backendURL) {\n throw new Error(\n 'Backend URL is not defined in the Intlayer configuration.'\n );\n }\n\n const GITHUB_API_ROUTE = `${backendURL}/api/github`;\n\n /**\n * Get GitHub OAuth authorization URL\n * @param redirectUri - Redirect URI after OAuth authorization\n */\n const getAuthUrl = async (\n redirectUri: string,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GitHubGetAuthUrlResult>(\n `${GITHUB_API_ROUTE}/auth-url`,\n authAPIOptions,\n otherOptions,\n {\n params: { redirectUri },\n }\n );\n\n /**\n * Exchange GitHub authorization code for access token\n * @param code - GitHub authorization code\n */\n const authenticate = async (\n code: string,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GitHubAuthCallbackResult>(\n `${GITHUB_API_ROUTE}/auth`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: { code },\n }\n );\n\n /**\n * Get user's GitHub repositories\n * @param token - Optional GitHub access token. If not provided, backend will use session.\n */\n const getRepositories = async (\n token?: string | null,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GitHubListReposResult>(\n `${GITHUB_API_ROUTE}/repos`,\n authAPIOptions,\n otherOptions,\n {\n params: token ? { token } : undefined,\n }\n );\n\n /**\n * Check if intlayer.config.ts exists in a repository\n * @param token - Optional GitHub access token. If not provided, backend will use session.\n * @param owner - Repository owner\n * @param repository - Repository name\n * @param branch - Branch name (default: 'main')\n */\n const checkIntlayerConfig = async (\n token: string | null | undefined,\n owner: string,\n repository: string,\n branch: string = 'main',\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GitHubCheckConfigResult>(\n `${GITHUB_API_ROUTE}/check-config`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: { token: token ?? undefined, owner, repository, branch },\n }\n );\n\n /**\n * Get intlayer.config.ts file contents from a repository\n * @param token - Optional GitHub access token. If not provided, backend will use session.\n * @param owner - Repository owner\n * @param repository - Repository name\n * @param branch - Branch name (default: 'main')\n * @param path - File path (default: 'intlayer.config.ts')\n */\n const getConfigFile = async (\n token: string | null | undefined,\n owner: string,\n repository: string,\n branch: string = 'main',\n path: string = 'intlayer.config.ts',\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GitHubGetConfigFileResult>(\n `${GITHUB_API_ROUTE}/get-config-file`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: { token: token ?? undefined, owner, repository, branch, path },\n }\n );\n\n return {\n getAuthUrl,\n authenticate,\n getRepositories,\n checkIntlayerConfig,\n getConfigFile,\n };\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"github.mjs","names":[],"sources":["../../../src/getIntlayerAPI/github.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { type FetcherOptions, fetcher } from '../fetcher';\n\nexport type GitHubRepository = {\n id: number;\n name: string;\n full_name: string;\n owner: {\n login: string;\n id: number;\n };\n html_url: string;\n default_branch: string;\n private: boolean;\n};\n\nexport type GitHubAuthCallbackBody = {\n code: string;\n};\n\nexport type GitHubAuthCallbackResult = {\n data: {\n token: string;\n };\n};\n\nexport type GitHubListReposResult = {\n data: GitHubRepository[];\n};\n\nexport type GitHubCheckConfigBody = {\n token?: string;\n owner: string;\n repository: string;\n branch?: string;\n};\n\nexport type GitHubCheckConfigResult = {\n data: {\n hasConfig: boolean;\n };\n};\n\nexport type GitHubGetConfigFileBody = {\n token?: string;\n owner: string;\n repository: string;\n branch?: string;\n path?: string;\n};\n\nexport type GitHubGetConfigFileResult = {\n data: {\n content: string;\n };\n};\n\nexport type GitHubGetAuthUrlResult = {\n data: {\n authUrl: string;\n };\n};\n\nexport const getGithubAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const backendURL =\n intlayerConfig?.editor?.backendURL ?? configuration?.editor?.backendURL;\n\n if (!backendURL) {\n throw new Error(\n 'Backend URL is not defined in the Intlayer configuration.'\n );\n }\n\n const GITHUB_API_ROUTE = `${backendURL}/api/github`;\n\n /**\n * Get GitHub OAuth authorization URL\n * @param redirectUri - Redirect URI after OAuth authorization\n */\n const getAuthUrl = async (\n redirectUri: string,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GitHubGetAuthUrlResult>(\n `${GITHUB_API_ROUTE}/auth-url`,\n authAPIOptions,\n otherOptions,\n {\n params: { redirectUri },\n }\n );\n\n /**\n * Exchange GitHub authorization code for access token\n * @param code - GitHub authorization code\n */\n const authenticate = async (\n code: string,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GitHubAuthCallbackResult>(\n `${GITHUB_API_ROUTE}/auth`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: { code },\n }\n );\n\n /**\n * Get user's GitHub repositories\n * @param token - Optional GitHub access token. If not provided, backend will use session.\n */\n const getRepositories = async (\n token?: string | null,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GitHubListReposResult>(\n `${GITHUB_API_ROUTE}/repos`,\n authAPIOptions,\n otherOptions,\n {\n params: token ? { token } : undefined,\n }\n );\n\n /**\n * Check if intlayer.config.ts exists in a repository\n * @param token - Optional GitHub access token. If not provided, backend will use session.\n * @param owner - Repository owner\n * @param repository - Repository name\n * @param branch - Branch name (default: 'main')\n */\n const checkIntlayerConfig = async (\n token: string | null | undefined,\n owner: string,\n repository: string,\n branch: string = 'main',\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GitHubCheckConfigResult>(\n `${GITHUB_API_ROUTE}/check-config`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: { token: token ?? undefined, owner, repository, branch },\n }\n );\n\n /**\n * Get intlayer.config.ts file contents from a repository\n * @param token - Optional GitHub access token. If not provided, backend will use session.\n * @param owner - Repository owner\n * @param repository - Repository name\n * @param branch - Branch name (default: 'main')\n * @param path - File path (default: 'intlayer.config.ts')\n */\n const getConfigFile = async (\n token: string | null | undefined,\n owner: string,\n repository: string,\n branch: string = 'main',\n path: string = 'intlayer.config.ts',\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GitHubGetConfigFileResult>(\n `${GITHUB_API_ROUTE}/get-config-file`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: { token: token ?? undefined, owner, repository, branch, path },\n }\n );\n\n return {\n getAuthUrl,\n authenticate,\n getRepositories,\n checkIntlayerConfig,\n getConfigFile,\n };\n};\n"],"mappings":"+EAgEA,MAAa,GACX,EAAiC,EAAE,CACnC,IACG,CACH,IAAM,EACJ,GAAgB,QAAQ,YAAc,GAAe,QAAQ,WAE/D,GAAI,CAAC,EACH,MAAU,MACR,4DACD,CAGH,IAAM,EAAmB,GAAG,EAAW,aAwGvC,MAAO,CACL,WAnGiB,MACjB,EACA,EAA+B,EAAE,GAEjC,MAAM,EACJ,GAAG,EAAiB,WACpB,EACA,EACA,CACE,OAAQ,CAAE,cAAa,CACxB,CACF,CAyFD,aAnFmB,MACnB,EACA,EAA+B,EAAE,GAEjC,MAAM,EACJ,GAAG,EAAiB,OACpB,EACA,EACA,CACE,OAAQ,OACR,KAAM,CAAE,OAAM,CACf,CACF,CAwED,gBAlEsB,MACtB,EACA,EAA+B,EAAE,GAEjC,MAAM,EACJ,GAAG,EAAiB,QACpB,EACA,EACA,CACE,OAAQ,EAAQ,CAAE,QAAO,CAAG,IAAA,GAC7B,CACF,CAwDD,oBA/C0B,MAC1B,EACA,EACA,EACA,EAAiB,OACjB,EAA+B,EAAE,GAEjC,MAAM,EACJ,GAAG,EAAiB,eACpB,EACA,EACA,CACE,OAAQ,OACR,KAAM,CAAE,MAAO,GAAS,IAAA,GAAW,QAAO,aAAY,SAAQ,CAC/D,CACF,CAiCD,cAvBoB,MACpB,EACA,EACA,EACA,EAAiB,OACjB,EAAe,qBACf,EAA+B,EAAE,GAEjC,MAAM,EACJ,GAAG,EAAiB,kBACpB,EACA,EACA,CACE,OAAQ,OACR,KAAM,CAAE,MAAO,GAAS,IAAA,GAAW,QAAO,aAAY,SAAQ,OAAM,CACrE,CACF,CAQF"}
|
|
@@ -1,86 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import configuration from "@intlayer/config/built";
|
|
3
|
-
|
|
4
|
-
//#region src/getIntlayerAPI/gitlab.ts
|
|
5
|
-
const getGitlabAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
6
|
-
const backendURL = intlayerConfig?.editor?.backendURL ?? configuration?.editor?.backendURL;
|
|
7
|
-
if (!backendURL) throw new Error("Backend URL is not defined in the Intlayer configuration.");
|
|
8
|
-
const GITLAB_API_ROUTE = `${backendURL}/api/gitlab`;
|
|
9
|
-
/**
|
|
10
|
-
* Get GitLab OAuth authorization URL
|
|
11
|
-
* @param redirectUri - Redirect URI after OAuth authorization
|
|
12
|
-
* @param instanceUrl - Custom GitLab instance URL (optional, for self-hosted)
|
|
13
|
-
*/
|
|
14
|
-
const getAuthUrl = async (redirectUri, instanceUrl, otherOptions = {}) => await fetcher(`${GITLAB_API_ROUTE}/auth-url`, authAPIOptions, otherOptions, { params: {
|
|
15
|
-
redirectUri,
|
|
16
|
-
...instanceUrl && { instanceUrl }
|
|
17
|
-
} });
|
|
18
|
-
/**
|
|
19
|
-
* Exchange GitLab authorization code for access token
|
|
20
|
-
* @param code - GitLab authorization code
|
|
21
|
-
* @param redirectUri - Redirect URI used in the authorization request
|
|
22
|
-
* @param instanceUrl - Custom GitLab instance URL (optional)
|
|
23
|
-
*/
|
|
24
|
-
const authenticate = async (code, redirectUri, instanceUrl, otherOptions = {}) => await fetcher(`${GITLAB_API_ROUTE}/auth`, authAPIOptions, otherOptions, {
|
|
25
|
-
method: "POST",
|
|
26
|
-
body: {
|
|
27
|
-
code,
|
|
28
|
-
redirectUri,
|
|
29
|
-
instanceUrl
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
/**
|
|
33
|
-
* Get user's GitLab projects
|
|
34
|
-
* @param token - Optional GitLab access token. If not provided, backend will use session.
|
|
35
|
-
* @param instanceUrl - Custom GitLab instance URL (optional)
|
|
36
|
-
*/
|
|
37
|
-
const getProjects = async (token, instanceUrl, otherOptions = {}) => await fetcher(`${GITLAB_API_ROUTE}/projects`, authAPIOptions, otherOptions, { params: {
|
|
38
|
-
...token && { token },
|
|
39
|
-
...instanceUrl && { instanceUrl }
|
|
40
|
-
} });
|
|
41
|
-
/**
|
|
42
|
-
* Check if intlayer.config.ts exists in a GitLab repository
|
|
43
|
-
* @param token - Optional GitLab access token. If not provided, backend will use session.
|
|
44
|
-
* @param projectId - GitLab project ID
|
|
45
|
-
* @param branch - Branch name (default: 'main')
|
|
46
|
-
* @param instanceUrl - Custom GitLab instance URL (optional)
|
|
47
|
-
*/
|
|
48
|
-
const checkIntlayerConfig = async (token, projectId, branch = "main", instanceUrl, otherOptions = {}) => await fetcher(`${GITLAB_API_ROUTE}/check-config`, authAPIOptions, otherOptions, {
|
|
49
|
-
method: "POST",
|
|
50
|
-
body: {
|
|
51
|
-
token: token ?? void 0,
|
|
52
|
-
projectId,
|
|
53
|
-
branch,
|
|
54
|
-
...instanceUrl && { instanceUrl }
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
/**
|
|
58
|
-
* Get intlayer.config.ts file contents from a GitLab repository
|
|
59
|
-
* @param token - Optional GitLab access token. If not provided, backend will use session.
|
|
60
|
-
* @param projectId - GitLab project ID
|
|
61
|
-
* @param branch - Branch name (default: 'main')
|
|
62
|
-
* @param path - File path (default: 'intlayer.config.ts')
|
|
63
|
-
* @param instanceUrl - Custom GitLab instance URL (optional)
|
|
64
|
-
*/
|
|
65
|
-
const getConfigFile = async (token, projectId, branch = "main", path = "intlayer.config.ts", instanceUrl, otherOptions = {}) => await fetcher(`${GITLAB_API_ROUTE}/get-config-file`, authAPIOptions, otherOptions, {
|
|
66
|
-
method: "POST",
|
|
67
|
-
body: {
|
|
68
|
-
token: token ?? void 0,
|
|
69
|
-
projectId,
|
|
70
|
-
branch,
|
|
71
|
-
path,
|
|
72
|
-
...instanceUrl && { instanceUrl }
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
return {
|
|
76
|
-
getAuthUrl,
|
|
77
|
-
authenticate,
|
|
78
|
-
getProjects,
|
|
79
|
-
checkIntlayerConfig,
|
|
80
|
-
getConfigFile
|
|
81
|
-
};
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
//#endregion
|
|
85
|
-
export { getGitlabAPI };
|
|
1
|
+
import{fetcher as e}from"../fetcher.mjs";import t from"@intlayer/config/built";const n=(n={},r)=>{let i=r?.editor?.backendURL??t?.editor?.backendURL;if(!i)throw Error(`Backend URL is not defined in the Intlayer configuration.`);let a=`${i}/api/gitlab`;return{getAuthUrl:async(t,r,i={})=>await e(`${a}/auth-url`,n,i,{params:{redirectUri:t,...r&&{instanceUrl:r}}}),authenticate:async(t,r,i,o={})=>await e(`${a}/auth`,n,o,{method:`POST`,body:{code:t,redirectUri:r,instanceUrl:i}}),getProjects:async(t,r,i={})=>await e(`${a}/projects`,n,i,{params:{...t&&{token:t},...r&&{instanceUrl:r}}}),checkIntlayerConfig:async(t,r,i=`main`,o,s={})=>await e(`${a}/check-config`,n,s,{method:`POST`,body:{token:t??void 0,projectId:r,branch:i,...o&&{instanceUrl:o}}}),getConfigFile:async(t,r,i=`main`,o=`intlayer.config.ts`,s,c={})=>await e(`${a}/get-config-file`,n,c,{method:`POST`,body:{token:t??void 0,projectId:r,branch:i,path:o,...s&&{instanceUrl:s}}})}};export{n as getGitlabAPI};
|
|
86
2
|
//# sourceMappingURL=gitlab.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitlab.mjs","names":[],"sources":["../../../src/getIntlayerAPI/gitlab.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { type FetcherOptions, fetcher } from '../fetcher';\n\nexport type GitLabProject = {\n id: number;\n name: string;\n path_with_namespace: string;\n web_url: string;\n default_branch: string;\n visibility: string;\n last_activity_at: string;\n namespace: {\n id: number;\n name: string;\n path: string;\n };\n};\n\nexport type GitLabAuthCallbackBody = {\n code: string;\n redirectUri: string;\n instanceUrl?: string;\n};\n\nexport type GitLabAuthCallbackResult = {\n data: {\n token: string;\n };\n};\n\nexport type GitLabListProjectsResult = {\n data: GitLabProject[];\n};\n\nexport type GitLabCheckConfigBody = {\n token?: string;\n projectId: number;\n branch?: string;\n instanceUrl?: string;\n};\n\nexport type GitLabCheckConfigResult = {\n data: {\n hasConfig: boolean;\n configPaths: string[];\n };\n};\n\nexport type GitLabGetConfigFileBody = {\n token?: string;\n projectId: number;\n branch?: string;\n path?: string;\n instanceUrl?: string;\n};\n\nexport type GitLabGetConfigFileResult = {\n data: {\n content: string;\n };\n};\n\nexport type GitLabGetAuthUrlResult = {\n data: {\n authUrl: string;\n };\n};\n\nexport const getGitlabAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const backendURL =\n intlayerConfig?.editor?.backendURL ?? configuration?.editor?.backendURL;\n\n if (!backendURL) {\n throw new Error(\n 'Backend URL is not defined in the Intlayer configuration.'\n );\n }\n\n const GITLAB_API_ROUTE = `${backendURL}/api/gitlab`;\n\n /**\n * Get GitLab OAuth authorization URL\n * @param redirectUri - Redirect URI after OAuth authorization\n * @param instanceUrl - Custom GitLab instance URL (optional, for self-hosted)\n */\n const getAuthUrl = async (\n redirectUri: string,\n instanceUrl?: string,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GitLabGetAuthUrlResult>(\n `${GITLAB_API_ROUTE}/auth-url`,\n authAPIOptions,\n otherOptions,\n {\n params: { redirectUri, ...(instanceUrl && { instanceUrl }) },\n }\n );\n\n /**\n * Exchange GitLab authorization code for access token\n * @param code - GitLab authorization code\n * @param redirectUri - Redirect URI used in the authorization request\n * @param instanceUrl - Custom GitLab instance URL (optional)\n */\n const authenticate = async (\n code: string,\n redirectUri: string,\n instanceUrl?: string,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GitLabAuthCallbackResult>(\n `${GITLAB_API_ROUTE}/auth`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: { code, redirectUri, instanceUrl },\n }\n );\n\n /**\n * Get user's GitLab projects\n * @param token - Optional GitLab access token. If not provided, backend will use session.\n * @param instanceUrl - Custom GitLab instance URL (optional)\n */\n const getProjects = async (\n token?: string | null,\n instanceUrl?: string,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GitLabListProjectsResult>(\n `${GITLAB_API_ROUTE}/projects`,\n authAPIOptions,\n otherOptions,\n {\n params: {\n ...(token && { token }),\n ...(instanceUrl && { instanceUrl }),\n },\n }\n );\n\n /**\n * Check if intlayer.config.ts exists in a GitLab repository\n * @param token - Optional GitLab access token. If not provided, backend will use session.\n * @param projectId - GitLab project ID\n * @param branch - Branch name (default: 'main')\n * @param instanceUrl - Custom GitLab instance URL (optional)\n */\n const checkIntlayerConfig = async (\n token: string | null | undefined,\n projectId: number,\n branch: string = 'main',\n instanceUrl?: string,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GitLabCheckConfigResult>(\n `${GITLAB_API_ROUTE}/check-config`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: {\n token: token ?? undefined,\n projectId,\n branch,\n ...(instanceUrl && { instanceUrl }),\n },\n }\n );\n\n /**\n * Get intlayer.config.ts file contents from a GitLab repository\n * @param token - Optional GitLab access token. If not provided, backend will use session.\n * @param projectId - GitLab project ID\n * @param branch - Branch name (default: 'main')\n * @param path - File path (default: 'intlayer.config.ts')\n * @param instanceUrl - Custom GitLab instance URL (optional)\n */\n const getConfigFile = async (\n token: string | null | undefined,\n projectId: number,\n branch: string = 'main',\n path: string = 'intlayer.config.ts',\n instanceUrl?: string,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GitLabGetConfigFileResult>(\n `${GITLAB_API_ROUTE}/get-config-file`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: {\n token: token ?? undefined,\n projectId,\n branch,\n path,\n ...(instanceUrl && { instanceUrl }),\n },\n }\n );\n\n return {\n getAuthUrl,\n authenticate,\n getProjects,\n checkIntlayerConfig,\n getConfigFile,\n };\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"gitlab.mjs","names":[],"sources":["../../../src/getIntlayerAPI/gitlab.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { type FetcherOptions, fetcher } from '../fetcher';\n\nexport type GitLabProject = {\n id: number;\n name: string;\n path_with_namespace: string;\n web_url: string;\n default_branch: string;\n visibility: string;\n last_activity_at: string;\n namespace: {\n id: number;\n name: string;\n path: string;\n };\n};\n\nexport type GitLabAuthCallbackBody = {\n code: string;\n redirectUri: string;\n instanceUrl?: string;\n};\n\nexport type GitLabAuthCallbackResult = {\n data: {\n token: string;\n };\n};\n\nexport type GitLabListProjectsResult = {\n data: GitLabProject[];\n};\n\nexport type GitLabCheckConfigBody = {\n token?: string;\n projectId: number;\n branch?: string;\n instanceUrl?: string;\n};\n\nexport type GitLabCheckConfigResult = {\n data: {\n hasConfig: boolean;\n configPaths: string[];\n };\n};\n\nexport type GitLabGetConfigFileBody = {\n token?: string;\n projectId: number;\n branch?: string;\n path?: string;\n instanceUrl?: string;\n};\n\nexport type GitLabGetConfigFileResult = {\n data: {\n content: string;\n };\n};\n\nexport type GitLabGetAuthUrlResult = {\n data: {\n authUrl: string;\n };\n};\n\nexport const getGitlabAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const backendURL =\n intlayerConfig?.editor?.backendURL ?? configuration?.editor?.backendURL;\n\n if (!backendURL) {\n throw new Error(\n 'Backend URL is not defined in the Intlayer configuration.'\n );\n }\n\n const GITLAB_API_ROUTE = `${backendURL}/api/gitlab`;\n\n /**\n * Get GitLab OAuth authorization URL\n * @param redirectUri - Redirect URI after OAuth authorization\n * @param instanceUrl - Custom GitLab instance URL (optional, for self-hosted)\n */\n const getAuthUrl = async (\n redirectUri: string,\n instanceUrl?: string,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GitLabGetAuthUrlResult>(\n `${GITLAB_API_ROUTE}/auth-url`,\n authAPIOptions,\n otherOptions,\n {\n params: { redirectUri, ...(instanceUrl && { instanceUrl }) },\n }\n );\n\n /**\n * Exchange GitLab authorization code for access token\n * @param code - GitLab authorization code\n * @param redirectUri - Redirect URI used in the authorization request\n * @param instanceUrl - Custom GitLab instance URL (optional)\n */\n const authenticate = async (\n code: string,\n redirectUri: string,\n instanceUrl?: string,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GitLabAuthCallbackResult>(\n `${GITLAB_API_ROUTE}/auth`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: { code, redirectUri, instanceUrl },\n }\n );\n\n /**\n * Get user's GitLab projects\n * @param token - Optional GitLab access token. If not provided, backend will use session.\n * @param instanceUrl - Custom GitLab instance URL (optional)\n */\n const getProjects = async (\n token?: string | null,\n instanceUrl?: string,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GitLabListProjectsResult>(\n `${GITLAB_API_ROUTE}/projects`,\n authAPIOptions,\n otherOptions,\n {\n params: {\n ...(token && { token }),\n ...(instanceUrl && { instanceUrl }),\n },\n }\n );\n\n /**\n * Check if intlayer.config.ts exists in a GitLab repository\n * @param token - Optional GitLab access token. If not provided, backend will use session.\n * @param projectId - GitLab project ID\n * @param branch - Branch name (default: 'main')\n * @param instanceUrl - Custom GitLab instance URL (optional)\n */\n const checkIntlayerConfig = async (\n token: string | null | undefined,\n projectId: number,\n branch: string = 'main',\n instanceUrl?: string,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GitLabCheckConfigResult>(\n `${GITLAB_API_ROUTE}/check-config`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: {\n token: token ?? undefined,\n projectId,\n branch,\n ...(instanceUrl && { instanceUrl }),\n },\n }\n );\n\n /**\n * Get intlayer.config.ts file contents from a GitLab repository\n * @param token - Optional GitLab access token. If not provided, backend will use session.\n * @param projectId - GitLab project ID\n * @param branch - Branch name (default: 'main')\n * @param path - File path (default: 'intlayer.config.ts')\n * @param instanceUrl - Custom GitLab instance URL (optional)\n */\n const getConfigFile = async (\n token: string | null | undefined,\n projectId: number,\n branch: string = 'main',\n path: string = 'intlayer.config.ts',\n instanceUrl?: string,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GitLabGetConfigFileResult>(\n `${GITLAB_API_ROUTE}/get-config-file`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: {\n token: token ?? undefined,\n projectId,\n branch,\n path,\n ...(instanceUrl && { instanceUrl }),\n },\n }\n );\n\n return {\n getAuthUrl,\n authenticate,\n getProjects,\n checkIntlayerConfig,\n getConfigFile,\n };\n};\n"],"mappings":"+EAqEA,MAAa,GACX,EAAiC,EAAE,CACnC,IACG,CACH,IAAM,EACJ,GAAgB,QAAQ,YAAc,GAAe,QAAQ,WAE/D,GAAI,CAAC,EACH,MAAU,MACR,4DACD,CAGH,IAAM,EAAmB,GAAG,EAAW,aA8HvC,MAAO,CACL,WAxHiB,MACjB,EACA,EACA,EAA+B,EAAE,GAEjC,MAAM,EACJ,GAAG,EAAiB,WACpB,EACA,EACA,CACE,OAAQ,CAAE,cAAa,GAAI,GAAe,CAAE,cAAa,CAAG,CAC7D,CACF,CA6GD,aArGmB,MACnB,EACA,EACA,EACA,EAA+B,EAAE,GAEjC,MAAM,EACJ,GAAG,EAAiB,OACpB,EACA,EACA,CACE,OAAQ,OACR,KAAM,CAAE,OAAM,cAAa,cAAa,CACzC,CACF,CAwFD,YAjFkB,MAClB,EACA,EACA,EAA+B,EAAE,GAEjC,MAAM,EACJ,GAAG,EAAiB,WACpB,EACA,EACA,CACE,OAAQ,CACN,GAAI,GAAS,CAAE,QAAO,CACtB,GAAI,GAAe,CAAE,cAAa,CACnC,CACF,CACF,CAmED,oBA1D0B,MAC1B,EACA,EACA,EAAiB,OACjB,EACA,EAA+B,EAAE,GAEjC,MAAM,EACJ,GAAG,EAAiB,eACpB,EACA,EACA,CACE,OAAQ,OACR,KAAM,CACJ,MAAO,GAAS,IAAA,GAChB,YACA,SACA,GAAI,GAAe,CAAE,cAAa,CACnC,CACF,CACF,CAuCD,cA7BoB,MACpB,EACA,EACA,EAAiB,OACjB,EAAe,qBACf,EACA,EAA+B,EAAE,GAEjC,MAAM,EACJ,GAAG,EAAiB,kBACpB,EACA,EACA,CACE,OAAQ,OACR,KAAM,CACJ,MAAO,GAAS,IAAA,GAChB,YACA,SACA,OACA,GAAI,GAAe,CAAE,cAAa,CACnC,CACF,CACF,CAQF"}
|
|
@@ -1,38 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { getAuditAPI } from "./audit.mjs";
|
|
3
|
-
import { getBitbucketAPI } from "./bitbucket.mjs";
|
|
4
|
-
import { getDictionaryAPI } from "./dictionary.mjs";
|
|
5
|
-
import { getEditorAPI } from "./editor.mjs";
|
|
6
|
-
import { getGithubAPI } from "./github.mjs";
|
|
7
|
-
import { getGitlabAPI } from "./gitlab.mjs";
|
|
8
|
-
import { getNewsletterAPI } from "./newsletter.mjs";
|
|
9
|
-
import { getOAuthAPI } from "./oAuth.mjs";
|
|
10
|
-
import { getOrganizationAPI } from "./organization.mjs";
|
|
11
|
-
import { getProjectAPI } from "./project.mjs";
|
|
12
|
-
import { getSearchAPI } from "./search.mjs";
|
|
13
|
-
import { getStripeAPI } from "./stripe.mjs";
|
|
14
|
-
import { getTagAPI } from "./tag.mjs";
|
|
15
|
-
import { getUserAPI } from "./user.mjs";
|
|
16
|
-
|
|
17
|
-
//#region src/getIntlayerAPI/index.ts
|
|
18
|
-
const getIntlayerAPI = (authAPIOptions = {}, intlayerConfig) => ({
|
|
19
|
-
organization: getOrganizationAPI(authAPIOptions, intlayerConfig),
|
|
20
|
-
project: getProjectAPI(authAPIOptions, intlayerConfig),
|
|
21
|
-
user: getUserAPI(authAPIOptions, intlayerConfig),
|
|
22
|
-
oAuth: getOAuthAPI(intlayerConfig),
|
|
23
|
-
dictionary: getDictionaryAPI(authAPIOptions, intlayerConfig),
|
|
24
|
-
stripe: getStripeAPI(authAPIOptions, intlayerConfig),
|
|
25
|
-
ai: getAiAPI(authAPIOptions, intlayerConfig),
|
|
26
|
-
tag: getTagAPI(authAPIOptions, intlayerConfig),
|
|
27
|
-
search: getSearchAPI(authAPIOptions, intlayerConfig),
|
|
28
|
-
editor: getEditorAPI(authAPIOptions, intlayerConfig),
|
|
29
|
-
newsletter: getNewsletterAPI(authAPIOptions, intlayerConfig),
|
|
30
|
-
github: getGithubAPI(authAPIOptions, intlayerConfig),
|
|
31
|
-
gitlab: getGitlabAPI(authAPIOptions, intlayerConfig),
|
|
32
|
-
bitbucket: getBitbucketAPI(authAPIOptions, intlayerConfig),
|
|
33
|
-
audit: getAuditAPI(authAPIOptions, intlayerConfig)
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
//#endregion
|
|
37
|
-
export { getIntlayerAPI };
|
|
1
|
+
import{getAiAPI as e}from"./ai.mjs";import{getAuditAPI as t}from"./audit.mjs";import{getBitbucketAPI as n}from"./bitbucket.mjs";import{getDictionaryAPI as r}from"./dictionary.mjs";import{getEditorAPI as i}from"./editor.mjs";import{getGithubAPI as a}from"./github.mjs";import{getGitlabAPI as o}from"./gitlab.mjs";import{getNewsletterAPI as s}from"./newsletter.mjs";import{getOAuthAPI as c}from"./oAuth.mjs";import{getOrganizationAPI as l}from"./organization.mjs";import{getProjectAPI as u}from"./project.mjs";import{getSearchAPI as d}from"./search.mjs";import{getStripeAPI as f}from"./stripe.mjs";import{getTagAPI as p}from"./tag.mjs";import{getUserAPI as m}from"./user.mjs";const h=(h={},g)=>({organization:l(h,g),project:u(h,g),user:m(h,g),oAuth:c(g),dictionary:r(h,g),stripe:f(h,g),ai:e(h,g),tag:p(h,g),search:d(h,g),editor:i(h,g),newsletter:s(h,g),github:a(h,g),gitlab:o(h,g),bitbucket:n(h,g),audit:t(h,g)});export{h as getIntlayerAPI};
|
|
38
2
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../../src/getIntlayerAPI/index.ts"],"sourcesContent":["import type { IntlayerConfig } from '@intlayer/types';\nimport type { FetcherOptions } from '../fetcher';\nimport { getAiAPI } from './ai';\nimport { getAuditAPI } from './audit';\nimport { getBitbucketAPI } from './bitbucket';\nimport { getDictionaryAPI } from './dictionary';\nimport { getEditorAPI } from './editor';\nimport { getGithubAPI } from './github';\nimport { getGitlabAPI } from './gitlab';\nimport { getNewsletterAPI } from './newsletter';\nimport { getOAuthAPI } from './oAuth';\nimport { getOrganizationAPI } from './organization';\nimport { getProjectAPI } from './project';\nimport { getSearchAPI } from './search';\nimport { getStripeAPI } from './stripe';\nimport { getTagAPI } from './tag';\nimport { getUserAPI } from './user';\n\ninterface IntlayerAPIReturn {\n organization: ReturnType<typeof getOrganizationAPI>;\n project: ReturnType<typeof getProjectAPI>;\n user: ReturnType<typeof getUserAPI>;\n oAuth: ReturnType<typeof getOAuthAPI>;\n dictionary: ReturnType<typeof getDictionaryAPI>;\n stripe: ReturnType<typeof getStripeAPI>;\n ai: ReturnType<typeof getAiAPI>;\n tag: ReturnType<typeof getTagAPI>;\n search: ReturnType<typeof getSearchAPI>;\n editor: ReturnType<typeof getEditorAPI>;\n newsletter: ReturnType<typeof getNewsletterAPI>;\n github: ReturnType<typeof getGithubAPI>;\n gitlab: ReturnType<typeof getGitlabAPI>;\n bitbucket: ReturnType<typeof getBitbucketAPI>;\n audit: ReturnType<typeof getAuditAPI>;\n}\n\nexport const getIntlayerAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n): IntlayerAPIReturn => ({\n organization: getOrganizationAPI(authAPIOptions, intlayerConfig),\n project: getProjectAPI(authAPIOptions, intlayerConfig),\n user: getUserAPI(authAPIOptions, intlayerConfig),\n oAuth: getOAuthAPI(intlayerConfig),\n dictionary: getDictionaryAPI(authAPIOptions, intlayerConfig),\n stripe: getStripeAPI(authAPIOptions, intlayerConfig),\n ai: getAiAPI(authAPIOptions, intlayerConfig),\n tag: getTagAPI(authAPIOptions, intlayerConfig),\n search: getSearchAPI(authAPIOptions, intlayerConfig),\n editor: getEditorAPI(authAPIOptions, intlayerConfig),\n newsletter: getNewsletterAPI(authAPIOptions, intlayerConfig),\n github: getGithubAPI(authAPIOptions, intlayerConfig),\n gitlab: getGitlabAPI(authAPIOptions, intlayerConfig),\n bitbucket: getBitbucketAPI(authAPIOptions, intlayerConfig),\n audit: getAuditAPI(authAPIOptions, intlayerConfig),\n});\n\nexport type IntlayerAPI = ReturnType<typeof getIntlayerAPI>;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../src/getIntlayerAPI/index.ts"],"sourcesContent":["import type { IntlayerConfig } from '@intlayer/types';\nimport type { FetcherOptions } from '../fetcher';\nimport { getAiAPI } from './ai';\nimport { getAuditAPI } from './audit';\nimport { getBitbucketAPI } from './bitbucket';\nimport { getDictionaryAPI } from './dictionary';\nimport { getEditorAPI } from './editor';\nimport { getGithubAPI } from './github';\nimport { getGitlabAPI } from './gitlab';\nimport { getNewsletterAPI } from './newsletter';\nimport { getOAuthAPI } from './oAuth';\nimport { getOrganizationAPI } from './organization';\nimport { getProjectAPI } from './project';\nimport { getSearchAPI } from './search';\nimport { getStripeAPI } from './stripe';\nimport { getTagAPI } from './tag';\nimport { getUserAPI } from './user';\n\ninterface IntlayerAPIReturn {\n organization: ReturnType<typeof getOrganizationAPI>;\n project: ReturnType<typeof getProjectAPI>;\n user: ReturnType<typeof getUserAPI>;\n oAuth: ReturnType<typeof getOAuthAPI>;\n dictionary: ReturnType<typeof getDictionaryAPI>;\n stripe: ReturnType<typeof getStripeAPI>;\n ai: ReturnType<typeof getAiAPI>;\n tag: ReturnType<typeof getTagAPI>;\n search: ReturnType<typeof getSearchAPI>;\n editor: ReturnType<typeof getEditorAPI>;\n newsletter: ReturnType<typeof getNewsletterAPI>;\n github: ReturnType<typeof getGithubAPI>;\n gitlab: ReturnType<typeof getGitlabAPI>;\n bitbucket: ReturnType<typeof getBitbucketAPI>;\n audit: ReturnType<typeof getAuditAPI>;\n}\n\nexport const getIntlayerAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n): IntlayerAPIReturn => ({\n organization: getOrganizationAPI(authAPIOptions, intlayerConfig),\n project: getProjectAPI(authAPIOptions, intlayerConfig),\n user: getUserAPI(authAPIOptions, intlayerConfig),\n oAuth: getOAuthAPI(intlayerConfig),\n dictionary: getDictionaryAPI(authAPIOptions, intlayerConfig),\n stripe: getStripeAPI(authAPIOptions, intlayerConfig),\n ai: getAiAPI(authAPIOptions, intlayerConfig),\n tag: getTagAPI(authAPIOptions, intlayerConfig),\n search: getSearchAPI(authAPIOptions, intlayerConfig),\n editor: getEditorAPI(authAPIOptions, intlayerConfig),\n newsletter: getNewsletterAPI(authAPIOptions, intlayerConfig),\n github: getGithubAPI(authAPIOptions, intlayerConfig),\n gitlab: getGitlabAPI(authAPIOptions, intlayerConfig),\n bitbucket: getBitbucketAPI(authAPIOptions, intlayerConfig),\n audit: getAuditAPI(authAPIOptions, intlayerConfig),\n});\n\nexport type IntlayerAPI = ReturnType<typeof getIntlayerAPI>;\n"],"mappings":"kqBAoCA,MAAa,GACX,EAAiC,EAAE,CACnC,KACuB,CACvB,aAAc,EAAmB,EAAgB,EAAe,CAChE,QAAS,EAAc,EAAgB,EAAe,CACtD,KAAM,EAAW,EAAgB,EAAe,CAChD,MAAO,EAAY,EAAe,CAClC,WAAY,EAAiB,EAAgB,EAAe,CAC5D,OAAQ,EAAa,EAAgB,EAAe,CACpD,GAAI,EAAS,EAAgB,EAAe,CAC5C,IAAK,EAAU,EAAgB,EAAe,CAC9C,OAAQ,EAAa,EAAgB,EAAe,CACpD,OAAQ,EAAa,EAAgB,EAAe,CACpD,WAAY,EAAiB,EAAgB,EAAe,CAC5D,OAAQ,EAAa,EAAgB,EAAe,CACpD,OAAQ,EAAa,EAAgB,EAAe,CACpD,UAAW,EAAgB,EAAgB,EAAe,CAC1D,MAAO,EAAY,EAAgB,EAAe,CACnD"}
|
|
@@ -1,41 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import configuration from "@intlayer/config/built";
|
|
3
|
-
|
|
4
|
-
//#region src/getIntlayerAPI/newsletter.ts
|
|
5
|
-
const getNewsletterAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
6
|
-
const backendURL = intlayerConfig?.editor?.backendURL ?? configuration?.editor?.backendURL;
|
|
7
|
-
if (!backendURL) throw new Error("Backend URL is not defined in the Intlayer configuration.");
|
|
8
|
-
const NEWSLETTER_API_ROUTE = `${backendURL}/api/newsletter`;
|
|
9
|
-
/**
|
|
10
|
-
* Subscribe a user to newsletter(s)
|
|
11
|
-
* @param body - Newsletter subscription parameters.
|
|
12
|
-
* @returns Newsletter subscription result.
|
|
13
|
-
*/
|
|
14
|
-
const subscribeToNewsletter = async (body, otherOptions = {}) => await fetcher(`${NEWSLETTER_API_ROUTE}/subscribe`, authAPIOptions, otherOptions, {
|
|
15
|
-
method: "POST",
|
|
16
|
-
body
|
|
17
|
-
});
|
|
18
|
-
/**
|
|
19
|
-
* Unsubscribe a user from newsletter(s)
|
|
20
|
-
* @param body - Newsletter unsubscription parameters.
|
|
21
|
-
* @returns Newsletter unsubscription result.
|
|
22
|
-
*/
|
|
23
|
-
const unsubscribeFromNewsletter = async (body, otherOptions = {}) => await fetcher(`${NEWSLETTER_API_ROUTE}/unsubscribe`, authAPIOptions, otherOptions, {
|
|
24
|
-
method: "POST",
|
|
25
|
-
body
|
|
26
|
-
});
|
|
27
|
-
/**
|
|
28
|
-
* Get newsletter subscription status for the authenticated user
|
|
29
|
-
* @returns Newsletter subscription status.
|
|
30
|
-
*/
|
|
31
|
-
const getNewsletterStatus = async (otherOptions = {}) => await fetcher(`${NEWSLETTER_API_ROUTE}/status`, authAPIOptions, otherOptions, { method: "GET" });
|
|
32
|
-
return {
|
|
33
|
-
subscribeToNewsletter,
|
|
34
|
-
unsubscribeFromNewsletter,
|
|
35
|
-
getNewsletterStatus
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
//#endregion
|
|
40
|
-
export { getNewsletterAPI };
|
|
1
|
+
import{fetcher as e}from"../fetcher.mjs";import t from"@intlayer/config/built";const n=(n={},r)=>{let i=r?.editor?.backendURL??t?.editor?.backendURL;if(!i)throw Error(`Backend URL is not defined in the Intlayer configuration.`);let a=`${i}/api/newsletter`;return{subscribeToNewsletter:async(t,r={})=>await e(`${a}/subscribe`,n,r,{method:`POST`,body:t}),unsubscribeFromNewsletter:async(t,r={})=>await e(`${a}/unsubscribe`,n,r,{method:`POST`,body:t}),getNewsletterStatus:async(t={})=>await e(`${a}/status`,n,t,{method:`GET`})}};export{n as getNewsletterAPI};
|
|
41
2
|
//# sourceMappingURL=newsletter.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"newsletter.mjs","names":[],"sources":["../../../src/getIntlayerAPI/newsletter.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { type FetcherOptions, fetcher } from '../fetcher';\nimport type {\n NewsletterSubscriptionBody,\n NewsletterSubscriptionResult,\n NewsletterUnsubscriptionBody,\n} from '../types';\n\nexport const getNewsletterAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const backendURL =\n intlayerConfig?.editor?.backendURL ?? configuration?.editor?.backendURL;\n\n if (!backendURL) {\n throw new Error(\n 'Backend URL is not defined in the Intlayer configuration.'\n );\n }\n\n const NEWSLETTER_API_ROUTE = `${backendURL}/api/newsletter`;\n\n /**\n * Subscribe a user to newsletter(s)\n * @param body - Newsletter subscription parameters.\n * @returns Newsletter subscription result.\n */\n const subscribeToNewsletter = async (\n body: NewsletterSubscriptionBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<NewsletterSubscriptionResult>(\n `${NEWSLETTER_API_ROUTE}/subscribe`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: body,\n }\n );\n\n /**\n * Unsubscribe a user from newsletter(s)\n * @param body - Newsletter unsubscription parameters.\n * @returns Newsletter unsubscription result.\n */\n const unsubscribeFromNewsletter = async (\n body: NewsletterUnsubscriptionBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<NewsletterSubscriptionResult>(\n `${NEWSLETTER_API_ROUTE}/unsubscribe`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: body,\n }\n );\n\n /**\n * Get newsletter subscription status for the authenticated user\n * @returns Newsletter subscription status.\n */\n const getNewsletterStatus = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<NewsletterSubscriptionResult>(\n `${NEWSLETTER_API_ROUTE}/status`,\n authAPIOptions,\n otherOptions,\n {\n method: 'GET',\n }\n );\n\n return {\n subscribeToNewsletter,\n unsubscribeFromNewsletter,\n getNewsletterStatus,\n };\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"newsletter.mjs","names":[],"sources":["../../../src/getIntlayerAPI/newsletter.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { type FetcherOptions, fetcher } from '../fetcher';\nimport type {\n NewsletterSubscriptionBody,\n NewsletterSubscriptionResult,\n NewsletterUnsubscriptionBody,\n} from '../types';\n\nexport const getNewsletterAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const backendURL =\n intlayerConfig?.editor?.backendURL ?? configuration?.editor?.backendURL;\n\n if (!backendURL) {\n throw new Error(\n 'Backend URL is not defined in the Intlayer configuration.'\n );\n }\n\n const NEWSLETTER_API_ROUTE = `${backendURL}/api/newsletter`;\n\n /**\n * Subscribe a user to newsletter(s)\n * @param body - Newsletter subscription parameters.\n * @returns Newsletter subscription result.\n */\n const subscribeToNewsletter = async (\n body: NewsletterSubscriptionBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<NewsletterSubscriptionResult>(\n `${NEWSLETTER_API_ROUTE}/subscribe`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: body,\n }\n );\n\n /**\n * Unsubscribe a user from newsletter(s)\n * @param body - Newsletter unsubscription parameters.\n * @returns Newsletter unsubscription result.\n */\n const unsubscribeFromNewsletter = async (\n body: NewsletterUnsubscriptionBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<NewsletterSubscriptionResult>(\n `${NEWSLETTER_API_ROUTE}/unsubscribe`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: body,\n }\n );\n\n /**\n * Get newsletter subscription status for the authenticated user\n * @returns Newsletter subscription status.\n */\n const getNewsletterStatus = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<NewsletterSubscriptionResult>(\n `${NEWSLETTER_API_ROUTE}/status`,\n authAPIOptions,\n otherOptions,\n {\n method: 'GET',\n }\n );\n\n return {\n subscribeToNewsletter,\n unsubscribeFromNewsletter,\n getNewsletterStatus,\n };\n};\n"],"mappings":"+EASA,MAAa,GACX,EAAiC,EAAE,CACnC,IACG,CACH,IAAM,EACJ,GAAgB,QAAQ,YAAc,GAAe,QAAQ,WAE/D,GAAI,CAAC,EACH,MAAU,MACR,4DACD,CAGH,IAAM,EAAuB,GAAG,EAAW,iBAsD3C,MAAO,CACL,sBAhD4B,MAC5B,EACA,EAA+B,EAAE,GAEjC,MAAM,EACJ,GAAG,EAAqB,YACxB,EACA,EACA,CACE,OAAQ,OACF,OACP,CACF,CAqCD,0BA9BgC,MAChC,EACA,EAA+B,EAAE,GAEjC,MAAM,EACJ,GAAG,EAAqB,cACxB,EACA,EACA,CACE,OAAQ,OACF,OACP,CACF,CAmBD,oBAb0B,MAAO,EAA+B,EAAE,GAClE,MAAM,EACJ,GAAG,EAAqB,SACxB,EACA,EACA,CACE,OAAQ,MACT,CACF,CAMF"}
|
|
@@ -1,27 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import configuration from "@intlayer/config/built";
|
|
3
|
-
|
|
4
|
-
//#region src/getIntlayerAPI/oAuth.ts
|
|
5
|
-
const getOAuthAPI = (intlayerConfig) => {
|
|
6
|
-
const backendURL = intlayerConfig?.editor?.backendURL ?? configuration?.editor?.backendURL;
|
|
7
|
-
const { clientId, clientSecret } = intlayerConfig?.editor ?? {};
|
|
8
|
-
if (!backendURL) throw new Error("Backend URL is not defined in the Intlayer configuration.");
|
|
9
|
-
/**
|
|
10
|
-
* Gets an oAuth2 accessToken
|
|
11
|
-
* @return The token information
|
|
12
|
-
*/
|
|
13
|
-
const getOAuth2AccessToken = async (otherOptions = {}) => await fetcher(`${backendURL}/oauth2/token`, {}, otherOptions, {
|
|
14
|
-
method: "POST",
|
|
15
|
-
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
16
|
-
body: {
|
|
17
|
-
grant_type: "client_credentials",
|
|
18
|
-
client_id: clientId,
|
|
19
|
-
client_secret: clientSecret
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
return { getOAuth2AccessToken };
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
//#endregion
|
|
26
|
-
export { getOAuthAPI };
|
|
1
|
+
import{fetcher as e}from"../fetcher.mjs";import t from"@intlayer/config/built";const n=n=>{let r=n?.editor?.backendURL??t?.editor?.backendURL,{clientId:i,clientSecret:a}=n?.editor??{};if(!r)throw Error(`Backend URL is not defined in the Intlayer configuration.`);return{getOAuth2AccessToken:async(t={})=>await e(`${r}/oauth2/token`,{},t,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`},body:{grant_type:`client_credentials`,client_id:i,client_secret:a}})}};export{n as getOAuthAPI};
|
|
27
2
|
//# sourceMappingURL=oAuth.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oAuth.mjs","names":[],"sources":["../../../src/getIntlayerAPI/oAuth.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { type FetcherOptions, fetcher } from '../fetcher';\nimport type { GetOAuth2TokenBody, GetOAuth2TokenResult } from '../types';\n\nexport const getOAuthAPI = (intlayerConfig?: IntlayerConfig) => {\n const backendURL =\n intlayerConfig?.editor?.backendURL ?? configuration?.editor?.backendURL;\n const { clientId, clientSecret } = intlayerConfig?.editor ?? {};\n\n if (!backendURL) {\n throw new Error(\n 'Backend URL is not defined in the Intlayer configuration.'\n );\n }\n\n /**\n * Gets an oAuth2 accessToken\n * @return The token information\n */\n const getOAuth2AccessToken = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetOAuth2TokenResult>(\n `${backendURL}/oauth2/token`,\n {},\n otherOptions,\n {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n },\n body: {\n grant_type: 'client_credentials',\n client_id: clientId!,\n client_secret: clientSecret!,\n } satisfies GetOAuth2TokenBody,\n }\n );\n\n return {\n getOAuth2AccessToken,\n };\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"oAuth.mjs","names":[],"sources":["../../../src/getIntlayerAPI/oAuth.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { type FetcherOptions, fetcher } from '../fetcher';\nimport type { GetOAuth2TokenBody, GetOAuth2TokenResult } from '../types';\n\nexport const getOAuthAPI = (intlayerConfig?: IntlayerConfig) => {\n const backendURL =\n intlayerConfig?.editor?.backendURL ?? configuration?.editor?.backendURL;\n const { clientId, clientSecret } = intlayerConfig?.editor ?? {};\n\n if (!backendURL) {\n throw new Error(\n 'Backend URL is not defined in the Intlayer configuration.'\n );\n }\n\n /**\n * Gets an oAuth2 accessToken\n * @return The token information\n */\n const getOAuth2AccessToken = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetOAuth2TokenResult>(\n `${backendURL}/oauth2/token`,\n {},\n otherOptions,\n {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n },\n body: {\n grant_type: 'client_credentials',\n client_id: clientId!,\n client_secret: clientSecret!,\n } satisfies GetOAuth2TokenBody,\n }\n );\n\n return {\n getOAuth2AccessToken,\n };\n};\n"],"mappings":"+EAKA,MAAa,EAAe,GAAoC,CAC9D,IAAM,EACJ,GAAgB,QAAQ,YAAc,GAAe,QAAQ,WACzD,CAAE,WAAU,gBAAiB,GAAgB,QAAU,EAAE,CAE/D,GAAI,CAAC,EACH,MAAU,MACR,4DACD,CAyBH,MAAO,CACL,qBAnB2B,MAAO,EAA+B,EAAE,GACnE,MAAM,EACJ,GAAG,EAAW,eACd,EAAE,CACF,EACA,CACE,OAAQ,OACR,QAAS,CACP,eAAgB,oCACjB,CACD,KAAM,CACJ,WAAY,qBACZ,UAAW,EACX,cAAe,EAChB,CACF,CACF,CAIF"}
|
|
@@ -1,94 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import configuration from "@intlayer/config/built";
|
|
3
|
-
|
|
4
|
-
//#region src/getIntlayerAPI/organization.ts
|
|
5
|
-
const getOrganizationAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
6
|
-
const backendURL = intlayerConfig?.editor?.backendURL ?? configuration?.editor?.backendURL;
|
|
7
|
-
if (!backendURL) throw new Error("Backend URL is not defined in the Intlayer configuration--.");
|
|
8
|
-
const ORGANIZATION_API_ROUTE = `${backendURL}/api/organization`;
|
|
9
|
-
/**
|
|
10
|
-
* Retrieves a list of organizations based on filters and pagination.
|
|
11
|
-
* @param filters - Filters and pagination options.
|
|
12
|
-
*/
|
|
13
|
-
const getOrganizations = async (filters, otherOptions = {}) => await fetcher(ORGANIZATION_API_ROUTE, authAPIOptions, otherOptions, {
|
|
14
|
-
cache: "no-store",
|
|
15
|
-
params: filters
|
|
16
|
-
});
|
|
17
|
-
/**
|
|
18
|
-
* Retrieves an organization by its ID.
|
|
19
|
-
* @param organizationId - Organization ID.
|
|
20
|
-
*/
|
|
21
|
-
const getOrganization = async (organizationId, otherOptions = {}) => await fetcher(`${ORGANIZATION_API_ROUTE}/${String(organizationId)}`, authAPIOptions, otherOptions);
|
|
22
|
-
/**
|
|
23
|
-
* Adds a new organization to the database.
|
|
24
|
-
* @param organization - Organization data.
|
|
25
|
-
*/
|
|
26
|
-
const addOrganization = async (organization, otherOptions = {}) => await fetcher(ORGANIZATION_API_ROUTE, authAPIOptions, otherOptions, {
|
|
27
|
-
method: "POST",
|
|
28
|
-
body: organization
|
|
29
|
-
});
|
|
30
|
-
/**
|
|
31
|
-
* Updates an existing organization in the database.
|
|
32
|
-
* @param organization - Updated organization data.
|
|
33
|
-
*/
|
|
34
|
-
const updateOrganization = async (organization, otherOptions = {}) => fetcher(ORGANIZATION_API_ROUTE, authAPIOptions, otherOptions, {
|
|
35
|
-
method: "PUT",
|
|
36
|
-
body: organization
|
|
37
|
-
});
|
|
38
|
-
/**
|
|
39
|
-
* Update members to the organization in the database.
|
|
40
|
-
* @param body - Updated organization members data.
|
|
41
|
-
*/
|
|
42
|
-
const updateOrganizationMembers = async (body, otherOptions = {}) => fetcher(`${ORGANIZATION_API_ROUTE}/members`, authAPIOptions, otherOptions, {
|
|
43
|
-
method: "PUT",
|
|
44
|
-
body
|
|
45
|
-
});
|
|
46
|
-
/**
|
|
47
|
-
* Admin-only: Update members of any organization by ID
|
|
48
|
-
* @param organizationId - Organization ID
|
|
49
|
-
* @param body - Updated organization members data.
|
|
50
|
-
*/
|
|
51
|
-
const updateOrganizationMembersById = async (organizationId, body, otherOptions = {}) => fetcher(`${ORGANIZATION_API_ROUTE}/${organizationId}/members`, authAPIOptions, otherOptions, {
|
|
52
|
-
method: "PUT",
|
|
53
|
-
body
|
|
54
|
-
});
|
|
55
|
-
/**
|
|
56
|
-
* Add member to the organization in the database.
|
|
57
|
-
* @param body - Updated organization members data.
|
|
58
|
-
*/
|
|
59
|
-
const addOrganizationMember = async (body, otherOptions = {}) => fetcher(`${ORGANIZATION_API_ROUTE}/member`, authAPIOptions, otherOptions, {
|
|
60
|
-
method: "POST",
|
|
61
|
-
body
|
|
62
|
-
});
|
|
63
|
-
/**
|
|
64
|
-
* Deletes an organization from the database by its ID.
|
|
65
|
-
* @param organizationId - Organization ID.
|
|
66
|
-
*/
|
|
67
|
-
const deleteOrganization = async (otherOptions = {}) => await fetcher(ORGANIZATION_API_ROUTE, authAPIOptions, otherOptions, { method: "DELETE" });
|
|
68
|
-
/**
|
|
69
|
-
* Select an organization from the database by its ID.
|
|
70
|
-
* @param organizationId - Organization ID.
|
|
71
|
-
*/
|
|
72
|
-
const selectOrganization = async (organizationId, otherOptions = {}) => await fetcher(`${ORGANIZATION_API_ROUTE}/${String(organizationId)}`, authAPIOptions, otherOptions, { method: "PUT" });
|
|
73
|
-
/**
|
|
74
|
-
* Unselect an organization from the database by its ID.
|
|
75
|
-
* @param organizationId - Organization ID.
|
|
76
|
-
*/
|
|
77
|
-
const unselectOrganization = async (otherOptions = {}) => await fetcher(`${ORGANIZATION_API_ROUTE}/logout`, authAPIOptions, otherOptions, { method: "POST" });
|
|
78
|
-
return {
|
|
79
|
-
getOrganizations,
|
|
80
|
-
getOrganization,
|
|
81
|
-
addOrganization,
|
|
82
|
-
addOrganizationMember,
|
|
83
|
-
updateOrganization,
|
|
84
|
-
updateOrganizationMembers,
|
|
85
|
-
updateOrganizationMembersById,
|
|
86
|
-
deleteOrganization,
|
|
87
|
-
selectOrganization,
|
|
88
|
-
unselectOrganization
|
|
89
|
-
};
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
//#endregion
|
|
93
|
-
export { getOrganizationAPI };
|
|
1
|
+
import{fetcher as e}from"../fetcher.mjs";import t from"@intlayer/config/built";const n=(n={},r)=>{let i=r?.editor?.backendURL??t?.editor?.backendURL;if(!i)throw Error(`Backend URL is not defined in the Intlayer configuration--.`);let a=`${i}/api/organization`;return{getOrganizations:async(t,r={})=>await e(a,n,r,{cache:`no-store`,params:t}),getOrganization:async(t,r={})=>await e(`${a}/${String(t)}`,n,r),addOrganization:async(t,r={})=>await e(a,n,r,{method:`POST`,body:t}),addOrganizationMember:async(t,r={})=>e(`${a}/member`,n,r,{method:`POST`,body:t}),updateOrganization:async(t,r={})=>e(a,n,r,{method:`PUT`,body:t}),updateOrganizationMembers:async(t,r={})=>e(`${a}/members`,n,r,{method:`PUT`,body:t}),updateOrganizationMembersById:async(t,r,i={})=>e(`${a}/${t}/members`,n,i,{method:`PUT`,body:r}),deleteOrganization:async(t={})=>await e(a,n,t,{method:`DELETE`}),selectOrganization:async(t,r={})=>await e(`${a}/${String(t)}`,n,r,{method:`PUT`}),unselectOrganization:async(t={})=>await e(`${a}/logout`,n,t,{method:`POST`})}};export{n as getOrganizationAPI};
|
|
94
2
|
//# sourceMappingURL=organization.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization.mjs","names":[],"sources":["../../../src/getIntlayerAPI/organization.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { type FetcherOptions, fetcher } from '../fetcher';\nimport type {\n AddOrganizationBody,\n AddOrganizationMemberBody,\n AddOrganizationMemberResult,\n AddOrganizationResult,\n DeleteOrganizationResult,\n GetOrganizationParam,\n GetOrganizationResult,\n GetOrganizationsParams,\n GetOrganizationsResult,\n SelectOrganizationParam,\n SelectOrganizationResult,\n UnselectOrganizationResult,\n UpdateOrganizationBody,\n UpdateOrganizationMembersBody,\n UpdateOrganizationMembersResult,\n UpdateOrganizationResult,\n} from '../types';\n\nexport const getOrganizationAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const backendURL =\n intlayerConfig?.editor?.backendURL ?? configuration?.editor?.backendURL;\n\n if (!backendURL) {\n throw new Error(\n 'Backend URL is not defined in the Intlayer configuration--.'\n );\n }\n\n const ORGANIZATION_API_ROUTE = `${backendURL}/api/organization`;\n\n /**\n * Retrieves a list of organizations based on filters and pagination.\n * @param filters - Filters and pagination options.\n */\n const getOrganizations = async (\n filters?: GetOrganizationsParams,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetOrganizationsResult>(\n ORGANIZATION_API_ROUTE,\n authAPIOptions,\n otherOptions,\n {\n cache: 'no-store',\n // @ts-ignore Number of parameter will be stringified by the fetcher\n params: filters,\n }\n );\n\n /**\n * Retrieves an organization by its ID.\n * @param organizationId - Organization ID.\n */\n const getOrganization = async (\n organizationId: GetOrganizationParam['organizationId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetOrganizationResult>(\n `${ORGANIZATION_API_ROUTE}/${String(organizationId)}`,\n authAPIOptions,\n otherOptions\n );\n\n /**\n * Adds a new organization to the database.\n * @param organization - Organization data.\n */\n const addOrganization = async (\n organization: AddOrganizationBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<AddOrganizationResult>(\n ORGANIZATION_API_ROUTE,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: organization,\n }\n );\n\n /**\n * Updates an existing organization in the database.\n * @param organization - Updated organization data.\n */\n const updateOrganization = async (\n organization: UpdateOrganizationBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<UpdateOrganizationResult>(\n ORGANIZATION_API_ROUTE,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body: organization,\n }\n );\n\n /**\n * Update members to the organization in the database.\n * @param body - Updated organization members data.\n */\n const updateOrganizationMembers = async (\n body: UpdateOrganizationMembersBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<UpdateOrganizationMembersResult>(\n `${ORGANIZATION_API_ROUTE}/members`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body,\n }\n );\n\n /**\n * Admin-only: Update members of any organization by ID\n * @param organizationId - Organization ID\n * @param body - Updated organization members data.\n */\n const updateOrganizationMembersById = async (\n organizationId: string,\n body: UpdateOrganizationMembersBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<UpdateOrganizationMembersResult>(\n `${ORGANIZATION_API_ROUTE}/${organizationId}/members`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body,\n }\n );\n\n /**\n * Add member to the organization in the database.\n * @param body - Updated organization members data.\n */\n const addOrganizationMember = async (\n body: AddOrganizationMemberBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<AddOrganizationMemberResult>(\n `${ORGANIZATION_API_ROUTE}/member`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body,\n }\n );\n\n /**\n * Deletes an organization from the database by its ID.\n * @param organizationId - Organization ID.\n */\n const deleteOrganization = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<DeleteOrganizationResult>(\n ORGANIZATION_API_ROUTE,\n authAPIOptions,\n otherOptions,\n {\n method: 'DELETE',\n }\n );\n\n /**\n * Select an organization from the database by its ID.\n * @param organizationId - Organization ID.\n */\n const selectOrganization = async (\n organizationId: SelectOrganizationParam['organizationId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<SelectOrganizationResult>(\n `${ORGANIZATION_API_ROUTE}/${String(organizationId)}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n }\n );\n\n /**\n * Unselect an organization from the database by its ID.\n * @param organizationId - Organization ID.\n */\n const unselectOrganization = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<UnselectOrganizationResult>(\n `${ORGANIZATION_API_ROUTE}/logout`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n }\n );\n\n return {\n getOrganizations,\n getOrganization,\n addOrganization,\n addOrganizationMember,\n updateOrganization,\n updateOrganizationMembers,\n updateOrganizationMembersById,\n deleteOrganization,\n selectOrganization,\n unselectOrganization,\n };\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"organization.mjs","names":[],"sources":["../../../src/getIntlayerAPI/organization.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { type FetcherOptions, fetcher } from '../fetcher';\nimport type {\n AddOrganizationBody,\n AddOrganizationMemberBody,\n AddOrganizationMemberResult,\n AddOrganizationResult,\n DeleteOrganizationResult,\n GetOrganizationParam,\n GetOrganizationResult,\n GetOrganizationsParams,\n GetOrganizationsResult,\n SelectOrganizationParam,\n SelectOrganizationResult,\n UnselectOrganizationResult,\n UpdateOrganizationBody,\n UpdateOrganizationMembersBody,\n UpdateOrganizationMembersResult,\n UpdateOrganizationResult,\n} from '../types';\n\nexport const getOrganizationAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const backendURL =\n intlayerConfig?.editor?.backendURL ?? configuration?.editor?.backendURL;\n\n if (!backendURL) {\n throw new Error(\n 'Backend URL is not defined in the Intlayer configuration--.'\n );\n }\n\n const ORGANIZATION_API_ROUTE = `${backendURL}/api/organization`;\n\n /**\n * Retrieves a list of organizations based on filters and pagination.\n * @param filters - Filters and pagination options.\n */\n const getOrganizations = async (\n filters?: GetOrganizationsParams,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetOrganizationsResult>(\n ORGANIZATION_API_ROUTE,\n authAPIOptions,\n otherOptions,\n {\n cache: 'no-store',\n // @ts-ignore Number of parameter will be stringified by the fetcher\n params: filters,\n }\n );\n\n /**\n * Retrieves an organization by its ID.\n * @param organizationId - Organization ID.\n */\n const getOrganization = async (\n organizationId: GetOrganizationParam['organizationId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetOrganizationResult>(\n `${ORGANIZATION_API_ROUTE}/${String(organizationId)}`,\n authAPIOptions,\n otherOptions\n );\n\n /**\n * Adds a new organization to the database.\n * @param organization - Organization data.\n */\n const addOrganization = async (\n organization: AddOrganizationBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<AddOrganizationResult>(\n ORGANIZATION_API_ROUTE,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: organization,\n }\n );\n\n /**\n * Updates an existing organization in the database.\n * @param organization - Updated organization data.\n */\n const updateOrganization = async (\n organization: UpdateOrganizationBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<UpdateOrganizationResult>(\n ORGANIZATION_API_ROUTE,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body: organization,\n }\n );\n\n /**\n * Update members to the organization in the database.\n * @param body - Updated organization members data.\n */\n const updateOrganizationMembers = async (\n body: UpdateOrganizationMembersBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<UpdateOrganizationMembersResult>(\n `${ORGANIZATION_API_ROUTE}/members`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body,\n }\n );\n\n /**\n * Admin-only: Update members of any organization by ID\n * @param organizationId - Organization ID\n * @param body - Updated organization members data.\n */\n const updateOrganizationMembersById = async (\n organizationId: string,\n body: UpdateOrganizationMembersBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<UpdateOrganizationMembersResult>(\n `${ORGANIZATION_API_ROUTE}/${organizationId}/members`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body,\n }\n );\n\n /**\n * Add member to the organization in the database.\n * @param body - Updated organization members data.\n */\n const addOrganizationMember = async (\n body: AddOrganizationMemberBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<AddOrganizationMemberResult>(\n `${ORGANIZATION_API_ROUTE}/member`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body,\n }\n );\n\n /**\n * Deletes an organization from the database by its ID.\n * @param organizationId - Organization ID.\n */\n const deleteOrganization = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<DeleteOrganizationResult>(\n ORGANIZATION_API_ROUTE,\n authAPIOptions,\n otherOptions,\n {\n method: 'DELETE',\n }\n );\n\n /**\n * Select an organization from the database by its ID.\n * @param organizationId - Organization ID.\n */\n const selectOrganization = async (\n organizationId: SelectOrganizationParam['organizationId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<SelectOrganizationResult>(\n `${ORGANIZATION_API_ROUTE}/${String(organizationId)}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n }\n );\n\n /**\n * Unselect an organization from the database by its ID.\n * @param organizationId - Organization ID.\n */\n const unselectOrganization = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<UnselectOrganizationResult>(\n `${ORGANIZATION_API_ROUTE}/logout`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n }\n );\n\n return {\n getOrganizations,\n getOrganization,\n addOrganization,\n addOrganizationMember,\n updateOrganization,\n updateOrganizationMembers,\n updateOrganizationMembersById,\n deleteOrganization,\n selectOrganization,\n unselectOrganization,\n };\n};\n"],"mappings":"+EAsBA,MAAa,GACX,EAAiC,EAAE,CACnC,IACG,CACH,IAAM,EACJ,GAAgB,QAAQ,YAAc,GAAe,QAAQ,WAE/D,GAAI,CAAC,EACH,MAAU,MACR,8DACD,CAGH,IAAM,EAAyB,GAAG,EAAW,mBA4K7C,MAAO,CACL,iBAvKuB,MACvB,EACA,EAA+B,EAAE,GAEjC,MAAM,EACJ,EACA,EACA,EACA,CACE,MAAO,WAEP,OAAQ,EACT,CACF,CA2JD,gBArJsB,MACtB,EACA,EAA+B,EAAE,GAEjC,MAAM,EACJ,GAAG,EAAuB,GAAG,OAAO,EAAe,GACnD,EACA,EACD,CA8ID,gBAxIsB,MACtB,EACA,EAA+B,EAAE,GAEjC,MAAM,EACJ,EACA,EACA,EACA,CACE,OAAQ,OACR,KAAM,EACP,CACF,CA6HD,sBA/D4B,MAC5B,EACA,EAA+B,EAAE,GAEjC,EACE,GAAG,EAAuB,SAC1B,EACA,EACA,CACE,OAAQ,OACR,OACD,CACF,CAoDD,mBAxHyB,MACzB,EACA,EAA+B,EAAE,GAEjC,EACE,EACA,EACA,EACA,CACE,OAAQ,MACR,KAAM,EACP,CACF,CA6GD,0BAvGgC,MAChC,EACA,EAA+B,EAAE,GAEjC,EACE,GAAG,EAAuB,UAC1B,EACA,EACA,CACE,OAAQ,MACR,OACD,CACF,CA4FD,8BArFoC,MACpC,EACA,EACA,EAA+B,EAAE,GAEjC,EACE,GAAG,EAAuB,GAAG,EAAe,UAC5C,EACA,EACA,CACE,OAAQ,MACR,OACD,CACF,CAyED,mBAjDyB,MAAO,EAA+B,EAAE,GACjE,MAAM,EACJ,EACA,EACA,EACA,CACE,OAAQ,SACT,CACF,CA0CD,mBApCyB,MACzB,EACA,EAA+B,EAAE,GAEjC,MAAM,EACJ,GAAG,EAAuB,GAAG,OAAO,EAAe,GACnD,EACA,EACA,CACE,OAAQ,MACT,CACF,CA0BD,qBApB2B,MAAO,EAA+B,EAAE,GACnE,MAAM,EACJ,GAAG,EAAuB,SAC1B,EACA,EACA,CACE,OAAQ,OACT,CACF,CAaF"}
|
|
@@ -1,142 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import configuration from "@intlayer/config/built";
|
|
3
|
-
|
|
4
|
-
//#region src/getIntlayerAPI/project.ts
|
|
5
|
-
const getProjectAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
6
|
-
const backendURL = intlayerConfig?.editor?.backendURL ?? configuration?.editor?.backendURL;
|
|
7
|
-
if (!backendURL) throw new Error("Backend URL is not defined in the Intlayer configuration.");
|
|
8
|
-
const PROJECT_API_ROUTE = `${backendURL}/api/project`;
|
|
9
|
-
/**
|
|
10
|
-
* Retrieves a list of projects based on filters and pagination.
|
|
11
|
-
* @param filters - Filters and pagination options.
|
|
12
|
-
*/
|
|
13
|
-
const getProjects = async (filters, otherOptions = {}) => await fetcher(PROJECT_API_ROUTE, authAPIOptions, otherOptions, {
|
|
14
|
-
cache: "no-store",
|
|
15
|
-
params: filters
|
|
16
|
-
});
|
|
17
|
-
/**
|
|
18
|
-
* Adds a new project to the database.
|
|
19
|
-
* @param project - Project data.
|
|
20
|
-
*/
|
|
21
|
-
const addProject = async (project, otherOptions = {}) => await fetcher(`${PROJECT_API_ROUTE}`, authAPIOptions, otherOptions, {
|
|
22
|
-
method: "POST",
|
|
23
|
-
body: project
|
|
24
|
-
});
|
|
25
|
-
/**
|
|
26
|
-
* Updates an existing project in the database.
|
|
27
|
-
* @param project - Updated project data.
|
|
28
|
-
*/
|
|
29
|
-
const updateProject = async (project, otherOptions = {}) => await fetcher(`${PROJECT_API_ROUTE}`, authAPIOptions, otherOptions, {
|
|
30
|
-
method: "PUT",
|
|
31
|
-
body: project
|
|
32
|
-
});
|
|
33
|
-
/**
|
|
34
|
-
* Updates project members in the database.
|
|
35
|
-
* @param project - Updated project data.
|
|
36
|
-
*/
|
|
37
|
-
const updateProjectMembers = async (body, otherOptions = {}) => await fetcher(`${PROJECT_API_ROUTE}/members`, authAPIOptions, otherOptions, {
|
|
38
|
-
method: "PUT",
|
|
39
|
-
body
|
|
40
|
-
});
|
|
41
|
-
/** Pushes a project configuration to the database.
|
|
42
|
-
* @param projectConfiguration - Project configuration data.
|
|
43
|
-
*/
|
|
44
|
-
const pushProjectConfiguration = async (projectConfiguration, otherOptions = {}) => await fetcher(`${PROJECT_API_ROUTE}/configuration`, authAPIOptions, otherOptions, {
|
|
45
|
-
method: "PUT",
|
|
46
|
-
body: projectConfiguration
|
|
47
|
-
});
|
|
48
|
-
/**
|
|
49
|
-
* Deletes a project from the database by its ID.
|
|
50
|
-
* @param id - Project ID.
|
|
51
|
-
*/
|
|
52
|
-
const deleteProject = async (otherOptions = {}) => await fetcher(`${PROJECT_API_ROUTE}`, authAPIOptions, otherOptions, { method: "DELETE" });
|
|
53
|
-
/**
|
|
54
|
-
* Select a project from the database by its ID.
|
|
55
|
-
* @param projectId - Organization ID.
|
|
56
|
-
*/
|
|
57
|
-
const selectProject = async (projectId, otherOptions = {}) => await fetcher(`${PROJECT_API_ROUTE}/${String(projectId)}`, authAPIOptions, otherOptions, { method: "PUT" });
|
|
58
|
-
/**
|
|
59
|
-
* Unselect a project from the database by its ID.
|
|
60
|
-
* @param projectId - Project ID.
|
|
61
|
-
*/
|
|
62
|
-
const unselectProject = async (otherOptions = {}) => await fetcher(`${PROJECT_API_ROUTE}/logout`, authAPIOptions, otherOptions, { method: "POST" });
|
|
63
|
-
/**
|
|
64
|
-
* Add a new access key to a project.
|
|
65
|
-
* @param accessKey - Access key data.
|
|
66
|
-
* @param otherOptions - Fetcher options.
|
|
67
|
-
* @returns The new access key.
|
|
68
|
-
*/
|
|
69
|
-
const addNewAccessKey = async (accessKey, otherOptions = {}) => await fetcher(`${PROJECT_API_ROUTE}/access_key`, authAPIOptions, otherOptions, {
|
|
70
|
-
method: "POST",
|
|
71
|
-
body: accessKey
|
|
72
|
-
});
|
|
73
|
-
/**
|
|
74
|
-
* Delete a project access key.
|
|
75
|
-
* @param clientId - Access key client ID.
|
|
76
|
-
* @param otherOptions - Fetcher options.
|
|
77
|
-
* @returns The deleted project.
|
|
78
|
-
*/
|
|
79
|
-
const deleteAccessKey = async (clientId, otherOptions = {}) => await fetcher(`${PROJECT_API_ROUTE}/access_key`, authAPIOptions, otherOptions, {
|
|
80
|
-
method: "DELETE",
|
|
81
|
-
body: { clientId }
|
|
82
|
-
});
|
|
83
|
-
/**
|
|
84
|
-
* Refreshes an access key from a project.
|
|
85
|
-
* @param clientId - The ID of the client to refresh.
|
|
86
|
-
* @param projectId - The ID of the project to refresh the access key from.
|
|
87
|
-
* @returns The new access key.
|
|
88
|
-
*/
|
|
89
|
-
const refreshAccessKey = async (clientId, otherOptions = {}) => await fetcher(`${PROJECT_API_ROUTE}/access_key`, authAPIOptions, otherOptions, {
|
|
90
|
-
method: "PATCH",
|
|
91
|
-
body: { clientId }
|
|
92
|
-
});
|
|
93
|
-
/**
|
|
94
|
-
* Triggers CI builds for a project (Git provider pipelines and webhooks).
|
|
95
|
-
* @param otherOptions - Fetcher options.
|
|
96
|
-
* @returns The trigger results.
|
|
97
|
-
*/
|
|
98
|
-
const triggerBuild = async (otherOptions = {}) => await fetcher(`${PROJECT_API_ROUTE}/build`, authAPIOptions, otherOptions, { method: "POST" });
|
|
99
|
-
/**
|
|
100
|
-
* Triggers a single webhook by index.
|
|
101
|
-
* @param webhookIndex - The index of the webhook to trigger.
|
|
102
|
-
* @param otherOptions - Fetcher options.
|
|
103
|
-
* @returns The trigger result.
|
|
104
|
-
*/
|
|
105
|
-
const triggerWebhook = async (webhookIndex, otherOptions = {}) => await fetcher(`${PROJECT_API_ROUTE}/webhook`, authAPIOptions, otherOptions, {
|
|
106
|
-
method: "POST",
|
|
107
|
-
body: { webhookIndex }
|
|
108
|
-
});
|
|
109
|
-
/**
|
|
110
|
-
* Get CI configuration status for the current project.
|
|
111
|
-
* @param otherOptions - Fetcher options.
|
|
112
|
-
* @returns The CI configuration status.
|
|
113
|
-
*/
|
|
114
|
-
const getCIConfig = async (otherOptions = {}) => await fetcher(`${PROJECT_API_ROUTE}/ci`, authAPIOptions, otherOptions, { method: "GET" });
|
|
115
|
-
/**
|
|
116
|
-
* Push CI configuration file to the repository.
|
|
117
|
-
* @param otherOptions - Fetcher options.
|
|
118
|
-
* @returns Success status.
|
|
119
|
-
*/
|
|
120
|
-
const pushCIConfig = async (otherOptions = {}) => await fetcher(`${PROJECT_API_ROUTE}/ci`, authAPIOptions, otherOptions, { method: "POST" });
|
|
121
|
-
return {
|
|
122
|
-
getProjects,
|
|
123
|
-
addProject,
|
|
124
|
-
updateProject,
|
|
125
|
-
updateProjectMembers,
|
|
126
|
-
pushProjectConfiguration,
|
|
127
|
-
deleteProject,
|
|
128
|
-
selectProject,
|
|
129
|
-
unselectProject,
|
|
130
|
-
addNewAccessKey,
|
|
131
|
-
deleteAccessKey,
|
|
132
|
-
refreshAccessKey,
|
|
133
|
-
triggerBuild,
|
|
134
|
-
triggerWebhook,
|
|
135
|
-
getCIConfig,
|
|
136
|
-
pushCIConfig
|
|
137
|
-
};
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
//#endregion
|
|
141
|
-
export { getProjectAPI };
|
|
1
|
+
import{fetcher as e}from"../fetcher.mjs";import t from"@intlayer/config/built";const n=(n={},r)=>{let i=r?.editor?.backendURL??t?.editor?.backendURL;if(!i)throw Error(`Backend URL is not defined in the Intlayer configuration.`);let a=`${i}/api/project`;return{getProjects:async(t,r={})=>await e(a,n,r,{cache:`no-store`,params:t}),addProject:async(t,r={})=>await e(`${a}`,n,r,{method:`POST`,body:t}),updateProject:async(t,r={})=>await e(`${a}`,n,r,{method:`PUT`,body:t}),updateProjectMembers:async(t,r={})=>await e(`${a}/members`,n,r,{method:`PUT`,body:t}),pushProjectConfiguration:async(t,r={})=>await e(`${a}/configuration`,n,r,{method:`PUT`,body:t}),deleteProject:async(t={})=>await e(`${a}`,n,t,{method:`DELETE`}),selectProject:async(t,r={})=>await e(`${a}/${String(t)}`,n,r,{method:`PUT`}),unselectProject:async(t={})=>await e(`${a}/logout`,n,t,{method:`POST`}),addNewAccessKey:async(t,r={})=>await e(`${a}/access_key`,n,r,{method:`POST`,body:t}),deleteAccessKey:async(t,r={})=>await e(`${a}/access_key`,n,r,{method:`DELETE`,body:{clientId:t}}),refreshAccessKey:async(t,r={})=>await e(`${a}/access_key`,n,r,{method:`PATCH`,body:{clientId:t}}),triggerBuild:async(t={})=>await e(`${a}/build`,n,t,{method:`POST`}),triggerWebhook:async(t,r={})=>await e(`${a}/webhook`,n,r,{method:`POST`,body:{webhookIndex:t}}),getCIConfig:async(t={})=>await e(`${a}/ci`,n,t,{method:`GET`}),pushCIConfig:async(t={})=>await e(`${a}/ci`,n,t,{method:`POST`})}};export{n as getProjectAPI};
|
|
142
2
|
//# sourceMappingURL=project.mjs.map
|