@intlayer/api 7.5.0-canary.1 → 7.5.1

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.
Files changed (32) hide show
  1. package/dist/cjs/getIntlayerAPI/ai.cjs +3 -3
  2. package/dist/cjs/getIntlayerAPI/ai.cjs.map +1 -1
  3. package/dist/cjs/getIntlayerAPI/audit.cjs +3 -3
  4. package/dist/cjs/getIntlayerAPI/audit.cjs.map +1 -1
  5. package/dist/cjs/getIntlayerAPI/dictionary.cjs +3 -3
  6. package/dist/cjs/getIntlayerAPI/dictionary.cjs.map +1 -1
  7. package/dist/cjs/getIntlayerAPI/editor.cjs +3 -3
  8. package/dist/cjs/getIntlayerAPI/editor.cjs.map +1 -1
  9. package/dist/cjs/getIntlayerAPI/newsletter.cjs +3 -3
  10. package/dist/cjs/getIntlayerAPI/newsletter.cjs.map +1 -1
  11. package/dist/cjs/getIntlayerAPI/oAuth.cjs +3 -3
  12. package/dist/cjs/getIntlayerAPI/oAuth.cjs.map +1 -1
  13. package/dist/cjs/getIntlayerAPI/organization.cjs +13 -3
  14. package/dist/cjs/getIntlayerAPI/organization.cjs.map +1 -1
  15. package/dist/cjs/getIntlayerAPI/project.cjs +3 -3
  16. package/dist/cjs/getIntlayerAPI/project.cjs.map +1 -1
  17. package/dist/cjs/getIntlayerAPI/search.cjs +3 -3
  18. package/dist/cjs/getIntlayerAPI/search.cjs.map +1 -1
  19. package/dist/cjs/getIntlayerAPI/stripe.cjs +3 -3
  20. package/dist/cjs/getIntlayerAPI/stripe.cjs.map +1 -1
  21. package/dist/cjs/getIntlayerAPI/tag.cjs +3 -3
  22. package/dist/cjs/getIntlayerAPI/tag.cjs.map +1 -1
  23. package/dist/cjs/getIntlayerAPI/user.cjs +3 -3
  24. package/dist/cjs/getIntlayerAPI/user.cjs.map +1 -1
  25. package/dist/esm/getIntlayerAPI/organization.mjs +10 -0
  26. package/dist/esm/getIntlayerAPI/organization.mjs.map +1 -1
  27. package/dist/types/getIntlayerAPI/organization.d.ts +2 -1
  28. package/dist/types/getIntlayerAPI/organization.d.ts.map +1 -1
  29. package/dist/types/index.d.ts +2 -2
  30. package/dist/types/types.d.ts +2 -2
  31. package/dist/types/types.d.ts.map +1 -1
  32. package/package.json +6 -6
@@ -1,11 +1,11 @@
1
1
  const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
2
  const require_fetcher = require('../fetcher.cjs');
3
- let __intlayer_config_built = require("@intlayer/config/built");
4
- __intlayer_config_built = require_rolldown_runtime.__toESM(__intlayer_config_built);
3
+ let _intlayer_config_built = require("@intlayer/config/built");
4
+ _intlayer_config_built = require_rolldown_runtime.__toESM(_intlayer_config_built);
5
5
 
6
6
  //#region src/getIntlayerAPI/ai.ts
7
7
  const getAiAPI = (authAPIOptions = {}, intlayerConfig) => {
8
- const backendURL = intlayerConfig?.editor?.backendURL ?? __intlayer_config_built.default?.editor?.backendURL;
8
+ const backendURL = intlayerConfig?.editor?.backendURL ?? _intlayer_config_built.default?.editor?.backendURL;
9
9
  if (!backendURL) throw new Error("Backend URL is not defined in the Intlayer configuration.");
10
10
  const AI_API_ROUTE = `${backendURL}/api/ai`;
11
11
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ai.cjs","names":["configuration","fetcher","errorMessage: string"],"sources":["../../../src/getIntlayerAPI/ai.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { type FetcherOptions, fetcher } from '../fetcher';\nimport type {\n AskDocQuestionResult,\n AuditContentDeclarationBody,\n AuditContentDeclarationFieldBody,\n AuditContentDeclarationFieldResult,\n AuditContentDeclarationMetadataBody,\n AuditContentDeclarationMetadataResult,\n AuditContentDeclarationResult,\n AuditTagBody,\n AuditTagResult,\n AutocompleteBody,\n AutocompleteResponse,\n ChatCompletionRequestMessage,\n CustomQueryBody,\n CustomQueryResult,\n GetDiscussionsParams,\n GetDiscussionsResult,\n TranslateJSONBody,\n TranslateJSONResult,\n} from '../types';\n\nexport type AskDocQuestionBody = {\n messages: ChatCompletionRequestMessage[];\n discussionId: string;\n onMessage?: (chunk: string) => void;\n onDone?: (response: AskDocQuestionResult) => void;\n};\n\nexport type { AskDocQuestionResult };\n\nexport const getAiAPI = (\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 AI_API_ROUTE = `${backendURL}/api/ai`;\n\n /**\n * Custom query\n * @param body - Custom query parameters.\n * @returns Custom query result.\n */\n const customQuery = async (\n body?: CustomQueryBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<CustomQueryResult>(\n AI_API_ROUTE,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: body,\n }\n );\n\n /**\n * Translate a JSON\n * @param body - Audit file parameters.\n * @returns Audited file content.\n */\n const translateJSON = async (\n body?: TranslateJSONBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<TranslateJSONResult>(\n `${AI_API_ROUTE}/translate/json`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: body,\n }\n );\n\n /**\n * Audits a content declaration file\n * @param body - Audit file parameters.\n * @returns Audited file content.\n */\n const auditContentDeclaration = async (\n body?: AuditContentDeclarationBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<AuditContentDeclarationResult>(\n `${AI_API_ROUTE}/audit/dictionary`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: body,\n }\n );\n\n /**\n * Audits a content declaration field\n * @param body - Audit file parameters.\n * @returns Audited file content.\n */\n const auditContentDeclarationField = async (\n body?: AuditContentDeclarationFieldBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<AuditContentDeclarationFieldResult>(\n `${AI_API_ROUTE}/audit/dictionary/field`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: body,\n }\n );\n\n /**\n * Audits a content declaration file to retrieve title, description and tags\n * @param body - Audit file parameters.\n * @returns Audited file content.\n */\n const auditContentDeclarationMetadata = async (\n body?: AuditContentDeclarationMetadataBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<AuditContentDeclarationMetadataResult>(\n `${AI_API_ROUTE}/audit/dictionary/metadata`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: body,\n }\n );\n\n /**\n * Audits a tag\n * @param body - Audit tag parameters.\n * @returns Audited tag content.\n */\n const auditTag = async (\n body?: AuditTagBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<AuditTagResult>(\n `${AI_API_ROUTE}/audit/tag`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: body,\n }\n );\n\n /**\n * Asks a question to the AI related to the documentation **and streams the\n * answer as Server‑Sent Events (SSE)**.\n *\n * The function **returns immediately** with a handle exposing:\n * - `promise` → resolves when the stream completes (or rejects on error)\n * - `abort()` → allows canceling the request on demand\n *\n * Usage example:\n * ```ts\n * const { promise, abort } = ai.askDocQuestion({\n * ...body,\n * onMessage: console.log,\n * onDone: (full) => console.log(\"✔\", full),\n * });\n * // later → abort();\n * await promise; // waits for completion if desired\n * ```\n */\n const askDocQuestion = async (\n body?: AskDocQuestionBody,\n otherOptions: FetcherOptions = {}\n ) => {\n if (!body) return;\n\n const { onMessage, onDone, ...rest } = body;\n const abortController = new AbortController();\n\n try {\n const response = await fetch(`${AI_API_ROUTE}/ask`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n ...authAPIOptions.headers,\n ...otherOptions.headers,\n },\n body: JSON.stringify({\n ...rest,\n ...authAPIOptions.body,\n ...otherOptions.body,\n }),\n signal: abortController.signal,\n credentials: 'include',\n });\n\n if (!response.ok) {\n // Align error handling with generic `fetcher` utility so that callers receive\n // meaningful messages (e.g. for 429 \"Too Many Requests\" responses).\n let errorMessage: string = 'An error occurred';\n\n try {\n // Attempt to parse JSON error payload produced by backend\n const errorData = await response.json();\n errorMessage = JSON.stringify(errorData.error) ?? 'An error occurred';\n } catch {\n // Fallback to plain-text body or HTTP status text\n try {\n const errorText = await response.text();\n if (errorText) {\n errorMessage = errorText;\n }\n } catch {\n // ignore – we already have a default message\n }\n }\n\n throw new Error(errorMessage);\n }\n\n const reader = response.body?.getReader();\n if (!reader) {\n throw new Error('No reader available');\n }\n\n const decoder = new TextDecoder();\n let buffer = '';\n\n while (true) {\n const { done, value } = await reader.read();\n if (done) break;\n\n buffer += decoder.decode(value, { stream: true });\n const lines = buffer.split('\\n');\n buffer = lines.pop() ?? '';\n\n for (const line of lines) {\n if (line.startsWith('data: ')) {\n try {\n const data = JSON.parse(line.slice(6));\n if (data.chunk) {\n onMessage?.(data.chunk);\n }\n if (data.done && data.response) {\n onDone?.(data.response);\n }\n } catch (e) {\n console.error('Failed to parse SSE data:', e);\n }\n }\n }\n }\n } catch (error) {\n console.error('Error in askDocQuestion:', error);\n throw error;\n }\n };\n\n const autocomplete = async (\n body?: AutocompleteBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<AutocompleteResponse>(\n `${AI_API_ROUTE}/autocomplete`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: body,\n }\n );\n\n /**\n * Retrieves discussions with filters and pagination. Only user or admin can access.\n */\n const getDiscussions = async (\n params?: GetDiscussionsParams,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetDiscussionsResult>(\n `${AI_API_ROUTE}/discussions`,\n authAPIOptions,\n otherOptions,\n {\n method: 'GET',\n // @ts-ignore Number of parameter will be stringified by the fetcher\n params,\n }\n );\n\n return {\n customQuery,\n translateJSON,\n auditContentDeclaration,\n auditContentDeclarationField,\n auditContentDeclarationMetadata,\n auditTag,\n askDocQuestion,\n autocomplete,\n getDiscussions,\n };\n};\n"],"mappings":";;;;;;AAiCA,MAAa,YACX,iBAAiC,EAAE,EACnC,mBACG;CACH,MAAM,aACJ,gBAAgB,QAAQ,cAAcA,iCAAe,QAAQ;AAE/D,KAAI,CAAC,WACH,OAAM,IAAI,MACR,4DACD;CAGH,MAAM,eAAe,GAAG,WAAW;;;;;;CAOnC,MAAM,cAAc,OAClB,MACA,eAA+B,EAAE,KAEjC,MAAMC,wBACJ,cACA,gBACA,cACA;EACE,QAAQ;EACF;EACP,CACF;;;;;;CAOH,MAAM,gBAAgB,OACpB,MACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,aAAa,kBAChB,gBACA,cACA;EACE,QAAQ;EACF;EACP,CACF;;;;;;CAOH,MAAM,0BAA0B,OAC9B,MACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,aAAa,oBAChB,gBACA,cACA;EACE,QAAQ;EACF;EACP,CACF;;;;;;CAOH,MAAM,+BAA+B,OACnC,MACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,aAAa,0BAChB,gBACA,cACA;EACE,QAAQ;EACF;EACP,CACF;;;;;;CAOH,MAAM,kCAAkC,OACtC,MACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,aAAa,6BAChB,gBACA,cACA;EACE,QAAQ;EACF;EACP,CACF;;;;;;CAOH,MAAM,WAAW,OACf,MACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,aAAa,aAChB,gBACA,cACA;EACE,QAAQ;EACF;EACP,CACF;;;;;;;;;;;;;;;;;;;;CAqBH,MAAM,iBAAiB,OACrB,MACA,eAA+B,EAAE,KAC9B;AACH,MAAI,CAAC,KAAM;EAEX,MAAM,EAAE,WAAW,QAAQ,GAAG,SAAS;EACvC,MAAM,kBAAkB,IAAI,iBAAiB;AAE7C,MAAI;GACF,MAAM,WAAW,MAAM,MAAM,GAAG,aAAa,OAAO;IAClD,QAAQ;IACR,SAAS;KACP,gBAAgB;KAChB,GAAG,eAAe;KAClB,GAAG,aAAa;KACjB;IACD,MAAM,KAAK,UAAU;KACnB,GAAG;KACH,GAAG,eAAe;KAClB,GAAG,aAAa;KACjB,CAAC;IACF,QAAQ,gBAAgB;IACxB,aAAa;IACd,CAAC;AAEF,OAAI,CAAC,SAAS,IAAI;IAGhB,IAAIC,eAAuB;AAE3B,QAAI;KAEF,MAAM,YAAY,MAAM,SAAS,MAAM;AACvC,oBAAe,KAAK,UAAU,UAAU,MAAM,IAAI;YAC5C;AAEN,SAAI;MACF,MAAM,YAAY,MAAM,SAAS,MAAM;AACvC,UAAI,UACF,gBAAe;aAEX;;AAKV,UAAM,IAAI,MAAM,aAAa;;GAG/B,MAAM,SAAS,SAAS,MAAM,WAAW;AACzC,OAAI,CAAC,OACH,OAAM,IAAI,MAAM,sBAAsB;GAGxC,MAAM,UAAU,IAAI,aAAa;GACjC,IAAI,SAAS;AAEb,UAAO,MAAM;IACX,MAAM,EAAE,MAAM,UAAU,MAAM,OAAO,MAAM;AAC3C,QAAI,KAAM;AAEV,cAAU,QAAQ,OAAO,OAAO,EAAE,QAAQ,MAAM,CAAC;IACjD,MAAM,QAAQ,OAAO,MAAM,KAAK;AAChC,aAAS,MAAM,KAAK,IAAI;AAExB,SAAK,MAAM,QAAQ,MACjB,KAAI,KAAK,WAAW,SAAS,CAC3B,KAAI;KACF,MAAM,OAAO,KAAK,MAAM,KAAK,MAAM,EAAE,CAAC;AACtC,SAAI,KAAK,MACP,aAAY,KAAK,MAAM;AAEzB,SAAI,KAAK,QAAQ,KAAK,SACpB,UAAS,KAAK,SAAS;aAElB,GAAG;AACV,aAAQ,MAAM,6BAA6B,EAAE;;;WAK9C,OAAO;AACd,WAAQ,MAAM,4BAA4B,MAAM;AAChD,SAAM;;;CAIV,MAAM,eAAe,OACnB,MACA,eAA+B,EAAE,KAEjC,MAAMD,wBACJ,GAAG,aAAa,gBAChB,gBACA,cACA;EACE,QAAQ;EACF;EACP,CACF;;;;CAKH,MAAM,iBAAiB,OACrB,QACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,aAAa,eAChB,gBACA,cACA;EACE,QAAQ;EAER;EACD,CACF;AAEH,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD"}
1
+ {"version":3,"file":"ai.cjs","names":["configuration","fetcher","errorMessage: string"],"sources":["../../../src/getIntlayerAPI/ai.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { type FetcherOptions, fetcher } from '../fetcher';\nimport type {\n AskDocQuestionResult,\n AuditContentDeclarationBody,\n AuditContentDeclarationFieldBody,\n AuditContentDeclarationFieldResult,\n AuditContentDeclarationMetadataBody,\n AuditContentDeclarationMetadataResult,\n AuditContentDeclarationResult,\n AuditTagBody,\n AuditTagResult,\n AutocompleteBody,\n AutocompleteResponse,\n ChatCompletionRequestMessage,\n CustomQueryBody,\n CustomQueryResult,\n GetDiscussionsParams,\n GetDiscussionsResult,\n TranslateJSONBody,\n TranslateJSONResult,\n} from '../types';\n\nexport type AskDocQuestionBody = {\n messages: ChatCompletionRequestMessage[];\n discussionId: string;\n onMessage?: (chunk: string) => void;\n onDone?: (response: AskDocQuestionResult) => void;\n};\n\nexport type { AskDocQuestionResult };\n\nexport const getAiAPI = (\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 AI_API_ROUTE = `${backendURL}/api/ai`;\n\n /**\n * Custom query\n * @param body - Custom query parameters.\n * @returns Custom query result.\n */\n const customQuery = async (\n body?: CustomQueryBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<CustomQueryResult>(\n AI_API_ROUTE,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: body,\n }\n );\n\n /**\n * Translate a JSON\n * @param body - Audit file parameters.\n * @returns Audited file content.\n */\n const translateJSON = async (\n body?: TranslateJSONBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<TranslateJSONResult>(\n `${AI_API_ROUTE}/translate/json`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: body,\n }\n );\n\n /**\n * Audits a content declaration file\n * @param body - Audit file parameters.\n * @returns Audited file content.\n */\n const auditContentDeclaration = async (\n body?: AuditContentDeclarationBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<AuditContentDeclarationResult>(\n `${AI_API_ROUTE}/audit/dictionary`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: body,\n }\n );\n\n /**\n * Audits a content declaration field\n * @param body - Audit file parameters.\n * @returns Audited file content.\n */\n const auditContentDeclarationField = async (\n body?: AuditContentDeclarationFieldBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<AuditContentDeclarationFieldResult>(\n `${AI_API_ROUTE}/audit/dictionary/field`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: body,\n }\n );\n\n /**\n * Audits a content declaration file to retrieve title, description and tags\n * @param body - Audit file parameters.\n * @returns Audited file content.\n */\n const auditContentDeclarationMetadata = async (\n body?: AuditContentDeclarationMetadataBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<AuditContentDeclarationMetadataResult>(\n `${AI_API_ROUTE}/audit/dictionary/metadata`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: body,\n }\n );\n\n /**\n * Audits a tag\n * @param body - Audit tag parameters.\n * @returns Audited tag content.\n */\n const auditTag = async (\n body?: AuditTagBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<AuditTagResult>(\n `${AI_API_ROUTE}/audit/tag`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: body,\n }\n );\n\n /**\n * Asks a question to the AI related to the documentation **and streams the\n * answer as Server‑Sent Events (SSE)**.\n *\n * The function **returns immediately** with a handle exposing:\n * - `promise` → resolves when the stream completes (or rejects on error)\n * - `abort()` → allows canceling the request on demand\n *\n * Usage example:\n * ```ts\n * const { promise, abort } = ai.askDocQuestion({\n * ...body,\n * onMessage: console.log,\n * onDone: (full) => console.log(\"✔\", full),\n * });\n * // later → abort();\n * await promise; // waits for completion if desired\n * ```\n */\n const askDocQuestion = async (\n body?: AskDocQuestionBody,\n otherOptions: FetcherOptions = {}\n ) => {\n if (!body) return;\n\n const { onMessage, onDone, ...rest } = body;\n const abortController = new AbortController();\n\n try {\n const response = await fetch(`${AI_API_ROUTE}/ask`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n ...authAPIOptions.headers,\n ...otherOptions.headers,\n },\n body: JSON.stringify({\n ...rest,\n ...authAPIOptions.body,\n ...otherOptions.body,\n }),\n signal: abortController.signal,\n credentials: 'include',\n });\n\n if (!response.ok) {\n // Align error handling with generic `fetcher` utility so that callers receive\n // meaningful messages (e.g. for 429 \"Too Many Requests\" responses).\n let errorMessage: string = 'An error occurred';\n\n try {\n // Attempt to parse JSON error payload produced by backend\n const errorData = await response.json();\n errorMessage = JSON.stringify(errorData.error) ?? 'An error occurred';\n } catch {\n // Fallback to plain-text body or HTTP status text\n try {\n const errorText = await response.text();\n if (errorText) {\n errorMessage = errorText;\n }\n } catch {\n // ignore – we already have a default message\n }\n }\n\n throw new Error(errorMessage);\n }\n\n const reader = response.body?.getReader();\n if (!reader) {\n throw new Error('No reader available');\n }\n\n const decoder = new TextDecoder();\n let buffer = '';\n\n while (true) {\n const { done, value } = await reader.read();\n if (done) break;\n\n buffer += decoder.decode(value, { stream: true });\n const lines = buffer.split('\\n');\n buffer = lines.pop() ?? '';\n\n for (const line of lines) {\n if (line.startsWith('data: ')) {\n try {\n const data = JSON.parse(line.slice(6));\n if (data.chunk) {\n onMessage?.(data.chunk);\n }\n if (data.done && data.response) {\n onDone?.(data.response);\n }\n } catch (e) {\n console.error('Failed to parse SSE data:', e);\n }\n }\n }\n }\n } catch (error) {\n console.error('Error in askDocQuestion:', error);\n throw error;\n }\n };\n\n const autocomplete = async (\n body?: AutocompleteBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<AutocompleteResponse>(\n `${AI_API_ROUTE}/autocomplete`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: body,\n }\n );\n\n /**\n * Retrieves discussions with filters and pagination. Only user or admin can access.\n */\n const getDiscussions = async (\n params?: GetDiscussionsParams,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetDiscussionsResult>(\n `${AI_API_ROUTE}/discussions`,\n authAPIOptions,\n otherOptions,\n {\n method: 'GET',\n // @ts-ignore Number of parameter will be stringified by the fetcher\n params,\n }\n );\n\n return {\n customQuery,\n translateJSON,\n auditContentDeclaration,\n auditContentDeclarationField,\n auditContentDeclarationMetadata,\n auditTag,\n askDocQuestion,\n autocomplete,\n getDiscussions,\n };\n};\n"],"mappings":";;;;;;AAiCA,MAAa,YACX,iBAAiC,EAAE,EACnC,mBACG;CACH,MAAM,aACJ,gBAAgB,QAAQ,cAAcA,gCAAe,QAAQ;AAE/D,KAAI,CAAC,WACH,OAAM,IAAI,MACR,4DACD;CAGH,MAAM,eAAe,GAAG,WAAW;;;;;;CAOnC,MAAM,cAAc,OAClB,MACA,eAA+B,EAAE,KAEjC,MAAMC,wBACJ,cACA,gBACA,cACA;EACE,QAAQ;EACF;EACP,CACF;;;;;;CAOH,MAAM,gBAAgB,OACpB,MACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,aAAa,kBAChB,gBACA,cACA;EACE,QAAQ;EACF;EACP,CACF;;;;;;CAOH,MAAM,0BAA0B,OAC9B,MACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,aAAa,oBAChB,gBACA,cACA;EACE,QAAQ;EACF;EACP,CACF;;;;;;CAOH,MAAM,+BAA+B,OACnC,MACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,aAAa,0BAChB,gBACA,cACA;EACE,QAAQ;EACF;EACP,CACF;;;;;;CAOH,MAAM,kCAAkC,OACtC,MACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,aAAa,6BAChB,gBACA,cACA;EACE,QAAQ;EACF;EACP,CACF;;;;;;CAOH,MAAM,WAAW,OACf,MACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,aAAa,aAChB,gBACA,cACA;EACE,QAAQ;EACF;EACP,CACF;;;;;;;;;;;;;;;;;;;;CAqBH,MAAM,iBAAiB,OACrB,MACA,eAA+B,EAAE,KAC9B;AACH,MAAI,CAAC,KAAM;EAEX,MAAM,EAAE,WAAW,QAAQ,GAAG,SAAS;EACvC,MAAM,kBAAkB,IAAI,iBAAiB;AAE7C,MAAI;GACF,MAAM,WAAW,MAAM,MAAM,GAAG,aAAa,OAAO;IAClD,QAAQ;IACR,SAAS;KACP,gBAAgB;KAChB,GAAG,eAAe;KAClB,GAAG,aAAa;KACjB;IACD,MAAM,KAAK,UAAU;KACnB,GAAG;KACH,GAAG,eAAe;KAClB,GAAG,aAAa;KACjB,CAAC;IACF,QAAQ,gBAAgB;IACxB,aAAa;IACd,CAAC;AAEF,OAAI,CAAC,SAAS,IAAI;IAGhB,IAAIC,eAAuB;AAE3B,QAAI;KAEF,MAAM,YAAY,MAAM,SAAS,MAAM;AACvC,oBAAe,KAAK,UAAU,UAAU,MAAM,IAAI;YAC5C;AAEN,SAAI;MACF,MAAM,YAAY,MAAM,SAAS,MAAM;AACvC,UAAI,UACF,gBAAe;aAEX;;AAKV,UAAM,IAAI,MAAM,aAAa;;GAG/B,MAAM,SAAS,SAAS,MAAM,WAAW;AACzC,OAAI,CAAC,OACH,OAAM,IAAI,MAAM,sBAAsB;GAGxC,MAAM,UAAU,IAAI,aAAa;GACjC,IAAI,SAAS;AAEb,UAAO,MAAM;IACX,MAAM,EAAE,MAAM,UAAU,MAAM,OAAO,MAAM;AAC3C,QAAI,KAAM;AAEV,cAAU,QAAQ,OAAO,OAAO,EAAE,QAAQ,MAAM,CAAC;IACjD,MAAM,QAAQ,OAAO,MAAM,KAAK;AAChC,aAAS,MAAM,KAAK,IAAI;AAExB,SAAK,MAAM,QAAQ,MACjB,KAAI,KAAK,WAAW,SAAS,CAC3B,KAAI;KACF,MAAM,OAAO,KAAK,MAAM,KAAK,MAAM,EAAE,CAAC;AACtC,SAAI,KAAK,MACP,aAAY,KAAK,MAAM;AAEzB,SAAI,KAAK,QAAQ,KAAK,SACpB,UAAS,KAAK,SAAS;aAElB,GAAG;AACV,aAAQ,MAAM,6BAA6B,EAAE;;;WAK9C,OAAO;AACd,WAAQ,MAAM,4BAA4B,MAAM;AAChD,SAAM;;;CAIV,MAAM,eAAe,OACnB,MACA,eAA+B,EAAE,KAEjC,MAAMD,wBACJ,GAAG,aAAa,gBAChB,gBACA,cACA;EACE,QAAQ;EACF;EACP,CACF;;;;CAKH,MAAM,iBAAiB,OACrB,QACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,aAAa,eAChB,gBACA,cACA;EACE,QAAQ;EAER;EACD,CACF;AAEH,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD"}
@@ -1,11 +1,11 @@
1
1
  const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
2
  const require_fetcher = require('../fetcher.cjs');
3
- let __intlayer_config_built = require("@intlayer/config/built");
4
- __intlayer_config_built = require_rolldown_runtime.__toESM(__intlayer_config_built);
3
+ let _intlayer_config_built = require("@intlayer/config/built");
4
+ _intlayer_config_built = require_rolldown_runtime.__toESM(_intlayer_config_built);
5
5
 
6
6
  //#region src/getIntlayerAPI/audit.ts
7
7
  const getAuditAPI = (authAPIOptions = {}, intlayerConfig) => {
8
- const backendURL = intlayerConfig?.editor?.backendURL ?? __intlayer_config_built.default?.editor?.backendURL;
8
+ const backendURL = intlayerConfig?.editor?.backendURL ?? _intlayer_config_built.default?.editor?.backendURL;
9
9
  if (!backendURL) throw new Error("Backend URL is not defined in the Intlayer configuration.");
10
10
  const AUDIT_API_ROUTE = `${backendURL}/api/audit`;
11
11
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"audit.cjs","names":["configuration","fetcher"],"sources":["../../../src/getIntlayerAPI/audit.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { type FetcherOptions, fetcher } from '../fetcher';\nimport type {\n CreateAuditBody,\n CreateAuditResult,\n GetAuditByIdParams,\n GetAuditByIdResult,\n GetAuditsParams,\n GetAuditsResult,\n} from '../types';\n\nexport const getAuditAPI = (\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 AUDIT_API_ROUTE = `${backendURL}/api/audit`;\n\n /**\n * Creates a new audit in the database.\n * @param audit - Audit data.\n */\n const createAudit = async (\n audit: CreateAuditBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<CreateAuditResult>(\n `${AUDIT_API_ROUTE}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: audit,\n }\n );\n\n /**\n * Retrieves audits for the current user or project.\n * @param params - Query parameters (page, pageSize).\n */\n const getAudits = async (\n params?: GetAuditsParams,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetAuditsResult>(\n AUDIT_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,\n }\n );\n\n /**\n * Retrieves an audit by its ID.\n * @param auditId - Audit ID.\n */\n const getAuditById = async (\n auditId: GetAuditByIdParams['auditId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetAuditByIdResult>(\n `${AUDIT_API_ROUTE}/${String(auditId)}`,\n authAPIOptions,\n otherOptions,\n {\n cache: 'no-store',\n }\n );\n\n return {\n createAudit,\n getAudits,\n getAuditById,\n };\n};\n"],"mappings":";;;;;;AAYA,MAAa,eACX,iBAAiC,EAAE,EACnC,mBACG;CACH,MAAM,aACJ,gBAAgB,QAAQ,cAAcA,iCAAe,QAAQ;AAE/D,KAAI,CAAC,WACH,OAAM,IAAI,MACR,4DACD;CAGH,MAAM,kBAAkB,GAAG,WAAW;;;;;CAMtC,MAAM,cAAc,OAClB,OACA,eAA+B,EAAE,KAEjC,MAAMC,wBACJ,GAAG,mBACH,gBACA,cACA;EACE,QAAQ;EACR,MAAM;EACP,CACF;;;;;CAMH,MAAM,YAAY,OAChB,QACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,iBACA,gBACA,cACA;EACE,OAAO;EAEP;EACD,CACF;;;;;CAMH,MAAM,eAAe,OACnB,SACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,gBAAgB,GAAG,OAAO,QAAQ,IACrC,gBACA,cACA,EACE,OAAO,YACR,CACF;AAEH,QAAO;EACL;EACA;EACA;EACD"}
1
+ {"version":3,"file":"audit.cjs","names":["configuration","fetcher"],"sources":["../../../src/getIntlayerAPI/audit.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { type FetcherOptions, fetcher } from '../fetcher';\nimport type {\n CreateAuditBody,\n CreateAuditResult,\n GetAuditByIdParams,\n GetAuditByIdResult,\n GetAuditsParams,\n GetAuditsResult,\n} from '../types';\n\nexport const getAuditAPI = (\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 AUDIT_API_ROUTE = `${backendURL}/api/audit`;\n\n /**\n * Creates a new audit in the database.\n * @param audit - Audit data.\n */\n const createAudit = async (\n audit: CreateAuditBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<CreateAuditResult>(\n `${AUDIT_API_ROUTE}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: audit,\n }\n );\n\n /**\n * Retrieves audits for the current user or project.\n * @param params - Query parameters (page, pageSize).\n */\n const getAudits = async (\n params?: GetAuditsParams,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetAuditsResult>(\n AUDIT_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,\n }\n );\n\n /**\n * Retrieves an audit by its ID.\n * @param auditId - Audit ID.\n */\n const getAuditById = async (\n auditId: GetAuditByIdParams['auditId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetAuditByIdResult>(\n `${AUDIT_API_ROUTE}/${String(auditId)}`,\n authAPIOptions,\n otherOptions,\n {\n cache: 'no-store',\n }\n );\n\n return {\n createAudit,\n getAudits,\n getAuditById,\n };\n};\n"],"mappings":";;;;;;AAYA,MAAa,eACX,iBAAiC,EAAE,EACnC,mBACG;CACH,MAAM,aACJ,gBAAgB,QAAQ,cAAcA,gCAAe,QAAQ;AAE/D,KAAI,CAAC,WACH,OAAM,IAAI,MACR,4DACD;CAGH,MAAM,kBAAkB,GAAG,WAAW;;;;;CAMtC,MAAM,cAAc,OAClB,OACA,eAA+B,EAAE,KAEjC,MAAMC,wBACJ,GAAG,mBACH,gBACA,cACA;EACE,QAAQ;EACR,MAAM;EACP,CACF;;;;;CAMH,MAAM,YAAY,OAChB,QACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,iBACA,gBACA,cACA;EACE,OAAO;EAEP;EACD,CACF;;;;;CAMH,MAAM,eAAe,OACnB,SACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,gBAAgB,GAAG,OAAO,QAAQ,IACrC,gBACA,cACA,EACE,OAAO,YACR,CACF;AAEH,QAAO;EACL;EACA;EACA;EACD"}
@@ -1,11 +1,11 @@
1
1
  const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
2
  const require_fetcher = require('../fetcher.cjs');
3
- let __intlayer_config_built = require("@intlayer/config/built");
4
- __intlayer_config_built = require_rolldown_runtime.__toESM(__intlayer_config_built);
3
+ let _intlayer_config_built = require("@intlayer/config/built");
4
+ _intlayer_config_built = require_rolldown_runtime.__toESM(_intlayer_config_built);
5
5
 
6
6
  //#region src/getIntlayerAPI/dictionary.ts
7
7
  const getDictionaryAPI = (authAPIOptions = {}, intlayerConfig) => {
8
- const backendURL = intlayerConfig?.editor?.backendURL ?? __intlayer_config_built.default?.editor?.backendURL;
8
+ const backendURL = intlayerConfig?.editor?.backendURL ?? _intlayer_config_built.default?.editor?.backendURL;
9
9
  if (!backendURL) throw new Error("Backend URL is not defined in the Intlayer configuration.");
10
10
  const PROJECT_API_ROUTE = `${backendURL}/api/dictionary`;
11
11
  /**
@@ -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":";;;;;;AAqBA,MAAa,oBACX,iBAAiC,EAAE,EACnC,mBACG;CACH,MAAM,aACJ,gBAAgB,QAAQ,cAAcA,iCAAe,QAAQ;AAE/D,KAAI,CAAC,WACH,OAAM,IAAI,MACR,4DACD;CAGH,MAAM,oBAAoB,GAAG,WAAW;;;;;CAMxC,MAAM,kBAAkB,OACtB,SACA,eAA+B,EAAE,KAEjC,MAAMC,wBACJ,mBACA,gBACA,cACA;EACE,OAAO;EAEP,QAAQ;EACT,CACF;;;;CAKH,MAAM,sBAAsB,OAAO,eAA+B,EAAE,KAClE,MAAMA,wBACJ,GAAG,kBAAkB,QACrB,gBACA,cACA,EACE,OAAO,YACR,CACF;;;;CAKH,MAAM,iCAAiC,OACrC,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,kBAAkB,UACrB,gBACA,cACA,EACE,OAAO,YACR,CACF;;;;;;CAOH,MAAM,gBAAgB,OACpB,eACA,SACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,kBAAkB,GAAG,iBACxB,gBACA,cACA,EACE,QAAQ,UAAU,EAAE,SAAS,QAAQ,UAAU,EAAE,GAAG,QACrD,CACF;;;;;CAMH,MAAM,gBAAgB,OACpB,MACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,qBACH,gBACA,cACA;EACE,QAAQ;EACR;EACD,CACF;CAEH,MAAM,mBAAmB,OACvB,cACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,qBACH,gBACA,cACA;EACE,QAAQ;EACR,MAAM,EAAE,cAAc;EACvB,CACF;;;;;CAMH,MAAM,mBAAmB,OACvB,YACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,kBAAkB,GAAG,WAAW,MACnC,gBACA,cACA;EACE,QAAQ;EACR,MAAM;EACP,CACF;;;;;CAMH,MAAM,mBAAmB,OACvB,IACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,kBAAkB,GAAG,MACxB,gBACA,cACA,EACE,QAAQ,UACT,CACF;AAEH,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD"}
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":";;;;;;AAqBA,MAAa,oBACX,iBAAiC,EAAE,EACnC,mBACG;CACH,MAAM,aACJ,gBAAgB,QAAQ,cAAcA,gCAAe,QAAQ;AAE/D,KAAI,CAAC,WACH,OAAM,IAAI,MACR,4DACD;CAGH,MAAM,oBAAoB,GAAG,WAAW;;;;;CAMxC,MAAM,kBAAkB,OACtB,SACA,eAA+B,EAAE,KAEjC,MAAMC,wBACJ,mBACA,gBACA,cACA;EACE,OAAO;EAEP,QAAQ;EACT,CACF;;;;CAKH,MAAM,sBAAsB,OAAO,eAA+B,EAAE,KAClE,MAAMA,wBACJ,GAAG,kBAAkB,QACrB,gBACA,cACA,EACE,OAAO,YACR,CACF;;;;CAKH,MAAM,iCAAiC,OACrC,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,kBAAkB,UACrB,gBACA,cACA,EACE,OAAO,YACR,CACF;;;;;;CAOH,MAAM,gBAAgB,OACpB,eACA,SACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,kBAAkB,GAAG,iBACxB,gBACA,cACA,EACE,QAAQ,UAAU,EAAE,SAAS,QAAQ,UAAU,EAAE,GAAG,QACrD,CACF;;;;;CAMH,MAAM,gBAAgB,OACpB,MACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,qBACH,gBACA,cACA;EACE,QAAQ;EACR;EACD,CACF;CAEH,MAAM,mBAAmB,OACvB,cACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,qBACH,gBACA,cACA;EACE,QAAQ;EACR,MAAM,EAAE,cAAc;EACvB,CACF;;;;;CAMH,MAAM,mBAAmB,OACvB,YACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,kBAAkB,GAAG,WAAW,MACnC,gBACA,cACA;EACE,QAAQ;EACR,MAAM;EACP,CACF;;;;;CAMH,MAAM,mBAAmB,OACvB,IACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,kBAAkB,GAAG,MACxB,gBACA,cACA,EACE,QAAQ,UACT,CACF;AAEH,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD"}
@@ -1,11 +1,11 @@
1
1
  const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
2
  const require_fetcher = require('../fetcher.cjs');
3
- let __intlayer_config_built = require("@intlayer/config/built");
4
- __intlayer_config_built = require_rolldown_runtime.__toESM(__intlayer_config_built);
3
+ let _intlayer_config_built = require("@intlayer/config/built");
4
+ _intlayer_config_built = require_rolldown_runtime.__toESM(_intlayer_config_built);
5
5
 
6
6
  //#region src/getIntlayerAPI/editor.ts
7
7
  const getEditorAPI = (authAPIOptions = {}, intlayerConfig) => {
8
- const editorURL = intlayerConfig?.editor?.editorURL ?? __intlayer_config_built.default?.editor?.editorURL;
8
+ const editorURL = intlayerConfig?.editor?.editorURL ?? _intlayer_config_built.default?.editor?.editorURL;
9
9
  if (!editorURL) throw new Error("Editor URL is not defined in the Intlayer configuration.");
10
10
  const EDITOR_API_ROUTE = `${editorURL}/api`;
11
11
  /**
@@ -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":";;;;;;AAUA,MAAa,gBACX,iBAAiC,EAAE,EACnC,mBACG;CACH,MAAM,YACJ,gBAAgB,QAAQ,aAAaA,iCAAe,QAAQ;AAE9D,KAAI,CAAC,UACH,OAAM,IAAI,MAAM,2DAA2D;CAG7E,MAAM,mBAAmB,GAAG,UAAU;;;;CAKtC,MAAM,mBAAmB,OACvB,eAA+B,EAAE,KACG;AAOpC,UANiB,MAAMC,wBACrB,GAAG,iBAAiB,UACpB,gBACA,aACD,EAEe;;;;;CAMlB,MAAM,kBAAkB,OACtB,eAA+B,EAAE,KACQ;AAOzC,UANiB,MAAMA,wBACrB,GAAG,iBAAiB,cACpB,gBACA,aACD,EAEe;;;;;;CAOlB,MAAM,kBAAkB,OACtB,MACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,iBAAiB,cACpB,gBACA,cACA;EACE,QAAQ;EACR;EACD,CACF;AAEH,QAAO;EACL;EACA;EACA;EACD"}
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":";;;;;;AAUA,MAAa,gBACX,iBAAiC,EAAE,EACnC,mBACG;CACH,MAAM,YACJ,gBAAgB,QAAQ,aAAaA,gCAAe,QAAQ;AAE9D,KAAI,CAAC,UACH,OAAM,IAAI,MAAM,2DAA2D;CAG7E,MAAM,mBAAmB,GAAG,UAAU;;;;CAKtC,MAAM,mBAAmB,OACvB,eAA+B,EAAE,KACG;AAOpC,UANiB,MAAMC,wBACrB,GAAG,iBAAiB,UACpB,gBACA,aACD,EAEe;;;;;CAMlB,MAAM,kBAAkB,OACtB,eAA+B,EAAE,KACQ;AAOzC,UANiB,MAAMA,wBACrB,GAAG,iBAAiB,cACpB,gBACA,aACD,EAEe;;;;;;CAOlB,MAAM,kBAAkB,OACtB,MACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,iBAAiB,cACpB,gBACA,cACA;EACE,QAAQ;EACR;EACD,CACF;AAEH,QAAO;EACL;EACA;EACA;EACD"}
@@ -1,11 +1,11 @@
1
1
  const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
2
  const require_fetcher = require('../fetcher.cjs');
3
- let __intlayer_config_built = require("@intlayer/config/built");
4
- __intlayer_config_built = require_rolldown_runtime.__toESM(__intlayer_config_built);
3
+ let _intlayer_config_built = require("@intlayer/config/built");
4
+ _intlayer_config_built = require_rolldown_runtime.__toESM(_intlayer_config_built);
5
5
 
6
6
  //#region src/getIntlayerAPI/newsletter.ts
7
7
  const getNewsletterAPI = (authAPIOptions = {}, intlayerConfig) => {
8
- const backendURL = intlayerConfig?.editor?.backendURL ?? __intlayer_config_built.default?.editor?.backendURL;
8
+ const backendURL = intlayerConfig?.editor?.backendURL ?? _intlayer_config_built.default?.editor?.backendURL;
9
9
  if (!backendURL) throw new Error("Backend URL is not defined in the Intlayer configuration.");
10
10
  const NEWSLETTER_API_ROUTE = `${backendURL}/api/newsletter`;
11
11
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"newsletter.cjs","names":["configuration","fetcher"],"sources":["../../../src/getIntlayerAPI/newsletter.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { type FetcherOptions, fetcher } from '../fetcher';\nimport type {\n NewsletterSubscriptionBody,\n NewsletterSubscriptionResult,\n NewsletterUnsubscriptionBody,\n} from '../types';\n\nexport const getNewsletterAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const backendURL =\n intlayerConfig?.editor?.backendURL ?? configuration?.editor?.backendURL;\n\n if (!backendURL) {\n throw new Error(\n 'Backend URL is not defined in the Intlayer configuration.'\n );\n }\n\n const NEWSLETTER_API_ROUTE = `${backendURL}/api/newsletter`;\n\n /**\n * Subscribe a user to newsletter(s)\n * @param body - Newsletter subscription parameters.\n * @returns Newsletter subscription result.\n */\n const subscribeToNewsletter = async (\n body: NewsletterSubscriptionBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<NewsletterSubscriptionResult>(\n `${NEWSLETTER_API_ROUTE}/subscribe`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: body,\n }\n );\n\n /**\n * Unsubscribe a user from newsletter(s)\n * @param body - Newsletter unsubscription parameters.\n * @returns Newsletter unsubscription result.\n */\n const unsubscribeFromNewsletter = async (\n body: NewsletterUnsubscriptionBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<NewsletterSubscriptionResult>(\n `${NEWSLETTER_API_ROUTE}/unsubscribe`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: body,\n }\n );\n\n /**\n * Get newsletter subscription status for the authenticated user\n * @returns Newsletter subscription status.\n */\n const getNewsletterStatus = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<NewsletterSubscriptionResult>(\n `${NEWSLETTER_API_ROUTE}/status`,\n authAPIOptions,\n otherOptions,\n {\n method: 'GET',\n }\n );\n\n return {\n subscribeToNewsletter,\n unsubscribeFromNewsletter,\n getNewsletterStatus,\n };\n};\n"],"mappings":";;;;;;AASA,MAAa,oBACX,iBAAiC,EAAE,EACnC,mBACG;CACH,MAAM,aACJ,gBAAgB,QAAQ,cAAcA,iCAAe,QAAQ;AAE/D,KAAI,CAAC,WACH,OAAM,IAAI,MACR,4DACD;CAGH,MAAM,uBAAuB,GAAG,WAAW;;;;;;CAO3C,MAAM,wBAAwB,OAC5B,MACA,eAA+B,EAAE,KAEjC,MAAMC,wBACJ,GAAG,qBAAqB,aACxB,gBACA,cACA;EACE,QAAQ;EACF;EACP,CACF;;;;;;CAOH,MAAM,4BAA4B,OAChC,MACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,qBAAqB,eACxB,gBACA,cACA;EACE,QAAQ;EACF;EACP,CACF;;;;;CAMH,MAAM,sBAAsB,OAAO,eAA+B,EAAE,KAClE,MAAMA,wBACJ,GAAG,qBAAqB,UACxB,gBACA,cACA,EACE,QAAQ,OACT,CACF;AAEH,QAAO;EACL;EACA;EACA;EACD"}
1
+ {"version":3,"file":"newsletter.cjs","names":["configuration","fetcher"],"sources":["../../../src/getIntlayerAPI/newsletter.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { type FetcherOptions, fetcher } from '../fetcher';\nimport type {\n NewsletterSubscriptionBody,\n NewsletterSubscriptionResult,\n NewsletterUnsubscriptionBody,\n} from '../types';\n\nexport const getNewsletterAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const backendURL =\n intlayerConfig?.editor?.backendURL ?? configuration?.editor?.backendURL;\n\n if (!backendURL) {\n throw new Error(\n 'Backend URL is not defined in the Intlayer configuration.'\n );\n }\n\n const NEWSLETTER_API_ROUTE = `${backendURL}/api/newsletter`;\n\n /**\n * Subscribe a user to newsletter(s)\n * @param body - Newsletter subscription parameters.\n * @returns Newsletter subscription result.\n */\n const subscribeToNewsletter = async (\n body: NewsletterSubscriptionBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<NewsletterSubscriptionResult>(\n `${NEWSLETTER_API_ROUTE}/subscribe`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: body,\n }\n );\n\n /**\n * Unsubscribe a user from newsletter(s)\n * @param body - Newsletter unsubscription parameters.\n * @returns Newsletter unsubscription result.\n */\n const unsubscribeFromNewsletter = async (\n body: NewsletterUnsubscriptionBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<NewsletterSubscriptionResult>(\n `${NEWSLETTER_API_ROUTE}/unsubscribe`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: body,\n }\n );\n\n /**\n * Get newsletter subscription status for the authenticated user\n * @returns Newsletter subscription status.\n */\n const getNewsletterStatus = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<NewsletterSubscriptionResult>(\n `${NEWSLETTER_API_ROUTE}/status`,\n authAPIOptions,\n otherOptions,\n {\n method: 'GET',\n }\n );\n\n return {\n subscribeToNewsletter,\n unsubscribeFromNewsletter,\n getNewsletterStatus,\n };\n};\n"],"mappings":";;;;;;AASA,MAAa,oBACX,iBAAiC,EAAE,EACnC,mBACG;CACH,MAAM,aACJ,gBAAgB,QAAQ,cAAcA,gCAAe,QAAQ;AAE/D,KAAI,CAAC,WACH,OAAM,IAAI,MACR,4DACD;CAGH,MAAM,uBAAuB,GAAG,WAAW;;;;;;CAO3C,MAAM,wBAAwB,OAC5B,MACA,eAA+B,EAAE,KAEjC,MAAMC,wBACJ,GAAG,qBAAqB,aACxB,gBACA,cACA;EACE,QAAQ;EACF;EACP,CACF;;;;;;CAOH,MAAM,4BAA4B,OAChC,MACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,qBAAqB,eACxB,gBACA,cACA;EACE,QAAQ;EACF;EACP,CACF;;;;;CAMH,MAAM,sBAAsB,OAAO,eAA+B,EAAE,KAClE,MAAMA,wBACJ,GAAG,qBAAqB,UACxB,gBACA,cACA,EACE,QAAQ,OACT,CACF;AAEH,QAAO;EACL;EACA;EACA;EACD"}
@@ -1,11 +1,11 @@
1
1
  const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
2
  const require_fetcher = require('../fetcher.cjs');
3
- let __intlayer_config_built = require("@intlayer/config/built");
4
- __intlayer_config_built = require_rolldown_runtime.__toESM(__intlayer_config_built);
3
+ let _intlayer_config_built = require("@intlayer/config/built");
4
+ _intlayer_config_built = require_rolldown_runtime.__toESM(_intlayer_config_built);
5
5
 
6
6
  //#region src/getIntlayerAPI/oAuth.ts
7
7
  const getOAuthAPI = (intlayerConfig) => {
8
- const backendURL = intlayerConfig?.editor?.backendURL ?? __intlayer_config_built.default?.editor?.backendURL;
8
+ const backendURL = intlayerConfig?.editor?.backendURL ?? _intlayer_config_built.default?.editor?.backendURL;
9
9
  const { clientId, clientSecret } = intlayerConfig?.editor ?? {};
10
10
  if (!backendURL) throw new Error("Backend URL is not defined in the Intlayer configuration.");
11
11
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"oAuth.cjs","names":["configuration","fetcher"],"sources":["../../../src/getIntlayerAPI/oAuth.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { type FetcherOptions, fetcher } from '../fetcher';\nimport type { GetOAuth2TokenBody, GetOAuth2TokenResult } from '../types';\n\nexport const getOAuthAPI = (intlayerConfig?: IntlayerConfig) => {\n const backendURL =\n intlayerConfig?.editor?.backendURL ?? configuration?.editor?.backendURL;\n const { clientId, clientSecret } = intlayerConfig?.editor ?? {};\n\n if (!backendURL) {\n throw new Error(\n 'Backend URL is not defined in the Intlayer configuration.'\n );\n }\n\n /**\n * Gets an oAuth2 accessToken\n * @return The token information\n */\n const getOAuth2AccessToken = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetOAuth2TokenResult>(\n `${backendURL}/oauth2/token`,\n {},\n otherOptions,\n {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n },\n body: {\n grant_type: 'client_credentials',\n client_id: clientId!,\n client_secret: clientSecret!,\n } satisfies GetOAuth2TokenBody,\n }\n );\n\n return {\n getOAuth2AccessToken,\n };\n};\n"],"mappings":";;;;;;AAKA,MAAa,eAAe,mBAAoC;CAC9D,MAAM,aACJ,gBAAgB,QAAQ,cAAcA,iCAAe,QAAQ;CAC/D,MAAM,EAAE,UAAU,iBAAiB,gBAAgB,UAAU,EAAE;AAE/D,KAAI,CAAC,WACH,OAAM,IAAI,MACR,4DACD;;;;;CAOH,MAAM,uBAAuB,OAAO,eAA+B,EAAE,KACnE,MAAMC,wBACJ,GAAG,WAAW,gBACd,EAAE,EACF,cACA;EACE,QAAQ;EACR,SAAS,EACP,gBAAgB,qCACjB;EACD,MAAM;GACJ,YAAY;GACZ,WAAW;GACX,eAAe;GAChB;EACF,CACF;AAEH,QAAO,EACL,sBACD"}
1
+ {"version":3,"file":"oAuth.cjs","names":["configuration","fetcher"],"sources":["../../../src/getIntlayerAPI/oAuth.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { type FetcherOptions, fetcher } from '../fetcher';\nimport type { GetOAuth2TokenBody, GetOAuth2TokenResult } from '../types';\n\nexport const getOAuthAPI = (intlayerConfig?: IntlayerConfig) => {\n const backendURL =\n intlayerConfig?.editor?.backendURL ?? configuration?.editor?.backendURL;\n const { clientId, clientSecret } = intlayerConfig?.editor ?? {};\n\n if (!backendURL) {\n throw new Error(\n 'Backend URL is not defined in the Intlayer configuration.'\n );\n }\n\n /**\n * Gets an oAuth2 accessToken\n * @return The token information\n */\n const getOAuth2AccessToken = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetOAuth2TokenResult>(\n `${backendURL}/oauth2/token`,\n {},\n otherOptions,\n {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n },\n body: {\n grant_type: 'client_credentials',\n client_id: clientId!,\n client_secret: clientSecret!,\n } satisfies GetOAuth2TokenBody,\n }\n );\n\n return {\n getOAuth2AccessToken,\n };\n};\n"],"mappings":";;;;;;AAKA,MAAa,eAAe,mBAAoC;CAC9D,MAAM,aACJ,gBAAgB,QAAQ,cAAcA,gCAAe,QAAQ;CAC/D,MAAM,EAAE,UAAU,iBAAiB,gBAAgB,UAAU,EAAE;AAE/D,KAAI,CAAC,WACH,OAAM,IAAI,MACR,4DACD;;;;;CAOH,MAAM,uBAAuB,OAAO,eAA+B,EAAE,KACnE,MAAMC,wBACJ,GAAG,WAAW,gBACd,EAAE,EACF,cACA;EACE,QAAQ;EACR,SAAS,EACP,gBAAgB,qCACjB;EACD,MAAM;GACJ,YAAY;GACZ,WAAW;GACX,eAAe;GAChB;EACF,CACF;AAEH,QAAO,EACL,sBACD"}
@@ -1,11 +1,11 @@
1
1
  const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
2
  const require_fetcher = require('../fetcher.cjs');
3
- let __intlayer_config_built = require("@intlayer/config/built");
4
- __intlayer_config_built = require_rolldown_runtime.__toESM(__intlayer_config_built);
3
+ let _intlayer_config_built = require("@intlayer/config/built");
4
+ _intlayer_config_built = require_rolldown_runtime.__toESM(_intlayer_config_built);
5
5
 
6
6
  //#region src/getIntlayerAPI/organization.ts
7
7
  const getOrganizationAPI = (authAPIOptions = {}, intlayerConfig) => {
8
- const backendURL = intlayerConfig?.editor?.backendURL ?? __intlayer_config_built.default?.editor?.backendURL;
8
+ const backendURL = intlayerConfig?.editor?.backendURL ?? _intlayer_config_built.default?.editor?.backendURL;
9
9
  if (!backendURL) throw new Error("Backend URL is not defined in the Intlayer configuration--.");
10
10
  const ORGANIZATION_API_ROUTE = `${backendURL}/api/organization`;
11
11
  /**
@@ -77,7 +77,17 @@ const getOrganizationAPI = (authAPIOptions = {}, intlayerConfig) => {
77
77
  * @param organizationId - Organization ID.
78
78
  */
79
79
  const unselectOrganization = async (otherOptions = {}) => await require_fetcher.fetcher(`${ORGANIZATION_API_ROUTE}/logout`, authAPIOptions, otherOptions, { method: "POST" });
80
+ /**
81
+ * Retrieves the SSO configuration for an organization by email domain.
82
+ * This endpoint is public.
83
+ * @param body - The body containing the email.
84
+ */
85
+ const getOrganizationSSOConfig = async (body, otherOptions = {}) => await require_fetcher.fetcher(`${ORGANIZATION_API_ROUTE}/sso`, authAPIOptions, otherOptions, {
86
+ method: "POST",
87
+ body
88
+ });
80
89
  return {
90
+ getOrganizationSSOConfig,
81
91
  getOrganizations,
82
92
  getOrganization,
83
93
  addOrganization,
@@ -1 +1 @@
1
- {"version":3,"file":"organization.cjs","names":["configuration","fetcher"],"sources":["../../../src/getIntlayerAPI/organization.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { type FetcherOptions, fetcher } from '../fetcher';\nimport type {\n AddOrganizationBody,\n AddOrganizationMemberBody,\n AddOrganizationMemberResult,\n AddOrganizationResult,\n DeleteOrganizationResult,\n GetOrganizationParam,\n GetOrganizationResult,\n GetOrganizationsParams,\n GetOrganizationsResult,\n SelectOrganizationParam,\n SelectOrganizationResult,\n UnselectOrganizationResult,\n UpdateOrganizationBody,\n UpdateOrganizationMembersBody,\n UpdateOrganizationMembersResult,\n UpdateOrganizationResult,\n} from '../types';\n\nexport const getOrganizationAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const backendURL =\n intlayerConfig?.editor?.backendURL ?? configuration?.editor?.backendURL;\n\n if (!backendURL) {\n throw new Error(\n 'Backend URL is not defined in the Intlayer configuration--.'\n );\n }\n\n const ORGANIZATION_API_ROUTE = `${backendURL}/api/organization`;\n\n /**\n * Retrieves a list of organizations based on filters and pagination.\n * @param filters - Filters and pagination options.\n */\n const getOrganizations = async (\n filters?: GetOrganizationsParams,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetOrganizationsResult>(\n ORGANIZATION_API_ROUTE,\n authAPIOptions,\n otherOptions,\n {\n cache: 'no-store',\n // @ts-ignore Number of parameter will be stringified by the fetcher\n params: filters,\n }\n );\n\n /**\n * Retrieves an organization by its ID.\n * @param organizationId - Organization ID.\n */\n const getOrganization = async (\n organizationId: GetOrganizationParam['organizationId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetOrganizationResult>(\n `${ORGANIZATION_API_ROUTE}/${String(organizationId)}`,\n authAPIOptions,\n otherOptions\n );\n\n /**\n * Adds a new organization to the database.\n * @param organization - Organization data.\n */\n const addOrganization = async (\n organization: AddOrganizationBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<AddOrganizationResult>(\n ORGANIZATION_API_ROUTE,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: organization,\n }\n );\n\n /**\n * Updates an existing organization in the database.\n * @param organization - Updated organization data.\n */\n const updateOrganization = async (\n organization: UpdateOrganizationBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<UpdateOrganizationResult>(\n ORGANIZATION_API_ROUTE,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body: organization,\n }\n );\n\n /**\n * Update members to the organization in the database.\n * @param body - Updated organization members data.\n */\n const updateOrganizationMembers = async (\n body: UpdateOrganizationMembersBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<UpdateOrganizationMembersResult>(\n `${ORGANIZATION_API_ROUTE}/members`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body,\n }\n );\n\n /**\n * Admin-only: Update members of any organization by ID\n * @param organizationId - Organization ID\n * @param body - Updated organization members data.\n */\n const updateOrganizationMembersById = async (\n organizationId: string,\n body: UpdateOrganizationMembersBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<UpdateOrganizationMembersResult>(\n `${ORGANIZATION_API_ROUTE}/${organizationId}/members`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body,\n }\n );\n\n /**\n * Add member to the organization in the database.\n * @param body - Updated organization members data.\n */\n const addOrganizationMember = async (\n body: AddOrganizationMemberBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<AddOrganizationMemberResult>(\n `${ORGANIZATION_API_ROUTE}/member`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body,\n }\n );\n\n /**\n * Deletes an organization from the database by its ID.\n * @param organizationId - Organization ID.\n */\n const deleteOrganization = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<DeleteOrganizationResult>(\n ORGANIZATION_API_ROUTE,\n authAPIOptions,\n otherOptions,\n {\n method: 'DELETE',\n }\n );\n\n /**\n * Select an organization from the database by its ID.\n * @param organizationId - Organization ID.\n */\n const selectOrganization = async (\n organizationId: SelectOrganizationParam['organizationId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<SelectOrganizationResult>(\n `${ORGANIZATION_API_ROUTE}/${String(organizationId)}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n }\n );\n\n /**\n * Unselect an organization from the database by its ID.\n * @param organizationId - Organization ID.\n */\n const unselectOrganization = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<UnselectOrganizationResult>(\n `${ORGANIZATION_API_ROUTE}/logout`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n }\n );\n\n return {\n getOrganizations,\n getOrganization,\n addOrganization,\n addOrganizationMember,\n updateOrganization,\n updateOrganizationMembers,\n updateOrganizationMembersById,\n deleteOrganization,\n selectOrganization,\n unselectOrganization,\n };\n};\n"],"mappings":";;;;;;AAsBA,MAAa,sBACX,iBAAiC,EAAE,EACnC,mBACG;CACH,MAAM,aACJ,gBAAgB,QAAQ,cAAcA,iCAAe,QAAQ;AAE/D,KAAI,CAAC,WACH,OAAM,IAAI,MACR,8DACD;CAGH,MAAM,yBAAyB,GAAG,WAAW;;;;;CAM7C,MAAM,mBAAmB,OACvB,SACA,eAA+B,EAAE,KAEjC,MAAMC,wBACJ,wBACA,gBACA,cACA;EACE,OAAO;EAEP,QAAQ;EACT,CACF;;;;;CAMH,MAAM,kBAAkB,OACtB,gBACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,uBAAuB,GAAG,OAAO,eAAe,IACnD,gBACA,aACD;;;;;CAMH,MAAM,kBAAkB,OACtB,cACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,wBACA,gBACA,cACA;EACE,QAAQ;EACR,MAAM;EACP,CACF;;;;;CAMH,MAAM,qBAAqB,OACzB,cACA,eAA+B,EAAE,KAEjCA,wBACE,wBACA,gBACA,cACA;EACE,QAAQ;EACR,MAAM;EACP,CACF;;;;;CAMH,MAAM,4BAA4B,OAChC,MACA,eAA+B,EAAE,KAEjCA,wBACE,GAAG,uBAAuB,WAC1B,gBACA,cACA;EACE,QAAQ;EACR;EACD,CACF;;;;;;CAOH,MAAM,gCAAgC,OACpC,gBACA,MACA,eAA+B,EAAE,KAEjCA,wBACE,GAAG,uBAAuB,GAAG,eAAe,WAC5C,gBACA,cACA;EACE,QAAQ;EACR;EACD,CACF;;;;;CAMH,MAAM,wBAAwB,OAC5B,MACA,eAA+B,EAAE,KAEjCA,wBACE,GAAG,uBAAuB,UAC1B,gBACA,cACA;EACE,QAAQ;EACR;EACD,CACF;;;;;CAMH,MAAM,qBAAqB,OAAO,eAA+B,EAAE,KACjE,MAAMA,wBACJ,wBACA,gBACA,cACA,EACE,QAAQ,UACT,CACF;;;;;CAMH,MAAM,qBAAqB,OACzB,gBACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,uBAAuB,GAAG,OAAO,eAAe,IACnD,gBACA,cACA,EACE,QAAQ,OACT,CACF;;;;;CAMH,MAAM,uBAAuB,OAAO,eAA+B,EAAE,KACnE,MAAMA,wBACJ,GAAG,uBAAuB,UAC1B,gBACA,cACA,EACE,QAAQ,QACT,CACF;AAEH,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD"}
1
+ {"version":3,"file":"organization.cjs","names":["configuration","fetcher"],"sources":["../../../src/getIntlayerAPI/organization.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { type FetcherOptions, fetcher } from '../fetcher';\nimport type {\n AddOrganizationBody,\n AddOrganizationMemberBody,\n AddOrganizationMemberResult,\n AddOrganizationResult,\n DeleteOrganizationResult,\n GetOrganizationParam,\n GetOrganizationResult,\n GetOrganizationSSOConfigBody,\n GetOrganizationSSOConfigResult,\n GetOrganizationsParams,\n GetOrganizationsResult,\n SelectOrganizationParam,\n SelectOrganizationResult,\n UnselectOrganizationResult,\n UpdateOrganizationBody,\n UpdateOrganizationMembersBody,\n UpdateOrganizationMembersResult,\n UpdateOrganizationResult,\n} from '../types';\n\nexport const getOrganizationAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const backendURL =\n intlayerConfig?.editor?.backendURL ?? configuration?.editor?.backendURL;\n\n if (!backendURL) {\n throw new Error(\n 'Backend URL is not defined in the Intlayer configuration--.'\n );\n }\n\n const ORGANIZATION_API_ROUTE = `${backendURL}/api/organization`;\n\n /**\n * Retrieves a list of organizations based on filters and pagination.\n * @param filters - Filters and pagination options.\n */\n const getOrganizations = async (\n filters?: GetOrganizationsParams,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetOrganizationsResult>(\n ORGANIZATION_API_ROUTE,\n authAPIOptions,\n otherOptions,\n {\n cache: 'no-store',\n // @ts-ignore Number of parameter will be stringified by the fetcher\n params: filters,\n }\n );\n\n /**\n * Retrieves an organization by its ID.\n * @param organizationId - Organization ID.\n */\n const getOrganization = async (\n organizationId: GetOrganizationParam['organizationId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetOrganizationResult>(\n `${ORGANIZATION_API_ROUTE}/${String(organizationId)}`,\n authAPIOptions,\n otherOptions\n );\n\n /**\n * Adds a new organization to the database.\n * @param organization - Organization data.\n */\n const addOrganization = async (\n organization: AddOrganizationBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<AddOrganizationResult>(\n ORGANIZATION_API_ROUTE,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: organization,\n }\n );\n\n /**\n * Updates an existing organization in the database.\n * @param organization - Updated organization data.\n */\n const updateOrganization = async (\n organization: UpdateOrganizationBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<UpdateOrganizationResult>(\n ORGANIZATION_API_ROUTE,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body: organization,\n }\n );\n\n /**\n * Update members to the organization in the database.\n * @param body - Updated organization members data.\n */\n const updateOrganizationMembers = async (\n body: UpdateOrganizationMembersBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<UpdateOrganizationMembersResult>(\n `${ORGANIZATION_API_ROUTE}/members`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body,\n }\n );\n\n /**\n * Admin-only: Update members of any organization by ID\n * @param organizationId - Organization ID\n * @param body - Updated organization members data.\n */\n const updateOrganizationMembersById = async (\n organizationId: string,\n body: UpdateOrganizationMembersBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<UpdateOrganizationMembersResult>(\n `${ORGANIZATION_API_ROUTE}/${organizationId}/members`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body,\n }\n );\n\n /**\n * Add member to the organization in the database.\n * @param body - Updated organization members data.\n */\n const addOrganizationMember = async (\n body: AddOrganizationMemberBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<AddOrganizationMemberResult>(\n `${ORGANIZATION_API_ROUTE}/member`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body,\n }\n );\n\n /**\n * Deletes an organization from the database by its ID.\n * @param organizationId - Organization ID.\n */\n const deleteOrganization = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<DeleteOrganizationResult>(\n ORGANIZATION_API_ROUTE,\n authAPIOptions,\n otherOptions,\n {\n method: 'DELETE',\n }\n );\n\n /**\n * Select an organization from the database by its ID.\n * @param organizationId - Organization ID.\n */\n const selectOrganization = async (\n organizationId: SelectOrganizationParam['organizationId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<SelectOrganizationResult>(\n `${ORGANIZATION_API_ROUTE}/${String(organizationId)}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n }\n );\n\n /**\n * Unselect an organization from the database by its ID.\n * @param organizationId - Organization ID.\n */\n const unselectOrganization = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<UnselectOrganizationResult>(\n `${ORGANIZATION_API_ROUTE}/logout`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n }\n );\n\n /**\n * Retrieves the SSO configuration for an organization by email domain.\n * This endpoint is public.\n * @param body - The body containing the email.\n */\n const getOrganizationSSOConfig = async (\n body: GetOrganizationSSOConfigBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetOrganizationSSOConfigResult>(\n `${ORGANIZATION_API_ROUTE}/sso`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body,\n }\n );\n\n return {\n getOrganizationSSOConfig,\n getOrganizations,\n getOrganization,\n addOrganization,\n addOrganizationMember,\n updateOrganization,\n updateOrganizationMembers,\n updateOrganizationMembersById,\n deleteOrganization,\n selectOrganization,\n unselectOrganization,\n };\n};\n"],"mappings":";;;;;;AAwBA,MAAa,sBACX,iBAAiC,EAAE,EACnC,mBACG;CACH,MAAM,aACJ,gBAAgB,QAAQ,cAAcA,gCAAe,QAAQ;AAE/D,KAAI,CAAC,WACH,OAAM,IAAI,MACR,8DACD;CAGH,MAAM,yBAAyB,GAAG,WAAW;;;;;CAM7C,MAAM,mBAAmB,OACvB,SACA,eAA+B,EAAE,KAEjC,MAAMC,wBACJ,wBACA,gBACA,cACA;EACE,OAAO;EAEP,QAAQ;EACT,CACF;;;;;CAMH,MAAM,kBAAkB,OACtB,gBACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,uBAAuB,GAAG,OAAO,eAAe,IACnD,gBACA,aACD;;;;;CAMH,MAAM,kBAAkB,OACtB,cACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,wBACA,gBACA,cACA;EACE,QAAQ;EACR,MAAM;EACP,CACF;;;;;CAMH,MAAM,qBAAqB,OACzB,cACA,eAA+B,EAAE,KAEjCA,wBACE,wBACA,gBACA,cACA;EACE,QAAQ;EACR,MAAM;EACP,CACF;;;;;CAMH,MAAM,4BAA4B,OAChC,MACA,eAA+B,EAAE,KAEjCA,wBACE,GAAG,uBAAuB,WAC1B,gBACA,cACA;EACE,QAAQ;EACR;EACD,CACF;;;;;;CAOH,MAAM,gCAAgC,OACpC,gBACA,MACA,eAA+B,EAAE,KAEjCA,wBACE,GAAG,uBAAuB,GAAG,eAAe,WAC5C,gBACA,cACA;EACE,QAAQ;EACR;EACD,CACF;;;;;CAMH,MAAM,wBAAwB,OAC5B,MACA,eAA+B,EAAE,KAEjCA,wBACE,GAAG,uBAAuB,UAC1B,gBACA,cACA;EACE,QAAQ;EACR;EACD,CACF;;;;;CAMH,MAAM,qBAAqB,OAAO,eAA+B,EAAE,KACjE,MAAMA,wBACJ,wBACA,gBACA,cACA,EACE,QAAQ,UACT,CACF;;;;;CAMH,MAAM,qBAAqB,OACzB,gBACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,uBAAuB,GAAG,OAAO,eAAe,IACnD,gBACA,cACA,EACE,QAAQ,OACT,CACF;;;;;CAMH,MAAM,uBAAuB,OAAO,eAA+B,EAAE,KACnE,MAAMA,wBACJ,GAAG,uBAAuB,UAC1B,gBACA,cACA,EACE,QAAQ,QACT,CACF;;;;;;CAOH,MAAM,2BAA2B,OAC/B,MACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,uBAAuB,OAC1B,gBACA,cACA;EACE,QAAQ;EACR;EACD,CACF;AAEH,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD"}
@@ -1,11 +1,11 @@
1
1
  const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
2
  const require_fetcher = require('../fetcher.cjs');
3
- let __intlayer_config_built = require("@intlayer/config/built");
4
- __intlayer_config_built = require_rolldown_runtime.__toESM(__intlayer_config_built);
3
+ let _intlayer_config_built = require("@intlayer/config/built");
4
+ _intlayer_config_built = require_rolldown_runtime.__toESM(_intlayer_config_built);
5
5
 
6
6
  //#region src/getIntlayerAPI/project.ts
7
7
  const getProjectAPI = (authAPIOptions = {}, intlayerConfig) => {
8
- const backendURL = intlayerConfig?.editor?.backendURL ?? __intlayer_config_built.default?.editor?.backendURL;
8
+ const backendURL = intlayerConfig?.editor?.backendURL ?? _intlayer_config_built.default?.editor?.backendURL;
9
9
  if (!backendURL) throw new Error("Backend URL is not defined in the Intlayer configuration.");
10
10
  const PROJECT_API_ROUTE = `${backendURL}/api/project`;
11
11
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"project.cjs","names":["configuration","fetcher"],"sources":["../../../src/getIntlayerAPI/project.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { type FetcherOptions, fetcher } from '../fetcher';\nimport type {\n AddNewAccessKeyBody,\n AddNewAccessKeyResponse,\n AddProjectBody,\n AddProjectResult,\n DeleteAccessKeyBody,\n DeleteAccessKeyResponse,\n DeleteProjectResult,\n GetProjectsParams,\n GetProjectsResult,\n PushProjectConfigurationBody,\n PushProjectConfigurationResult,\n RefreshAccessKeyBody,\n RefreshAccessKeyResponse,\n SelectProjectParam,\n SelectProjectResult,\n UnselectProjectResult,\n UpdateProjectBody,\n UpdateProjectMembersBody,\n UpdateProjectMembersResult,\n UpdateProjectResult,\n} from '../types';\n\nexport const getProjectAPI = (\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/project`;\n\n /**\n * Retrieves a list of projects based on filters and pagination.\n * @param filters - Filters and pagination options.\n */\n const getProjects = async (\n filters?: GetProjectsParams,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetProjectsResult>(\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 * Adds a new project to the database.\n * @param project - Project data.\n */\n const addProject = async (\n project: AddProjectBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<AddProjectResult>(\n `${PROJECT_API_ROUTE}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: project,\n }\n );\n\n /**\n * Updates an existing project in the database.\n * @param project - Updated project data.\n */\n const updateProject = async (\n project: UpdateProjectBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<UpdateProjectResult>(\n `${PROJECT_API_ROUTE}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body: project,\n }\n );\n\n /**\n * Updates project members in the database.\n * @param project - Updated project data.\n */\n const updateProjectMembers = async (\n body: UpdateProjectMembersBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<UpdateProjectMembersResult>(\n `${PROJECT_API_ROUTE}/members`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body,\n }\n );\n\n /** Pushes a project configuration to the database.\n * @param projectConfiguration - Project configuration data.\n */\n const pushProjectConfiguration = async (\n projectConfiguration: PushProjectConfigurationBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<PushProjectConfigurationResult>(\n `${PROJECT_API_ROUTE}/configuration`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body: projectConfiguration,\n }\n );\n\n /**\n * Deletes a project from the database by its ID.\n * @param id - Project ID.\n */\n const deleteProject = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<DeleteProjectResult>(\n `${PROJECT_API_ROUTE}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'DELETE',\n }\n );\n\n /**\n * Select a project from the database by its ID.\n * @param projectId - Organization ID.\n */\n const selectProject = async (\n projectId: SelectProjectParam['projectId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<SelectProjectResult>(\n `${PROJECT_API_ROUTE}/${String(projectId)}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n }\n );\n\n /**\n * Unselect a project from the database by its ID.\n * @param projectId - Project ID.\n */\n const unselectProject = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<UnselectProjectResult>(\n `${PROJECT_API_ROUTE}/logout`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n }\n );\n\n /**\n * Add a new access key to a project.\n * @param accessKey - Access key data.\n * @param otherOptions - Fetcher options.\n * @returns The new access key.\n */\n const addNewAccessKey = async (\n accessKey: AddNewAccessKeyBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<AddNewAccessKeyResponse>(\n `${PROJECT_API_ROUTE}/access_key`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: accessKey,\n }\n );\n\n /**\n * Delete a project access key.\n * @param clientId - Access key client ID.\n * @param otherOptions - Fetcher options.\n * @returns The deleted project.\n */\n const deleteAccessKey = async (\n clientId: DeleteAccessKeyBody['clientId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<DeleteAccessKeyResponse>(\n `${PROJECT_API_ROUTE}/access_key`,\n authAPIOptions,\n otherOptions,\n {\n method: 'DELETE',\n body: { clientId },\n }\n );\n\n /**\n * Refreshes an access key from a project.\n * @param clientId - The ID of the client to refresh.\n * @param projectId - The ID of the project to refresh the access key from.\n * @returns The new access key.\n */\n const refreshAccessKey = async (\n clientId: RefreshAccessKeyBody['clientId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<RefreshAccessKeyResponse>(\n `${PROJECT_API_ROUTE}/access_key`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PATCH',\n body: { clientId },\n }\n );\n\n return {\n getProjects,\n addProject,\n updateProject,\n updateProjectMembers,\n pushProjectConfiguration,\n deleteProject,\n selectProject,\n unselectProject,\n addNewAccessKey,\n deleteAccessKey,\n refreshAccessKey,\n };\n};\n"],"mappings":";;;;;;AA0BA,MAAa,iBACX,iBAAiC,EAAE,EACnC,mBACG;CACH,MAAM,aACJ,gBAAgB,QAAQ,cAAcA,iCAAe,QAAQ;AAE/D,KAAI,CAAC,WACH,OAAM,IAAI,MACR,4DACD;CAGH,MAAM,oBAAoB,GAAG,WAAW;;;;;CAMxC,MAAM,cAAc,OAClB,SACA,eAA+B,EAAE,KAEjC,MAAMC,wBACJ,mBACA,gBACA,cACA;EACE,OAAO;EAEP,QAAQ;EACT,CACF;;;;;CAMH,MAAM,aAAa,OACjB,SACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,qBACH,gBACA,cACA;EACE,QAAQ;EACR,MAAM;EACP,CACF;;;;;CAMH,MAAM,gBAAgB,OACpB,SACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,qBACH,gBACA,cACA;EACE,QAAQ;EACR,MAAM;EACP,CACF;;;;;CAMH,MAAM,uBAAuB,OAC3B,MACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,kBAAkB,WACrB,gBACA,cACA;EACE,QAAQ;EACR;EACD,CACF;;;;CAKH,MAAM,2BAA2B,OAC/B,sBACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,kBAAkB,iBACrB,gBACA,cACA;EACE,QAAQ;EACR,MAAM;EACP,CACF;;;;;CAMH,MAAM,gBAAgB,OAAO,eAA+B,EAAE,KAC5D,MAAMA,wBACJ,GAAG,qBACH,gBACA,cACA,EACE,QAAQ,UACT,CACF;;;;;CAMH,MAAM,gBAAgB,OACpB,WACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,kBAAkB,GAAG,OAAO,UAAU,IACzC,gBACA,cACA,EACE,QAAQ,OACT,CACF;;;;;CAMH,MAAM,kBAAkB,OAAO,eAA+B,EAAE,KAC9D,MAAMA,wBACJ,GAAG,kBAAkB,UACrB,gBACA,cACA,EACE,QAAQ,QACT,CACF;;;;;;;CAQH,MAAM,kBAAkB,OACtB,WACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,kBAAkB,cACrB,gBACA,cACA;EACE,QAAQ;EACR,MAAM;EACP,CACF;;;;;;;CAQH,MAAM,kBAAkB,OACtB,UACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,kBAAkB,cACrB,gBACA,cACA;EACE,QAAQ;EACR,MAAM,EAAE,UAAU;EACnB,CACF;;;;;;;CAQH,MAAM,mBAAmB,OACvB,UACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,kBAAkB,cACrB,gBACA,cACA;EACE,QAAQ;EACR,MAAM,EAAE,UAAU;EACnB,CACF;AAEH,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD"}
1
+ {"version":3,"file":"project.cjs","names":["configuration","fetcher"],"sources":["../../../src/getIntlayerAPI/project.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { type FetcherOptions, fetcher } from '../fetcher';\nimport type {\n AddNewAccessKeyBody,\n AddNewAccessKeyResponse,\n AddProjectBody,\n AddProjectResult,\n DeleteAccessKeyBody,\n DeleteAccessKeyResponse,\n DeleteProjectResult,\n GetProjectsParams,\n GetProjectsResult,\n PushProjectConfigurationBody,\n PushProjectConfigurationResult,\n RefreshAccessKeyBody,\n RefreshAccessKeyResponse,\n SelectProjectParam,\n SelectProjectResult,\n UnselectProjectResult,\n UpdateProjectBody,\n UpdateProjectMembersBody,\n UpdateProjectMembersResult,\n UpdateProjectResult,\n} from '../types';\n\nexport const getProjectAPI = (\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/project`;\n\n /**\n * Retrieves a list of projects based on filters and pagination.\n * @param filters - Filters and pagination options.\n */\n const getProjects = async (\n filters?: GetProjectsParams,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetProjectsResult>(\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 * Adds a new project to the database.\n * @param project - Project data.\n */\n const addProject = async (\n project: AddProjectBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<AddProjectResult>(\n `${PROJECT_API_ROUTE}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: project,\n }\n );\n\n /**\n * Updates an existing project in the database.\n * @param project - Updated project data.\n */\n const updateProject = async (\n project: UpdateProjectBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<UpdateProjectResult>(\n `${PROJECT_API_ROUTE}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body: project,\n }\n );\n\n /**\n * Updates project members in the database.\n * @param project - Updated project data.\n */\n const updateProjectMembers = async (\n body: UpdateProjectMembersBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<UpdateProjectMembersResult>(\n `${PROJECT_API_ROUTE}/members`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body,\n }\n );\n\n /** Pushes a project configuration to the database.\n * @param projectConfiguration - Project configuration data.\n */\n const pushProjectConfiguration = async (\n projectConfiguration: PushProjectConfigurationBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<PushProjectConfigurationResult>(\n `${PROJECT_API_ROUTE}/configuration`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body: projectConfiguration,\n }\n );\n\n /**\n * Deletes a project from the database by its ID.\n * @param id - Project ID.\n */\n const deleteProject = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<DeleteProjectResult>(\n `${PROJECT_API_ROUTE}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'DELETE',\n }\n );\n\n /**\n * Select a project from the database by its ID.\n * @param projectId - Organization ID.\n */\n const selectProject = async (\n projectId: SelectProjectParam['projectId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<SelectProjectResult>(\n `${PROJECT_API_ROUTE}/${String(projectId)}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n }\n );\n\n /**\n * Unselect a project from the database by its ID.\n * @param projectId - Project ID.\n */\n const unselectProject = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<UnselectProjectResult>(\n `${PROJECT_API_ROUTE}/logout`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n }\n );\n\n /**\n * Add a new access key to a project.\n * @param accessKey - Access key data.\n * @param otherOptions - Fetcher options.\n * @returns The new access key.\n */\n const addNewAccessKey = async (\n accessKey: AddNewAccessKeyBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<AddNewAccessKeyResponse>(\n `${PROJECT_API_ROUTE}/access_key`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: accessKey,\n }\n );\n\n /**\n * Delete a project access key.\n * @param clientId - Access key client ID.\n * @param otherOptions - Fetcher options.\n * @returns The deleted project.\n */\n const deleteAccessKey = async (\n clientId: DeleteAccessKeyBody['clientId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<DeleteAccessKeyResponse>(\n `${PROJECT_API_ROUTE}/access_key`,\n authAPIOptions,\n otherOptions,\n {\n method: 'DELETE',\n body: { clientId },\n }\n );\n\n /**\n * Refreshes an access key from a project.\n * @param clientId - The ID of the client to refresh.\n * @param projectId - The ID of the project to refresh the access key from.\n * @returns The new access key.\n */\n const refreshAccessKey = async (\n clientId: RefreshAccessKeyBody['clientId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<RefreshAccessKeyResponse>(\n `${PROJECT_API_ROUTE}/access_key`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PATCH',\n body: { clientId },\n }\n );\n\n return {\n getProjects,\n addProject,\n updateProject,\n updateProjectMembers,\n pushProjectConfiguration,\n deleteProject,\n selectProject,\n unselectProject,\n addNewAccessKey,\n deleteAccessKey,\n refreshAccessKey,\n };\n};\n"],"mappings":";;;;;;AA0BA,MAAa,iBACX,iBAAiC,EAAE,EACnC,mBACG;CACH,MAAM,aACJ,gBAAgB,QAAQ,cAAcA,gCAAe,QAAQ;AAE/D,KAAI,CAAC,WACH,OAAM,IAAI,MACR,4DACD;CAGH,MAAM,oBAAoB,GAAG,WAAW;;;;;CAMxC,MAAM,cAAc,OAClB,SACA,eAA+B,EAAE,KAEjC,MAAMC,wBACJ,mBACA,gBACA,cACA;EACE,OAAO;EAEP,QAAQ;EACT,CACF;;;;;CAMH,MAAM,aAAa,OACjB,SACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,qBACH,gBACA,cACA;EACE,QAAQ;EACR,MAAM;EACP,CACF;;;;;CAMH,MAAM,gBAAgB,OACpB,SACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,qBACH,gBACA,cACA;EACE,QAAQ;EACR,MAAM;EACP,CACF;;;;;CAMH,MAAM,uBAAuB,OAC3B,MACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,kBAAkB,WACrB,gBACA,cACA;EACE,QAAQ;EACR;EACD,CACF;;;;CAKH,MAAM,2BAA2B,OAC/B,sBACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,kBAAkB,iBACrB,gBACA,cACA;EACE,QAAQ;EACR,MAAM;EACP,CACF;;;;;CAMH,MAAM,gBAAgB,OAAO,eAA+B,EAAE,KAC5D,MAAMA,wBACJ,GAAG,qBACH,gBACA,cACA,EACE,QAAQ,UACT,CACF;;;;;CAMH,MAAM,gBAAgB,OACpB,WACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,kBAAkB,GAAG,OAAO,UAAU,IACzC,gBACA,cACA,EACE,QAAQ,OACT,CACF;;;;;CAMH,MAAM,kBAAkB,OAAO,eAA+B,EAAE,KAC9D,MAAMA,wBACJ,GAAG,kBAAkB,UACrB,gBACA,cACA,EACE,QAAQ,QACT,CACF;;;;;;;CAQH,MAAM,kBAAkB,OACtB,WACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,kBAAkB,cACrB,gBACA,cACA;EACE,QAAQ;EACR,MAAM;EACP,CACF;;;;;;;CAQH,MAAM,kBAAkB,OACtB,UACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,kBAAkB,cACrB,gBACA,cACA;EACE,QAAQ;EACR,MAAM,EAAE,UAAU;EACnB,CACF;;;;;;;CAQH,MAAM,mBAAmB,OACvB,UACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,kBAAkB,cACrB,gBACA,cACA;EACE,QAAQ;EACR,MAAM,EAAE,UAAU;EACnB,CACF;AAEH,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD"}
@@ -1,11 +1,11 @@
1
1
  const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
2
  const require_fetcher = require('../fetcher.cjs');
3
- let __intlayer_config_built = require("@intlayer/config/built");
4
- __intlayer_config_built = require_rolldown_runtime.__toESM(__intlayer_config_built);
3
+ let _intlayer_config_built = require("@intlayer/config/built");
4
+ _intlayer_config_built = require_rolldown_runtime.__toESM(_intlayer_config_built);
5
5
 
6
6
  //#region src/getIntlayerAPI/search.ts
7
7
  const getSearchAPI = (authAPIOptions = {}, intlayerConfig) => {
8
- const backendURL = intlayerConfig?.editor?.backendURL ?? __intlayer_config_built.default?.editor?.backendURL;
8
+ const backendURL = intlayerConfig?.editor?.backendURL ?? _intlayer_config_built.default?.editor?.backendURL;
9
9
  if (!backendURL) throw new Error("Backend URL is not defined in the Intlayer configuration.");
10
10
  const AI_API_ROUTE = `${backendURL}/api/search`;
11
11
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"search.cjs","names":["configuration","fetcher"],"sources":["../../../src/getIntlayerAPI/search.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { type FetcherOptions, fetcher } from '../fetcher';\nimport type { SearchDocUtilParams, SearchDocUtilResult } from '../types';\n\nexport const getSearchAPI = (\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 AI_API_ROUTE = `${backendURL}/api/search`;\n\n /**\n * Search documentation\n * @param params - Search parameters containing the input query.\n * @returns Search results with GitHub URLs.\n */\n const searchDoc = async (\n params?: SearchDocUtilParams,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<SearchDocUtilResult>(\n `${AI_API_ROUTE}/doc`,\n authAPIOptions,\n otherOptions,\n {\n method: 'GET',\n params: params,\n }\n );\n\n return {\n searchDoc,\n };\n};\n"],"mappings":";;;;;;AAKA,MAAa,gBACX,iBAAiC,EAAE,EACnC,mBACG;CACH,MAAM,aACJ,gBAAgB,QAAQ,cAAcA,iCAAe,QAAQ;AAE/D,KAAI,CAAC,WACH,OAAM,IAAI,MACR,4DACD;CAGH,MAAM,eAAe,GAAG,WAAW;;;;;;CAOnC,MAAM,YAAY,OAChB,QACA,eAA+B,EAAE,KAEjC,MAAMC,wBACJ,GAAG,aAAa,OAChB,gBACA,cACA;EACE,QAAQ;EACA;EACT,CACF;AAEH,QAAO,EACL,WACD"}
1
+ {"version":3,"file":"search.cjs","names":["configuration","fetcher"],"sources":["../../../src/getIntlayerAPI/search.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { type FetcherOptions, fetcher } from '../fetcher';\nimport type { SearchDocUtilParams, SearchDocUtilResult } from '../types';\n\nexport const getSearchAPI = (\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 AI_API_ROUTE = `${backendURL}/api/search`;\n\n /**\n * Search documentation\n * @param params - Search parameters containing the input query.\n * @returns Search results with GitHub URLs.\n */\n const searchDoc = async (\n params?: SearchDocUtilParams,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<SearchDocUtilResult>(\n `${AI_API_ROUTE}/doc`,\n authAPIOptions,\n otherOptions,\n {\n method: 'GET',\n params: params,\n }\n );\n\n return {\n searchDoc,\n };\n};\n"],"mappings":";;;;;;AAKA,MAAa,gBACX,iBAAiC,EAAE,EACnC,mBACG;CACH,MAAM,aACJ,gBAAgB,QAAQ,cAAcA,gCAAe,QAAQ;AAE/D,KAAI,CAAC,WACH,OAAM,IAAI,MACR,4DACD;CAGH,MAAM,eAAe,GAAG,WAAW;;;;;;CAOnC,MAAM,YAAY,OAChB,QACA,eAA+B,EAAE,KAEjC,MAAMC,wBACJ,GAAG,aAAa,OAChB,gBACA,cACA;EACE,QAAQ;EACA;EACT,CACF;AAEH,QAAO,EACL,WACD"}
@@ -1,11 +1,11 @@
1
1
  const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
2
  const require_fetcher = require('../fetcher.cjs');
3
- let __intlayer_config_built = require("@intlayer/config/built");
4
- __intlayer_config_built = require_rolldown_runtime.__toESM(__intlayer_config_built);
3
+ let _intlayer_config_built = require("@intlayer/config/built");
4
+ _intlayer_config_built = require_rolldown_runtime.__toESM(_intlayer_config_built);
5
5
 
6
6
  //#region src/getIntlayerAPI/stripe.ts
7
7
  const getStripeAPI = (authAPIOptions = {}, intlayerConfig) => {
8
- const backendURL = intlayerConfig?.editor?.backendURL ?? __intlayer_config_built.default?.editor?.backendURL;
8
+ const backendURL = intlayerConfig?.editor?.backendURL ?? _intlayer_config_built.default?.editor?.backendURL;
9
9
  if (!backendURL) throw new Error("Backend URL is not defined in the Intlayer configuration.");
10
10
  const STRIPE_API_ROUTE = `${backendURL}/api/stripe`;
11
11
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"stripe.cjs","names":["configuration","fetcher"],"sources":["../../../src/getIntlayerAPI/stripe.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { type FetcherOptions, fetcher } from '../fetcher';\nimport type {\n GetCheckoutSessionBody,\n GetCheckoutSessionResult,\n GetPricingBody,\n GetPricingResult,\n} from '../types';\n\nexport const getStripeAPI = (\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 STRIPE_API_ROUTE = `${backendURL}/api/stripe`;\n\n /**\n * Get a pricing plan calculated for a given promotion code.\n * @param body - Pricing plan body.\n */\n const getPricing = async (\n body?: GetPricingBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetPricingResult>(\n `${STRIPE_API_ROUTE}/pricing`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body,\n }\n );\n\n /**\n * Retrieves a checkout session.\n * @param body - Checkout session body.\n */\n const getSubscription = async (\n body?: GetCheckoutSessionBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetCheckoutSessionResult>(\n `${STRIPE_API_ROUTE}/create-subscription`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body,\n }\n );\n\n /**\n * Cancels a subscription.\n * @param body - Checkout session body.\n */\n const cancelSubscription = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetCheckoutSessionResult>(\n `${STRIPE_API_ROUTE}/cancel-subscription`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n }\n );\n\n return {\n getPricing,\n getSubscription,\n cancelSubscription,\n };\n};\n"],"mappings":";;;;;;AAUA,MAAa,gBACX,iBAAiC,EAAE,EACnC,mBACG;CACH,MAAM,aACJ,gBAAgB,QAAQ,cAAcA,iCAAe,QAAQ;AAE/D,KAAI,CAAC,WACH,OAAM,IAAI,MACR,4DACD;CAGH,MAAM,mBAAmB,GAAG,WAAW;;;;;CAMvC,MAAM,aAAa,OACjB,MACA,eAA+B,EAAE,KAEjC,MAAMC,wBACJ,GAAG,iBAAiB,WACpB,gBACA,cACA;EACE,QAAQ;EACR;EACD,CACF;;;;;CAMH,MAAM,kBAAkB,OACtB,MACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,iBAAiB,uBACpB,gBACA,cACA;EACE,QAAQ;EACR;EACD,CACF;;;;;CAMH,MAAM,qBAAqB,OAAO,eAA+B,EAAE,KACjE,MAAMA,wBACJ,GAAG,iBAAiB,uBACpB,gBACA,cACA,EACE,QAAQ,QACT,CACF;AAEH,QAAO;EACL;EACA;EACA;EACD"}
1
+ {"version":3,"file":"stripe.cjs","names":["configuration","fetcher"],"sources":["../../../src/getIntlayerAPI/stripe.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { type FetcherOptions, fetcher } from '../fetcher';\nimport type {\n GetCheckoutSessionBody,\n GetCheckoutSessionResult,\n GetPricingBody,\n GetPricingResult,\n} from '../types';\n\nexport const getStripeAPI = (\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 STRIPE_API_ROUTE = `${backendURL}/api/stripe`;\n\n /**\n * Get a pricing plan calculated for a given promotion code.\n * @param body - Pricing plan body.\n */\n const getPricing = async (\n body?: GetPricingBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetPricingResult>(\n `${STRIPE_API_ROUTE}/pricing`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body,\n }\n );\n\n /**\n * Retrieves a checkout session.\n * @param body - Checkout session body.\n */\n const getSubscription = async (\n body?: GetCheckoutSessionBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetCheckoutSessionResult>(\n `${STRIPE_API_ROUTE}/create-subscription`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body,\n }\n );\n\n /**\n * Cancels a subscription.\n * @param body - Checkout session body.\n */\n const cancelSubscription = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetCheckoutSessionResult>(\n `${STRIPE_API_ROUTE}/cancel-subscription`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n }\n );\n\n return {\n getPricing,\n getSubscription,\n cancelSubscription,\n };\n};\n"],"mappings":";;;;;;AAUA,MAAa,gBACX,iBAAiC,EAAE,EACnC,mBACG;CACH,MAAM,aACJ,gBAAgB,QAAQ,cAAcA,gCAAe,QAAQ;AAE/D,KAAI,CAAC,WACH,OAAM,IAAI,MACR,4DACD;CAGH,MAAM,mBAAmB,GAAG,WAAW;;;;;CAMvC,MAAM,aAAa,OACjB,MACA,eAA+B,EAAE,KAEjC,MAAMC,wBACJ,GAAG,iBAAiB,WACpB,gBACA,cACA;EACE,QAAQ;EACR;EACD,CACF;;;;;CAMH,MAAM,kBAAkB,OACtB,MACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,iBAAiB,uBACpB,gBACA,cACA;EACE,QAAQ;EACR;EACD,CACF;;;;;CAMH,MAAM,qBAAqB,OAAO,eAA+B,EAAE,KACjE,MAAMA,wBACJ,GAAG,iBAAiB,uBACpB,gBACA,cACA,EACE,QAAQ,QACT,CACF;AAEH,QAAO;EACL;EACA;EACA;EACD"}
@@ -1,11 +1,11 @@
1
1
  const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
2
  const require_fetcher = require('../fetcher.cjs');
3
- let __intlayer_config_built = require("@intlayer/config/built");
4
- __intlayer_config_built = require_rolldown_runtime.__toESM(__intlayer_config_built);
3
+ let _intlayer_config_built = require("@intlayer/config/built");
4
+ _intlayer_config_built = require_rolldown_runtime.__toESM(_intlayer_config_built);
5
5
 
6
6
  //#region src/getIntlayerAPI/tag.ts
7
7
  const getTagAPI = (authAPIOptions = {}, intlayerConfig) => {
8
- const backendURL = intlayerConfig?.editor?.backendURL ?? __intlayer_config_built.default?.editor?.backendURL;
8
+ const backendURL = intlayerConfig?.editor?.backendURL ?? _intlayer_config_built.default?.editor?.backendURL;
9
9
  if (!backendURL) throw new Error("Backend URL is not defined in the Intlayer configuration.");
10
10
  const PROJECT_API_ROUTE = `${backendURL}/api/tag`;
11
11
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"tag.cjs","names":["configuration","fetcher"],"sources":["../../../src/getIntlayerAPI/tag.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { type FetcherOptions, fetcher } from '../fetcher';\nimport type {\n AddTagBody,\n AddTagResult,\n DeleteTagParams,\n DeleteTagResult,\n GetTagsParams,\n GetTagsResult,\n UpdateTagBody,\n UpdateTagParams,\n UpdateTagResult,\n} from '../types';\n\nexport const getTagAPI = (\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/tag`;\n\n /**\n * Retrieves a list of tags based on filters and pagination.\n * @param filters - Filters and pagination options.\n */\n const getTags = async (\n filters?: GetTagsParams,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetTagsResult>(\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 * Adds a new tag to the database.\n * @param tag - Tag data.\n */\n const addTag = async (tag: AddTagBody, otherOptions: FetcherOptions = {}) =>\n await fetcher<AddTagResult>(\n `${PROJECT_API_ROUTE}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: tag,\n }\n );\n\n /**\n * Updates an existing tag in the database.\n * @param tag - Updated tag data.\n */\n const updateTag = async (\n tagId: UpdateTagParams['tagId'],\n tag: UpdateTagBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<UpdateTagResult>(\n `${PROJECT_API_ROUTE}/${tagId}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body: tag,\n }\n );\n\n /**\n * Deletes a tag from the database by its ID.\n * @param tagId - Tag ID.\n */\n const deleteTag = async (\n tagId: DeleteTagParams['tagId'],\n\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<DeleteTagResult>(\n `${PROJECT_API_ROUTE}/${tagId}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'DELETE',\n }\n );\n\n return {\n getTags,\n addTag,\n updateTag,\n deleteTag,\n };\n};\n"],"mappings":";;;;;;AAeA,MAAa,aACX,iBAAiC,EAAE,EACnC,mBACG;CACH,MAAM,aACJ,gBAAgB,QAAQ,cAAcA,iCAAe,QAAQ;AAE/D,KAAI,CAAC,WACH,OAAM,IAAI,MACR,4DACD;CAGH,MAAM,oBAAoB,GAAG,WAAW;;;;;CAMxC,MAAM,UAAU,OACd,SACA,eAA+B,EAAE,KAEjC,MAAMC,wBACJ,mBACA,gBACA,cACA;EACE,OAAO;EAEP,QAAQ;EACT,CACF;;;;;CAMH,MAAM,SAAS,OAAO,KAAiB,eAA+B,EAAE,KACtE,MAAMA,wBACJ,GAAG,qBACH,gBACA,cACA;EACE,QAAQ;EACR,MAAM;EACP,CACF;;;;;CAMH,MAAM,YAAY,OAChB,OACA,KACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,kBAAkB,GAAG,SACxB,gBACA,cACA;EACE,QAAQ;EACR,MAAM;EACP,CACF;;;;;CAMH,MAAM,YAAY,OAChB,OAEA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,kBAAkB,GAAG,SACxB,gBACA,cACA,EACE,QAAQ,UACT,CACF;AAEH,QAAO;EACL;EACA;EACA;EACA;EACD"}
1
+ {"version":3,"file":"tag.cjs","names":["configuration","fetcher"],"sources":["../../../src/getIntlayerAPI/tag.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { type FetcherOptions, fetcher } from '../fetcher';\nimport type {\n AddTagBody,\n AddTagResult,\n DeleteTagParams,\n DeleteTagResult,\n GetTagsParams,\n GetTagsResult,\n UpdateTagBody,\n UpdateTagParams,\n UpdateTagResult,\n} from '../types';\n\nexport const getTagAPI = (\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/tag`;\n\n /**\n * Retrieves a list of tags based on filters and pagination.\n * @param filters - Filters and pagination options.\n */\n const getTags = async (\n filters?: GetTagsParams,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetTagsResult>(\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 * Adds a new tag to the database.\n * @param tag - Tag data.\n */\n const addTag = async (tag: AddTagBody, otherOptions: FetcherOptions = {}) =>\n await fetcher<AddTagResult>(\n `${PROJECT_API_ROUTE}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: tag,\n }\n );\n\n /**\n * Updates an existing tag in the database.\n * @param tag - Updated tag data.\n */\n const updateTag = async (\n tagId: UpdateTagParams['tagId'],\n tag: UpdateTagBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<UpdateTagResult>(\n `${PROJECT_API_ROUTE}/${tagId}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body: tag,\n }\n );\n\n /**\n * Deletes a tag from the database by its ID.\n * @param tagId - Tag ID.\n */\n const deleteTag = async (\n tagId: DeleteTagParams['tagId'],\n\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<DeleteTagResult>(\n `${PROJECT_API_ROUTE}/${tagId}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'DELETE',\n }\n );\n\n return {\n getTags,\n addTag,\n updateTag,\n deleteTag,\n };\n};\n"],"mappings":";;;;;;AAeA,MAAa,aACX,iBAAiC,EAAE,EACnC,mBACG;CACH,MAAM,aACJ,gBAAgB,QAAQ,cAAcA,gCAAe,QAAQ;AAE/D,KAAI,CAAC,WACH,OAAM,IAAI,MACR,4DACD;CAGH,MAAM,oBAAoB,GAAG,WAAW;;;;;CAMxC,MAAM,UAAU,OACd,SACA,eAA+B,EAAE,KAEjC,MAAMC,wBACJ,mBACA,gBACA,cACA;EACE,OAAO;EAEP,QAAQ;EACT,CACF;;;;;CAMH,MAAM,SAAS,OAAO,KAAiB,eAA+B,EAAE,KACtE,MAAMA,wBACJ,GAAG,qBACH,gBACA,cACA;EACE,QAAQ;EACR,MAAM;EACP,CACF;;;;;CAMH,MAAM,YAAY,OAChB,OACA,KACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,kBAAkB,GAAG,SACxB,gBACA,cACA;EACE,QAAQ;EACR,MAAM;EACP,CACF;;;;;CAMH,MAAM,YAAY,OAChB,OAEA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,kBAAkB,GAAG,SACxB,gBACA,cACA,EACE,QAAQ,UACT,CACF;AAEH,QAAO;EACL;EACA;EACA;EACA;EACD"}
@@ -1,11 +1,11 @@
1
1
  const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
2
  const require_fetcher = require('../fetcher.cjs');
3
- let __intlayer_config_built = require("@intlayer/config/built");
4
- __intlayer_config_built = require_rolldown_runtime.__toESM(__intlayer_config_built);
3
+ let _intlayer_config_built = require("@intlayer/config/built");
4
+ _intlayer_config_built = require_rolldown_runtime.__toESM(_intlayer_config_built);
5
5
 
6
6
  //#region src/getIntlayerAPI/user.ts
7
7
  const getUserAPI = (authAPIOptions = {}, intlayerConfig) => {
8
- const backendURL = intlayerConfig?.editor?.backendURL ?? __intlayer_config_built.default?.editor?.backendURL;
8
+ const backendURL = intlayerConfig?.editor?.backendURL ?? _intlayer_config_built.default?.editor?.backendURL;
9
9
  if (!backendURL) throw new Error("Backend URL is not defined in the Intlayer configuration.");
10
10
  const USER_API_ROUTE = `${backendURL}/api/user`;
11
11
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"user.cjs","names":["configuration","fetcher"],"sources":["../../../src/getIntlayerAPI/user.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { type FetcherOptions, fetcher } from '../fetcher';\nimport type {\n CreateUserBody,\n CreateUserResult,\n GetUserByAccountParams,\n GetUserByAccountResult,\n GetUserByEmailParams,\n GetUserByEmailResult,\n GetUserByIdParams,\n GetUserByIdResult,\n GetUsersParams,\n GetUsersResult,\n UpdateUserBody,\n UpdateUserResult,\n UserAPI,\n} from '../types';\n\nexport const getUserAPI = (\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 USER_API_ROUTE = `${backendURL}/api/user`;\n\n /**\n * Retrieves a list of users based on filters and pagination.\n * @param filters - Filters and pagination options.\n * @returns List of users.\n */\n const getUsers = async (\n filters?: GetUsersParams,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetUsersResult>(\n USER_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 user by ID.\n * @param userId - User ID.\n * @returns User object.\n */\n const getUserById = async (\n userId: GetUserByIdParams['userId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetUserByIdResult>(\n `${USER_API_ROUTE}/${userId}`,\n authAPIOptions,\n otherOptions,\n {\n cache: 'no-store',\n }\n );\n\n /**\n * Retrieves a user by email.\n * @param email - User email.\n * @returns User object.\n */\n const getUserByEmail = async (\n email: GetUserByEmailParams['email'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetUserByEmailResult>(\n `${USER_API_ROUTE}/email/${email}`,\n authAPIOptions,\n otherOptions,\n {\n cache: 'no-store',\n }\n );\n\n /**\n * Retrieves a user by account.\n * @param providerAccountId - The provider account ID.\n * @param provider - The provider of the account.\n */\n const getUserByAccount = async (\n providerAccountId: GetUserByAccountParams['providerAccountId'],\n provider: GetUserByAccountParams['provider'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetUserByAccountResult>(\n `${USER_API_ROUTE}/account/${provider}/${providerAccountId}`,\n authAPIOptions,\n otherOptions,\n {\n cache: 'no-store',\n }\n );\n\n /**\n * Creates a new user.\n * @param user - User credentials.\n * @returns User object.\n */\n const createUser = async (\n user: CreateUserBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<CreateUserResult>(\n `${USER_API_ROUTE}/`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: user,\n }\n );\n\n /**\n * Updates the user with the provided data.\n * @param user - Updated user data.\n * @returns User object.\n */\n const updateUser = async (\n user: UpdateUserBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<UpdateUserResult>(\n `${USER_API_ROUTE}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body: user,\n }\n );\n\n /**\n * Deletes a user with the provided ID.\n * @param userId - User ID.\n * @returns User object.\n */\n const deleteUser = async (\n userId: string,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<UpdateUserResult>(\n `${USER_API_ROUTE}/${userId}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'DELETE',\n }\n );\n\n /**\n * Gets the verify email status URL to use in the SSE.\n * @param userId - User ID.\n * @returns The verify email status URL.\n */\n const getVerifyEmailStatusURL = (userId: string | UserAPI['id']) =>\n `${USER_API_ROUTE}/verify-email-status/${String(userId)}`;\n\n return {\n createUser,\n getUsers,\n getUserById,\n getUserByAccount,\n getUserByEmail,\n updateUser,\n deleteUser,\n getVerifyEmailStatusURL,\n };\n};\n"],"mappings":";;;;;;AAmBA,MAAa,cACX,iBAAiC,EAAE,EACnC,mBACG;CACH,MAAM,aACJ,gBAAgB,QAAQ,cAAcA,iCAAe,QAAQ;AAE/D,KAAI,CAAC,WACH,OAAM,IAAI,MACR,4DACD;CAGH,MAAM,iBAAiB,GAAG,WAAW;;;;;;CAOrC,MAAM,WAAW,OACf,SACA,eAA+B,EAAE,KAEjC,MAAMC,wBACJ,gBACA,gBACA,cACA;EACE,OAAO;EAEP,QAAQ;EACT,CACF;;;;;;CAOH,MAAM,cAAc,OAClB,QACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,eAAe,GAAG,UACrB,gBACA,cACA,EACE,OAAO,YACR,CACF;;;;;;CAOH,MAAM,iBAAiB,OACrB,OACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,eAAe,SAAS,SAC3B,gBACA,cACA,EACE,OAAO,YACR,CACF;;;;;;CAOH,MAAM,mBAAmB,OACvB,mBACA,UACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,eAAe,WAAW,SAAS,GAAG,qBACzC,gBACA,cACA,EACE,OAAO,YACR,CACF;;;;;;CAOH,MAAM,aAAa,OACjB,MACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,eAAe,IAClB,gBACA,cACA;EACE,QAAQ;EACR,MAAM;EACP,CACF;;;;;;CAOH,MAAM,aAAa,OACjB,MACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,kBACH,gBACA,cACA;EACE,QAAQ;EACR,MAAM;EACP,CACF;;;;;;CAOH,MAAM,aAAa,OACjB,QACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,eAAe,GAAG,UACrB,gBACA,cACA,EACE,QAAQ,UACT,CACF;;;;;;CAOH,MAAM,2BAA2B,WAC/B,GAAG,eAAe,uBAAuB,OAAO,OAAO;AAEzD,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD"}
1
+ {"version":3,"file":"user.cjs","names":["configuration","fetcher"],"sources":["../../../src/getIntlayerAPI/user.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { type FetcherOptions, fetcher } from '../fetcher';\nimport type {\n CreateUserBody,\n CreateUserResult,\n GetUserByAccountParams,\n GetUserByAccountResult,\n GetUserByEmailParams,\n GetUserByEmailResult,\n GetUserByIdParams,\n GetUserByIdResult,\n GetUsersParams,\n GetUsersResult,\n UpdateUserBody,\n UpdateUserResult,\n UserAPI,\n} from '../types';\n\nexport const getUserAPI = (\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 USER_API_ROUTE = `${backendURL}/api/user`;\n\n /**\n * Retrieves a list of users based on filters and pagination.\n * @param filters - Filters and pagination options.\n * @returns List of users.\n */\n const getUsers = async (\n filters?: GetUsersParams,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetUsersResult>(\n USER_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 user by ID.\n * @param userId - User ID.\n * @returns User object.\n */\n const getUserById = async (\n userId: GetUserByIdParams['userId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetUserByIdResult>(\n `${USER_API_ROUTE}/${userId}`,\n authAPIOptions,\n otherOptions,\n {\n cache: 'no-store',\n }\n );\n\n /**\n * Retrieves a user by email.\n * @param email - User email.\n * @returns User object.\n */\n const getUserByEmail = async (\n email: GetUserByEmailParams['email'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetUserByEmailResult>(\n `${USER_API_ROUTE}/email/${email}`,\n authAPIOptions,\n otherOptions,\n {\n cache: 'no-store',\n }\n );\n\n /**\n * Retrieves a user by account.\n * @param providerAccountId - The provider account ID.\n * @param provider - The provider of the account.\n */\n const getUserByAccount = async (\n providerAccountId: GetUserByAccountParams['providerAccountId'],\n provider: GetUserByAccountParams['provider'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetUserByAccountResult>(\n `${USER_API_ROUTE}/account/${provider}/${providerAccountId}`,\n authAPIOptions,\n otherOptions,\n {\n cache: 'no-store',\n }\n );\n\n /**\n * Creates a new user.\n * @param user - User credentials.\n * @returns User object.\n */\n const createUser = async (\n user: CreateUserBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<CreateUserResult>(\n `${USER_API_ROUTE}/`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: user,\n }\n );\n\n /**\n * Updates the user with the provided data.\n * @param user - Updated user data.\n * @returns User object.\n */\n const updateUser = async (\n user: UpdateUserBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<UpdateUserResult>(\n `${USER_API_ROUTE}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body: user,\n }\n );\n\n /**\n * Deletes a user with the provided ID.\n * @param userId - User ID.\n * @returns User object.\n */\n const deleteUser = async (\n userId: string,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<UpdateUserResult>(\n `${USER_API_ROUTE}/${userId}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'DELETE',\n }\n );\n\n /**\n * Gets the verify email status URL to use in the SSE.\n * @param userId - User ID.\n * @returns The verify email status URL.\n */\n const getVerifyEmailStatusURL = (userId: string | UserAPI['id']) =>\n `${USER_API_ROUTE}/verify-email-status/${String(userId)}`;\n\n return {\n createUser,\n getUsers,\n getUserById,\n getUserByAccount,\n getUserByEmail,\n updateUser,\n deleteUser,\n getVerifyEmailStatusURL,\n };\n};\n"],"mappings":";;;;;;AAmBA,MAAa,cACX,iBAAiC,EAAE,EACnC,mBACG;CACH,MAAM,aACJ,gBAAgB,QAAQ,cAAcA,gCAAe,QAAQ;AAE/D,KAAI,CAAC,WACH,OAAM,IAAI,MACR,4DACD;CAGH,MAAM,iBAAiB,GAAG,WAAW;;;;;;CAOrC,MAAM,WAAW,OACf,SACA,eAA+B,EAAE,KAEjC,MAAMC,wBACJ,gBACA,gBACA,cACA;EACE,OAAO;EAEP,QAAQ;EACT,CACF;;;;;;CAOH,MAAM,cAAc,OAClB,QACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,eAAe,GAAG,UACrB,gBACA,cACA,EACE,OAAO,YACR,CACF;;;;;;CAOH,MAAM,iBAAiB,OACrB,OACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,eAAe,SAAS,SAC3B,gBACA,cACA,EACE,OAAO,YACR,CACF;;;;;;CAOH,MAAM,mBAAmB,OACvB,mBACA,UACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,eAAe,WAAW,SAAS,GAAG,qBACzC,gBACA,cACA,EACE,OAAO,YACR,CACF;;;;;;CAOH,MAAM,aAAa,OACjB,MACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,eAAe,IAClB,gBACA,cACA;EACE,QAAQ;EACR,MAAM;EACP,CACF;;;;;;CAOH,MAAM,aAAa,OACjB,MACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,kBACH,gBACA,cACA;EACE,QAAQ;EACR,MAAM;EACP,CACF;;;;;;CAOH,MAAM,aAAa,OACjB,QACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,eAAe,GAAG,UACrB,gBACA,cACA,EACE,QAAQ,UACT,CACF;;;;;;CAOH,MAAM,2BAA2B,WAC/B,GAAG,eAAe,uBAAuB,OAAO,OAAO;AAEzD,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD"}
@@ -75,7 +75,17 @@ const getOrganizationAPI = (authAPIOptions = {}, intlayerConfig) => {
75
75
  * @param organizationId - Organization ID.
76
76
  */
77
77
  const unselectOrganization = async (otherOptions = {}) => await fetcher(`${ORGANIZATION_API_ROUTE}/logout`, authAPIOptions, otherOptions, { method: "POST" });
78
+ /**
79
+ * Retrieves the SSO configuration for an organization by email domain.
80
+ * This endpoint is public.
81
+ * @param body - The body containing the email.
82
+ */
83
+ const getOrganizationSSOConfig = async (body, otherOptions = {}) => await fetcher(`${ORGANIZATION_API_ROUTE}/sso`, authAPIOptions, otherOptions, {
84
+ method: "POST",
85
+ body
86
+ });
78
87
  return {
88
+ getOrganizationSSOConfig,
79
89
  getOrganizations,
80
90
  getOrganization,
81
91
  addOrganization,
@@ -1 +1 @@
1
- {"version":3,"file":"organization.mjs","names":[],"sources":["../../../src/getIntlayerAPI/organization.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { type FetcherOptions, fetcher } from '../fetcher';\nimport type {\n AddOrganizationBody,\n AddOrganizationMemberBody,\n AddOrganizationMemberResult,\n AddOrganizationResult,\n DeleteOrganizationResult,\n GetOrganizationParam,\n GetOrganizationResult,\n GetOrganizationsParams,\n GetOrganizationsResult,\n SelectOrganizationParam,\n SelectOrganizationResult,\n UnselectOrganizationResult,\n UpdateOrganizationBody,\n UpdateOrganizationMembersBody,\n UpdateOrganizationMembersResult,\n UpdateOrganizationResult,\n} from '../types';\n\nexport const getOrganizationAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const backendURL =\n intlayerConfig?.editor?.backendURL ?? configuration?.editor?.backendURL;\n\n if (!backendURL) {\n throw new Error(\n 'Backend URL is not defined in the Intlayer configuration--.'\n );\n }\n\n const ORGANIZATION_API_ROUTE = `${backendURL}/api/organization`;\n\n /**\n * Retrieves a list of organizations based on filters and pagination.\n * @param filters - Filters and pagination options.\n */\n const getOrganizations = async (\n filters?: GetOrganizationsParams,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetOrganizationsResult>(\n ORGANIZATION_API_ROUTE,\n authAPIOptions,\n otherOptions,\n {\n cache: 'no-store',\n // @ts-ignore Number of parameter will be stringified by the fetcher\n params: filters,\n }\n );\n\n /**\n * Retrieves an organization by its ID.\n * @param organizationId - Organization ID.\n */\n const getOrganization = async (\n organizationId: GetOrganizationParam['organizationId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetOrganizationResult>(\n `${ORGANIZATION_API_ROUTE}/${String(organizationId)}`,\n authAPIOptions,\n otherOptions\n );\n\n /**\n * Adds a new organization to the database.\n * @param organization - Organization data.\n */\n const addOrganization = async (\n organization: AddOrganizationBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<AddOrganizationResult>(\n ORGANIZATION_API_ROUTE,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: organization,\n }\n );\n\n /**\n * Updates an existing organization in the database.\n * @param organization - Updated organization data.\n */\n const updateOrganization = async (\n organization: UpdateOrganizationBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<UpdateOrganizationResult>(\n ORGANIZATION_API_ROUTE,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body: organization,\n }\n );\n\n /**\n * Update members to the organization in the database.\n * @param body - Updated organization members data.\n */\n const updateOrganizationMembers = async (\n body: UpdateOrganizationMembersBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<UpdateOrganizationMembersResult>(\n `${ORGANIZATION_API_ROUTE}/members`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body,\n }\n );\n\n /**\n * Admin-only: Update members of any organization by ID\n * @param organizationId - Organization ID\n * @param body - Updated organization members data.\n */\n const updateOrganizationMembersById = async (\n organizationId: string,\n body: UpdateOrganizationMembersBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<UpdateOrganizationMembersResult>(\n `${ORGANIZATION_API_ROUTE}/${organizationId}/members`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body,\n }\n );\n\n /**\n * Add member to the organization in the database.\n * @param body - Updated organization members data.\n */\n const addOrganizationMember = async (\n body: AddOrganizationMemberBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<AddOrganizationMemberResult>(\n `${ORGANIZATION_API_ROUTE}/member`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body,\n }\n );\n\n /**\n * Deletes an organization from the database by its ID.\n * @param organizationId - Organization ID.\n */\n const deleteOrganization = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<DeleteOrganizationResult>(\n ORGANIZATION_API_ROUTE,\n authAPIOptions,\n otherOptions,\n {\n method: 'DELETE',\n }\n );\n\n /**\n * Select an organization from the database by its ID.\n * @param organizationId - Organization ID.\n */\n const selectOrganization = async (\n organizationId: SelectOrganizationParam['organizationId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<SelectOrganizationResult>(\n `${ORGANIZATION_API_ROUTE}/${String(organizationId)}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n }\n );\n\n /**\n * Unselect an organization from the database by its ID.\n * @param organizationId - Organization ID.\n */\n const unselectOrganization = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<UnselectOrganizationResult>(\n `${ORGANIZATION_API_ROUTE}/logout`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n }\n );\n\n return {\n getOrganizations,\n getOrganization,\n addOrganization,\n addOrganizationMember,\n updateOrganization,\n updateOrganizationMembers,\n updateOrganizationMembersById,\n deleteOrganization,\n selectOrganization,\n unselectOrganization,\n };\n};\n"],"mappings":";;;;AAsBA,MAAa,sBACX,iBAAiC,EAAE,EACnC,mBACG;CACH,MAAM,aACJ,gBAAgB,QAAQ,cAAc,eAAe,QAAQ;AAE/D,KAAI,CAAC,WACH,OAAM,IAAI,MACR,8DACD;CAGH,MAAM,yBAAyB,GAAG,WAAW;;;;;CAM7C,MAAM,mBAAmB,OACvB,SACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,wBACA,gBACA,cACA;EACE,OAAO;EAEP,QAAQ;EACT,CACF;;;;;CAMH,MAAM,kBAAkB,OACtB,gBACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,uBAAuB,GAAG,OAAO,eAAe,IACnD,gBACA,aACD;;;;;CAMH,MAAM,kBAAkB,OACtB,cACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,wBACA,gBACA,cACA;EACE,QAAQ;EACR,MAAM;EACP,CACF;;;;;CAMH,MAAM,qBAAqB,OACzB,cACA,eAA+B,EAAE,KAEjC,QACE,wBACA,gBACA,cACA;EACE,QAAQ;EACR,MAAM;EACP,CACF;;;;;CAMH,MAAM,4BAA4B,OAChC,MACA,eAA+B,EAAE,KAEjC,QACE,GAAG,uBAAuB,WAC1B,gBACA,cACA;EACE,QAAQ;EACR;EACD,CACF;;;;;;CAOH,MAAM,gCAAgC,OACpC,gBACA,MACA,eAA+B,EAAE,KAEjC,QACE,GAAG,uBAAuB,GAAG,eAAe,WAC5C,gBACA,cACA;EACE,QAAQ;EACR;EACD,CACF;;;;;CAMH,MAAM,wBAAwB,OAC5B,MACA,eAA+B,EAAE,KAEjC,QACE,GAAG,uBAAuB,UAC1B,gBACA,cACA;EACE,QAAQ;EACR;EACD,CACF;;;;;CAMH,MAAM,qBAAqB,OAAO,eAA+B,EAAE,KACjE,MAAM,QACJ,wBACA,gBACA,cACA,EACE,QAAQ,UACT,CACF;;;;;CAMH,MAAM,qBAAqB,OACzB,gBACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,uBAAuB,GAAG,OAAO,eAAe,IACnD,gBACA,cACA,EACE,QAAQ,OACT,CACF;;;;;CAMH,MAAM,uBAAuB,OAAO,eAA+B,EAAE,KACnE,MAAM,QACJ,GAAG,uBAAuB,UAC1B,gBACA,cACA,EACE,QAAQ,QACT,CACF;AAEH,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD"}
1
+ {"version":3,"file":"organization.mjs","names":[],"sources":["../../../src/getIntlayerAPI/organization.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { type FetcherOptions, fetcher } from '../fetcher';\nimport type {\n AddOrganizationBody,\n AddOrganizationMemberBody,\n AddOrganizationMemberResult,\n AddOrganizationResult,\n DeleteOrganizationResult,\n GetOrganizationParam,\n GetOrganizationResult,\n GetOrganizationSSOConfigBody,\n GetOrganizationSSOConfigResult,\n GetOrganizationsParams,\n GetOrganizationsResult,\n SelectOrganizationParam,\n SelectOrganizationResult,\n UnselectOrganizationResult,\n UpdateOrganizationBody,\n UpdateOrganizationMembersBody,\n UpdateOrganizationMembersResult,\n UpdateOrganizationResult,\n} from '../types';\n\nexport const getOrganizationAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const backendURL =\n intlayerConfig?.editor?.backendURL ?? configuration?.editor?.backendURL;\n\n if (!backendURL) {\n throw new Error(\n 'Backend URL is not defined in the Intlayer configuration--.'\n );\n }\n\n const ORGANIZATION_API_ROUTE = `${backendURL}/api/organization`;\n\n /**\n * Retrieves a list of organizations based on filters and pagination.\n * @param filters - Filters and pagination options.\n */\n const getOrganizations = async (\n filters?: GetOrganizationsParams,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetOrganizationsResult>(\n ORGANIZATION_API_ROUTE,\n authAPIOptions,\n otherOptions,\n {\n cache: 'no-store',\n // @ts-ignore Number of parameter will be stringified by the fetcher\n params: filters,\n }\n );\n\n /**\n * Retrieves an organization by its ID.\n * @param organizationId - Organization ID.\n */\n const getOrganization = async (\n organizationId: GetOrganizationParam['organizationId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetOrganizationResult>(\n `${ORGANIZATION_API_ROUTE}/${String(organizationId)}`,\n authAPIOptions,\n otherOptions\n );\n\n /**\n * Adds a new organization to the database.\n * @param organization - Organization data.\n */\n const addOrganization = async (\n organization: AddOrganizationBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<AddOrganizationResult>(\n ORGANIZATION_API_ROUTE,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: organization,\n }\n );\n\n /**\n * Updates an existing organization in the database.\n * @param organization - Updated organization data.\n */\n const updateOrganization = async (\n organization: UpdateOrganizationBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<UpdateOrganizationResult>(\n ORGANIZATION_API_ROUTE,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body: organization,\n }\n );\n\n /**\n * Update members to the organization in the database.\n * @param body - Updated organization members data.\n */\n const updateOrganizationMembers = async (\n body: UpdateOrganizationMembersBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<UpdateOrganizationMembersResult>(\n `${ORGANIZATION_API_ROUTE}/members`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body,\n }\n );\n\n /**\n * Admin-only: Update members of any organization by ID\n * @param organizationId - Organization ID\n * @param body - Updated organization members data.\n */\n const updateOrganizationMembersById = async (\n organizationId: string,\n body: UpdateOrganizationMembersBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<UpdateOrganizationMembersResult>(\n `${ORGANIZATION_API_ROUTE}/${organizationId}/members`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body,\n }\n );\n\n /**\n * Add member to the organization in the database.\n * @param body - Updated organization members data.\n */\n const addOrganizationMember = async (\n body: AddOrganizationMemberBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<AddOrganizationMemberResult>(\n `${ORGANIZATION_API_ROUTE}/member`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body,\n }\n );\n\n /**\n * Deletes an organization from the database by its ID.\n * @param organizationId - Organization ID.\n */\n const deleteOrganization = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<DeleteOrganizationResult>(\n ORGANIZATION_API_ROUTE,\n authAPIOptions,\n otherOptions,\n {\n method: 'DELETE',\n }\n );\n\n /**\n * Select an organization from the database by its ID.\n * @param organizationId - Organization ID.\n */\n const selectOrganization = async (\n organizationId: SelectOrganizationParam['organizationId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<SelectOrganizationResult>(\n `${ORGANIZATION_API_ROUTE}/${String(organizationId)}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n }\n );\n\n /**\n * Unselect an organization from the database by its ID.\n * @param organizationId - Organization ID.\n */\n const unselectOrganization = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<UnselectOrganizationResult>(\n `${ORGANIZATION_API_ROUTE}/logout`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n }\n );\n\n /**\n * Retrieves the SSO configuration for an organization by email domain.\n * This endpoint is public.\n * @param body - The body containing the email.\n */\n const getOrganizationSSOConfig = async (\n body: GetOrganizationSSOConfigBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetOrganizationSSOConfigResult>(\n `${ORGANIZATION_API_ROUTE}/sso`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body,\n }\n );\n\n return {\n getOrganizationSSOConfig,\n getOrganizations,\n getOrganization,\n addOrganization,\n addOrganizationMember,\n updateOrganization,\n updateOrganizationMembers,\n updateOrganizationMembersById,\n deleteOrganization,\n selectOrganization,\n unselectOrganization,\n };\n};\n"],"mappings":";;;;AAwBA,MAAa,sBACX,iBAAiC,EAAE,EACnC,mBACG;CACH,MAAM,aACJ,gBAAgB,QAAQ,cAAc,eAAe,QAAQ;AAE/D,KAAI,CAAC,WACH,OAAM,IAAI,MACR,8DACD;CAGH,MAAM,yBAAyB,GAAG,WAAW;;;;;CAM7C,MAAM,mBAAmB,OACvB,SACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,wBACA,gBACA,cACA;EACE,OAAO;EAEP,QAAQ;EACT,CACF;;;;;CAMH,MAAM,kBAAkB,OACtB,gBACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,uBAAuB,GAAG,OAAO,eAAe,IACnD,gBACA,aACD;;;;;CAMH,MAAM,kBAAkB,OACtB,cACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,wBACA,gBACA,cACA;EACE,QAAQ;EACR,MAAM;EACP,CACF;;;;;CAMH,MAAM,qBAAqB,OACzB,cACA,eAA+B,EAAE,KAEjC,QACE,wBACA,gBACA,cACA;EACE,QAAQ;EACR,MAAM;EACP,CACF;;;;;CAMH,MAAM,4BAA4B,OAChC,MACA,eAA+B,EAAE,KAEjC,QACE,GAAG,uBAAuB,WAC1B,gBACA,cACA;EACE,QAAQ;EACR;EACD,CACF;;;;;;CAOH,MAAM,gCAAgC,OACpC,gBACA,MACA,eAA+B,EAAE,KAEjC,QACE,GAAG,uBAAuB,GAAG,eAAe,WAC5C,gBACA,cACA;EACE,QAAQ;EACR;EACD,CACF;;;;;CAMH,MAAM,wBAAwB,OAC5B,MACA,eAA+B,EAAE,KAEjC,QACE,GAAG,uBAAuB,UAC1B,gBACA,cACA;EACE,QAAQ;EACR;EACD,CACF;;;;;CAMH,MAAM,qBAAqB,OAAO,eAA+B,EAAE,KACjE,MAAM,QACJ,wBACA,gBACA,cACA,EACE,QAAQ,UACT,CACF;;;;;CAMH,MAAM,qBAAqB,OACzB,gBACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,uBAAuB,GAAG,OAAO,eAAe,IACnD,gBACA,cACA,EACE,QAAQ,OACT,CACF;;;;;CAMH,MAAM,uBAAuB,OAAO,eAA+B,EAAE,KACnE,MAAM,QACJ,GAAG,uBAAuB,UAC1B,gBACA,cACA,EACE,QAAQ,QACT,CACF;;;;;;CAOH,MAAM,2BAA2B,OAC/B,MACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,uBAAuB,OAC1B,gBACA,cACA;EACE,QAAQ;EACR;EACD,CACF;AAEH,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD"}
@@ -1,9 +1,10 @@
1
- import { AddOrganizationBody, AddOrganizationMemberBody, GetOrganizationParam, GetOrganizationsParams, SelectOrganizationParam, UpdateOrganizationBody, UpdateOrganizationMembersBody } from "../types.js";
1
+ import { AddOrganizationBody, AddOrganizationMemberBody, GetOrganizationParam, GetOrganizationSSOConfigBody, GetOrganizationsParams, SelectOrganizationParam, UpdateOrganizationBody, UpdateOrganizationMembersBody } from "../types.js";
2
2
  import { FetcherOptions } from "../fetcher.js";
3
3
  import { IntlayerConfig } from "@intlayer/types";
4
4
 
5
5
  //#region src/getIntlayerAPI/organization.d.ts
6
6
  declare const getOrganizationAPI: (authAPIOptions?: FetcherOptions, intlayerConfig?: IntlayerConfig) => {
7
+ getOrganizationSSOConfig: (body: GetOrganizationSSOConfigBody, otherOptions?: FetcherOptions) => Promise<GetOrganizationSSOConfigResult>;
7
8
  getOrganizations: (filters?: GetOrganizationsParams, otherOptions?: FetcherOptions) => Promise<GetOrganizationsResult>;
8
9
  getOrganization: (organizationId: GetOrganizationParam["organizationId"], otherOptions?: FetcherOptions) => Promise<GetOrganizationResult>;
9
10
  addOrganization: (organization: AddOrganizationBody, otherOptions?: FetcherOptions) => Promise<AddOrganizationResult>;
@@ -1 +1 @@
1
- {"version":3,"file":"organization.d.ts","names":[],"sources":["../../../src/getIntlayerAPI/organization.ts"],"sourcesContent":[],"mappings":";;;;;cAsBa,sCACK,iCACC;+BAkBL,uCACI,mBAAc,QAAA;EArBnB,eAAA,EAAA,CAAA,cAqMZ,EA9JmB,oBA8JnB,CAAA,gBAAA,CAAA,EAAA,YAAA,CAAA,EA7JiB,cA6JjB,EAAA,GA7J+B,OA6J/B,CA7J+B,qBA6J/B,CAAA;EApMiB,eAAA,EAAA,CAAA,YAAA,EAoDA,mBApDA,EAAA,YAAA,CAAA,EAqDA,cArDA,EAAA,GAqDc,OArDd,CAqDc,qBArDd,CAAA;EACC,qBAAA,EAAA,CAAA,IAAA,EA6HT,yBA7HS,EAAA,YAAA,CAAA,EA8HD,cA9HC,EAAA,GA8Ha,OA9Hb,CA8Ha,2BA9Hb,CAAA;EAkBL,kBAAA,EAAA,CAAA,YAAA,EAmDI,sBAnDJ,EAAA,YAAA,CAAA,EAoDI,cApDJ,EAAA,GAoDkB,OApDlB,CAoDkB,wBApDlB,CAAA;EACI,yBAAA,EAAA,CAAA,IAAA,EAoER,6BApEQ,EAAA,YAAA,CAAA,EAqEA,cArEA,EAAA,GAqEc,OArEd,CAqEc,+BArEd,CAAA;EAAc,6BAAA,EAAA,CAAA,cAAA,EAAA,MAAA,EAAA,IAAA,EAwFtB,6BAxFsB,EAAA,YAAA,CAAA,EAyFd,cAzFc,EAAA,GAyFA,OAzFA,CAyFA,+BAzFA,CAAA;EAAA,kBAAA,EAAA,CAAA,YAAA,CAAA,EA2HkB,cA3HlB,EAAA,GA2HgC,OA3HhC,CA2HgC,wBA3HhC,CAAA;EAkBZ,kBAAA,EAAA,CAAA,cAAA,EAwHA,uBAxHA,CAAA,gBAAA,CAAA,EAAA,YAAA,CAAA,EAyHF,cAzHE,EAAA,GAyHY,OAzHZ,CAyHY,wBAzHZ,CAAA;EACF,oBAAA,EAAA,CAAA,YAAA,CAAA,EAuIkC,cAvIlC,EAAA,GAuIgD,OAvIhD,CAuIgD,0BAvIhD,CAAA;CAAc"}
1
+ {"version":3,"file":"organization.d.ts","names":[],"sources":["../../../src/getIntlayerAPI/organization.ts"],"sourcesContent":[],"mappings":";;;;;cAwBa,sCACK,iCACC;mCA6LT,6CACQ,mBAAc,QAAA;EAhMnB,gBAAA,EAAA,CAAA,OAyNZ,CAAA,EArMa,sBAqMb,EAAA,YAAA,CAAA,EApMiB,cAoMjB,EAAA,GApM+B,OAoM/B,CApM+B,sBAoM/B,CAAA;EAxNiB,eAAA,EAAA,CAAA,cAAA,EAsCE,oBAtCF,CAAA,gBAAA,CAAA,EAAA,YAAA,CAAA,EAuCA,cAvCA,EAAA,GAuCc,OAvCd,CAuCc,qBAvCd,CAAA;EACC,eAAA,EAAA,CAAA,YAAA,EAmDD,mBAnDC,EAAA,YAAA,CAAA,EAoDD,cApDC,EAAA,GAoDa,OApDb,CAoDa,qBApDb,CAAA;EA6LT,qBAAA,EAAA,CAAA,IAAA,EAhEA,yBAgEA,EAAA,YAAA,CAAA,EA/DQ,cA+DR,EAAA,GA/DsB,OA+DtB,CA/DsB,2BA+DtB,CAAA;EACQ,kBAAA,EAAA,CAAA,YAAA,EAzHA,sBAyHA,EAAA,YAAA,CAAA,EAxHA,cAwHA,EAAA,GAxHc,OAwHd,CAxHc,wBAwHd,CAAA;EAAc,yBAAA,EAAA,CAAA,IAAA,EAvGtB,6BAuGsB,EAAA,YAAA,CAAA,EAtGd,cAsGc,EAAA,GAtGA,OAsGA,CAtGA,+BAsGA,CAAA;EAAA,6BAAA,EAAA,CAAA,cAAA,EAAA,MAAA,EAAA,IAAA,EAnFtB,6BAmFsB,EAAA,YAAA,CAAA,EAlFd,cAkFc,EAAA,GAlFA,OAkFA,CAlFA,+BAkFA,CAAA;EA5KlB,kBAAA,EAAA,CAAA,YAAA,CAAA,EA4HoC,cA5HpC,EAAA,GA4HkD,OA5HlD,CA4HkD,wBA5HlD,CAAA;EACI,kBAAA,EAAA,CAAA,cAAA,EA0IE,uBA1IF,CAAA,gBAAA,CAAA,EAAA,YAAA,CAAA,EA2IA,cA3IA,EAAA,GA2Ic,OA3Id,CA2Ic,wBA3Id,CAAA;EAAc,oBAAA,EAAA,CAAA,YAAA,CAAA,EA0JoB,cA1JpB,EAAA,GA0JkC,OA1JlC,CA0JkC,0BA1JlC,CAAA;CAAA"}
@@ -1,4 +1,4 @@
1
- import { AIOptions, AIProvider, AddDictionaryBody, AddDictionaryResult, AddNewAccessKeyBody, AddNewAccessKeyResponse, AddOrganizationBody, AddOrganizationMemberBody, AddOrganizationMemberResult, AddOrganizationResult, AddProjectBody, AddProjectResult, AddTagBody, AddTagResult, AskDocQuestionResult, AskResetPasswordBody, AskResetPasswordResult, AuditContentDeclarationBody, AuditContentDeclarationFieldBody, AuditContentDeclarationFieldResult, AuditContentDeclarationMetadataBody, AuditContentDeclarationMetadataResult, AuditContentDeclarationResult, AuditTagBody, AuditTagResult, AuthClient, AutocompleteBody, AutocompleteResponse, ChatCompletionRequestMessage, CheckIfUserHasPasswordResult, CreateAuditBody, CreateAuditResult, CreateSessionBody, CreateSessionResult, CreateUserBody, CreateUserResult, CustomQueryBody, CustomQueryResult, DefinePasswordBody, DefinePasswordResult, DeleteAccessKeyBody, DeleteAccessKeyResponse, DeleteDictionaryParam, DeleteDictionaryResult, DeleteOrganizationResult, DeleteProjectResult, DeleteTagParams, DeleteTagResult, DictionaryAPI, GetAuditByIdParams, GetAuditByIdResult, GetAuditsParams, GetAuditsResult, GetCheckoutSessionBody, GetCheckoutSessionResult, GetConfigurationResult, GetDictionariesKeysResult, GetDictionariesParams, GetDictionariesResult, GetDictionariesUpdateTimestampResult, GetDictionaryParams, GetDictionaryQuery, GetDictionaryResult, GetDiscussionsParams, GetDiscussionsResult, GetEditorDictionariesResult, GetOAuth2TokenBody, GetOAuth2TokenResult, GetOrganizationParam, GetOrganizationResult, GetOrganizationsParams, GetOrganizationsResult, GetPricingBody, GetPricingResult, GetProjectsParams, GetProjectsResult, GetSessionInformationQuery, GetSessionInformationResult, GetTagsParams, GetTagsResult, GetUserByAccountParams, GetUserByAccountResult, GetUserByEmailParams, GetUserByEmailResult, GetUserByIdParams, GetUserByIdResult, GetUsersParams, GetUsersResult, GithubLoginQueryParams, GoogleLoginQueryParams, LoginBody, LoginResult, Messages, NewsletterSubscriptionBody, NewsletterSubscriptionResult, NewsletterUnsubscriptionBody, PushDictionariesBody, PushDictionariesResult, PushProjectConfigurationBody, PushProjectConfigurationResult, RefreshAccessKeyBody, RefreshAccessKeyResponse, RegisterBody, RegisterQuery, RegisterResult, SearchDocUtilParams, SearchDocUtilResult, SelectOrganizationParam, SelectOrganizationResult, SelectProjectParam, SelectProjectResult, SetCSRFTokenResult, TranslateJSONBody, TranslateJSONResult, UnselectOrganizationResult, UnselectProjectResult, UpdateDictionaryBody, UpdateDictionaryParam, UpdateDictionaryResult, UpdateOrganizationBody, UpdateOrganizationMembersBody, UpdateOrganizationMembersResult, UpdateOrganizationResult, UpdatePasswordBody, UpdatePasswordResult, UpdateProjectBody, UpdateProjectMembersBody, UpdateProjectMembersResult, UpdateProjectResult, UpdateTagBody, UpdateTagParams, UpdateTagResult, UpdateUserBody, UpdateUserResult, UserAPI, ValidEmailParams, ValidEmailResult, WriteContentDeclarationBody, WriteContentDeclarationResult } from "./types.js";
1
+ import { AIOptions, AIProvider, AddDictionaryBody, AddDictionaryResult, AddNewAccessKeyBody, AddNewAccessKeyResponse, AddOrganizationBody, AddOrganizationMemberBody, AddOrganizationMemberResult, AddOrganizationResult, AddProjectBody, AddProjectResult, AddTagBody, AddTagResult, AskDocQuestionResult, AskResetPasswordBody, AskResetPasswordResult, AuditContentDeclarationBody, AuditContentDeclarationFieldBody, AuditContentDeclarationFieldResult, AuditContentDeclarationMetadataBody, AuditContentDeclarationMetadataResult, AuditContentDeclarationResult, AuditTagBody, AuditTagResult, AuthClient, AutocompleteBody, AutocompleteResponse, ChatCompletionRequestMessage, CheckIfUserHasPasswordResult, CreateAuditBody, CreateAuditResult, CreateSessionBody, CreateSessionResult, CreateUserBody, CreateUserResult, CustomQueryBody, CustomQueryResult, DefinePasswordBody, DefinePasswordResult, DeleteAccessKeyBody, DeleteAccessKeyResponse, DeleteDictionaryParam, DeleteDictionaryResult, DeleteOrganizationResult, DeleteProjectResult, DeleteTagParams, DeleteTagResult, DictionaryAPI, GetAuditByIdParams, GetAuditByIdResult, GetAuditsParams, GetAuditsResult, GetCheckoutSessionBody, GetCheckoutSessionResult, GetConfigurationResult, GetDictionariesKeysResult, GetDictionariesParams, GetDictionariesResult, GetDictionariesUpdateTimestampResult, GetDictionaryParams, GetDictionaryQuery, GetDictionaryResult, GetDiscussionsParams, GetDiscussionsResult, GetEditorDictionariesResult, GetOAuth2TokenBody, GetOAuth2TokenResult, GetOrganizationParam, GetOrganizationResult, GetOrganizationSSOConfigBody, GetOrganizationSSOConfigResult, GetOrganizationsParams, GetOrganizationsResult, GetPricingBody, GetPricingResult, GetProjectsParams, GetProjectsResult, GetSessionInformationQuery, GetSessionInformationResult, GetTagsParams, GetTagsResult, GetUserByAccountParams, GetUserByAccountResult, GetUserByEmailParams, GetUserByEmailResult, GetUserByIdParams, GetUserByIdResult, GetUsersParams, GetUsersResult, GithubLoginQueryParams, GoogleLoginQueryParams, LoginBody, LoginResult, Messages, NewsletterSubscriptionBody, NewsletterSubscriptionResult, NewsletterUnsubscriptionBody, PushDictionariesBody, PushDictionariesResult, PushProjectConfigurationBody, PushProjectConfigurationResult, RefreshAccessKeyBody, RefreshAccessKeyResponse, RegisterBody, RegisterQuery, RegisterResult, SearchDocUtilParams, SearchDocUtilResult, SelectOrganizationParam, SelectOrganizationResult, SelectProjectParam, SelectProjectResult, SetCSRFTokenResult, TranslateJSONBody, TranslateJSONResult, UnselectOrganizationResult, UnselectProjectResult, UpdateDictionaryBody, UpdateDictionaryParam, UpdateDictionaryResult, UpdateOrganizationBody, UpdateOrganizationMembersBody, UpdateOrganizationMembersResult, UpdateOrganizationResult, UpdatePasswordBody, UpdatePasswordResult, UpdateProjectBody, UpdateProjectMembersBody, UpdateProjectMembersResult, UpdateProjectResult, UpdateTagBody, UpdateTagParams, UpdateTagResult, UpdateUserBody, UpdateUserResult, UserAPI, ValidEmailParams, ValidEmailResult, WriteContentDeclarationBody, WriteContentDeclarationResult } from "./types.js";
2
2
  import { fetchDistantDictionaries } from "./distantDictionary/fetchDistantDictionaries.js";
3
3
  import { fetchDistantDictionary } from "./distantDictionary/fetchDistantDictionary.js";
4
4
  import "./distantDictionary/index.js";
@@ -15,4 +15,4 @@ import { getTagAPI } from "./getIntlayerAPI/tag.js";
15
15
  import { getUserAPI } from "./getIntlayerAPI/user.js";
16
16
  import { IntlayerAPI, getIntlayerAPI } from "./getIntlayerAPI/index.js";
17
17
  import { IntlayerAPIProxy, getIntlayerAPIProxy } from "./proxy.js";
18
- export { AIOptions, AIProvider, AddDictionaryBody, AddDictionaryResult, AddNewAccessKeyBody, AddNewAccessKeyResponse, AddOrganizationBody, AddOrganizationMemberBody, AddOrganizationMemberResult, AddOrganizationResult, AddProjectBody, AddProjectResult, AddTagBody, AddTagResult, AskDocQuestionBody, AskDocQuestionResult, AskResetPasswordBody, AskResetPasswordResult, AuditContentDeclarationBody, AuditContentDeclarationFieldBody, AuditContentDeclarationFieldResult, AuditContentDeclarationMetadataBody, AuditContentDeclarationMetadataResult, AuditContentDeclarationResult, AuditTagBody, AuditTagResult, AuthClient, AutocompleteBody, AutocompleteResponse, ChatCompletionRequestMessage, CheckIfUserHasPasswordResult, CreateAuditBody, CreateAuditResult, CreateSessionBody, CreateSessionResult, CreateUserBody, CreateUserResult, CustomQueryBody, CustomQueryResult, DefinePasswordBody, DefinePasswordResult, DeleteAccessKeyBody, DeleteAccessKeyResponse, DeleteDictionaryParam, DeleteDictionaryResult, DeleteOrganizationResult, DeleteProjectResult, DeleteTagParams, DeleteTagResult, DictionaryAPI, FetcherOptions, GetAuditByIdParams, GetAuditByIdResult, GetAuditsParams, GetAuditsResult, GetCheckoutSessionBody, GetCheckoutSessionResult, GetConfigurationResult, GetDictionariesKeysResult, GetDictionariesParams, GetDictionariesResult, GetDictionariesUpdateTimestampResult, GetDictionaryParams, GetDictionaryQuery, GetDictionaryResult, GetDiscussionsParams, GetDiscussionsResult, GetEditorDictionariesResult, GetOAuth2TokenBody, GetOAuth2TokenResult, GetOrganizationParam, GetOrganizationResult, GetOrganizationsParams, GetOrganizationsResult, GetPricingBody, GetPricingResult, GetProjectsParams, GetProjectsResult, GetSessionInformationQuery, GetSessionInformationResult, GetTagsParams, GetTagsResult, GetUserByAccountParams, GetUserByAccountResult, GetUserByEmailParams, GetUserByEmailResult, GetUserByIdParams, GetUserByIdResult, GetUsersParams, GetUsersResult, GithubLoginQueryParams, GoogleLoginQueryParams, IntlayerAPI, IntlayerAPIProxy, LoginBody, LoginResult, Messages, NewsletterSubscriptionBody, NewsletterSubscriptionResult, NewsletterUnsubscriptionBody, PushDictionariesBody, PushDictionariesResult, PushProjectConfigurationBody, PushProjectConfigurationResult, RefreshAccessKeyBody, RefreshAccessKeyResponse, RegisterBody, RegisterQuery, RegisterResult, SearchDocUtilParams, SearchDocUtilResult, SelectOrganizationParam, SelectOrganizationResult, SelectProjectParam, SelectProjectResult, SetCSRFTokenResult, TranslateJSONBody, TranslateJSONResult, UnselectOrganizationResult, UnselectProjectResult, UpdateDictionaryBody, UpdateDictionaryParam, UpdateDictionaryResult, UpdateOrganizationBody, UpdateOrganizationMembersBody, UpdateOrganizationMembersResult, UpdateOrganizationResult, UpdatePasswordBody, UpdatePasswordResult, UpdateProjectBody, UpdateProjectMembersBody, UpdateProjectMembersResult, UpdateProjectResult, UpdateTagBody, UpdateTagParams, UpdateTagResult, UpdateUserBody, UpdateUserResult, UserAPI, ValidEmailParams, ValidEmailResult, WriteContentDeclarationBody, WriteContentDeclarationResult, fetchDistantDictionaries, fetchDistantDictionary, fetcher, fetcherOptions, getAiAPI, getAuditAPI, getDictionaryAPI, getEditorAPI, getIntlayerAPI, getIntlayerAPIProxy, getOAuthAPI, getOrganizationAPI, getProjectAPI, getStripeAPI, getTagAPI, getUserAPI };
18
+ export { AIOptions, AIProvider, AddDictionaryBody, AddDictionaryResult, AddNewAccessKeyBody, AddNewAccessKeyResponse, AddOrganizationBody, AddOrganizationMemberBody, AddOrganizationMemberResult, AddOrganizationResult, AddProjectBody, AddProjectResult, AddTagBody, AddTagResult, AskDocQuestionBody, AskDocQuestionResult, AskResetPasswordBody, AskResetPasswordResult, AuditContentDeclarationBody, AuditContentDeclarationFieldBody, AuditContentDeclarationFieldResult, AuditContentDeclarationMetadataBody, AuditContentDeclarationMetadataResult, AuditContentDeclarationResult, AuditTagBody, AuditTagResult, AuthClient, AutocompleteBody, AutocompleteResponse, ChatCompletionRequestMessage, CheckIfUserHasPasswordResult, CreateAuditBody, CreateAuditResult, CreateSessionBody, CreateSessionResult, CreateUserBody, CreateUserResult, CustomQueryBody, CustomQueryResult, DefinePasswordBody, DefinePasswordResult, DeleteAccessKeyBody, DeleteAccessKeyResponse, DeleteDictionaryParam, DeleteDictionaryResult, DeleteOrganizationResult, DeleteProjectResult, DeleteTagParams, DeleteTagResult, DictionaryAPI, FetcherOptions, GetAuditByIdParams, GetAuditByIdResult, GetAuditsParams, GetAuditsResult, GetCheckoutSessionBody, GetCheckoutSessionResult, GetConfigurationResult, GetDictionariesKeysResult, GetDictionariesParams, GetDictionariesResult, GetDictionariesUpdateTimestampResult, GetDictionaryParams, GetDictionaryQuery, GetDictionaryResult, GetDiscussionsParams, GetDiscussionsResult, GetEditorDictionariesResult, GetOAuth2TokenBody, GetOAuth2TokenResult, GetOrganizationParam, GetOrganizationResult, GetOrganizationSSOConfigBody, GetOrganizationSSOConfigResult, GetOrganizationsParams, GetOrganizationsResult, GetPricingBody, GetPricingResult, GetProjectsParams, GetProjectsResult, GetSessionInformationQuery, GetSessionInformationResult, GetTagsParams, GetTagsResult, GetUserByAccountParams, GetUserByAccountResult, GetUserByEmailParams, GetUserByEmailResult, GetUserByIdParams, GetUserByIdResult, GetUsersParams, GetUsersResult, GithubLoginQueryParams, GoogleLoginQueryParams, IntlayerAPI, IntlayerAPIProxy, LoginBody, LoginResult, Messages, NewsletterSubscriptionBody, NewsletterSubscriptionResult, NewsletterUnsubscriptionBody, PushDictionariesBody, PushDictionariesResult, PushProjectConfigurationBody, PushProjectConfigurationResult, RefreshAccessKeyBody, RefreshAccessKeyResponse, RegisterBody, RegisterQuery, RegisterResult, SearchDocUtilParams, SearchDocUtilResult, SelectOrganizationParam, SelectOrganizationResult, SelectProjectParam, SelectProjectResult, SetCSRFTokenResult, TranslateJSONBody, TranslateJSONResult, UnselectOrganizationResult, UnselectProjectResult, UpdateDictionaryBody, UpdateDictionaryParam, UpdateDictionaryResult, UpdateOrganizationBody, UpdateOrganizationMembersBody, UpdateOrganizationMembersResult, UpdateOrganizationResult, UpdatePasswordBody, UpdatePasswordResult, UpdateProjectBody, UpdateProjectMembersBody, UpdateProjectMembersResult, UpdateProjectResult, UpdateTagBody, UpdateTagParams, UpdateTagResult, UpdateUserBody, UpdateUserResult, UserAPI, ValidEmailParams, ValidEmailResult, WriteContentDeclarationBody, WriteContentDeclarationResult, fetchDistantDictionaries, fetchDistantDictionary, fetcher, fetcherOptions, getAiAPI, getAuditAPI, getDictionaryAPI, getEditorAPI, getIntlayerAPI, getIntlayerAPIProxy, getOAuthAPI, getOrganizationAPI, getProjectAPI, getStripeAPI, getTagAPI, getUserAPI };
@@ -1,4 +1,4 @@
1
- import { AIOptions as AIOptions$1, AIProvider, AddDictionaryBody, AddDictionaryResult, AddNewAccessKeyBody, AddNewAccessKeyResponse, AddOrganizationBody, AddOrganizationMemberBody, AddOrganizationMemberResult, AddOrganizationResult, AddProjectBody, AddProjectResult, AddTagBody, AddTagResult, AskDocQuestionResult, AskResetPasswordBody, AskResetPasswordResult, AuditContentDeclarationBody, AuditContentDeclarationFieldBody, AuditContentDeclarationFieldResult, AuditContentDeclarationMetadataBody, AuditContentDeclarationMetadataResult, AuditContentDeclarationResult, AuditTagBody, AuditTagResult, AuthClient, AutocompleteResponse, ChatCompletionRequestMessage, CheckIfUserHasPasswordResult, CreateAuditBody, CreateAuditResult, CreateSessionBody, CreateSessionResult, CreateUserBody, CreateUserResult, CustomQueryBody, CustomQueryResult, DefinePasswordBody, DefinePasswordResult, DeleteAccessKeyBody, DeleteAccessKeyResponse, DeleteDictionaryParam, DeleteDictionaryResult, DeleteOrganizationResult, DeleteProjectResult, DeleteTagParams, DeleteTagResult, DictionaryAPI, GetAuditByIdParams, GetAuditByIdResult, GetAuditsParams, GetAuditsResult, GetCheckoutSessionBody, GetCheckoutSessionResult, GetDictionariesKeysResult, GetDictionariesParams, GetDictionariesResult, GetDictionariesUpdateTimestampResult, GetDictionaryParams, GetDictionaryQuery, GetDictionaryResult, GetDiscussionsParams, GetDiscussionsResult, GetOAuth2TokenBody, GetOAuth2TokenResult, GetOrganizationParam, GetOrganizationResult, GetOrganizationsParams, GetOrganizationsResult, GetPricingBody, GetPricingResult, GetProjectsParams, GetProjectsResult, GetSessionInformationQuery, GetSessionInformationResult, GetTagsParams, GetTagsResult, GetUserByAccountParams, GetUserByAccountResult, GetUserByEmailParams, GetUserByEmailResult, GetUserByIdParams, GetUserByIdResult, GetUsersParams, GetUsersResult, GithubLoginQueryParams, GoogleLoginQueryParams, LoginBody, LoginResult, Messages, NewsletterSubscriptionBody, NewsletterSubscriptionResult, NewsletterUnsubscriptionBody, PushDictionariesBody, PushDictionariesResult, PushProjectConfigurationBody, PushProjectConfigurationResult, RefreshAccessKeyBody, RefreshAccessKeyResponse, RegisterBody, RegisterQuery, RegisterResult, SearchDocUtilParams, SearchDocUtilResult, SelectOrganizationParam, SelectOrganizationResult, SelectProjectParam, SelectProjectResult, SetCSRFTokenResult, TranslateJSONBody, TranslateJSONResult, UnselectOrganizationResult, UnselectProjectResult, UpdateDictionaryBody, UpdateDictionaryParam, UpdateDictionaryResult, UpdateOrganizationBody, UpdateOrganizationMembersBody, UpdateOrganizationMembersResult, UpdateOrganizationResult, UpdatePasswordBody, UpdatePasswordResult, UpdateProjectBody, UpdateProjectMembersBody, UpdateProjectMembersResult, UpdateProjectResult, UpdateTagBody, UpdateTagParams, UpdateTagResult, UpdateUserBody, UpdateUserResult, UserAPI, ValidEmailParams, ValidEmailResult } from "@intlayer/backend";
1
+ import { AIOptions as AIOptions$1, AIProvider, AddDictionaryBody, AddDictionaryResult, AddNewAccessKeyBody, AddNewAccessKeyResponse, AddOrganizationBody, AddOrganizationMemberBody, AddOrganizationMemberResult, AddOrganizationResult, AddProjectBody, AddProjectResult, AddTagBody, AddTagResult, AskDocQuestionResult, AskResetPasswordBody, AskResetPasswordResult, AuditContentDeclarationBody, AuditContentDeclarationFieldBody, AuditContentDeclarationFieldResult, AuditContentDeclarationMetadataBody, AuditContentDeclarationMetadataResult, AuditContentDeclarationResult, AuditTagBody, AuditTagResult, AuthClient, AutocompleteResponse, ChatCompletionRequestMessage, CheckIfUserHasPasswordResult, CreateAuditBody, CreateAuditResult, CreateSessionBody, CreateSessionResult, CreateUserBody, CreateUserResult, CustomQueryBody, CustomQueryResult, DefinePasswordBody, DefinePasswordResult, DeleteAccessKeyBody, DeleteAccessKeyResponse, DeleteDictionaryParam, DeleteDictionaryResult, DeleteOrganizationResult, DeleteProjectResult, DeleteTagParams, DeleteTagResult, DictionaryAPI, GetAuditByIdParams, GetAuditByIdResult, GetAuditsParams, GetAuditsResult, GetCheckoutSessionBody, GetCheckoutSessionResult, GetDictionariesKeysResult, GetDictionariesParams, GetDictionariesResult, GetDictionariesUpdateTimestampResult, GetDictionaryParams, GetDictionaryQuery, GetDictionaryResult, GetDiscussionsParams, GetDiscussionsResult, GetOAuth2TokenBody, GetOAuth2TokenResult, GetOrganizationParam, GetOrganizationResult, GetOrganizationSSOConfigBody, GetOrganizationSSOConfigResult, GetOrganizationsParams, GetOrganizationsResult, GetPricingBody, GetPricingResult, GetProjectsParams, GetProjectsResult, GetSessionInformationQuery, GetSessionInformationResult, GetTagsParams, GetTagsResult, GetUserByAccountParams, GetUserByAccountResult, GetUserByEmailParams, GetUserByEmailResult, GetUserByIdParams, GetUserByIdResult, GetUsersParams, GetUsersResult, GithubLoginQueryParams, GoogleLoginQueryParams, LoginBody, LoginResult, Messages, NewsletterSubscriptionBody, NewsletterSubscriptionResult, NewsletterUnsubscriptionBody, PushDictionariesBody, PushDictionariesResult, PushProjectConfigurationBody, PushProjectConfigurationResult, RefreshAccessKeyBody, RefreshAccessKeyResponse, RegisterBody, RegisterQuery, RegisterResult, SearchDocUtilParams, SearchDocUtilResult, SelectOrganizationParam, SelectOrganizationResult, SelectProjectParam, SelectProjectResult, SetCSRFTokenResult, TranslateJSONBody, TranslateJSONResult, UnselectOrganizationResult, UnselectProjectResult, UpdateDictionaryBody, UpdateDictionaryParam, UpdateDictionaryResult, UpdateOrganizationBody, UpdateOrganizationMembersBody, UpdateOrganizationMembersResult, UpdateOrganizationResult, UpdatePasswordBody, UpdatePasswordResult, UpdateProjectBody, UpdateProjectMembersBody, UpdateProjectMembersResult, UpdateProjectResult, UpdateTagBody, UpdateTagParams, UpdateTagResult, UpdateUserBody, UpdateUserResult, UserAPI, ValidEmailParams, ValidEmailResult } from "@intlayer/backend";
2
2
  import { GetConfigurationResult, GetEditorDictionariesResult, WriteContentDeclarationBody, WriteContentDeclarationResult } from "intlayer-editor";
3
3
 
4
4
  //#region src/types.d.ts
@@ -11,5 +11,5 @@ type AutocompleteBody = {
11
11
  contextAfter?: string;
12
12
  };
13
13
  //#endregion
14
- export { type AIOptions$1 as AIOptions, type AIProvider, type AddDictionaryBody, type AddDictionaryResult, type AddNewAccessKeyBody, type AddNewAccessKeyResponse, type AddOrganizationBody, type AddOrganizationMemberBody, type AddOrganizationMemberResult, type AddOrganizationResult, type AddProjectBody, type AddProjectResult, type AddTagBody, type AddTagResult, type AskDocQuestionResult, type AskResetPasswordBody, type AskResetPasswordResult, type AuditContentDeclarationBody, type AuditContentDeclarationFieldBody, type AuditContentDeclarationFieldResult, type AuditContentDeclarationMetadataBody, type AuditContentDeclarationMetadataResult, type AuditContentDeclarationResult, type AuditTagBody, type AuditTagResult, type AuthClient, type AutocompleteBody, type AutocompleteResponse, type ChatCompletionRequestMessage, type CheckIfUserHasPasswordResult, type CreateAuditBody, type CreateAuditResult, type CreateSessionBody, type CreateSessionResult, type CreateUserBody, type CreateUserResult, type CustomQueryBody, type CustomQueryResult, type DefinePasswordBody, type DefinePasswordResult, type DeleteAccessKeyBody, type DeleteAccessKeyResponse, type DeleteDictionaryParam, type DeleteDictionaryResult, type DeleteOrganizationResult, type DeleteProjectResult, type DeleteTagParams, type DeleteTagResult, type DictionaryAPI, type GetAuditByIdParams, type GetAuditByIdResult, type GetAuditsParams, type GetAuditsResult, type GetCheckoutSessionBody, type GetCheckoutSessionResult, type GetConfigurationResult, type GetDictionariesKeysResult, type GetDictionariesParams, type GetDictionariesResult, type GetDictionariesUpdateTimestampResult, type GetDictionaryParams, type GetDictionaryQuery, type GetDictionaryResult, type GetDiscussionsParams, type GetDiscussionsResult, type GetEditorDictionariesResult, type GetOAuth2TokenBody, type GetOAuth2TokenResult, type GetOrganizationParam, type GetOrganizationResult, type GetOrganizationsParams, type GetOrganizationsResult, type GetPricingBody, type GetPricingResult, type GetProjectsParams, type GetProjectsResult, type GetSessionInformationQuery, type GetSessionInformationResult, type GetTagsParams, type GetTagsResult, type GetUserByAccountParams, type GetUserByAccountResult, type GetUserByEmailParams, type GetUserByEmailResult, type GetUserByIdParams, type GetUserByIdResult, type GetUsersParams, type GetUsersResult, type GithubLoginQueryParams, type GoogleLoginQueryParams, type LoginBody, type LoginResult, type Messages, type NewsletterSubscriptionBody, type NewsletterSubscriptionResult, type NewsletterUnsubscriptionBody, type PushDictionariesBody, type PushDictionariesResult, type PushProjectConfigurationBody, type PushProjectConfigurationResult, type RefreshAccessKeyBody, type RefreshAccessKeyResponse, type RegisterBody, type RegisterQuery, type RegisterResult, type SearchDocUtilParams, type SearchDocUtilResult, type SelectOrganizationParam, type SelectOrganizationResult, type SelectProjectParam, type SelectProjectResult, type SetCSRFTokenResult, type TranslateJSONBody, type TranslateJSONResult, type UnselectOrganizationResult, type UnselectProjectResult, type UpdateDictionaryBody, type UpdateDictionaryParam, type UpdateDictionaryResult, type UpdateOrganizationBody, type UpdateOrganizationMembersBody, type UpdateOrganizationMembersResult, type UpdateOrganizationResult, type UpdatePasswordBody, type UpdatePasswordResult, type UpdateProjectBody, type UpdateProjectMembersBody, type UpdateProjectMembersResult, type UpdateProjectResult, type UpdateTagBody, type UpdateTagParams, type UpdateTagResult, type UpdateUserBody, type UpdateUserResult, type UserAPI, type ValidEmailParams, type ValidEmailResult, type WriteContentDeclarationBody, type WriteContentDeclarationResult };
14
+ export { type AIOptions$1 as AIOptions, type AIProvider, type AddDictionaryBody, type AddDictionaryResult, type AddNewAccessKeyBody, type AddNewAccessKeyResponse, type AddOrganizationBody, type AddOrganizationMemberBody, type AddOrganizationMemberResult, type AddOrganizationResult, type AddProjectBody, type AddProjectResult, type AddTagBody, type AddTagResult, type AskDocQuestionResult, type AskResetPasswordBody, type AskResetPasswordResult, type AuditContentDeclarationBody, type AuditContentDeclarationFieldBody, type AuditContentDeclarationFieldResult, type AuditContentDeclarationMetadataBody, type AuditContentDeclarationMetadataResult, type AuditContentDeclarationResult, type AuditTagBody, type AuditTagResult, type AuthClient, type AutocompleteBody, type AutocompleteResponse, type ChatCompletionRequestMessage, type CheckIfUserHasPasswordResult, type CreateAuditBody, type CreateAuditResult, type CreateSessionBody, type CreateSessionResult, type CreateUserBody, type CreateUserResult, type CustomQueryBody, type CustomQueryResult, type DefinePasswordBody, type DefinePasswordResult, type DeleteAccessKeyBody, type DeleteAccessKeyResponse, type DeleteDictionaryParam, type DeleteDictionaryResult, type DeleteOrganizationResult, type DeleteProjectResult, type DeleteTagParams, type DeleteTagResult, type DictionaryAPI, type GetAuditByIdParams, type GetAuditByIdResult, type GetAuditsParams, type GetAuditsResult, type GetCheckoutSessionBody, type GetCheckoutSessionResult, type GetConfigurationResult, type GetDictionariesKeysResult, type GetDictionariesParams, type GetDictionariesResult, type GetDictionariesUpdateTimestampResult, type GetDictionaryParams, type GetDictionaryQuery, type GetDictionaryResult, type GetDiscussionsParams, type GetDiscussionsResult, type GetEditorDictionariesResult, type GetOAuth2TokenBody, type GetOAuth2TokenResult, type GetOrganizationParam, type GetOrganizationResult, type GetOrganizationSSOConfigBody, type GetOrganizationSSOConfigResult, type GetOrganizationsParams, type GetOrganizationsResult, type GetPricingBody, type GetPricingResult, type GetProjectsParams, type GetProjectsResult, type GetSessionInformationQuery, type GetSessionInformationResult, type GetTagsParams, type GetTagsResult, type GetUserByAccountParams, type GetUserByAccountResult, type GetUserByEmailParams, type GetUserByEmailResult, type GetUserByIdParams, type GetUserByIdResult, type GetUsersParams, type GetUsersResult, type GithubLoginQueryParams, type GoogleLoginQueryParams, type LoginBody, type LoginResult, type Messages, type NewsletterSubscriptionBody, type NewsletterSubscriptionResult, type NewsletterUnsubscriptionBody, type PushDictionariesBody, type PushDictionariesResult, type PushProjectConfigurationBody, type PushProjectConfigurationResult, type RefreshAccessKeyBody, type RefreshAccessKeyResponse, type RegisterBody, type RegisterQuery, type RegisterResult, type SearchDocUtilParams, type SearchDocUtilResult, type SelectOrganizationParam, type SelectOrganizationResult, type SelectProjectParam, type SelectProjectResult, type SetCSRFTokenResult, type TranslateJSONBody, type TranslateJSONResult, type UnselectOrganizationResult, type UnselectProjectResult, type UpdateDictionaryBody, type UpdateDictionaryParam, type UpdateDictionaryResult, type UpdateOrganizationBody, type UpdateOrganizationMembersBody, type UpdateOrganizationMembersResult, type UpdateOrganizationResult, type UpdatePasswordBody, type UpdatePasswordResult, type UpdateProjectBody, type UpdateProjectMembersBody, type UpdateProjectMembersResult, type UpdateProjectResult, type UpdateTagBody, type UpdateTagParams, type UpdateTagResult, type UpdateUserBody, type UpdateUserResult, type UserAPI, type ValidEmailParams, type ValidEmailResult, type WriteContentDeclarationBody, type WriteContentDeclarationResult };
15
15
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","names":[],"sources":["../../src/types.ts"],"sourcesContent":[],"mappings":";;;;;KAuJY,gBAAA;;cAEE"}
1
+ {"version":3,"file":"types.d.ts","names":[],"sources":["../../src/types.ts"],"sourcesContent":[],"mappings":";;;;;KAyJY,gBAAA;;cAEE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/api",
3
- "version": "7.5.0-canary.1",
3
+ "version": "7.5.1",
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": [
@@ -73,21 +73,21 @@
73
73
  "typecheck": "tsc --noEmit --project tsconfig.types.json"
74
74
  },
75
75
  "dependencies": {
76
- "@intlayer/config": "7.5.0-canary.1"
76
+ "@intlayer/config": "7.5.1"
77
77
  },
78
78
  "devDependencies": {
79
- "@types/node": "25.0.2",
79
+ "@types/node": "25.0.3",
80
80
  "@utils/ts-config": "1.0.4",
81
81
  "@utils/ts-config-types": "1.0.4",
82
82
  "@utils/tsdown-config": "1.0.4",
83
83
  "rimraf": "6.1.2",
84
- "tsdown": "0.18.0",
84
+ "tsdown": "0.18.1",
85
85
  "typescript": "5.9.3",
86
86
  "vitest": "4.0.16"
87
87
  },
88
88
  "peerDependencies": {
89
- "@intlayer/backend": "7.5.0-canary.1",
90
- "intlayer-editor": "7.5.0-canary.1"
89
+ "@intlayer/backend": "7.5.1",
90
+ "intlayer-editor": "7.5.1"
91
91
  },
92
92
  "peerDependenciesMeta": {
93
93
  "@intlayer/backend": {