@intlayer/api 4.0.4 → 4.0.5
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/getIntlayerAPI/editor.cjs +51 -0
- package/dist/cjs/getIntlayerAPI/editor.cjs.map +1 -0
- package/dist/cjs/getIntlayerAPI/index.cjs +3 -1
- package/dist/cjs/getIntlayerAPI/index.cjs.map +1 -1
- package/dist/esm/distantDictionary/fetchDistantDictionaries.mjs +1 -1
- package/dist/esm/distantDictionary/fetchDistantDictionary.mjs +1 -1
- package/dist/esm/distantDictionary/index.mjs +2 -2
- package/dist/esm/getIntlayerAPI/ai.mjs +1 -1
- package/dist/esm/getIntlayerAPI/auth.mjs +1 -1
- package/dist/esm/getIntlayerAPI/dictionary.mjs +1 -1
- package/dist/esm/getIntlayerAPI/editor.mjs +26 -0
- package/dist/esm/getIntlayerAPI/editor.mjs.map +1 -0
- package/dist/esm/getIntlayerAPI/index.mjs +11 -9
- package/dist/esm/getIntlayerAPI/index.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/organization.mjs +1 -1
- package/dist/esm/getIntlayerAPI/project.mjs +1 -1
- package/dist/esm/getIntlayerAPI/stripe.mjs +1 -1
- package/dist/esm/getIntlayerAPI/tag.mjs +1 -1
- package/dist/esm/getIntlayerAPI/user.mjs +1 -1
- package/dist/esm/index.mjs +3 -3
- package/dist/types/getIntlayerAPI/editor.d.ts +10 -0
- package/dist/types/getIntlayerAPI/editor.d.ts.map +1 -0
- package/dist/types/getIntlayerAPI/index.d.ts +6 -0
- package/dist/types/getIntlayerAPI/index.d.ts.map +1 -1
- package/package.json +5 -4
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var editor_exports = {};
|
|
20
|
+
__export(editor_exports, {
|
|
21
|
+
editorAPI: () => editorAPI,
|
|
22
|
+
getEditorAPI: () => getEditorAPI
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(editor_exports);
|
|
25
|
+
var import_client = require("@intlayer/config/client");
|
|
26
|
+
var import_fetcher = require('../fetcher.cjs');
|
|
27
|
+
const getEditorAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
28
|
+
const { editorURL } = (intlayerConfig ?? (0, import_client.getConfiguration)()).editor;
|
|
29
|
+
const EDITOR_API_ROUTE = `${editorURL}/api`;
|
|
30
|
+
const writeDictionary = async (dictionary, otherOptions = {}) => {
|
|
31
|
+
await (0, import_fetcher.fetcher)(
|
|
32
|
+
`${EDITOR_API_ROUTE}/dictionary`,
|
|
33
|
+
authAPIOptions,
|
|
34
|
+
otherOptions,
|
|
35
|
+
{
|
|
36
|
+
method: "POST",
|
|
37
|
+
body: dictionary
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
};
|
|
41
|
+
return {
|
|
42
|
+
writeDictionary
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
const editorAPI = getEditorAPI();
|
|
46
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
47
|
+
0 && (module.exports = {
|
|
48
|
+
editorAPI,
|
|
49
|
+
getEditorAPI
|
|
50
|
+
});
|
|
51
|
+
//# sourceMappingURL=editor.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/getIntlayerAPI/editor.ts"],"sourcesContent":["import { getConfiguration, type IntlayerConfig } from '@intlayer/config/client';\nimport type {\n // @ts-ignore: intlayer-editor is not built yet\n WriteContentDeclarationBody,\n // @ts-ignore: intlayer-editor is not built yet\n WriteContentDeclarationResult,\n // @ts-ignore: intlayer-editor is not built yet\n} from 'intlayer-editor';\nimport { fetcher, type FetcherOptions } from '../fetcher';\n\nexport const getEditorAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const { editorURL } = (intlayerConfig ?? getConfiguration()).editor;\n const EDITOR_API_ROUTE = `${editorURL}/api`;\n\n /**\n * Adds a new dictionary to the database.\n * @param dictionary - Dictionary data.\n */\n const writeDictionary = async (\n dictionary: WriteContentDeclarationBody,\n otherOptions: FetcherOptions = {}\n ) => {\n await fetcher<WriteContentDeclarationResult>(\n `${EDITOR_API_ROUTE}/dictionary`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: dictionary,\n }\n );\n };\n\n return {\n writeDictionary,\n };\n};\n\nexport const editorAPI = getEditorAPI();\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAsD;AAQtD,qBAA6C;AAEtC,MAAM,eAAe,CAC1B,iBAAiC,CAAC,GAClC,mBACG;AACH,QAAM,EAAE,UAAU,KAAK,sBAAkB,gCAAiB,GAAG;AAC7D,QAAM,mBAAmB,GAAG,SAAS;AAMrC,QAAM,kBAAkB,OACtB,YACA,eAA+B,CAAC,MAC7B;AACH,cAAM;AAAA,MACJ,GAAG,gBAAgB;AAAA,MACnB;AAAA,MACA;AAAA,MACA;AAAA,QACE,QAAQ;AAAA,QACR,MAAM;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AAAA,IACL;AAAA,EACF;AACF;AAEO,MAAM,YAAY,aAAa;","names":[]}
|
|
@@ -25,6 +25,7 @@ module.exports = __toCommonJS(getIntlayerAPI_exports);
|
|
|
25
25
|
var import_ai = require('./ai.cjs');
|
|
26
26
|
var import_auth = require('./auth.cjs');
|
|
27
27
|
var import_dictionary = require('./dictionary.cjs');
|
|
28
|
+
var import_editor = require('./editor.cjs');
|
|
28
29
|
var import_organization = require('./organization.cjs');
|
|
29
30
|
var import_project = require('./project.cjs');
|
|
30
31
|
var import_stripe = require('./stripe.cjs');
|
|
@@ -38,7 +39,8 @@ const getIntlayerAPI = (authAPIOptions = {}, intlayerConfig) => ({
|
|
|
38
39
|
dictionary: (0, import_dictionary.getDictionaryAPI)(authAPIOptions, intlayerConfig),
|
|
39
40
|
stripe: (0, import_stripe.getStripeAPI)(authAPIOptions, intlayerConfig),
|
|
40
41
|
ai: (0, import_ai.getAiAPI)(authAPIOptions, intlayerConfig),
|
|
41
|
-
tag: (0, import_tag.getTagAPI)(authAPIOptions, intlayerConfig)
|
|
42
|
+
tag: (0, import_tag.getTagAPI)(authAPIOptions, intlayerConfig),
|
|
43
|
+
editor: (0, import_editor.getEditorAPI)(authAPIOptions, intlayerConfig)
|
|
42
44
|
});
|
|
43
45
|
const intlayerAPI = getIntlayerAPI();
|
|
44
46
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/getIntlayerAPI/index.ts"],"sourcesContent":["import { type IntlayerConfig } from '@intlayer/config/client';\nimport type { FetcherOptions } from '../fetcher';\nimport { getAiAPI } from './ai';\nimport { getAuthAPI } from './auth';\nimport { getDictionaryAPI } from './dictionary';\nimport { getOrganizationAPI } from './organization';\nimport { getProjectAPI } from './project';\nimport { getStripeAPI } from './stripe';\nimport { getTagAPI } from './tag';\nimport { getUserAPI } from './user';\n\nexport const getIntlayerAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => ({\n organization: getOrganizationAPI(authAPIOptions, intlayerConfig),\n project: getProjectAPI(authAPIOptions, intlayerConfig),\n user: getUserAPI(authAPIOptions, intlayerConfig),\n auth: getAuthAPI(authAPIOptions, intlayerConfig),\n dictionary: getDictionaryAPI(authAPIOptions, intlayerConfig),\n stripe: getStripeAPI(authAPIOptions, intlayerConfig),\n ai: getAiAPI(authAPIOptions, intlayerConfig),\n tag: getTagAPI(authAPIOptions, intlayerConfig),\n});\n\nexport const intlayerAPI = getIntlayerAPI();\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,gBAAyB;AACzB,kBAA2B;AAC3B,wBAAiC;AACjC,0BAAmC;AACnC,qBAA8B;AAC9B,oBAA6B;AAC7B,iBAA0B;AAC1B,kBAA2B;AAEpB,MAAM,iBAAiB,CAC5B,iBAAiC,CAAC,GAClC,oBACI;AAAA,EACJ,kBAAc,wCAAmB,gBAAgB,cAAc;AAAA,EAC/D,aAAS,8BAAc,gBAAgB,cAAc;AAAA,EACrD,UAAM,wBAAW,gBAAgB,cAAc;AAAA,EAC/C,UAAM,wBAAW,gBAAgB,cAAc;AAAA,EAC/C,gBAAY,oCAAiB,gBAAgB,cAAc;AAAA,EAC3D,YAAQ,4BAAa,gBAAgB,cAAc;AAAA,EACnD,QAAI,oBAAS,gBAAgB,cAAc;AAAA,EAC3C,SAAK,sBAAU,gBAAgB,cAAc;
|
|
1
|
+
{"version":3,"sources":["../../../src/getIntlayerAPI/index.ts"],"sourcesContent":["import { type IntlayerConfig } from '@intlayer/config/client';\nimport type { FetcherOptions } from '../fetcher';\nimport { getAiAPI } from './ai';\nimport { getAuthAPI } from './auth';\nimport { getDictionaryAPI } from './dictionary';\nimport { getEditorAPI } from './editor';\nimport { getOrganizationAPI } from './organization';\nimport { getProjectAPI } from './project';\nimport { getStripeAPI } from './stripe';\nimport { getTagAPI } from './tag';\nimport { getUserAPI } from './user';\n\nexport const getIntlayerAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => ({\n organization: getOrganizationAPI(authAPIOptions, intlayerConfig),\n project: getProjectAPI(authAPIOptions, intlayerConfig),\n user: getUserAPI(authAPIOptions, intlayerConfig),\n auth: getAuthAPI(authAPIOptions, intlayerConfig),\n dictionary: getDictionaryAPI(authAPIOptions, intlayerConfig),\n stripe: getStripeAPI(authAPIOptions, intlayerConfig),\n ai: getAiAPI(authAPIOptions, intlayerConfig),\n tag: getTagAPI(authAPIOptions, intlayerConfig),\n editor: getEditorAPI(authAPIOptions, intlayerConfig),\n});\n\nexport const intlayerAPI = getIntlayerAPI();\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,gBAAyB;AACzB,kBAA2B;AAC3B,wBAAiC;AACjC,oBAA6B;AAC7B,0BAAmC;AACnC,qBAA8B;AAC9B,oBAA6B;AAC7B,iBAA0B;AAC1B,kBAA2B;AAEpB,MAAM,iBAAiB,CAC5B,iBAAiC,CAAC,GAClC,oBACI;AAAA,EACJ,kBAAc,wCAAmB,gBAAgB,cAAc;AAAA,EAC/D,aAAS,8BAAc,gBAAgB,cAAc;AAAA,EACrD,UAAM,wBAAW,gBAAgB,cAAc;AAAA,EAC/C,UAAM,wBAAW,gBAAgB,cAAc;AAAA,EAC/C,gBAAY,oCAAiB,gBAAgB,cAAc;AAAA,EAC3D,YAAQ,4BAAa,gBAAgB,cAAc;AAAA,EACnD,QAAI,oBAAS,gBAAgB,cAAc;AAAA,EAC3C,SAAK,sBAAU,gBAAgB,cAAc;AAAA,EAC7C,YAAQ,4BAAa,gBAAgB,cAAc;AACrD;AAEO,MAAM,cAAc,eAAe;","names":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getConfiguration } from "@intlayer/config/client";
|
|
2
|
-
import { getIntlayerAPI } from
|
|
2
|
+
import { getIntlayerAPI } from "../getIntlayerAPI/index.mjs";
|
|
3
3
|
const fetchDistantDictionaries = async (intlayerConfig) => {
|
|
4
4
|
try {
|
|
5
5
|
const config = intlayerConfig ?? getConfiguration();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getConfiguration } from "@intlayer/config/client";
|
|
2
|
-
import { getIntlayerAPI } from
|
|
2
|
+
import { getIntlayerAPI } from "../getIntlayerAPI/index.mjs";
|
|
3
3
|
const fetchDistantDictionary = async (dictionaryKey, intlayerConfig) => {
|
|
4
4
|
try {
|
|
5
5
|
const config = intlayerConfig ?? getConfiguration();
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
1
|
+
export * from "./fetchDistantDictionary.mjs";
|
|
2
|
+
export * from "./fetchDistantDictionaries.mjs";
|
|
3
3
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getConfiguration } from "@intlayer/config/client";
|
|
2
|
-
import { fetcher } from
|
|
2
|
+
import { fetcher } from "../fetcher.mjs";
|
|
3
3
|
const getAiAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
4
4
|
const { backendURL } = (intlayerConfig ?? getConfiguration()).editor;
|
|
5
5
|
const AI_API_ROUTE = `${backendURL}/api/ai`;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getConfiguration } from "@intlayer/config/client";
|
|
2
|
-
import { fetcher } from
|
|
2
|
+
import { fetcher } from "../fetcher.mjs";
|
|
3
3
|
const getAuthAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
4
4
|
const { backendURL, clientId, clientSecret } = (intlayerConfig ?? getConfiguration()).editor;
|
|
5
5
|
const AUTH_API_ROUTE = `${backendURL}/api/auth`;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getConfiguration } from "@intlayer/config/client";
|
|
2
|
-
import { fetcher } from
|
|
2
|
+
import { fetcher } from "../fetcher.mjs";
|
|
3
3
|
const getDictionaryAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
4
4
|
const { backendURL } = (intlayerConfig ?? getConfiguration()).editor;
|
|
5
5
|
const PROJECT_API_ROUTE = `${backendURL}/api/dictionary`;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { getConfiguration } from "@intlayer/config/client";
|
|
2
|
+
import { fetcher } from "../fetcher.mjs";
|
|
3
|
+
const getEditorAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
4
|
+
const { editorURL } = (intlayerConfig ?? getConfiguration()).editor;
|
|
5
|
+
const EDITOR_API_ROUTE = `${editorURL}/api`;
|
|
6
|
+
const writeDictionary = async (dictionary, otherOptions = {}) => {
|
|
7
|
+
await fetcher(
|
|
8
|
+
`${EDITOR_API_ROUTE}/dictionary`,
|
|
9
|
+
authAPIOptions,
|
|
10
|
+
otherOptions,
|
|
11
|
+
{
|
|
12
|
+
method: "POST",
|
|
13
|
+
body: dictionary
|
|
14
|
+
}
|
|
15
|
+
);
|
|
16
|
+
};
|
|
17
|
+
return {
|
|
18
|
+
writeDictionary
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
const editorAPI = getEditorAPI();
|
|
22
|
+
export {
|
|
23
|
+
editorAPI,
|
|
24
|
+
getEditorAPI
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=editor.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/getIntlayerAPI/editor.ts"],"sourcesContent":["import { getConfiguration, type IntlayerConfig } from '@intlayer/config/client';\nimport type {\n // @ts-ignore: intlayer-editor is not built yet\n WriteContentDeclarationBody,\n // @ts-ignore: intlayer-editor is not built yet\n WriteContentDeclarationResult,\n // @ts-ignore: intlayer-editor is not built yet\n} from 'intlayer-editor';\nimport { fetcher, type FetcherOptions } from '../fetcher';\n\nexport const getEditorAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const { editorURL } = (intlayerConfig ?? getConfiguration()).editor;\n const EDITOR_API_ROUTE = `${editorURL}/api`;\n\n /**\n * Adds a new dictionary to the database.\n * @param dictionary - Dictionary data.\n */\n const writeDictionary = async (\n dictionary: WriteContentDeclarationBody,\n otherOptions: FetcherOptions = {}\n ) => {\n await fetcher<WriteContentDeclarationResult>(\n `${EDITOR_API_ROUTE}/dictionary`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: dictionary,\n }\n );\n };\n\n return {\n writeDictionary,\n };\n};\n\nexport const editorAPI = getEditorAPI();\n"],"mappings":"AAAA,SAAS,wBAA6C;AAQtD,SAAS,eAAoC;AAEtC,MAAM,eAAe,CAC1B,iBAAiC,CAAC,GAClC,mBACG;AACH,QAAM,EAAE,UAAU,KAAK,kBAAkB,iBAAiB,GAAG;AAC7D,QAAM,mBAAmB,GAAG,SAAS;AAMrC,QAAM,kBAAkB,OACtB,YACA,eAA+B,CAAC,MAC7B;AACH,UAAM;AAAA,MACJ,GAAG,gBAAgB;AAAA,MACnB;AAAA,MACA;AAAA,MACA;AAAA,QACE,QAAQ;AAAA,QACR,MAAM;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AAAA,IACL;AAAA,EACF;AACF;AAEO,MAAM,YAAY,aAAa;","names":[]}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { getAiAPI } from
|
|
2
|
-
import { getAuthAPI } from
|
|
3
|
-
import { getDictionaryAPI } from
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
1
|
+
import { getAiAPI } from "./ai.mjs";
|
|
2
|
+
import { getAuthAPI } from "./auth.mjs";
|
|
3
|
+
import { getDictionaryAPI } from "./dictionary.mjs";
|
|
4
|
+
import { getEditorAPI } from "./editor.mjs";
|
|
5
|
+
import { getOrganizationAPI } from "./organization.mjs";
|
|
6
|
+
import { getProjectAPI } from "./project.mjs";
|
|
7
|
+
import { getStripeAPI } from "./stripe.mjs";
|
|
8
|
+
import { getTagAPI } from "./tag.mjs";
|
|
9
|
+
import { getUserAPI } from "./user.mjs";
|
|
9
10
|
const getIntlayerAPI = (authAPIOptions = {}, intlayerConfig) => ({
|
|
10
11
|
organization: getOrganizationAPI(authAPIOptions, intlayerConfig),
|
|
11
12
|
project: getProjectAPI(authAPIOptions, intlayerConfig),
|
|
@@ -14,7 +15,8 @@ const getIntlayerAPI = (authAPIOptions = {}, intlayerConfig) => ({
|
|
|
14
15
|
dictionary: getDictionaryAPI(authAPIOptions, intlayerConfig),
|
|
15
16
|
stripe: getStripeAPI(authAPIOptions, intlayerConfig),
|
|
16
17
|
ai: getAiAPI(authAPIOptions, intlayerConfig),
|
|
17
|
-
tag: getTagAPI(authAPIOptions, intlayerConfig)
|
|
18
|
+
tag: getTagAPI(authAPIOptions, intlayerConfig),
|
|
19
|
+
editor: getEditorAPI(authAPIOptions, intlayerConfig)
|
|
18
20
|
});
|
|
19
21
|
const intlayerAPI = getIntlayerAPI();
|
|
20
22
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/getIntlayerAPI/index.ts"],"sourcesContent":["import { type IntlayerConfig } from '@intlayer/config/client';\nimport type { FetcherOptions } from '../fetcher';\nimport { getAiAPI } from './ai';\nimport { getAuthAPI } from './auth';\nimport { getDictionaryAPI } from './dictionary';\nimport { getOrganizationAPI } from './organization';\nimport { getProjectAPI } from './project';\nimport { getStripeAPI } from './stripe';\nimport { getTagAPI } from './tag';\nimport { getUserAPI } from './user';\n\nexport const getIntlayerAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => ({\n organization: getOrganizationAPI(authAPIOptions, intlayerConfig),\n project: getProjectAPI(authAPIOptions, intlayerConfig),\n user: getUserAPI(authAPIOptions, intlayerConfig),\n auth: getAuthAPI(authAPIOptions, intlayerConfig),\n dictionary: getDictionaryAPI(authAPIOptions, intlayerConfig),\n stripe: getStripeAPI(authAPIOptions, intlayerConfig),\n ai: getAiAPI(authAPIOptions, intlayerConfig),\n tag: getTagAPI(authAPIOptions, intlayerConfig),\n});\n\nexport const intlayerAPI = getIntlayerAPI();\n"],"mappings":"AAEA,SAAS,gBAAgB;AACzB,SAAS,kBAAkB;AAC3B,SAAS,wBAAwB;AACjC,SAAS,0BAA0B;AACnC,SAAS,qBAAqB;AAC9B,SAAS,oBAAoB;AAC7B,SAAS,iBAAiB;AAC1B,SAAS,kBAAkB;AAEpB,MAAM,iBAAiB,CAC5B,iBAAiC,CAAC,GAClC,oBACI;AAAA,EACJ,cAAc,mBAAmB,gBAAgB,cAAc;AAAA,EAC/D,SAAS,cAAc,gBAAgB,cAAc;AAAA,EACrD,MAAM,WAAW,gBAAgB,cAAc;AAAA,EAC/C,MAAM,WAAW,gBAAgB,cAAc;AAAA,EAC/C,YAAY,iBAAiB,gBAAgB,cAAc;AAAA,EAC3D,QAAQ,aAAa,gBAAgB,cAAc;AAAA,EACnD,IAAI,SAAS,gBAAgB,cAAc;AAAA,EAC3C,KAAK,UAAU,gBAAgB,cAAc;
|
|
1
|
+
{"version":3,"sources":["../../../src/getIntlayerAPI/index.ts"],"sourcesContent":["import { type IntlayerConfig } from '@intlayer/config/client';\nimport type { FetcherOptions } from '../fetcher';\nimport { getAiAPI } from './ai';\nimport { getAuthAPI } from './auth';\nimport { getDictionaryAPI } from './dictionary';\nimport { getEditorAPI } from './editor';\nimport { getOrganizationAPI } from './organization';\nimport { getProjectAPI } from './project';\nimport { getStripeAPI } from './stripe';\nimport { getTagAPI } from './tag';\nimport { getUserAPI } from './user';\n\nexport const getIntlayerAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => ({\n organization: getOrganizationAPI(authAPIOptions, intlayerConfig),\n project: getProjectAPI(authAPIOptions, intlayerConfig),\n user: getUserAPI(authAPIOptions, intlayerConfig),\n auth: getAuthAPI(authAPIOptions, intlayerConfig),\n dictionary: getDictionaryAPI(authAPIOptions, intlayerConfig),\n stripe: getStripeAPI(authAPIOptions, intlayerConfig),\n ai: getAiAPI(authAPIOptions, intlayerConfig),\n tag: getTagAPI(authAPIOptions, intlayerConfig),\n editor: getEditorAPI(authAPIOptions, intlayerConfig),\n});\n\nexport const intlayerAPI = getIntlayerAPI();\n"],"mappings":"AAEA,SAAS,gBAAgB;AACzB,SAAS,kBAAkB;AAC3B,SAAS,wBAAwB;AACjC,SAAS,oBAAoB;AAC7B,SAAS,0BAA0B;AACnC,SAAS,qBAAqB;AAC9B,SAAS,oBAAoB;AAC7B,SAAS,iBAAiB;AAC1B,SAAS,kBAAkB;AAEpB,MAAM,iBAAiB,CAC5B,iBAAiC,CAAC,GAClC,oBACI;AAAA,EACJ,cAAc,mBAAmB,gBAAgB,cAAc;AAAA,EAC/D,SAAS,cAAc,gBAAgB,cAAc;AAAA,EACrD,MAAM,WAAW,gBAAgB,cAAc;AAAA,EAC/C,MAAM,WAAW,gBAAgB,cAAc;AAAA,EAC/C,YAAY,iBAAiB,gBAAgB,cAAc;AAAA,EAC3D,QAAQ,aAAa,gBAAgB,cAAc;AAAA,EACnD,IAAI,SAAS,gBAAgB,cAAc;AAAA,EAC3C,KAAK,UAAU,gBAAgB,cAAc;AAAA,EAC7C,QAAQ,aAAa,gBAAgB,cAAc;AACrD;AAEO,MAAM,cAAc,eAAe;","names":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getConfiguration } from "@intlayer/config/client";
|
|
2
|
-
import { fetcher } from
|
|
2
|
+
import { fetcher } from "../fetcher.mjs";
|
|
3
3
|
const getOrganizationAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
4
4
|
const { backendURL } = (intlayerConfig ?? getConfiguration()).editor;
|
|
5
5
|
const ORGANIZATION_API_ROUTE = `${backendURL}/api/organization`;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getConfiguration } from "@intlayer/config/client";
|
|
2
|
-
import { fetcher } from
|
|
2
|
+
import { fetcher } from "../fetcher.mjs";
|
|
3
3
|
const getProjectAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
4
4
|
const { backendURL } = (intlayerConfig ?? getConfiguration()).editor;
|
|
5
5
|
const PROJECT_API_ROUTE = `${backendURL}/api/project`;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getConfiguration } from "@intlayer/config/client";
|
|
2
|
-
import { fetcher } from
|
|
2
|
+
import { fetcher } from "../fetcher.mjs";
|
|
3
3
|
const getStripeAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
4
4
|
const backendURL = (intlayerConfig ?? getConfiguration()).editor.backendURL;
|
|
5
5
|
const STRIPE_API_ROUTE = `${backendURL}/api/stripe`;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getConfiguration } from "@intlayer/config/client";
|
|
2
|
-
import { fetcher } from
|
|
2
|
+
import { fetcher } from "../fetcher.mjs";
|
|
3
3
|
const getTagAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
4
4
|
const { backendURL } = (intlayerConfig ?? getConfiguration()).editor;
|
|
5
5
|
const PROJECT_API_ROUTE = `${backendURL}/api/tag`;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getConfiguration } from "@intlayer/config/client";
|
|
2
|
-
import { fetcher } from
|
|
2
|
+
import { fetcher } from "../fetcher.mjs";
|
|
3
3
|
const getUserAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
4
4
|
const { backendURL } = (intlayerConfig ?? getConfiguration()).editor;
|
|
5
5
|
const USER_API_ROUTE = `${backendURL}/api/user`;
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
1
|
+
export * from "./getIntlayerAPI/index.mjs";
|
|
2
|
+
export * from "./distantDictionary/index.mjs";
|
|
3
|
+
export * from "./fetcher.mjs";
|
|
4
4
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type IntlayerConfig } from '@intlayer/config/client';
|
|
2
|
+
import type { WriteContentDeclarationBody } from 'intlayer-editor';
|
|
3
|
+
import { type FetcherOptions } from '../fetcher';
|
|
4
|
+
export declare const getEditorAPI: (authAPIOptions?: FetcherOptions, intlayerConfig?: IntlayerConfig) => {
|
|
5
|
+
writeDictionary: (dictionary: WriteContentDeclarationBody, otherOptions?: FetcherOptions) => Promise<void>;
|
|
6
|
+
};
|
|
7
|
+
export declare const editorAPI: {
|
|
8
|
+
writeDictionary: (dictionary: WriteContentDeclarationBody, otherOptions?: FetcherOptions) => Promise<void>;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=editor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../src/getIntlayerAPI/editor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAChF,OAAO,KAAK,EAEV,2BAA2B,EAI5B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAW,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC;AAE1D,eAAO,MAAM,YAAY,oBACP,cAAc,mBACb,cAAc;kCAUjB,2BAA2B,iBACzB,cAAc;CAgB/B,CAAC;AAEF,eAAO,MAAM,SAAS;kCAnBN,2BAA2B,iBACzB,cAAc;CAkBO,CAAC"}
|
|
@@ -76,6 +76,9 @@ export declare const getIntlayerAPI: (authAPIOptions?: FetcherOptions, intlayerC
|
|
|
76
76
|
updateTag: (tagId: import("@intlayer/backend").UpdateTagParams["tagId"], tag: import("@intlayer/backend").UpdateTagBody, otherOptions?: FetcherOptions) => Promise<import("@intlayer/backend").UpdateTagResult>;
|
|
77
77
|
deleteTag: (tagId: import("@intlayer/backend").DeleteTagParams["tagId"], otherOptions?: FetcherOptions) => Promise<import("@intlayer/backend").DeleteTagResult>;
|
|
78
78
|
};
|
|
79
|
+
editor: {
|
|
80
|
+
writeDictionary: (dictionary: WriteContentDeclarationBody, otherOptions?: FetcherOptions) => Promise<void>;
|
|
81
|
+
};
|
|
79
82
|
};
|
|
80
83
|
export declare const intlayerAPI: {
|
|
81
84
|
organization: {
|
|
@@ -153,5 +156,8 @@ export declare const intlayerAPI: {
|
|
|
153
156
|
updateTag: (tagId: import("@intlayer/backend").UpdateTagParams["tagId"], tag: import("@intlayer/backend").UpdateTagBody, otherOptions?: FetcherOptions) => Promise<import("@intlayer/backend").UpdateTagResult>;
|
|
154
157
|
deleteTag: (tagId: import("@intlayer/backend").DeleteTagParams["tagId"], otherOptions?: FetcherOptions) => Promise<import("@intlayer/backend").DeleteTagResult>;
|
|
155
158
|
};
|
|
159
|
+
editor: {
|
|
160
|
+
writeDictionary: (dictionary: WriteContentDeclarationBody, otherOptions?: FetcherOptions) => Promise<void>;
|
|
161
|
+
};
|
|
156
162
|
};
|
|
157
163
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/getIntlayerAPI/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/getIntlayerAPI/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAWjD,eAAO,MAAM,cAAc,oBACT,cAAc,mBACb,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAW/B,CAAC;AAEH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAmB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/api",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "SDK for interacting with the Intlayer API, enabling content auditing, and managing organizations, projects, and users.",
|
|
6
6
|
"keywords": [
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"./package.json"
|
|
58
58
|
],
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@intlayer/config": "4.0.
|
|
60
|
+
"@intlayer/config": "4.0.5"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@changesets/changelog-github": "0.5.0",
|
|
@@ -71,14 +71,15 @@
|
|
|
71
71
|
"tsc-alias": "^1.8.10",
|
|
72
72
|
"tsup": "^8.3.5",
|
|
73
73
|
"typescript": "^5.7.3",
|
|
74
|
-
"@intlayer/backend": "4.0.
|
|
74
|
+
"@intlayer/backend": "4.0.5",
|
|
75
75
|
"@utils/eslint-config": "1.0.4",
|
|
76
76
|
"@utils/ts-config": "1.0.4",
|
|
77
77
|
"@utils/tsup-config": "1.0.4",
|
|
78
|
+
"intlayer-editor": "4.0.5",
|
|
78
79
|
"@utils/ts-config-types": "1.0.4"
|
|
79
80
|
},
|
|
80
81
|
"peerDependencies": {
|
|
81
|
-
"@intlayer/config": "4.0.
|
|
82
|
+
"@intlayer/config": "4.0.5"
|
|
82
83
|
},
|
|
83
84
|
"engines": {
|
|
84
85
|
"node": ">=14.18"
|