@intlayer/api 8.1.1 → 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 +6 -6
|
@@ -1,75 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
|
-
const require_fetcher = require('../fetcher.cjs');
|
|
4
|
-
let _intlayer_config_built = require("@intlayer/config/built");
|
|
5
|
-
_intlayer_config_built = require_runtime.__toESM(_intlayer_config_built);
|
|
6
|
-
|
|
7
|
-
//#region src/getIntlayerAPI/bitbucket.ts
|
|
8
|
-
const getBitbucketAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
9
|
-
const backendURL = intlayerConfig?.editor?.backendURL ?? _intlayer_config_built.default?.editor?.backendURL;
|
|
10
|
-
if (!backendURL) throw new Error("Backend URL is not defined in the Intlayer configuration.");
|
|
11
|
-
const BITBUCKET_API_ROUTE = `${backendURL}/api/bitbucket`;
|
|
12
|
-
/**
|
|
13
|
-
* Get Bitbucket OAuth authorization URL
|
|
14
|
-
* @param redirectUri - Redirect URI after OAuth authorization
|
|
15
|
-
*/
|
|
16
|
-
const getAuthUrl = async (redirectUri, otherOptions = {}) => await require_fetcher.fetcher(`${BITBUCKET_API_ROUTE}/auth-url`, authAPIOptions, otherOptions, { params: { redirectUri } });
|
|
17
|
-
/**
|
|
18
|
-
* Exchange Bitbucket authorization code for access token
|
|
19
|
-
* @param code - Bitbucket authorization code
|
|
20
|
-
*/
|
|
21
|
-
const authenticate = async (code, otherOptions = {}) => await require_fetcher.fetcher(`${BITBUCKET_API_ROUTE}/auth`, authAPIOptions, otherOptions, {
|
|
22
|
-
method: "POST",
|
|
23
|
-
body: { code }
|
|
24
|
-
});
|
|
25
|
-
/**
|
|
26
|
-
* Get user's Bitbucket repositories
|
|
27
|
-
* @param token - Optional Bitbucket access token. If not provided, backend will use session.
|
|
28
|
-
*/
|
|
29
|
-
const getRepositories = async (token, otherOptions = {}) => await require_fetcher.fetcher(`${BITBUCKET_API_ROUTE}/repos`, authAPIOptions, otherOptions, { params: token ? { token } : void 0 });
|
|
30
|
-
/**
|
|
31
|
-
* Check if intlayer.config.ts exists in a Bitbucket repository
|
|
32
|
-
* @param token - Optional Bitbucket access token. If not provided, backend will use session.
|
|
33
|
-
* @param workspace - Bitbucket workspace slug
|
|
34
|
-
* @param repoSlug - Repository slug
|
|
35
|
-
* @param branch - Branch name (default: 'main')
|
|
36
|
-
*/
|
|
37
|
-
const checkIntlayerConfig = async (token, workspace, repoSlug, branch = "main", otherOptions = {}) => await require_fetcher.fetcher(`${BITBUCKET_API_ROUTE}/check-config`, authAPIOptions, otherOptions, {
|
|
38
|
-
method: "POST",
|
|
39
|
-
body: {
|
|
40
|
-
token: token ?? void 0,
|
|
41
|
-
workspace,
|
|
42
|
-
repoSlug,
|
|
43
|
-
branch
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
/**
|
|
47
|
-
* Get intlayer.config.ts file contents from a Bitbucket repository
|
|
48
|
-
* @param token - Optional Bitbucket access token. If not provided, backend will use session.
|
|
49
|
-
* @param workspace - Bitbucket workspace slug
|
|
50
|
-
* @param repoSlug - Repository slug
|
|
51
|
-
* @param branch - Branch name (default: 'main')
|
|
52
|
-
* @param path - File path (default: 'intlayer.config.ts')
|
|
53
|
-
*/
|
|
54
|
-
const getConfigFile = async (token, workspace, repoSlug, branch = "main", path = "intlayer.config.ts", otherOptions = {}) => await require_fetcher.fetcher(`${BITBUCKET_API_ROUTE}/get-config-file`, authAPIOptions, otherOptions, {
|
|
55
|
-
method: "POST",
|
|
56
|
-
body: {
|
|
57
|
-
token: token ?? void 0,
|
|
58
|
-
workspace,
|
|
59
|
-
repoSlug,
|
|
60
|
-
branch,
|
|
61
|
-
path
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
return {
|
|
65
|
-
getAuthUrl,
|
|
66
|
-
authenticate,
|
|
67
|
-
getRepositories,
|
|
68
|
-
checkIntlayerConfig,
|
|
69
|
-
getConfigFile
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
//#endregion
|
|
74
|
-
exports.getBitbucketAPI = getBitbucketAPI;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`),t=require(`../fetcher.cjs`);let n=require(`@intlayer/config/built`);n=e.__toESM(n);const r=(e={},r)=>{let i=r?.editor?.backendURL??n.default?.editor?.backendURL;if(!i)throw Error(`Backend URL is not defined in the Intlayer configuration.`);let a=`${i}/api/bitbucket`;return{getAuthUrl:async(n,r={})=>await t.fetcher(`${a}/auth-url`,e,r,{params:{redirectUri:n}}),authenticate:async(n,r={})=>await t.fetcher(`${a}/auth`,e,r,{method:`POST`,body:{code:n}}),getRepositories:async(n,r={})=>await t.fetcher(`${a}/repos`,e,r,{params:n?{token:n}:void 0}),checkIntlayerConfig:async(n,r,i,o=`main`,s={})=>await t.fetcher(`${a}/check-config`,e,s,{method:`POST`,body:{token:n??void 0,workspace:r,repoSlug:i,branch:o}}),getConfigFile:async(n,r,i,o=`main`,s=`intlayer.config.ts`,c={})=>await t.fetcher(`${a}/get-config-file`,e,c,{method:`POST`,body:{token:n??void 0,workspace:r,repoSlug:i,branch:o,path:s}})}};exports.getBitbucketAPI=r;
|
|
75
2
|
//# sourceMappingURL=bitbucket.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bitbucket.cjs","names":["configuration","fetcher"],"sources":["../../../src/getIntlayerAPI/bitbucket.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { type FetcherOptions, fetcher } from '../fetcher';\n\nexport type BitbucketRepository = {\n uuid: string;\n name: string;\n full_name: string;\n slug: string;\n mainbranch?: {\n name: string;\n type: string;\n };\n links: {\n html: {\n href: string;\n };\n };\n workspace: {\n slug: string;\n name: string;\n uuid: string;\n };\n owner: {\n display_name: string;\n username?: string;\n uuid: string;\n };\n updated_on: string;\n is_private: boolean;\n};\n\nexport type BitbucketAuthCallbackBody = {\n code: string;\n};\n\nexport type BitbucketAuthCallbackResult = {\n data: {\n token: string;\n };\n};\n\nexport type BitbucketListReposResult = {\n data: BitbucketRepository[];\n};\n\nexport type BitbucketCheckConfigBody = {\n token?: string;\n workspace: string;\n repoSlug: string;\n branch?: string;\n};\n\nexport type BitbucketCheckConfigResult = {\n data: {\n hasConfig: boolean;\n configPaths: string[];\n };\n};\n\nexport type BitbucketGetConfigFileBody = {\n token?: string;\n workspace: string;\n repoSlug: string;\n branch?: string;\n path?: string;\n};\n\nexport type BitbucketGetConfigFileResult = {\n data: {\n content: string;\n };\n};\n\nexport type BitbucketGetAuthUrlResult = {\n data: {\n authUrl: string;\n };\n};\n\nexport const getBitbucketAPI = (\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 BITBUCKET_API_ROUTE = `${backendURL}/api/bitbucket`;\n\n /**\n * Get Bitbucket 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<BitbucketGetAuthUrlResult>(\n `${BITBUCKET_API_ROUTE}/auth-url`,\n authAPIOptions,\n otherOptions,\n {\n params: { redirectUri },\n }\n );\n\n /**\n * Exchange Bitbucket authorization code for access token\n * @param code - Bitbucket authorization code\n */\n const authenticate = async (\n code: string,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<BitbucketAuthCallbackResult>(\n `${BITBUCKET_API_ROUTE}/auth`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: { code },\n }\n );\n\n /**\n * Get user's Bitbucket repositories\n * @param token - Optional Bitbucket 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<BitbucketListReposResult>(\n `${BITBUCKET_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 Bitbucket repository\n * @param token - Optional Bitbucket access token. If not provided, backend will use session.\n * @param workspace - Bitbucket workspace slug\n * @param repoSlug - Repository slug\n * @param branch - Branch name (default: 'main')\n */\n const checkIntlayerConfig = async (\n token: string | null | undefined,\n workspace: string,\n repoSlug: string,\n branch: string = 'main',\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<BitbucketCheckConfigResult>(\n `${BITBUCKET_API_ROUTE}/check-config`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: { token: token ?? undefined, workspace, repoSlug, branch },\n }\n );\n\n /**\n * Get intlayer.config.ts file contents from a Bitbucket repository\n * @param token - Optional Bitbucket access token. If not provided, backend will use session.\n * @param workspace - Bitbucket workspace slug\n * @param repoSlug - Repository slug\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 workspace: string,\n repoSlug: string,\n branch: string = 'main',\n path: string = 'intlayer.config.ts',\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<BitbucketGetConfigFileResult>(\n `${BITBUCKET_API_ROUTE}/get-config-file`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: {\n token: token ?? undefined,\n workspace,\n repoSlug,\n branch,\n path,\n },\n }\n );\n\n return {\n getAuthUrl,\n authenticate,\n getRepositories,\n checkIntlayerConfig,\n getConfigFile,\n };\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"bitbucket.cjs","names":["configuration","fetcher"],"sources":["../../../src/getIntlayerAPI/bitbucket.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { type FetcherOptions, fetcher } from '../fetcher';\n\nexport type BitbucketRepository = {\n uuid: string;\n name: string;\n full_name: string;\n slug: string;\n mainbranch?: {\n name: string;\n type: string;\n };\n links: {\n html: {\n href: string;\n };\n };\n workspace: {\n slug: string;\n name: string;\n uuid: string;\n };\n owner: {\n display_name: string;\n username?: string;\n uuid: string;\n };\n updated_on: string;\n is_private: boolean;\n};\n\nexport type BitbucketAuthCallbackBody = {\n code: string;\n};\n\nexport type BitbucketAuthCallbackResult = {\n data: {\n token: string;\n };\n};\n\nexport type BitbucketListReposResult = {\n data: BitbucketRepository[];\n};\n\nexport type BitbucketCheckConfigBody = {\n token?: string;\n workspace: string;\n repoSlug: string;\n branch?: string;\n};\n\nexport type BitbucketCheckConfigResult = {\n data: {\n hasConfig: boolean;\n configPaths: string[];\n };\n};\n\nexport type BitbucketGetConfigFileBody = {\n token?: string;\n workspace: string;\n repoSlug: string;\n branch?: string;\n path?: string;\n};\n\nexport type BitbucketGetConfigFileResult = {\n data: {\n content: string;\n };\n};\n\nexport type BitbucketGetAuthUrlResult = {\n data: {\n authUrl: string;\n };\n};\n\nexport const getBitbucketAPI = (\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 BITBUCKET_API_ROUTE = `${backendURL}/api/bitbucket`;\n\n /**\n * Get Bitbucket 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<BitbucketGetAuthUrlResult>(\n `${BITBUCKET_API_ROUTE}/auth-url`,\n authAPIOptions,\n otherOptions,\n {\n params: { redirectUri },\n }\n );\n\n /**\n * Exchange Bitbucket authorization code for access token\n * @param code - Bitbucket authorization code\n */\n const authenticate = async (\n code: string,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<BitbucketAuthCallbackResult>(\n `${BITBUCKET_API_ROUTE}/auth`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: { code },\n }\n );\n\n /**\n * Get user's Bitbucket repositories\n * @param token - Optional Bitbucket 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<BitbucketListReposResult>(\n `${BITBUCKET_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 Bitbucket repository\n * @param token - Optional Bitbucket access token. If not provided, backend will use session.\n * @param workspace - Bitbucket workspace slug\n * @param repoSlug - Repository slug\n * @param branch - Branch name (default: 'main')\n */\n const checkIntlayerConfig = async (\n token: string | null | undefined,\n workspace: string,\n repoSlug: string,\n branch: string = 'main',\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<BitbucketCheckConfigResult>(\n `${BITBUCKET_API_ROUTE}/check-config`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: { token: token ?? undefined, workspace, repoSlug, branch },\n }\n );\n\n /**\n * Get intlayer.config.ts file contents from a Bitbucket repository\n * @param token - Optional Bitbucket access token. If not provided, backend will use session.\n * @param workspace - Bitbucket workspace slug\n * @param repoSlug - Repository slug\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 workspace: string,\n repoSlug: string,\n branch: string = 'main',\n path: string = 'intlayer.config.ts',\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<BitbucketGetConfigFileResult>(\n `${BITBUCKET_API_ROUTE}/get-config-file`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: {\n token: token ?? undefined,\n workspace,\n repoSlug,\n branch,\n path,\n },\n }\n );\n\n return {\n getAuthUrl,\n authenticate,\n getRepositories,\n checkIntlayerConfig,\n getConfigFile,\n };\n};\n"],"mappings":"2MAgFA,MAAa,GACX,EAAiC,EAAE,CACnC,IACG,CACH,IAAM,EACJ,GAAgB,QAAQ,YAAcA,EAAAA,SAAe,QAAQ,WAE/D,GAAI,CAAC,EACH,MAAU,MACR,4DACD,CAGH,IAAM,EAAsB,GAAG,EAAW,gBA8G1C,MAAO,CACL,WAzGiB,MACjB,EACA,EAA+B,EAAE,GAEjC,MAAMC,EAAAA,QACJ,GAAG,EAAoB,WACvB,EACA,EACA,CACE,OAAQ,CAAE,cAAa,CACxB,CACF,CA+FD,aAzFmB,MACnB,EACA,EAA+B,EAAE,GAEjC,MAAMA,EAAAA,QACJ,GAAG,EAAoB,OACvB,EACA,EACA,CACE,OAAQ,OACR,KAAM,CAAE,OAAM,CACf,CACF,CA8ED,gBAxEsB,MACtB,EACA,EAA+B,EAAE,GAEjC,MAAMA,EAAAA,QACJ,GAAG,EAAoB,QACvB,EACA,EACA,CACE,OAAQ,EAAQ,CAAE,QAAO,CAAG,IAAA,GAC7B,CACF,CA8DD,oBArD0B,MAC1B,EACA,EACA,EACA,EAAiB,OACjB,EAA+B,EAAE,GAEjC,MAAMA,EAAAA,QACJ,GAAG,EAAoB,eACvB,EACA,EACA,CACE,OAAQ,OACR,KAAM,CAAE,MAAO,GAAS,IAAA,GAAW,YAAW,WAAU,SAAQ,CACjE,CACF,CAuCD,cA7BoB,MACpB,EACA,EACA,EACA,EAAiB,OACjB,EAAe,qBACf,EAA+B,EAAE,GAEjC,MAAMA,EAAAA,QACJ,GAAG,EAAoB,kBACvB,EACA,EACA,CACE,OAAQ,OACR,KAAM,CACJ,MAAO,GAAS,IAAA,GAChB,YACA,WACA,SACA,OACD,CACF,CACF,CAQF"}
|
|
@@ -1,73 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
|
-
const require_fetcher = require('../fetcher.cjs');
|
|
4
|
-
let _intlayer_config_built = require("@intlayer/config/built");
|
|
5
|
-
_intlayer_config_built = require_runtime.__toESM(_intlayer_config_built);
|
|
6
|
-
|
|
7
|
-
//#region src/getIntlayerAPI/dictionary.ts
|
|
8
|
-
const getDictionaryAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
9
|
-
const backendURL = intlayerConfig?.editor?.backendURL ?? _intlayer_config_built.default?.editor?.backendURL;
|
|
10
|
-
if (!backendURL) throw new Error("Backend URL is not defined in the Intlayer configuration.");
|
|
11
|
-
const PROJECT_API_ROUTE = `${backendURL}/api/dictionary`;
|
|
12
|
-
/**
|
|
13
|
-
* Retrieves a list of dictionaries based on filters and pagination.
|
|
14
|
-
* @param filters - Filters and pagination options.
|
|
15
|
-
*/
|
|
16
|
-
const getDictionaries = async (filters, otherOptions = {}) => await require_fetcher.fetcher(PROJECT_API_ROUTE, authAPIOptions, otherOptions, {
|
|
17
|
-
cache: "no-store",
|
|
18
|
-
params: filters
|
|
19
|
-
});
|
|
20
|
-
/**
|
|
21
|
-
* Retrieves a list of dictionary keys related to the project.
|
|
22
|
-
*/
|
|
23
|
-
const getDictionariesKeys = async (otherOptions = {}) => await require_fetcher.fetcher(`${PROJECT_API_ROUTE}/keys`, authAPIOptions, otherOptions, { cache: "no-store" });
|
|
24
|
-
/**
|
|
25
|
-
* Retrieves a list of dictionary keys related to the project.
|
|
26
|
-
*/
|
|
27
|
-
const getDictionariesUpdateTimestamp = async (otherOptions = {}) => await require_fetcher.fetcher(`${PROJECT_API_ROUTE}/update`, authAPIOptions, otherOptions, { cache: "no-store" });
|
|
28
|
-
/**
|
|
29
|
-
* Retrieves a dictionary by its key and version.
|
|
30
|
-
* @param dictionaryKey - Dictionary key.
|
|
31
|
-
* @param version - Dictionary version of content.
|
|
32
|
-
*/
|
|
33
|
-
const getDictionary = async (dictionaryKey, version, otherOptions = {}) => await require_fetcher.fetcher(`${PROJECT_API_ROUTE}/${dictionaryKey}`, authAPIOptions, otherOptions, { params: version ? { version: version.toString() } : void 0 });
|
|
34
|
-
/**
|
|
35
|
-
* Adds a new dictionary to the database.
|
|
36
|
-
* @param dictionary - Dictionary data.
|
|
37
|
-
*/
|
|
38
|
-
const addDictionary = async (body, otherOptions = {}) => await require_fetcher.fetcher(`${PROJECT_API_ROUTE}`, authAPIOptions, otherOptions, {
|
|
39
|
-
method: "POST",
|
|
40
|
-
body
|
|
41
|
-
});
|
|
42
|
-
const pushDictionaries = async (dictionaries, otherOptions = {}) => await require_fetcher.fetcher(`${PROJECT_API_ROUTE}`, authAPIOptions, otherOptions, {
|
|
43
|
-
method: "PATCH",
|
|
44
|
-
body: { dictionaries }
|
|
45
|
-
});
|
|
46
|
-
/**
|
|
47
|
-
* Updates an existing dictionary in the database.
|
|
48
|
-
* @param dictionary - Updated dictionary data.
|
|
49
|
-
*/
|
|
50
|
-
const updateDictionary = async (dictionary, otherOptions = {}) => await require_fetcher.fetcher(`${PROJECT_API_ROUTE}/${dictionary.id}`, authAPIOptions, otherOptions, {
|
|
51
|
-
method: "PUT",
|
|
52
|
-
body: dictionary
|
|
53
|
-
});
|
|
54
|
-
/**
|
|
55
|
-
* Deletes a dictionary from the database by its ID.
|
|
56
|
-
* @param id - Dictionary ID.
|
|
57
|
-
*/
|
|
58
|
-
const deleteDictionary = async (id, otherOptions = {}) => await require_fetcher.fetcher(`${PROJECT_API_ROUTE}/${id}`, authAPIOptions, otherOptions, { method: "DELETE" });
|
|
59
|
-
return {
|
|
60
|
-
getDictionaries,
|
|
61
|
-
getDictionariesKeys,
|
|
62
|
-
getDictionariesUpdateTimestamp,
|
|
63
|
-
getDictionary,
|
|
64
|
-
pushDictionaries,
|
|
65
|
-
addDictionary,
|
|
66
|
-
updateDictionary,
|
|
67
|
-
deleteDictionary
|
|
68
|
-
};
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
//#endregion
|
|
72
|
-
exports.getDictionaryAPI = getDictionaryAPI;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`),t=require(`../fetcher.cjs`);let n=require(`@intlayer/config/built`);n=e.__toESM(n);const r=(e={},r)=>{let i=r?.editor?.backendURL??n.default?.editor?.backendURL;if(!i)throw Error(`Backend URL is not defined in the Intlayer configuration.`);let a=`${i}/api/dictionary`;return{getDictionaries:async(n,r={})=>await t.fetcher(a,e,r,{cache:`no-store`,params:n}),getDictionariesKeys:async(n={})=>await t.fetcher(`${a}/keys`,e,n,{cache:`no-store`}),getDictionariesUpdateTimestamp:async(n={})=>await t.fetcher(`${a}/update`,e,n,{cache:`no-store`}),getDictionary:async(n,r,i={})=>await t.fetcher(`${a}/${n}`,e,i,{params:r?{version:r.toString()}:void 0}),pushDictionaries:async(n,r={})=>await t.fetcher(`${a}`,e,r,{method:`PATCH`,body:{dictionaries:n}}),addDictionary:async(n,r={})=>await t.fetcher(`${a}`,e,r,{method:`POST`,body:n}),updateDictionary:async(n,r={})=>await t.fetcher(`${a}/${n.id}`,e,r,{method:`PUT`,body:n}),deleteDictionary:async(n,r={})=>await t.fetcher(`${a}/${n}`,e,r,{method:`DELETE`})}};exports.getDictionaryAPI=r;
|
|
73
2
|
//# sourceMappingURL=dictionary.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dictionary.cjs","names":["configuration","fetcher"],"sources":["../../../src/getIntlayerAPI/dictionary.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { type FetcherOptions, fetcher } from '../fetcher';\nimport type {\n AddDictionaryBody,\n AddDictionaryResult,\n DeleteDictionaryParam,\n DeleteDictionaryResult,\n GetDictionariesKeysResult,\n GetDictionariesParams,\n GetDictionariesResult,\n GetDictionariesUpdateTimestampResult,\n GetDictionaryParams,\n GetDictionaryQuery,\n GetDictionaryResult,\n PushDictionariesBody,\n PushDictionariesResult,\n UpdateDictionaryBody,\n UpdateDictionaryResult,\n} from '../types';\n\nexport const getDictionaryAPI = (\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 PROJECT_API_ROUTE = `${backendURL}/api/dictionary`;\n\n /**\n * Retrieves a list of dictionaries based on filters and pagination.\n * @param filters - Filters and pagination options.\n */\n const getDictionaries = async (\n filters?: GetDictionariesParams,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetDictionariesResult>(\n PROJECT_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 a list of dictionary keys related to the project.\n */\n const getDictionariesKeys = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetDictionariesKeysResult>(\n `${PROJECT_API_ROUTE}/keys`,\n authAPIOptions,\n otherOptions,\n {\n cache: 'no-store',\n }\n );\n\n /**\n * Retrieves a list of dictionary keys related to the project.\n */\n const getDictionariesUpdateTimestamp = async (\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetDictionariesUpdateTimestampResult>(\n `${PROJECT_API_ROUTE}/update`,\n authAPIOptions,\n otherOptions,\n {\n cache: 'no-store',\n }\n );\n\n /**\n * Retrieves a dictionary by its key and version.\n * @param dictionaryKey - Dictionary key.\n * @param version - Dictionary version of content.\n */\n const getDictionary = async (\n dictionaryKey: GetDictionaryParams['dictionaryKey'],\n version?: GetDictionaryQuery['version'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetDictionaryResult>(\n `${PROJECT_API_ROUTE}/${dictionaryKey}`,\n authAPIOptions,\n otherOptions,\n {\n params: version ? { version: version.toString() } : undefined,\n }\n );\n\n /**\n * Adds a new dictionary to the database.\n * @param dictionary - Dictionary data.\n */\n const addDictionary = async (\n body: AddDictionaryBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<AddDictionaryResult>(\n `${PROJECT_API_ROUTE}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body,\n }\n );\n\n const pushDictionaries = async (\n dictionaries: PushDictionariesBody['dictionaries'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<PushDictionariesResult>(\n `${PROJECT_API_ROUTE}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PATCH',\n body: { dictionaries },\n }\n );\n\n /**\n * Updates an existing dictionary in the database.\n * @param dictionary - Updated dictionary data.\n */\n const updateDictionary = async (\n dictionary: UpdateDictionaryBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<UpdateDictionaryResult>(\n `${PROJECT_API_ROUTE}/${dictionary.id}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body: dictionary,\n }\n );\n\n /**\n * Deletes a dictionary from the database by its ID.\n * @param id - Dictionary ID.\n */\n const deleteDictionary = async (\n id: DeleteDictionaryParam['dictionaryId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<DeleteDictionaryResult>(\n `${PROJECT_API_ROUTE}/${id}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'DELETE',\n }\n );\n\n return {\n getDictionaries,\n getDictionariesKeys,\n getDictionariesUpdateTimestamp,\n getDictionary,\n pushDictionaries,\n addDictionary,\n updateDictionary,\n deleteDictionary,\n };\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"dictionary.cjs","names":["configuration","fetcher"],"sources":["../../../src/getIntlayerAPI/dictionary.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { type FetcherOptions, fetcher } from '../fetcher';\nimport type {\n AddDictionaryBody,\n AddDictionaryResult,\n DeleteDictionaryParam,\n DeleteDictionaryResult,\n GetDictionariesKeysResult,\n GetDictionariesParams,\n GetDictionariesResult,\n GetDictionariesUpdateTimestampResult,\n GetDictionaryParams,\n GetDictionaryQuery,\n GetDictionaryResult,\n PushDictionariesBody,\n PushDictionariesResult,\n UpdateDictionaryBody,\n UpdateDictionaryResult,\n} from '../types';\n\nexport const getDictionaryAPI = (\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 PROJECT_API_ROUTE = `${backendURL}/api/dictionary`;\n\n /**\n * Retrieves a list of dictionaries based on filters and pagination.\n * @param filters - Filters and pagination options.\n */\n const getDictionaries = async (\n filters?: GetDictionariesParams,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetDictionariesResult>(\n PROJECT_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 a list of dictionary keys related to the project.\n */\n const getDictionariesKeys = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetDictionariesKeysResult>(\n `${PROJECT_API_ROUTE}/keys`,\n authAPIOptions,\n otherOptions,\n {\n cache: 'no-store',\n }\n );\n\n /**\n * Retrieves a list of dictionary keys related to the project.\n */\n const getDictionariesUpdateTimestamp = async (\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetDictionariesUpdateTimestampResult>(\n `${PROJECT_API_ROUTE}/update`,\n authAPIOptions,\n otherOptions,\n {\n cache: 'no-store',\n }\n );\n\n /**\n * Retrieves a dictionary by its key and version.\n * @param dictionaryKey - Dictionary key.\n * @param version - Dictionary version of content.\n */\n const getDictionary = async (\n dictionaryKey: GetDictionaryParams['dictionaryKey'],\n version?: GetDictionaryQuery['version'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetDictionaryResult>(\n `${PROJECT_API_ROUTE}/${dictionaryKey}`,\n authAPIOptions,\n otherOptions,\n {\n params: version ? { version: version.toString() } : undefined,\n }\n );\n\n /**\n * Adds a new dictionary to the database.\n * @param dictionary - Dictionary data.\n */\n const addDictionary = async (\n body: AddDictionaryBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<AddDictionaryResult>(\n `${PROJECT_API_ROUTE}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body,\n }\n );\n\n const pushDictionaries = async (\n dictionaries: PushDictionariesBody['dictionaries'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<PushDictionariesResult>(\n `${PROJECT_API_ROUTE}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PATCH',\n body: { dictionaries },\n }\n );\n\n /**\n * Updates an existing dictionary in the database.\n * @param dictionary - Updated dictionary data.\n */\n const updateDictionary = async (\n dictionary: UpdateDictionaryBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<UpdateDictionaryResult>(\n `${PROJECT_API_ROUTE}/${dictionary.id}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body: dictionary,\n }\n );\n\n /**\n * Deletes a dictionary from the database by its ID.\n * @param id - Dictionary ID.\n */\n const deleteDictionary = async (\n id: DeleteDictionaryParam['dictionaryId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<DeleteDictionaryResult>(\n `${PROJECT_API_ROUTE}/${id}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'DELETE',\n }\n );\n\n return {\n getDictionaries,\n getDictionariesKeys,\n getDictionariesUpdateTimestamp,\n getDictionary,\n pushDictionaries,\n addDictionary,\n updateDictionary,\n deleteDictionary,\n };\n};\n"],"mappings":"2MAqBA,MAAa,GACX,EAAiC,EAAE,CACnC,IACG,CACH,IAAM,EACJ,GAAgB,QAAQ,YAAcA,EAAAA,SAAe,QAAQ,WAE/D,GAAI,CAAC,EACH,MAAU,MACR,4DACD,CAGH,IAAM,EAAoB,GAAG,EAAW,iBAuIxC,MAAO,CACL,gBAlIsB,MACtB,EACA,EAA+B,EAAE,GAEjC,MAAMC,EAAAA,QACJ,EACA,EACA,EACA,CACE,MAAO,WAEP,OAAQ,EACT,CACF,CAsHD,oBAjH0B,MAAO,EAA+B,EAAE,GAClE,MAAMA,EAAAA,QACJ,GAAG,EAAkB,OACrB,EACA,EACA,CACE,MAAO,WACR,CACF,CA0GD,+BArGqC,MACrC,EAA+B,EAAE,GAEjC,MAAMA,EAAAA,QACJ,GAAG,EAAkB,SACrB,EACA,EACA,CACE,MAAO,WACR,CACF,CA4FD,cArFoB,MACpB,EACA,EACA,EAA+B,EAAE,GAEjC,MAAMA,EAAAA,QACJ,GAAG,EAAkB,GAAG,IACxB,EACA,EACA,CACE,OAAQ,EAAU,CAAE,QAAS,EAAQ,UAAU,CAAE,CAAG,IAAA,GACrD,CACF,CA0ED,iBAtDuB,MACvB,EACA,EAA+B,EAAE,GAEjC,MAAMA,EAAAA,QACJ,GAAG,IACH,EACA,EACA,CACE,OAAQ,QACR,KAAM,CAAE,eAAc,CACvB,CACF,CA2CD,cArEoB,MACpB,EACA,EAA+B,EAAE,GAEjC,MAAMA,EAAAA,QACJ,GAAG,IACH,EACA,EACA,CACE,OAAQ,OACR,OACD,CACF,CA0DD,iBAtCuB,MACvB,EACA,EAA+B,EAAE,GAEjC,MAAMA,EAAAA,QACJ,GAAG,EAAkB,GAAG,EAAW,KACnC,EACA,EACA,CACE,OAAQ,MACR,KAAM,EACP,CACF,CA2BD,iBArBuB,MACvB,EACA,EAA+B,EAAE,GAEjC,MAAMA,EAAAA,QACJ,GAAG,EAAkB,GAAG,IACxB,EACA,EACA,CACE,OAAQ,SACT,CACF,CAWF"}
|
|
@@ -1,41 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
|
-
const require_fetcher = require('../fetcher.cjs');
|
|
4
|
-
let _intlayer_config_built = require("@intlayer/config/built");
|
|
5
|
-
_intlayer_config_built = require_runtime.__toESM(_intlayer_config_built);
|
|
6
|
-
|
|
7
|
-
//#region src/getIntlayerAPI/editor.ts
|
|
8
|
-
const getEditorAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
9
|
-
const editorURL = intlayerConfig?.editor?.editorURL ?? _intlayer_config_built.default?.editor?.editorURL;
|
|
10
|
-
if (!editorURL) throw new Error("Editor URL is not defined in the Intlayer configuration.");
|
|
11
|
-
const EDITOR_API_ROUTE = `${editorURL}/api`;
|
|
12
|
-
/**
|
|
13
|
-
* Get the Intlayer configuration
|
|
14
|
-
*/
|
|
15
|
-
const getConfiguration = async (otherOptions = {}) => {
|
|
16
|
-
return (await require_fetcher.fetcher(`${EDITOR_API_ROUTE}/config`, authAPIOptions, otherOptions)).data;
|
|
17
|
-
};
|
|
18
|
-
/**
|
|
19
|
-
* Get the Intlayer configuration
|
|
20
|
-
*/
|
|
21
|
-
const getDictionaries = async (otherOptions = {}) => {
|
|
22
|
-
return (await require_fetcher.fetcher(`${EDITOR_API_ROUTE}/dictionary`, authAPIOptions, otherOptions)).data;
|
|
23
|
-
};
|
|
24
|
-
/**
|
|
25
|
-
* Adds a new dictionary to the database.
|
|
26
|
-
* @param dictionary - Dictionary data.
|
|
27
|
-
*/
|
|
28
|
-
const writeDictionary = async (body, otherOptions = {}) => await require_fetcher.fetcher(`${EDITOR_API_ROUTE}/dictionary`, authAPIOptions, otherOptions, {
|
|
29
|
-
method: "POST",
|
|
30
|
-
body
|
|
31
|
-
});
|
|
32
|
-
return {
|
|
33
|
-
getDictionaries,
|
|
34
|
-
getConfiguration,
|
|
35
|
-
writeDictionary
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
//#endregion
|
|
40
|
-
exports.getEditorAPI = getEditorAPI;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`),t=require(`../fetcher.cjs`);let n=require(`@intlayer/config/built`);n=e.__toESM(n);const r=(e={},r)=>{let i=r?.editor?.editorURL??n.default?.editor?.editorURL;if(!i)throw Error(`Editor URL is not defined in the Intlayer configuration.`);let a=`${i}/api`;return{getDictionaries:async(n={})=>(await t.fetcher(`${a}/dictionary`,e,n)).data,getConfiguration:async(n={})=>(await t.fetcher(`${a}/config`,e,n)).data,writeDictionary:async(n,r={})=>await t.fetcher(`${a}/dictionary`,e,r,{method:`POST`,body:n})}};exports.getEditorAPI=r;
|
|
41
2
|
//# sourceMappingURL=editor.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor.cjs","names":["configuration","fetcher"],"sources":["../../../src/getIntlayerAPI/editor.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { type FetcherOptions, fetcher } from '../fetcher';\nimport type {\n GetConfigurationResult,\n GetEditorDictionariesResult,\n WriteContentDeclarationBody,\n WriteContentDeclarationResult,\n} from '../types';\n\nexport const getEditorAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const editorURL =\n intlayerConfig?.editor?.editorURL ?? configuration?.editor?.editorURL;\n\n if (!editorURL) {\n throw new Error('Editor URL is not defined in the Intlayer configuration.');\n }\n\n const EDITOR_API_ROUTE = `${editorURL}/api`;\n\n /**\n * Get the Intlayer configuration\n */\n const getConfiguration = async (\n otherOptions: FetcherOptions = {}\n ): Promise<GetConfigurationResult> => {\n const response = await fetcher<GetConfigurationResult>(\n `${EDITOR_API_ROUTE}/config`,\n authAPIOptions,\n otherOptions\n );\n\n return response.data as unknown as GetConfigurationResult;\n };\n\n /**\n * Get the Intlayer configuration\n */\n const getDictionaries = async (\n otherOptions: FetcherOptions = {}\n ): Promise<GetEditorDictionariesResult> => {\n const response = await fetcher<GetEditorDictionariesResult>(\n `${EDITOR_API_ROUTE}/dictionary`,\n authAPIOptions,\n otherOptions\n );\n\n return response.data as unknown as GetEditorDictionariesResult;\n };\n\n /**\n * Adds a new dictionary to the database.\n * @param dictionary - Dictionary data.\n */\n const writeDictionary = async (\n body: WriteContentDeclarationBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<WriteContentDeclarationResult>(\n `${EDITOR_API_ROUTE}/dictionary`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body,\n }\n );\n\n return {\n getDictionaries,\n getConfiguration,\n writeDictionary,\n };\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"editor.cjs","names":["configuration","fetcher"],"sources":["../../../src/getIntlayerAPI/editor.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { type FetcherOptions, fetcher } from '../fetcher';\nimport type {\n GetConfigurationResult,\n GetEditorDictionariesResult,\n WriteContentDeclarationBody,\n WriteContentDeclarationResult,\n} from '../types';\n\nexport const getEditorAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const editorURL =\n intlayerConfig?.editor?.editorURL ?? configuration?.editor?.editorURL;\n\n if (!editorURL) {\n throw new Error('Editor URL is not defined in the Intlayer configuration.');\n }\n\n const EDITOR_API_ROUTE = `${editorURL}/api`;\n\n /**\n * Get the Intlayer configuration\n */\n const getConfiguration = async (\n otherOptions: FetcherOptions = {}\n ): Promise<GetConfigurationResult> => {\n const response = await fetcher<GetConfigurationResult>(\n `${EDITOR_API_ROUTE}/config`,\n authAPIOptions,\n otherOptions\n );\n\n return response.data as unknown as GetConfigurationResult;\n };\n\n /**\n * Get the Intlayer configuration\n */\n const getDictionaries = async (\n otherOptions: FetcherOptions = {}\n ): Promise<GetEditorDictionariesResult> => {\n const response = await fetcher<GetEditorDictionariesResult>(\n `${EDITOR_API_ROUTE}/dictionary`,\n authAPIOptions,\n otherOptions\n );\n\n return response.data as unknown as GetEditorDictionariesResult;\n };\n\n /**\n * Adds a new dictionary to the database.\n * @param dictionary - Dictionary data.\n */\n const writeDictionary = async (\n body: WriteContentDeclarationBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<WriteContentDeclarationResult>(\n `${EDITOR_API_ROUTE}/dictionary`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body,\n }\n );\n\n return {\n getDictionaries,\n getConfiguration,\n writeDictionary,\n };\n};\n"],"mappings":"2MAUA,MAAa,GACX,EAAiC,EAAE,CACnC,IACG,CACH,IAAM,EACJ,GAAgB,QAAQ,WAAaA,EAAAA,SAAe,QAAQ,UAE9D,GAAI,CAAC,EACH,MAAU,MAAM,2DAA2D,CAG7E,IAAM,EAAmB,GAAG,EAAU,MAkDtC,MAAO,CACL,gBA/BsB,MACtB,EAA+B,EAAE,IAEhB,MAAMC,EAAAA,QACrB,GAAG,EAAiB,aACpB,EACA,EACD,EAEe,KAuBhB,iBA/CuB,MACvB,EAA+B,EAAE,IAEhB,MAAMA,EAAAA,QACrB,GAAG,EAAiB,SACpB,EACA,EACD,EAEe,KAuChB,gBAjBsB,MACtB,EACA,EAA+B,EAAE,GAEjC,MAAMA,EAAAA,QACJ,GAAG,EAAiB,aACpB,EACA,EACA,CACE,OAAQ,OACR,OACD,CACF,CAMF"}
|
|
@@ -1,75 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
|
-
const require_fetcher = require('../fetcher.cjs');
|
|
4
|
-
let _intlayer_config_built = require("@intlayer/config/built");
|
|
5
|
-
_intlayer_config_built = require_runtime.__toESM(_intlayer_config_built);
|
|
6
|
-
|
|
7
|
-
//#region src/getIntlayerAPI/github.ts
|
|
8
|
-
const getGithubAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
9
|
-
const backendURL = intlayerConfig?.editor?.backendURL ?? _intlayer_config_built.default?.editor?.backendURL;
|
|
10
|
-
if (!backendURL) throw new Error("Backend URL is not defined in the Intlayer configuration.");
|
|
11
|
-
const GITHUB_API_ROUTE = `${backendURL}/api/github`;
|
|
12
|
-
/**
|
|
13
|
-
* Get GitHub OAuth authorization URL
|
|
14
|
-
* @param redirectUri - Redirect URI after OAuth authorization
|
|
15
|
-
*/
|
|
16
|
-
const getAuthUrl = async (redirectUri, otherOptions = {}) => await require_fetcher.fetcher(`${GITHUB_API_ROUTE}/auth-url`, authAPIOptions, otherOptions, { params: { redirectUri } });
|
|
17
|
-
/**
|
|
18
|
-
* Exchange GitHub authorization code for access token
|
|
19
|
-
* @param code - GitHub authorization code
|
|
20
|
-
*/
|
|
21
|
-
const authenticate = async (code, otherOptions = {}) => await require_fetcher.fetcher(`${GITHUB_API_ROUTE}/auth`, authAPIOptions, otherOptions, {
|
|
22
|
-
method: "POST",
|
|
23
|
-
body: { code }
|
|
24
|
-
});
|
|
25
|
-
/**
|
|
26
|
-
* Get user's GitHub repositories
|
|
27
|
-
* @param token - Optional GitHub access token. If not provided, backend will use session.
|
|
28
|
-
*/
|
|
29
|
-
const getRepositories = async (token, otherOptions = {}) => await require_fetcher.fetcher(`${GITHUB_API_ROUTE}/repos`, authAPIOptions, otherOptions, { params: token ? { token } : void 0 });
|
|
30
|
-
/**
|
|
31
|
-
* Check if intlayer.config.ts exists in a repository
|
|
32
|
-
* @param token - Optional GitHub access token. If not provided, backend will use session.
|
|
33
|
-
* @param owner - Repository owner
|
|
34
|
-
* @param repository - Repository name
|
|
35
|
-
* @param branch - Branch name (default: 'main')
|
|
36
|
-
*/
|
|
37
|
-
const checkIntlayerConfig = async (token, owner, repository, branch = "main", otherOptions = {}) => await require_fetcher.fetcher(`${GITHUB_API_ROUTE}/check-config`, authAPIOptions, otherOptions, {
|
|
38
|
-
method: "POST",
|
|
39
|
-
body: {
|
|
40
|
-
token: token ?? void 0,
|
|
41
|
-
owner,
|
|
42
|
-
repository,
|
|
43
|
-
branch
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
/**
|
|
47
|
-
* Get intlayer.config.ts file contents from a repository
|
|
48
|
-
* @param token - Optional GitHub access token. If not provided, backend will use session.
|
|
49
|
-
* @param owner - Repository owner
|
|
50
|
-
* @param repository - Repository name
|
|
51
|
-
* @param branch - Branch name (default: 'main')
|
|
52
|
-
* @param path - File path (default: 'intlayer.config.ts')
|
|
53
|
-
*/
|
|
54
|
-
const getConfigFile = async (token, owner, repository, branch = "main", path = "intlayer.config.ts", otherOptions = {}) => await require_fetcher.fetcher(`${GITHUB_API_ROUTE}/get-config-file`, authAPIOptions, otherOptions, {
|
|
55
|
-
method: "POST",
|
|
56
|
-
body: {
|
|
57
|
-
token: token ?? void 0,
|
|
58
|
-
owner,
|
|
59
|
-
repository,
|
|
60
|
-
branch,
|
|
61
|
-
path
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
return {
|
|
65
|
-
getAuthUrl,
|
|
66
|
-
authenticate,
|
|
67
|
-
getRepositories,
|
|
68
|
-
checkIntlayerConfig,
|
|
69
|
-
getConfigFile
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
//#endregion
|
|
74
|
-
exports.getGithubAPI = getGithubAPI;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`),t=require(`../fetcher.cjs`);let n=require(`@intlayer/config/built`);n=e.__toESM(n);const r=(e={},r)=>{let i=r?.editor?.backendURL??n.default?.editor?.backendURL;if(!i)throw Error(`Backend URL is not defined in the Intlayer configuration.`);let a=`${i}/api/github`;return{getAuthUrl:async(n,r={})=>await t.fetcher(`${a}/auth-url`,e,r,{params:{redirectUri:n}}),authenticate:async(n,r={})=>await t.fetcher(`${a}/auth`,e,r,{method:`POST`,body:{code:n}}),getRepositories:async(n,r={})=>await t.fetcher(`${a}/repos`,e,r,{params:n?{token:n}:void 0}),checkIntlayerConfig:async(n,r,i,o=`main`,s={})=>await t.fetcher(`${a}/check-config`,e,s,{method:`POST`,body:{token:n??void 0,owner:r,repository:i,branch:o}}),getConfigFile:async(n,r,i,o=`main`,s=`intlayer.config.ts`,c={})=>await t.fetcher(`${a}/get-config-file`,e,c,{method:`POST`,body:{token:n??void 0,owner:r,repository:i,branch:o,path:s}})}};exports.getGithubAPI=r;
|
|
75
2
|
//# sourceMappingURL=github.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github.cjs","names":["configuration","fetcher"],"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.cjs","names":["configuration","fetcher"],"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":"2MAgEA,MAAa,GACX,EAAiC,EAAE,CACnC,IACG,CACH,IAAM,EACJ,GAAgB,QAAQ,YAAcA,EAAAA,SAAe,QAAQ,WAE/D,GAAI,CAAC,EACH,MAAU,MACR,4DACD,CAGH,IAAM,EAAmB,GAAG,EAAW,aAwGvC,MAAO,CACL,WAnGiB,MACjB,EACA,EAA+B,EAAE,GAEjC,MAAMC,EAAAA,QACJ,GAAG,EAAiB,WACpB,EACA,EACA,CACE,OAAQ,CAAE,cAAa,CACxB,CACF,CAyFD,aAnFmB,MACnB,EACA,EAA+B,EAAE,GAEjC,MAAMA,EAAAA,QACJ,GAAG,EAAiB,OACpB,EACA,EACA,CACE,OAAQ,OACR,KAAM,CAAE,OAAM,CACf,CACF,CAwED,gBAlEsB,MACtB,EACA,EAA+B,EAAE,GAEjC,MAAMA,EAAAA,QACJ,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,MAAMA,EAAAA,QACJ,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,MAAMA,EAAAA,QACJ,GAAG,EAAiB,kBACpB,EACA,EACA,CACE,OAAQ,OACR,KAAM,CAAE,MAAO,GAAS,IAAA,GAAW,QAAO,aAAY,SAAQ,OAAM,CACrE,CACF,CAQF"}
|
|
@@ -1,89 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
|
-
const require_fetcher = require('../fetcher.cjs');
|
|
4
|
-
let _intlayer_config_built = require("@intlayer/config/built");
|
|
5
|
-
_intlayer_config_built = require_runtime.__toESM(_intlayer_config_built);
|
|
6
|
-
|
|
7
|
-
//#region src/getIntlayerAPI/gitlab.ts
|
|
8
|
-
const getGitlabAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
9
|
-
const backendURL = intlayerConfig?.editor?.backendURL ?? _intlayer_config_built.default?.editor?.backendURL;
|
|
10
|
-
if (!backendURL) throw new Error("Backend URL is not defined in the Intlayer configuration.");
|
|
11
|
-
const GITLAB_API_ROUTE = `${backendURL}/api/gitlab`;
|
|
12
|
-
/**
|
|
13
|
-
* Get GitLab OAuth authorization URL
|
|
14
|
-
* @param redirectUri - Redirect URI after OAuth authorization
|
|
15
|
-
* @param instanceUrl - Custom GitLab instance URL (optional, for self-hosted)
|
|
16
|
-
*/
|
|
17
|
-
const getAuthUrl = async (redirectUri, instanceUrl, otherOptions = {}) => await require_fetcher.fetcher(`${GITLAB_API_ROUTE}/auth-url`, authAPIOptions, otherOptions, { params: {
|
|
18
|
-
redirectUri,
|
|
19
|
-
...instanceUrl && { instanceUrl }
|
|
20
|
-
} });
|
|
21
|
-
/**
|
|
22
|
-
* Exchange GitLab authorization code for access token
|
|
23
|
-
* @param code - GitLab authorization code
|
|
24
|
-
* @param redirectUri - Redirect URI used in the authorization request
|
|
25
|
-
* @param instanceUrl - Custom GitLab instance URL (optional)
|
|
26
|
-
*/
|
|
27
|
-
const authenticate = async (code, redirectUri, instanceUrl, otherOptions = {}) => await require_fetcher.fetcher(`${GITLAB_API_ROUTE}/auth`, authAPIOptions, otherOptions, {
|
|
28
|
-
method: "POST",
|
|
29
|
-
body: {
|
|
30
|
-
code,
|
|
31
|
-
redirectUri,
|
|
32
|
-
instanceUrl
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
/**
|
|
36
|
-
* Get user's GitLab projects
|
|
37
|
-
* @param token - Optional GitLab access token. If not provided, backend will use session.
|
|
38
|
-
* @param instanceUrl - Custom GitLab instance URL (optional)
|
|
39
|
-
*/
|
|
40
|
-
const getProjects = async (token, instanceUrl, otherOptions = {}) => await require_fetcher.fetcher(`${GITLAB_API_ROUTE}/projects`, authAPIOptions, otherOptions, { params: {
|
|
41
|
-
...token && { token },
|
|
42
|
-
...instanceUrl && { instanceUrl }
|
|
43
|
-
} });
|
|
44
|
-
/**
|
|
45
|
-
* Check if intlayer.config.ts exists in a GitLab repository
|
|
46
|
-
* @param token - Optional GitLab access token. If not provided, backend will use session.
|
|
47
|
-
* @param projectId - GitLab project ID
|
|
48
|
-
* @param branch - Branch name (default: 'main')
|
|
49
|
-
* @param instanceUrl - Custom GitLab instance URL (optional)
|
|
50
|
-
*/
|
|
51
|
-
const checkIntlayerConfig = async (token, projectId, branch = "main", instanceUrl, otherOptions = {}) => await require_fetcher.fetcher(`${GITLAB_API_ROUTE}/check-config`, authAPIOptions, otherOptions, {
|
|
52
|
-
method: "POST",
|
|
53
|
-
body: {
|
|
54
|
-
token: token ?? void 0,
|
|
55
|
-
projectId,
|
|
56
|
-
branch,
|
|
57
|
-
...instanceUrl && { instanceUrl }
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
/**
|
|
61
|
-
* Get intlayer.config.ts file contents from a GitLab repository
|
|
62
|
-
* @param token - Optional GitLab access token. If not provided, backend will use session.
|
|
63
|
-
* @param projectId - GitLab project ID
|
|
64
|
-
* @param branch - Branch name (default: 'main')
|
|
65
|
-
* @param path - File path (default: 'intlayer.config.ts')
|
|
66
|
-
* @param instanceUrl - Custom GitLab instance URL (optional)
|
|
67
|
-
*/
|
|
68
|
-
const getConfigFile = async (token, projectId, branch = "main", path = "intlayer.config.ts", instanceUrl, otherOptions = {}) => await require_fetcher.fetcher(`${GITLAB_API_ROUTE}/get-config-file`, authAPIOptions, otherOptions, {
|
|
69
|
-
method: "POST",
|
|
70
|
-
body: {
|
|
71
|
-
token: token ?? void 0,
|
|
72
|
-
projectId,
|
|
73
|
-
branch,
|
|
74
|
-
path,
|
|
75
|
-
...instanceUrl && { instanceUrl }
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
return {
|
|
79
|
-
getAuthUrl,
|
|
80
|
-
authenticate,
|
|
81
|
-
getProjects,
|
|
82
|
-
checkIntlayerConfig,
|
|
83
|
-
getConfigFile
|
|
84
|
-
};
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
//#endregion
|
|
88
|
-
exports.getGitlabAPI = getGitlabAPI;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`),t=require(`../fetcher.cjs`);let n=require(`@intlayer/config/built`);n=e.__toESM(n);const r=(e={},r)=>{let i=r?.editor?.backendURL??n.default?.editor?.backendURL;if(!i)throw Error(`Backend URL is not defined in the Intlayer configuration.`);let a=`${i}/api/gitlab`;return{getAuthUrl:async(n,r,i={})=>await t.fetcher(`${a}/auth-url`,e,i,{params:{redirectUri:n,...r&&{instanceUrl:r}}}),authenticate:async(n,r,i,o={})=>await t.fetcher(`${a}/auth`,e,o,{method:`POST`,body:{code:n,redirectUri:r,instanceUrl:i}}),getProjects:async(n,r,i={})=>await t.fetcher(`${a}/projects`,e,i,{params:{...n&&{token:n},...r&&{instanceUrl:r}}}),checkIntlayerConfig:async(n,r,i=`main`,o,s={})=>await t.fetcher(`${a}/check-config`,e,s,{method:`POST`,body:{token:n??void 0,projectId:r,branch:i,...o&&{instanceUrl:o}}}),getConfigFile:async(n,r,i=`main`,o=`intlayer.config.ts`,s,c={})=>await t.fetcher(`${a}/get-config-file`,e,c,{method:`POST`,body:{token:n??void 0,projectId:r,branch:i,path:o,...s&&{instanceUrl:s}}})}};exports.getGitlabAPI=r;
|
|
89
2
|
//# sourceMappingURL=gitlab.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitlab.cjs","names":["configuration","fetcher"],"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.cjs","names":["configuration","fetcher"],"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":"2MAqEA,MAAa,GACX,EAAiC,EAAE,CACnC,IACG,CACH,IAAM,EACJ,GAAgB,QAAQ,YAAcA,EAAAA,SAAe,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,MAAMC,EAAAA,QACJ,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,MAAMA,EAAAA,QACJ,GAAG,EAAiB,OACpB,EACA,EACA,CACE,OAAQ,OACR,KAAM,CAAE,OAAM,cAAa,cAAa,CACzC,CACF,CAwFD,YAjFkB,MAClB,EACA,EACA,EAA+B,EAAE,GAEjC,MAAMA,EAAAA,QACJ,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,MAAMA,EAAAA,QACJ,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,MAAMA,EAAAA,QACJ,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,39 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
const require_getIntlayerAPI_ai = require('./ai.cjs');
|
|
3
|
-
const require_getIntlayerAPI_audit = require('./audit.cjs');
|
|
4
|
-
const require_getIntlayerAPI_bitbucket = require('./bitbucket.cjs');
|
|
5
|
-
const require_getIntlayerAPI_dictionary = require('./dictionary.cjs');
|
|
6
|
-
const require_getIntlayerAPI_editor = require('./editor.cjs');
|
|
7
|
-
const require_getIntlayerAPI_github = require('./github.cjs');
|
|
8
|
-
const require_getIntlayerAPI_gitlab = require('./gitlab.cjs');
|
|
9
|
-
const require_getIntlayerAPI_newsletter = require('./newsletter.cjs');
|
|
10
|
-
const require_getIntlayerAPI_oAuth = require('./oAuth.cjs');
|
|
11
|
-
const require_getIntlayerAPI_organization = require('./organization.cjs');
|
|
12
|
-
const require_getIntlayerAPI_project = require('./project.cjs');
|
|
13
|
-
const require_getIntlayerAPI_search = require('./search.cjs');
|
|
14
|
-
const require_getIntlayerAPI_stripe = require('./stripe.cjs');
|
|
15
|
-
const require_getIntlayerAPI_tag = require('./tag.cjs');
|
|
16
|
-
const require_getIntlayerAPI_user = require('./user.cjs');
|
|
17
|
-
|
|
18
|
-
//#region src/getIntlayerAPI/index.ts
|
|
19
|
-
const getIntlayerAPI = (authAPIOptions = {}, intlayerConfig) => ({
|
|
20
|
-
organization: require_getIntlayerAPI_organization.getOrganizationAPI(authAPIOptions, intlayerConfig),
|
|
21
|
-
project: require_getIntlayerAPI_project.getProjectAPI(authAPIOptions, intlayerConfig),
|
|
22
|
-
user: require_getIntlayerAPI_user.getUserAPI(authAPIOptions, intlayerConfig),
|
|
23
|
-
oAuth: require_getIntlayerAPI_oAuth.getOAuthAPI(intlayerConfig),
|
|
24
|
-
dictionary: require_getIntlayerAPI_dictionary.getDictionaryAPI(authAPIOptions, intlayerConfig),
|
|
25
|
-
stripe: require_getIntlayerAPI_stripe.getStripeAPI(authAPIOptions, intlayerConfig),
|
|
26
|
-
ai: require_getIntlayerAPI_ai.getAiAPI(authAPIOptions, intlayerConfig),
|
|
27
|
-
tag: require_getIntlayerAPI_tag.getTagAPI(authAPIOptions, intlayerConfig),
|
|
28
|
-
search: require_getIntlayerAPI_search.getSearchAPI(authAPIOptions, intlayerConfig),
|
|
29
|
-
editor: require_getIntlayerAPI_editor.getEditorAPI(authAPIOptions, intlayerConfig),
|
|
30
|
-
newsletter: require_getIntlayerAPI_newsletter.getNewsletterAPI(authAPIOptions, intlayerConfig),
|
|
31
|
-
github: require_getIntlayerAPI_github.getGithubAPI(authAPIOptions, intlayerConfig),
|
|
32
|
-
gitlab: require_getIntlayerAPI_gitlab.getGitlabAPI(authAPIOptions, intlayerConfig),
|
|
33
|
-
bitbucket: require_getIntlayerAPI_bitbucket.getBitbucketAPI(authAPIOptions, intlayerConfig),
|
|
34
|
-
audit: require_getIntlayerAPI_audit.getAuditAPI(authAPIOptions, intlayerConfig)
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
//#endregion
|
|
38
|
-
exports.getIntlayerAPI = getIntlayerAPI;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./ai.cjs`),t=require(`./audit.cjs`),n=require(`./bitbucket.cjs`),r=require(`./dictionary.cjs`),i=require(`./editor.cjs`),a=require(`./github.cjs`),o=require(`./gitlab.cjs`),s=require(`./newsletter.cjs`),c=require(`./oAuth.cjs`),l=require(`./organization.cjs`),u=require(`./project.cjs`),d=require(`./search.cjs`),f=require(`./stripe.cjs`),p=require(`./tag.cjs`),m=require(`./user.cjs`),h=(h={},g)=>({organization:l.getOrganizationAPI(h,g),project:u.getProjectAPI(h,g),user:m.getUserAPI(h,g),oAuth:c.getOAuthAPI(g),dictionary:r.getDictionaryAPI(h,g),stripe:f.getStripeAPI(h,g),ai:e.getAiAPI(h,g),tag:p.getTagAPI(h,g),search:d.getSearchAPI(h,g),editor:i.getEditorAPI(h,g),newsletter:s.getNewsletterAPI(h,g),github:a.getGithubAPI(h,g),gitlab:o.getGitlabAPI(h,g),bitbucket:n.getBitbucketAPI(h,g),audit:t.getAuditAPI(h,g)});exports.getIntlayerAPI=h;
|
|
39
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["getOrganizationAPI","getProjectAPI","getUserAPI","getOAuthAPI","getDictionaryAPI","getStripeAPI","getAiAPI","getTagAPI","getSearchAPI","getEditorAPI","getNewsletterAPI","getGithubAPI","getGitlabAPI","getBitbucketAPI","getAuditAPI"],"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.cjs","names":["getOrganizationAPI","getProjectAPI","getUserAPI","getOAuthAPI","getDictionaryAPI","getStripeAPI","getAiAPI","getTagAPI","getSearchAPI","getEditorAPI","getNewsletterAPI","getGithubAPI","getGitlabAPI","getBitbucketAPI","getAuditAPI"],"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":"sdAoCa,GACX,EAAiC,EAAE,CACnC,KACuB,CACvB,aAAcA,EAAAA,mBAAmB,EAAgB,EAAe,CAChE,QAASC,EAAAA,cAAc,EAAgB,EAAe,CACtD,KAAMC,EAAAA,WAAW,EAAgB,EAAe,CAChD,MAAOC,EAAAA,YAAY,EAAe,CAClC,WAAYC,EAAAA,iBAAiB,EAAgB,EAAe,CAC5D,OAAQC,EAAAA,aAAa,EAAgB,EAAe,CACpD,GAAIC,EAAAA,SAAS,EAAgB,EAAe,CAC5C,IAAKC,EAAAA,UAAU,EAAgB,EAAe,CAC9C,OAAQC,EAAAA,aAAa,EAAgB,EAAe,CACpD,OAAQC,EAAAA,aAAa,EAAgB,EAAe,CACpD,WAAYC,EAAAA,iBAAiB,EAAgB,EAAe,CAC5D,OAAQC,EAAAA,aAAa,EAAgB,EAAe,CACpD,OAAQC,EAAAA,aAAa,EAAgB,EAAe,CACpD,UAAWC,EAAAA,gBAAgB,EAAgB,EAAe,CAC1D,MAAOC,EAAAA,YAAY,EAAgB,EAAe,CACnD"}
|