@intlayer/api 4.0.4 → 4.1.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.
@@ -0,0 +1,60 @@
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 getConfiguration = async (otherOptions = {}) => {
31
+ const response = await (0, import_fetcher.fetcher)(
32
+ `${EDITOR_API_ROUTE}/config`,
33
+ authAPIOptions,
34
+ otherOptions
35
+ );
36
+ return response.data;
37
+ };
38
+ const writeDictionary = async (dictionary, otherOptions = {}) => {
39
+ await (0, import_fetcher.fetcher)(
40
+ `${EDITOR_API_ROUTE}/dictionary`,
41
+ authAPIOptions,
42
+ otherOptions,
43
+ {
44
+ method: "POST",
45
+ body: dictionary
46
+ }
47
+ );
48
+ };
49
+ return {
50
+ getConfiguration,
51
+ writeDictionary
52
+ };
53
+ };
54
+ const editorAPI = getEditorAPI();
55
+ // Annotate the CommonJS export names for ESM import in node:
56
+ 0 && (module.exports = {
57
+ editorAPI,
58
+ getEditorAPI
59
+ });
60
+ //# sourceMappingURL=editor.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/getIntlayerAPI/editor.ts"],"sourcesContent":["import {\n getConfiguration as getLocaleConfiguration,\n type IntlayerConfig,\n} from '@intlayer/config/client';\nimport type {\n // @ts-ignore: intlayer-editor is not built yet\n GetConfigurationResult,\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 ?? getLocaleConfiguration()).editor;\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;\n };\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 getConfiguration,\n writeDictionary,\n };\n};\n\nexport const editorAPI = getEditorAPI();\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAGO;AAUP,qBAA6C;AAEtC,MAAM,eAAe,CAC1B,iBAAiC,CAAC,GAClC,mBACG;AACH,QAAM,EAAE,UAAU,KAAK,sBAAkB,cAAAA,kBAAuB,GAAG;AACnE,QAAM,mBAAmB,GAAG,SAAS;AAKrC,QAAM,mBAAmB,OACvB,eAA+B,CAAC,MACI;AACpC,UAAM,WAAW,UAAM;AAAA,MACrB,GAAG,gBAAgB;AAAA,MACnB;AAAA,MACA;AAAA,IACF;AAEA,WAAO,SAAS;AAAA,EAClB;AAMA,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,IACA;AAAA,EACF;AACF;AAEO,MAAM,YAAY,aAAa;","names":["getLocaleConfiguration"]}
@@ -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;AAC/C;AAEO,MAAM,cAAc,eAAe;","names":[]}
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 '../getIntlayerAPI/index.mjs';
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 '../getIntlayerAPI/index.mjs';
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 './fetchDistantDictionary.mjs';
2
- export * from './fetchDistantDictionaries.mjs';
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 '../fetcher.mjs';
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 '../fetcher.mjs';
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 '../fetcher.mjs';
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,37 @@
1
+ import {
2
+ getConfiguration as getLocaleConfiguration
3
+ } from "@intlayer/config/client";
4
+ import { fetcher } from "../fetcher.mjs";
5
+ const getEditorAPI = (authAPIOptions = {}, intlayerConfig) => {
6
+ const { editorURL } = (intlayerConfig ?? getLocaleConfiguration()).editor;
7
+ const EDITOR_API_ROUTE = `${editorURL}/api`;
8
+ const getConfiguration = async (otherOptions = {}) => {
9
+ const response = await fetcher(
10
+ `${EDITOR_API_ROUTE}/config`,
11
+ authAPIOptions,
12
+ otherOptions
13
+ );
14
+ return response.data;
15
+ };
16
+ const writeDictionary = async (dictionary, otherOptions = {}) => {
17
+ await fetcher(
18
+ `${EDITOR_API_ROUTE}/dictionary`,
19
+ authAPIOptions,
20
+ otherOptions,
21
+ {
22
+ method: "POST",
23
+ body: dictionary
24
+ }
25
+ );
26
+ };
27
+ return {
28
+ getConfiguration,
29
+ writeDictionary
30
+ };
31
+ };
32
+ const editorAPI = getEditorAPI();
33
+ export {
34
+ editorAPI,
35
+ getEditorAPI
36
+ };
37
+ //# sourceMappingURL=editor.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/getIntlayerAPI/editor.ts"],"sourcesContent":["import {\n getConfiguration as getLocaleConfiguration,\n type IntlayerConfig,\n} from '@intlayer/config/client';\nimport type {\n // @ts-ignore: intlayer-editor is not built yet\n GetConfigurationResult,\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 ?? getLocaleConfiguration()).editor;\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;\n };\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 getConfiguration,\n writeDictionary,\n };\n};\n\nexport const editorAPI = getEditorAPI();\n"],"mappings":"AAAA;AAAA,EACE,oBAAoB;AAAA,OAEf;AAUP,SAAS,eAAoC;AAEtC,MAAM,eAAe,CAC1B,iBAAiC,CAAC,GAClC,mBACG;AACH,QAAM,EAAE,UAAU,KAAK,kBAAkB,uBAAuB,GAAG;AACnE,QAAM,mBAAmB,GAAG,SAAS;AAKrC,QAAM,mBAAmB,OACvB,eAA+B,CAAC,MACI;AACpC,UAAM,WAAW,MAAM;AAAA,MACrB,GAAG,gBAAgB;AAAA,MACnB;AAAA,MACA;AAAA,IACF;AAEA,WAAO,SAAS;AAAA,EAClB;AAMA,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,IACA;AAAA,EACF;AACF;AAEO,MAAM,YAAY,aAAa;","names":[]}
@@ -1,11 +1,12 @@
1
- import { getAiAPI } from './ai.mjs';
2
- import { getAuthAPI } from './auth.mjs';
3
- import { getDictionaryAPI } from './dictionary.mjs';
4
- import { getOrganizationAPI } from './organization.mjs';
5
- import { getProjectAPI } from './project.mjs';
6
- import { getStripeAPI } from './stripe.mjs';
7
- import { getTagAPI } from './tag.mjs';
8
- import { getUserAPI } from './user.mjs';
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;AAC/C;AAEO,MAAM,cAAc,eAAe;","names":[]}
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 '../fetcher.mjs';
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 '../fetcher.mjs';
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 '../fetcher.mjs';
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 '../fetcher.mjs';
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 '../fetcher.mjs';
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`;
@@ -1,4 +1,4 @@
1
- export * from './getIntlayerAPI/index.mjs';
2
- export * from './distantDictionary/index.mjs';
3
- export * from './fetcher.mjs';
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,12 @@
1
+ import { type IntlayerConfig } from '@intlayer/config/client';
2
+ import type { GetConfigurationResult, WriteContentDeclarationBody } from 'intlayer-editor';
3
+ import { type FetcherOptions } from '../fetcher';
4
+ export declare const getEditorAPI: (authAPIOptions?: FetcherOptions, intlayerConfig?: IntlayerConfig) => {
5
+ getConfiguration: (otherOptions?: FetcherOptions) => Promise<GetConfigurationResult>;
6
+ writeDictionary: (dictionary: WriteContentDeclarationBody, otherOptions?: FetcherOptions) => Promise<void>;
7
+ };
8
+ export declare const editorAPI: {
9
+ getConfiguration: (otherOptions?: FetcherOptions) => Promise<GetConfigurationResult>;
10
+ writeDictionary: (dictionary: WriteContentDeclarationBody, otherOptions?: FetcherOptions) => Promise<void>;
11
+ };
12
+ //# 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,EAEL,KAAK,cAAc,EACpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAEV,sBAAsB,EAEtB,2BAA2B,EAI5B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAW,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC;AAE1D,eAAO,MAAM,YAAY,oBACP,cAAc,mBACb,cAAc;sCASf,cAAc,KAC3B,OAAO,CAAC,sBAAsB,CAAC;kCAepB,2BAA2B,iBACzB,cAAc;CAiB/B,CAAC;AAEF,eAAO,MAAM,SAAS;sCApCJ,cAAc,KAC3B,OAAO,CAAC,sBAAsB,CAAC;kCAepB,2BAA2B,iBACzB,cAAc;CAmBO,CAAC"}
@@ -76,6 +76,10 @@ 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
+ getConfiguration: (otherOptions?: FetcherOptions) => Promise<GetConfigurationResult>;
81
+ writeDictionary: (dictionary: WriteContentDeclarationBody, otherOptions?: FetcherOptions) => Promise<void>;
82
+ };
79
83
  };
80
84
  export declare const intlayerAPI: {
81
85
  organization: {
@@ -153,5 +157,9 @@ export declare const intlayerAPI: {
153
157
  updateTag: (tagId: import("@intlayer/backend").UpdateTagParams["tagId"], tag: import("@intlayer/backend").UpdateTagBody, otherOptions?: FetcherOptions) => Promise<import("@intlayer/backend").UpdateTagResult>;
154
158
  deleteTag: (tagId: import("@intlayer/backend").DeleteTagParams["tagId"], otherOptions?: FetcherOptions) => Promise<import("@intlayer/backend").DeleteTagResult>;
155
159
  };
160
+ editor: {
161
+ getConfiguration: (otherOptions?: FetcherOptions) => Promise<GetConfigurationResult>;
162
+ writeDictionary: (dictionary: WriteContentDeclarationBody, otherOptions?: FetcherOptions) => Promise<void>;
163
+ };
156
164
  };
157
165
  //# 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;AAUjD,eAAO,MAAM,cAAc,oBACT,cAAc,mBACb,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAU/B,CAAC;AAEH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAmB,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.4",
3
+ "version": "4.1.0",
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.4"
60
+ "@intlayer/config": "4.1.0"
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.4",
74
+ "@intlayer/backend": "4.1.0",
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
- "@utils/ts-config-types": "1.0.4"
78
+ "@utils/ts-config-types": "1.0.4",
79
+ "intlayer-editor": "4.1.0"
79
80
  },
80
81
  "peerDependencies": {
81
- "@intlayer/config": "4.0.4"
82
+ "@intlayer/config": "4.1.0"
82
83
  },
83
84
  "engines": {
84
85
  "node": ">=14.18"