@intlayer/api 3.5.8

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 (63) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +240 -0
  3. package/dist/cjs/ai.cjs +89 -0
  4. package/dist/cjs/ai.cjs.map +1 -0
  5. package/dist/cjs/auth.cjs +166 -0
  6. package/dist/cjs/auth.cjs.map +1 -0
  7. package/dist/cjs/dictionary.cjs +103 -0
  8. package/dist/cjs/dictionary.cjs.map +1 -0
  9. package/dist/cjs/fetcher.cjs +98 -0
  10. package/dist/cjs/fetcher.cjs.map +1 -0
  11. package/dist/cjs/index.cjs +49 -0
  12. package/dist/cjs/index.cjs.map +1 -0
  13. package/dist/cjs/organization.cjs +121 -0
  14. package/dist/cjs/organization.cjs.map +1 -0
  15. package/dist/cjs/project.cjs +135 -0
  16. package/dist/cjs/project.cjs.map +1 -0
  17. package/dist/cjs/stripe.cjs +55 -0
  18. package/dist/cjs/stripe.cjs.map +1 -0
  19. package/dist/cjs/tag.cjs +77 -0
  20. package/dist/cjs/tag.cjs.map +1 -0
  21. package/dist/cjs/user.cjs +95 -0
  22. package/dist/cjs/user.cjs.map +1 -0
  23. package/dist/esm/ai.mjs +64 -0
  24. package/dist/esm/ai.mjs.map +1 -0
  25. package/dist/esm/auth.mjs +141 -0
  26. package/dist/esm/auth.mjs.map +1 -0
  27. package/dist/esm/dictionary.mjs +78 -0
  28. package/dist/esm/dictionary.mjs.map +1 -0
  29. package/dist/esm/fetcher.mjs +73 -0
  30. package/dist/esm/fetcher.mjs.map +1 -0
  31. package/dist/esm/index.mjs +24 -0
  32. package/dist/esm/index.mjs.map +1 -0
  33. package/dist/esm/organization.mjs +96 -0
  34. package/dist/esm/organization.mjs.map +1 -0
  35. package/dist/esm/project.mjs +110 -0
  36. package/dist/esm/project.mjs.map +1 -0
  37. package/dist/esm/stripe.mjs +31 -0
  38. package/dist/esm/stripe.mjs.map +1 -0
  39. package/dist/esm/tag.mjs +52 -0
  40. package/dist/esm/tag.mjs.map +1 -0
  41. package/dist/esm/user.mjs +70 -0
  42. package/dist/esm/user.mjs.map +1 -0
  43. package/dist/types/ai.d.ts +18 -0
  44. package/dist/types/ai.d.ts.map +1 -0
  45. package/dist/types/auth.d.ts +38 -0
  46. package/dist/types/auth.d.ts.map +1 -0
  47. package/dist/types/dictionary.d.ts +22 -0
  48. package/dist/types/dictionary.d.ts.map +1 -0
  49. package/dist/types/fetcher.d.ts +70 -0
  50. package/dist/types/fetcher.d.ts.map +1 -0
  51. package/dist/types/index.d.ts +157 -0
  52. package/dist/types/index.d.ts.map +1 -0
  53. package/dist/types/organization.d.ts +26 -0
  54. package/dist/types/organization.d.ts.map +1 -0
  55. package/dist/types/project.d.ts +28 -0
  56. package/dist/types/project.d.ts.map +1 -0
  57. package/dist/types/stripe.d.ts +8 -0
  58. package/dist/types/stripe.d.ts.map +1 -0
  59. package/dist/types/tag.d.ts +16 -0
  60. package/dist/types/tag.d.ts.map +1 -0
  61. package/dist/types/user.d.ts +22 -0
  62. package/dist/types/user.d.ts.map +1 -0
  63. package/package.json +99 -0
@@ -0,0 +1,78 @@
1
+ import { getConfiguration } from "@intlayer/config/client";
2
+ import { fetcher } from './fetcher.mjs';
3
+ const getDictionaryAPI = (authAPIOptions = {}, intlayerConfig) => {
4
+ const { backendURL } = (intlayerConfig ?? getConfiguration()).editor;
5
+ const PROJECT_API_ROUTE = `${backendURL}/api/dictionary`;
6
+ const getDictionaries = async (filters, otherOptions = {}) => await fetcher(
7
+ PROJECT_API_ROUTE,
8
+ authAPIOptions,
9
+ otherOptions,
10
+ {
11
+ params: filters
12
+ }
13
+ );
14
+ const getDictionariesKeys = async (otherOptions = {}) => await fetcher(
15
+ `${PROJECT_API_ROUTE}/keys`,
16
+ authAPIOptions,
17
+ otherOptions
18
+ );
19
+ const getDictionary = async (dictionaryKey, version, otherOptions = {}) => await fetcher(
20
+ `${PROJECT_API_ROUTE}/${dictionaryKey}`,
21
+ authAPIOptions,
22
+ otherOptions,
23
+ {
24
+ params: version ? { version: version.toString() } : void 0
25
+ }
26
+ );
27
+ const addDictionary = async (dictionary, otherOptions = {}) => await fetcher(
28
+ `${PROJECT_API_ROUTE}`,
29
+ authAPIOptions,
30
+ otherOptions,
31
+ {
32
+ method: "POST",
33
+ body: dictionary
34
+ }
35
+ );
36
+ const pushDictionaries = async (dictionaries, otherOptions = {}) => await fetcher(
37
+ `${PROJECT_API_ROUTE}`,
38
+ authAPIOptions,
39
+ otherOptions,
40
+ {
41
+ method: "PATCH",
42
+ body: { dictionaries }
43
+ }
44
+ );
45
+ const updateDictionary = async (dictionaryId, dictionary, otherOptions = {}) => await fetcher(
46
+ `${PROJECT_API_ROUTE}/${dictionaryId}`,
47
+ authAPIOptions,
48
+ otherOptions,
49
+ {
50
+ method: "PUT",
51
+ body: dictionary
52
+ }
53
+ );
54
+ const deleteDictionary = async (id, otherOptions = {}) => await fetcher(
55
+ `${PROJECT_API_ROUTE}`,
56
+ authAPIOptions,
57
+ otherOptions,
58
+ {
59
+ method: "DELETE",
60
+ body: { id }
61
+ }
62
+ );
63
+ return {
64
+ getDictionaries,
65
+ getDictionariesKeys,
66
+ getDictionary,
67
+ pushDictionaries,
68
+ addDictionary,
69
+ updateDictionary,
70
+ deleteDictionary
71
+ };
72
+ };
73
+ const dictionaryAPI = getDictionaryAPI();
74
+ export {
75
+ dictionaryAPI,
76
+ getDictionaryAPI
77
+ };
78
+ //# sourceMappingURL=dictionary.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/dictionary.ts"],"sourcesContent":["import type {\n AddDictionaryBody,\n AddDictionaryResult,\n DeleteDictionaryParam,\n DeleteDictionaryResult,\n GetDictionariesParams,\n GetDictionariesResult,\n UpdateDictionaryParam,\n UpdateDictionaryBody,\n UpdateDictionaryResult,\n PushDictionariesBody,\n PushDictionariesResult,\n GetDictionaryParams,\n GetDictionaryQuery,\n GetDictionaryResult,\n GetDictionariesKeysResult,\n // @ts-ignore @intlayer/backend not build yet\n} from '@intlayer/backend';\nimport { getConfiguration, type IntlayerConfig } from '@intlayer/config/client';\nimport { fetcher, type FetcherOptions } from './fetcher';\n\nexport const getDictionaryAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const { backendURL } = (intlayerConfig ?? getConfiguration()).editor;\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 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\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 dictionary: AddDictionaryBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<AddDictionaryResult>(\n `${PROJECT_API_ROUTE}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: dictionary,\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 dictionaryId: UpdateDictionaryParam['dictionaryId'],\n dictionary: UpdateDictionaryBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<UpdateDictionaryResult>(\n `${PROJECT_API_ROUTE}/${dictionaryId}`,\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}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'DELETE',\n body: { id },\n }\n );\n\n return {\n getDictionaries,\n getDictionariesKeys,\n getDictionary,\n pushDictionaries,\n addDictionary,\n updateDictionary,\n deleteDictionary,\n };\n};\n\nexport const dictionaryAPI = getDictionaryAPI();\n"],"mappings":"AAkBA,SAAS,wBAA6C;AACtD,SAAS,eAAoC;AAEtC,MAAM,mBAAmB,CAC9B,iBAAiC,CAAC,GAClC,mBACG;AACH,QAAM,EAAE,WAAW,KAAK,kBAAkB,iBAAiB,GAAG;AAC9D,QAAM,oBAAoB,GAAG,UAAU;AAMvC,QAAM,kBAAkB,OACtB,SACA,eAA+B,CAAC,MAEhC,MAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,IACV;AAAA,EACF;AAKF,QAAM,sBAAsB,OAAO,eAA+B,CAAC,MACjE,MAAM;AAAA,IACJ,GAAG,iBAAiB;AAAA,IACpB;AAAA,IACA;AAAA,EACF;AAOF,QAAM,gBAAgB,OACpB,eACA,SACA,eAA+B,CAAC,MAEhC,MAAM;AAAA,IACJ,GAAG,iBAAiB,IAAI,aAAa;AAAA,IACrC;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ,UAAU,EAAE,SAAS,QAAQ,SAAS,EAAE,IAAI;AAAA,IACtD;AAAA,EACF;AAMF,QAAM,gBAAgB,OACpB,YACA,eAA+B,CAAC,MAEhC,MAAM;AAAA,IACJ,GAAG,iBAAiB;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,MACR,MAAM;AAAA,IACR;AAAA,EACF;AAEF,QAAM,mBAAmB,OACvB,cACA,eAA+B,CAAC,MAEhC,MAAM;AAAA,IACJ,GAAG,iBAAiB;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,MACR,MAAM,EAAE,aAAa;AAAA,IACvB;AAAA,EACF;AAMF,QAAM,mBAAmB,OACvB,cACA,YACA,eAA+B,CAAC,MAEhC,MAAM;AAAA,IACJ,GAAG,iBAAiB,IAAI,YAAY;AAAA,IACpC;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,MACR,MAAM;AAAA,IACR;AAAA,EACF;AAMF,QAAM,mBAAmB,OACvB,IACA,eAA+B,CAAC,MAEhC,MAAM;AAAA,IACJ,GAAG,iBAAiB;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,MACR,MAAM,EAAE,GAAG;AAAA,IACb;AAAA,EACF;AAEF,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAEO,MAAM,gBAAgB,iBAAiB;","names":[]}
@@ -0,0 +1,73 @@
1
+ const fetcherOptions = {
2
+ method: "GET",
3
+ // Default HTTP method
4
+ headers: {
5
+ "Content-Type": "application/json"
6
+ // Default content type
7
+ },
8
+ credentials: "include"
9
+ // Include cookies in the request
10
+ };
11
+ const removeUndefined = (obj) => {
12
+ Object.keys(obj).forEach((key) => {
13
+ if (obj[key] === void 0) {
14
+ delete obj[key];
15
+ }
16
+ });
17
+ return obj;
18
+ };
19
+ const deepMerge = (objects) => objects.reduce((acc, obj) => {
20
+ const acc1 = acc ?? {};
21
+ const obj1 = removeUndefined(obj ?? {});
22
+ if (typeof acc1 === "object" && typeof obj1 === "object") {
23
+ return { ...acc1, ...obj1 };
24
+ }
25
+ return obj1 ?? acc1;
26
+ }, {});
27
+ const fetcher = async (url, ...options) => {
28
+ let paramsString = "";
29
+ let bodyString = void 0;
30
+ const otherOptions = options.map(
31
+ ({ body, params: params2, headers, ...otherOptions2 }) => otherOptions2
32
+ );
33
+ const mergedOptions = deepMerge([fetcherOptions, ...otherOptions]);
34
+ const mergedHeaders = deepMerge([
35
+ fetcherOptions.headers,
36
+ ...options.map((option) => option.headers)
37
+ ]);
38
+ const params = deepMerge(options.map((option) => option.params));
39
+ const method = mergedOptions.method;
40
+ if (method !== "GET" && method !== "HEAD") {
41
+ const body = deepMerge(options.map((option) => option.body));
42
+ if (mergedHeaders?.["Content-Type"] === "application/x-www-form-urlencoded") {
43
+ bodyString = new URLSearchParams(
44
+ body
45
+ ).toString();
46
+ } else {
47
+ bodyString = JSON.stringify(body);
48
+ }
49
+ }
50
+ if (Object.entries(params).length > 0) {
51
+ paramsString = `?${new URLSearchParams(
52
+ params
53
+ ).toString()}`;
54
+ }
55
+ const formattedOptions = {
56
+ ...mergedOptions,
57
+ headers: mergedHeaders,
58
+ body: bodyString
59
+ };
60
+ const urlResult = `${url}${paramsString}`;
61
+ const response = await fetch(urlResult, formattedOptions);
62
+ if (!response.ok) {
63
+ const result = await response.json();
64
+ console.error(result);
65
+ throw new Error(JSON.stringify(result.error) ?? "An error occurred");
66
+ }
67
+ return await response.json();
68
+ };
69
+ export {
70
+ fetcher,
71
+ fetcherOptions
72
+ };
73
+ //# sourceMappingURL=fetcher.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/fetcher.ts"],"sourcesContent":["/**\n * Type definition for options used in the fetcher function.\n * Extends the standard RequestInit interface (excluding 'body'),\n * and adds 'body' and 'params' properties for convenience.\n */\nexport type FetcherOptions = Omit<RequestInit, 'body'> & {\n /**\n * Body of the request. Should be a key-value pair object.\n */\n body?: Record<string, unknown>;\n /**\n * Query parameters to be appended to the URL.\n */\n params?:\n | Record<string, string | string[] | undefined>\n | string[]\n | URLSearchParams;\n};\n\n/**\n * Default options for the fetcher function.\n * Sets the default method to 'GET', the 'Content-Type' header to 'application/json',\n * and includes credentials in the request.\n */\nexport const fetcherOptions: FetcherOptions = {\n method: 'GET', // Default HTTP method\n headers: {\n 'Content-Type': 'application/json', // Default content type\n },\n credentials: 'include', // Include cookies in the request\n};\n\n/**\n * Utility function to remove properties with undefined values from an object.\n * This helps prevent sending undefined values in the request options.\n *\n * @param obj - The object to clean.\n * @returns The cleaned object without undefined values.\n */\nconst removeUndefined = (obj: object) => {\n Object.keys(obj).forEach((key) => {\n if (obj[key as keyof typeof obj] === undefined) {\n delete obj[key as keyof typeof obj];\n }\n });\n return obj;\n};\n\n/**\n * Deeply merges an array of objects into a single object.\n * Later objects in the array overwrite properties of earlier ones.\n *\n * @template T - The type of objects being merged.\n * @param objects - An array of objects to merge.\n * @returns The merged object.\n */\nconst deepMerge = <T extends object>(objects: (T | undefined)[]): T =>\n objects.reduce((acc, obj) => {\n const acc1: T = (acc ?? {}) as T;\n const obj1: T = removeUndefined(obj ?? {}) as T;\n\n if (typeof acc1 === 'object' && typeof obj1 === 'object') {\n // Merge the two objects\n return { ...acc1, ...obj1 };\n }\n\n // If one of them is not an object, return the defined one\n return obj1 ?? acc1;\n }, {} as T)!;\n\n/**\n * Fetcher function to make HTTP requests.\n * It merges default options with user-provided options,\n * handles query parameters and request body,\n * and returns the parsed JSON response.\n *\n * @template T - The expected type of the response data.\n * @param url - The endpoint URL.\n * @param options - Additional options to customize the request.\n * @returns A promise that resolves with the response data of type T.\n *\n * @example\n * ```typescript\n * // Making a GET request with query parameters\n * const data = await fetcher<MyResponseType>('https://api.example.com/data', {\n * params: { search: 'query' },\n * });\n *\n * // Making a POST request with a JSON body\n * const result = await fetcher<AnotherResponseType>('https://api.example.com/submit', {\n * method: 'POST',\n * body: { key: 'value' },\n * });\n *\n * // Merge body, headers, and params\n * const result = await fetcher<AnotherResponseType>('https://api.example.com/submit', {\n * method: 'POST',\n * body: { key: 'value' },\n * headers: { 'Content-Type': 'application/json' },\n * params: { search: 'query' },\n * },\n * {\n * headers: { 'Content-Type': 'application/x-www-form-urlencoded' },\n * params: { page: 1 },\n * });\n * ```\n *\n * Result:\n * ```typescript\n * {\n * method: 'POST',\n * headers: { 'Content-Type': 'application/x-www-form-urlencoded' },\n * params: { page: 1, search: 'query' },\n * body: { key: 'value' },\n * }\n * ```\n */\nexport const fetcher = async <T>(\n url: string,\n ...options: FetcherOptions[]\n): Promise<T> => {\n // Initialize query parameters string and request body string\n let paramsString = '';\n let bodyString: string | undefined = undefined;\n\n // Extract other options excluding 'body', 'params', and 'headers'\n const otherOptions = options.map(\n ({ body, params, headers, ...otherOptions }) => otherOptions\n );\n\n // Merge default options with user-provided options\n const mergedOptions = deepMerge([fetcherOptions, ...otherOptions]);\n\n // Merge default headers with user-provided headers\n const mergedHeaders = deepMerge([\n fetcherOptions.headers,\n ...options.map((option) => option.headers),\n ]);\n\n // Merge query parameters\n const params = deepMerge(options.map((option) => option.params));\n\n const method = mergedOptions.method;\n\n // If the request method is not 'GET' or 'HEAD', prepare the request body\n if (method !== 'GET' && method !== 'HEAD') {\n // Merge all 'body' options\n const body = deepMerge(options.map((option) => option.body));\n if (\n mergedHeaders?.['Content-Type' as keyof HeadersInit] ===\n 'application/x-www-form-urlencoded'\n ) {\n // If the content type is 'application/x-www-form-urlencoded', encode the body accordingly\n bodyString = new URLSearchParams(\n body as Record<string, string>\n ).toString();\n } else {\n // Otherwise, stringify the body as JSON\n bodyString = JSON.stringify(body);\n }\n }\n\n // If there are query parameters, append them to the URL\n if (Object.entries(params).length > 0) {\n paramsString = `?${new URLSearchParams(\n params as Record<string, string>\n ).toString()}`;\n }\n\n // Prepare the final request options\n const formattedOptions: RequestInit = {\n ...mergedOptions,\n headers: mergedHeaders,\n body: bodyString,\n };\n\n // Construct the full URL with query parameters\n const urlResult = `${url}${paramsString}`;\n\n // Make the HTTP request using fetch\n const response = await fetch(urlResult, formattedOptions);\n\n if (!response.ok) {\n const result = await response.json();\n\n console.error(result);\n\n // You can customize the error message or include more details\n throw new Error(JSON.stringify(result.error) ?? 'An error occurred');\n }\n return await response.json();\n};\n"],"mappings":"AAwBO,MAAM,iBAAiC;AAAA,EAC5C,QAAQ;AAAA;AAAA,EACR,SAAS;AAAA,IACP,gBAAgB;AAAA;AAAA,EAClB;AAAA,EACA,aAAa;AAAA;AACf;AASA,MAAM,kBAAkB,CAAC,QAAgB;AACvC,SAAO,KAAK,GAAG,EAAE,QAAQ,CAAC,QAAQ;AAChC,QAAI,IAAI,GAAuB,MAAM,QAAW;AAC9C,aAAO,IAAI,GAAuB;AAAA,IACpC;AAAA,EACF,CAAC;AACD,SAAO;AACT;AAUA,MAAM,YAAY,CAAmB,YACnC,QAAQ,OAAO,CAAC,KAAK,QAAQ;AAC3B,QAAM,OAAW,OAAO,CAAC;AACzB,QAAM,OAAU,gBAAgB,OAAO,CAAC,CAAC;AAEzC,MAAI,OAAO,SAAS,YAAY,OAAO,SAAS,UAAU;AAExD,WAAO,EAAE,GAAG,MAAM,GAAG,KAAK;AAAA,EAC5B;AAGA,SAAO,QAAQ;AACjB,GAAG,CAAC,CAAM;AAiDL,MAAM,UAAU,OACrB,QACG,YACY;AAEf,MAAI,eAAe;AACnB,MAAI,aAAiC;AAGrC,QAAM,eAAe,QAAQ;AAAA,IAC3B,CAAC,EAAE,MAAM,QAAAA,SAAQ,SAAS,GAAGC,cAAa,MAAMA;AAAA,EAClD;AAGA,QAAM,gBAAgB,UAAU,CAAC,gBAAgB,GAAG,YAAY,CAAC;AAGjE,QAAM,gBAAgB,UAAU;AAAA,IAC9B,eAAe;AAAA,IACf,GAAG,QAAQ,IAAI,CAAC,WAAW,OAAO,OAAO;AAAA,EAC3C,CAAC;AAGD,QAAM,SAAS,UAAU,QAAQ,IAAI,CAAC,WAAW,OAAO,MAAM,CAAC;AAE/D,QAAM,SAAS,cAAc;AAG7B,MAAI,WAAW,SAAS,WAAW,QAAQ;AAEzC,UAAM,OAAO,UAAU,QAAQ,IAAI,CAAC,WAAW,OAAO,IAAI,CAAC;AAC3D,QACE,gBAAgB,cAAmC,MACnD,qCACA;AAEA,mBAAa,IAAI;AAAA,QACf;AAAA,MACF,EAAE,SAAS;AAAA,IACb,OAAO;AAEL,mBAAa,KAAK,UAAU,IAAI;AAAA,IAClC;AAAA,EACF;AAGA,MAAI,OAAO,QAAQ,MAAM,EAAE,SAAS,GAAG;AACrC,mBAAe,IAAI,IAAI;AAAA,MACrB;AAAA,IACF,EAAE,SAAS,CAAC;AAAA,EACd;AAGA,QAAM,mBAAgC;AAAA,IACpC,GAAG;AAAA,IACH,SAAS;AAAA,IACT,MAAM;AAAA,EACR;AAGA,QAAM,YAAY,GAAG,GAAG,GAAG,YAAY;AAGvC,QAAM,WAAW,MAAM,MAAM,WAAW,gBAAgB;AAExD,MAAI,CAAC,SAAS,IAAI;AAChB,UAAM,SAAS,MAAM,SAAS,KAAK;AAEnC,YAAQ,MAAM,MAAM;AAGpB,UAAM,IAAI,MAAM,KAAK,UAAU,OAAO,KAAK,KAAK,mBAAmB;AAAA,EACrE;AACA,SAAO,MAAM,SAAS,KAAK;AAC7B;","names":["params","otherOptions"]}
@@ -0,0 +1,24 @@
1
+ import { getAiAPI } from './ai.mjs';
2
+ import { getAuthAPI } from './auth.mjs';
3
+ import { getDictionaryAPI } from './dictionary.mjs';
4
+ import { getOrganizationAPI } from './organization.mjs';
5
+ import { getProjectAPI } from './project.mjs';
6
+ import { getStripeAPI } from './stripe.mjs';
7
+ import { getTagAPI } from './tag.mjs';
8
+ import { getUserAPI } from './user.mjs';
9
+ const getIntlayerAPI = (authAPIOptions = {}, intlayerConfig) => ({
10
+ organization: getOrganizationAPI(authAPIOptions, intlayerConfig),
11
+ project: getProjectAPI(authAPIOptions, intlayerConfig),
12
+ user: getUserAPI(authAPIOptions, intlayerConfig),
13
+ auth: getAuthAPI(authAPIOptions, intlayerConfig),
14
+ dictionary: getDictionaryAPI(authAPIOptions, intlayerConfig),
15
+ stripe: getStripeAPI(authAPIOptions, intlayerConfig),
16
+ ai: getAiAPI(authAPIOptions, intlayerConfig),
17
+ tag: getTagAPI(authAPIOptions, intlayerConfig)
18
+ });
19
+ const intlayerAPI = getIntlayerAPI();
20
+ export {
21
+ getIntlayerAPI,
22
+ intlayerAPI
23
+ };
24
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["import { type IntlayerConfig } from '@intlayer/config/client';\nimport { getAiAPI } from './ai';\nimport { getAuthAPI } from './auth';\nimport { getDictionaryAPI } from './dictionary';\nimport type { FetcherOptions } from './fetcher';\nimport { getOrganizationAPI } from './organization';\nimport { getProjectAPI } from './project';\nimport { getStripeAPI } from './stripe';\nimport { getTagAPI } from './tag';\nimport { getUserAPI } from './user';\n\nexport const getIntlayerAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => ({\n organization: getOrganizationAPI(authAPIOptions, intlayerConfig),\n project: getProjectAPI(authAPIOptions, intlayerConfig),\n user: getUserAPI(authAPIOptions, intlayerConfig),\n auth: getAuthAPI(authAPIOptions, intlayerConfig),\n dictionary: getDictionaryAPI(authAPIOptions, intlayerConfig),\n stripe: getStripeAPI(authAPIOptions, intlayerConfig),\n ai: getAiAPI(authAPIOptions, intlayerConfig),\n tag: getTagAPI(authAPIOptions, intlayerConfig),\n});\n\nexport const intlayerAPI = getIntlayerAPI();\n"],"mappings":"AACA,SAAS,gBAAgB;AACzB,SAAS,kBAAkB;AAC3B,SAAS,wBAAwB;AAEjC,SAAS,0BAA0B;AACnC,SAAS,qBAAqB;AAC9B,SAAS,oBAAoB;AAC7B,SAAS,iBAAiB;AAC1B,SAAS,kBAAkB;AAEpB,MAAM,iBAAiB,CAC5B,iBAAiC,CAAC,GAClC,oBACI;AAAA,EACJ,cAAc,mBAAmB,gBAAgB,cAAc;AAAA,EAC/D,SAAS,cAAc,gBAAgB,cAAc;AAAA,EACrD,MAAM,WAAW,gBAAgB,cAAc;AAAA,EAC/C,MAAM,WAAW,gBAAgB,cAAc;AAAA,EAC/C,YAAY,iBAAiB,gBAAgB,cAAc;AAAA,EAC3D,QAAQ,aAAa,gBAAgB,cAAc;AAAA,EACnD,IAAI,SAAS,gBAAgB,cAAc;AAAA,EAC3C,KAAK,UAAU,gBAAgB,cAAc;AAC/C;AAEO,MAAM,cAAc,eAAe;","names":[]}
@@ -0,0 +1,96 @@
1
+ import { getConfiguration } from "@intlayer/config/client";
2
+ import { fetcher } from './fetcher.mjs';
3
+ const getOrganizationAPI = (authAPIOptions = {}, intlayerConfig) => {
4
+ const { backendURL } = (intlayerConfig ?? getConfiguration()).editor;
5
+ const ORGANIZATION_API_ROUTE = `${backendURL}/api/organization`;
6
+ const getOrganizations = async (filters, otherOptions = {}) => await fetcher(
7
+ ORGANIZATION_API_ROUTE,
8
+ authAPIOptions,
9
+ otherOptions,
10
+ {
11
+ params: filters
12
+ }
13
+ );
14
+ const getOrganization = async (organizationId, otherOptions = {}) => await fetcher(
15
+ `${ORGANIZATION_API_ROUTE}/${String(organizationId)}`,
16
+ authAPIOptions,
17
+ otherOptions
18
+ );
19
+ const addOrganization = async (organization, otherOptions = {}) => await fetcher(
20
+ ORGANIZATION_API_ROUTE,
21
+ authAPIOptions,
22
+ otherOptions,
23
+ {
24
+ method: "POST",
25
+ body: organization
26
+ }
27
+ );
28
+ const updateOrganization = async (organization, otherOptions = {}) => fetcher(
29
+ ORGANIZATION_API_ROUTE,
30
+ authAPIOptions,
31
+ otherOptions,
32
+ {
33
+ method: "PUT",
34
+ body: organization
35
+ }
36
+ );
37
+ const updateOrganizationMembers = async (body, otherOptions = {}) => fetcher(
38
+ `${ORGANIZATION_API_ROUTE}/members`,
39
+ authAPIOptions,
40
+ otherOptions,
41
+ {
42
+ method: "PUT",
43
+ body
44
+ }
45
+ );
46
+ const addOrganizationMember = async (body, otherOptions = {}) => fetcher(
47
+ `${ORGANIZATION_API_ROUTE}/member`,
48
+ authAPIOptions,
49
+ otherOptions,
50
+ {
51
+ method: "POST",
52
+ body
53
+ }
54
+ );
55
+ const deleteOrganization = async (otherOptions = {}) => await fetcher(
56
+ ORGANIZATION_API_ROUTE,
57
+ authAPIOptions,
58
+ otherOptions,
59
+ {
60
+ method: "DELETE"
61
+ }
62
+ );
63
+ const selectOrganization = async (organizationId, otherOptions = {}) => await fetcher(
64
+ `${ORGANIZATION_API_ROUTE}/${String(organizationId)}`,
65
+ authAPIOptions,
66
+ otherOptions,
67
+ {
68
+ method: "PUT"
69
+ }
70
+ );
71
+ const unselectOrganization = async (otherOptions = {}) => await fetcher(
72
+ `${ORGANIZATION_API_ROUTE}/logout`,
73
+ authAPIOptions,
74
+ otherOptions,
75
+ {
76
+ method: "POST"
77
+ }
78
+ );
79
+ return {
80
+ getOrganizations,
81
+ getOrganization,
82
+ addOrganization,
83
+ addOrganizationMember,
84
+ updateOrganization,
85
+ updateOrganizationMembers,
86
+ deleteOrganization,
87
+ selectOrganization,
88
+ unselectOrganization
89
+ };
90
+ };
91
+ const organizationAPI = getOrganizationAPI();
92
+ export {
93
+ getOrganizationAPI,
94
+ organizationAPI
95
+ };
96
+ //# sourceMappingURL=organization.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/organization.ts"],"sourcesContent":["import type {\n AddOrganizationBody,\n AddOrganizationResult,\n DeleteOrganizationResult,\n GetOrganizationParam,\n GetOrganizationResult,\n GetOrganizationsParams,\n GetOrganizationsResult,\n UpdateOrganizationBody,\n UpdateOrganizationResult,\n SelectOrganizationParam,\n SelectOrganizationResult,\n UnselectOrganizationResult,\n UpdateOrganizationMembersBody,\n UpdateOrganizationMembersResult,\n AddOrganizationMemberBody,\n AddOrganizationMemberResult,\n // @ts-ignore @intlayer/backend not build yet\n} from '@intlayer/backend';\nimport { getConfiguration, type IntlayerConfig } from '@intlayer/config/client';\nimport { fetcher, type FetcherOptions } from './fetcher';\n\nexport const getOrganizationAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const { backendURL } = (intlayerConfig ?? getConfiguration()).editor;\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 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 * 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 deleteOrganization,\n selectOrganization,\n unselectOrganization,\n };\n};\n\nexport const organizationAPI = getOrganizationAPI();\n"],"mappings":"AAmBA,SAAS,wBAA6C;AACtD,SAAS,eAAoC;AAEtC,MAAM,qBAAqB,CAChC,iBAAiC,CAAC,GAClC,mBACG;AACH,QAAM,EAAE,WAAW,KAAK,kBAAkB,iBAAiB,GAAG;AAC9D,QAAM,yBAAyB,GAAG,UAAU;AAM5C,QAAM,mBAAmB,OACvB,SACA,eAA+B,CAAC,MAEhC,MAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,IACV;AAAA,EACF;AAMF,QAAM,kBAAkB,OACtB,gBACA,eAA+B,CAAC,MAEhC,MAAM;AAAA,IACJ,GAAG,sBAAsB,IAAI,OAAO,cAAc,CAAC;AAAA,IACnD;AAAA,IACA;AAAA,EACF;AAMF,QAAM,kBAAkB,OACtB,cACA,eAA+B,CAAC,MAEhC,MAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,MACR,MAAM;AAAA,IACR;AAAA,EACF;AAMF,QAAM,qBAAqB,OACzB,cACA,eAA+B,CAAC,MAEhC;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,MACR,MAAM;AAAA,IACR;AAAA,EACF;AAMF,QAAM,4BAA4B,OAChC,MACA,eAA+B,CAAC,MAEhC;AAAA,IACE,GAAG,sBAAsB;AAAA,IACzB;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAMF,QAAM,wBAAwB,OAC5B,MACA,eAA+B,CAAC,MAEhC;AAAA,IACE,GAAG,sBAAsB;AAAA,IACzB;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAMF,QAAM,qBAAqB,OAAO,eAA+B,CAAC,MAChE,MAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,IACV;AAAA,EACF;AAMF,QAAM,qBAAqB,OACzB,gBACA,eAA+B,CAAC,MAEhC,MAAM;AAAA,IACJ,GAAG,sBAAsB,IAAI,OAAO,cAAc,CAAC;AAAA,IACnD;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,IACV;AAAA,EACF;AAMF,QAAM,uBAAuB,OAAO,eAA+B,CAAC,MAClE,MAAM;AAAA,IACJ,GAAG,sBAAsB;AAAA,IACzB;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,IACV;AAAA,EACF;AAEF,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAEO,MAAM,kBAAkB,mBAAmB;","names":[]}
@@ -0,0 +1,110 @@
1
+ import { getConfiguration } from "@intlayer/config/client";
2
+ import { fetcher } from './fetcher.mjs';
3
+ const getProjectAPI = (authAPIOptions = {}, intlayerConfig) => {
4
+ const { backendURL } = (intlayerConfig ?? getConfiguration()).editor;
5
+ const PROJECT_API_ROUTE = `${backendURL}/api/project`;
6
+ const getProjects = async (filters, otherOptions = {}) => await fetcher(
7
+ PROJECT_API_ROUTE,
8
+ authAPIOptions,
9
+ otherOptions,
10
+ {
11
+ params: filters
12
+ }
13
+ );
14
+ const addProject = async (project, otherOptions = {}) => await fetcher(
15
+ `${PROJECT_API_ROUTE}`,
16
+ authAPIOptions,
17
+ otherOptions,
18
+ {
19
+ method: "POST",
20
+ body: project
21
+ }
22
+ );
23
+ const updateProject = async (project, otherOptions = {}) => await fetcher(
24
+ `${PROJECT_API_ROUTE}`,
25
+ authAPIOptions,
26
+ otherOptions,
27
+ {
28
+ method: "PUT",
29
+ body: project
30
+ }
31
+ );
32
+ const updateProjectMembers = async (body, otherOptions = {}) => await fetcher(
33
+ `${PROJECT_API_ROUTE}/members`,
34
+ authAPIOptions,
35
+ otherOptions,
36
+ {
37
+ method: "PUT",
38
+ body
39
+ }
40
+ );
41
+ const deleteProject = async (otherOptions = {}) => await fetcher(
42
+ `${PROJECT_API_ROUTE}`,
43
+ authAPIOptions,
44
+ otherOptions,
45
+ {
46
+ method: "DELETE"
47
+ }
48
+ );
49
+ const selectProject = async (projectId, otherOptions = {}) => await fetcher(
50
+ `${PROJECT_API_ROUTE}/${String(projectId)}`,
51
+ authAPIOptions,
52
+ otherOptions,
53
+ {
54
+ method: "PUT"
55
+ }
56
+ );
57
+ const unselectProject = async (otherOptions = {}) => await fetcher(
58
+ `${PROJECT_API_ROUTE}/logout`,
59
+ authAPIOptions,
60
+ otherOptions,
61
+ {
62
+ method: "POST"
63
+ }
64
+ );
65
+ const addNewAccessKey = async (accessKey, otherOptions = {}) => await fetcher(
66
+ `${PROJECT_API_ROUTE}/access_key`,
67
+ authAPIOptions,
68
+ otherOptions,
69
+ {
70
+ method: "POST",
71
+ body: accessKey
72
+ }
73
+ );
74
+ const deleteAccessKey = async (clientId, otherOptions = {}) => await fetcher(
75
+ `${PROJECT_API_ROUTE}/access_key`,
76
+ authAPIOptions,
77
+ otherOptions,
78
+ {
79
+ method: "DELETE",
80
+ body: { clientId }
81
+ }
82
+ );
83
+ const refreshAccessKey = async (clientId, otherOptions = {}) => await fetcher(
84
+ `${PROJECT_API_ROUTE}/access_key`,
85
+ authAPIOptions,
86
+ otherOptions,
87
+ {
88
+ method: "PATCH",
89
+ body: { clientId }
90
+ }
91
+ );
92
+ return {
93
+ getProjects,
94
+ addProject,
95
+ updateProject,
96
+ updateProjectMembers,
97
+ deleteProject,
98
+ selectProject,
99
+ unselectProject,
100
+ addNewAccessKey,
101
+ deleteAccessKey,
102
+ refreshAccessKey
103
+ };
104
+ };
105
+ const projectAPI = getProjectAPI();
106
+ export {
107
+ getProjectAPI,
108
+ projectAPI
109
+ };
110
+ //# sourceMappingURL=project.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/project.ts"],"sourcesContent":["import type {\n AddProjectBody,\n AddProjectResult,\n DeleteProjectResult,\n GetProjectsParams,\n GetProjectsResult,\n UpdateProjectBody,\n UpdateProjectResult,\n SelectProjectParam,\n SelectProjectResult,\n UnselectProjectResult,\n AddNewAccessKeyBody,\n AddNewAccessKeyResponse,\n DeleteAccessKeyBody,\n DeleteAccessKeyResponse,\n RefreshAccessKeyBody,\n RefreshAccessKeyResponse,\n UpdateProjectMembersBody,\n UpdateProjectMembersResult,\n // @ts-ignore @intlayer/backend not build yet\n} from '@intlayer/backend';\nimport { getConfiguration, type IntlayerConfig } from '@intlayer/config/client';\nimport { fetcher, type FetcherOptions } from './fetcher';\n\nexport const getProjectAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const { backendURL } = (intlayerConfig ?? getConfiguration()).editor;\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 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 /**\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 deleteProject,\n selectProject,\n unselectProject,\n addNewAccessKey,\n deleteAccessKey,\n refreshAccessKey,\n };\n};\n\nexport const projectAPI = getProjectAPI();\n"],"mappings":"AAqBA,SAAS,wBAA6C;AACtD,SAAS,eAAoC;AAEtC,MAAM,gBAAgB,CAC3B,iBAAiC,CAAC,GAClC,mBACG;AACH,QAAM,EAAE,WAAW,KAAK,kBAAkB,iBAAiB,GAAG;AAC9D,QAAM,oBAAoB,GAAG,UAAU;AAMvC,QAAM,cAAc,OAClB,SACA,eAA+B,CAAC,MAEhC,MAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,IACV;AAAA,EACF;AAMF,QAAM,aAAa,OACjB,SACA,eAA+B,CAAC,MAEhC,MAAM;AAAA,IACJ,GAAG,iBAAiB;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,MACR,MAAM;AAAA,IACR;AAAA,EACF;AAMF,QAAM,gBAAgB,OACpB,SACA,eAA+B,CAAC,MAEhC,MAAM;AAAA,IACJ,GAAG,iBAAiB;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,MACR,MAAM;AAAA,IACR;AAAA,EACF;AAMF,QAAM,uBAAuB,OAC3B,MACA,eAA+B,CAAC,MAEhC,MAAM;AAAA,IACJ,GAAG,iBAAiB;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAMF,QAAM,gBAAgB,OAAO,eAA+B,CAAC,MAC3D,MAAM;AAAA,IACJ,GAAG,iBAAiB;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,IACV;AAAA,EACF;AAMF,QAAM,gBAAgB,OACpB,WACA,eAA+B,CAAC,MAEhC,MAAM;AAAA,IACJ,GAAG,iBAAiB,IAAI,OAAO,SAAS,CAAC;AAAA,IACzC;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,IACV;AAAA,EACF;AAMF,QAAM,kBAAkB,OAAO,eAA+B,CAAC,MAC7D,MAAM;AAAA,IACJ,GAAG,iBAAiB;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,IACV;AAAA,EACF;AAQF,QAAM,kBAAkB,OACtB,WACA,eAA+B,CAAC,MAEhC,MAAM;AAAA,IACJ,GAAG,iBAAiB;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,MACR,MAAM;AAAA,IACR;AAAA,EACF;AAQF,QAAM,kBAAkB,OACtB,UACA,eAA+B,CAAC,MAEhC,MAAM;AAAA,IACJ,GAAG,iBAAiB;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,MACR,MAAM,EAAE,SAAS;AAAA,IACnB;AAAA,EACF;AAQF,QAAM,mBAAmB,OACvB,UACA,eAA+B,CAAC,MAEhC,MAAM;AAAA,IACJ,GAAG,iBAAiB;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,MACR,MAAM,EAAE,SAAS;AAAA,IACnB;AAAA,EACF;AAEF,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAEO,MAAM,aAAa,cAAc;","names":[]}
@@ -0,0 +1,31 @@
1
+ import { getConfiguration } from "@intlayer/config/client";
2
+ import { fetcher } from './fetcher.mjs';
3
+ const getStripeAPI = (authAPIOptions = {}, intlayerConfig) => {
4
+ const backendURL = (intlayerConfig ?? getConfiguration()).editor.backendURL;
5
+ const STRIPE_API_ROUTE = `${backendURL}/api/stripe`;
6
+ const getSubscription = async (body, otherOptions = {}) => await fetcher(
7
+ `${STRIPE_API_ROUTE}/create-subscription`,
8
+ authAPIOptions,
9
+ otherOptions,
10
+ {
11
+ method: "POST",
12
+ body
13
+ }
14
+ );
15
+ const cancelSubscription = async (otherOptions = {}) => await fetcher(
16
+ `${STRIPE_API_ROUTE}/cancel-subscription`,
17
+ authAPIOptions,
18
+ otherOptions,
19
+ {
20
+ method: "POST"
21
+ }
22
+ );
23
+ return {
24
+ getSubscription,
25
+ cancelSubscription
26
+ };
27
+ };
28
+ export {
29
+ getStripeAPI
30
+ };
31
+ //# sourceMappingURL=stripe.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/stripe.ts"],"sourcesContent":["import type {\n GetCheckoutSessionBody,\n GetCheckoutSessionResult,\n // @ts-ignore @intlayer/backend not build yet\n} from '@intlayer/backend';\nimport { getConfiguration, type IntlayerConfig } from '@intlayer/config/client';\nimport { fetcher, type FetcherOptions } from './fetcher';\n\nexport const getStripeAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const backendURL = (intlayerConfig ?? getConfiguration()).editor.backendURL;\n const STRIPE_API_ROUTE = `${backendURL}/api/stripe`;\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 getSubscription,\n cancelSubscription,\n };\n};\n"],"mappings":"AAKA,SAAS,wBAA6C;AACtD,SAAS,eAAoC;AAEtC,MAAM,eAAe,CAC1B,iBAAiC,CAAC,GAClC,mBACG;AACH,QAAM,cAAc,kBAAkB,iBAAiB,GAAG,OAAO;AACjE,QAAM,mBAAmB,GAAG,UAAU;AAMtC,QAAM,kBAAkB,OACtB,MACA,eAA+B,CAAC,MAEhC,MAAM;AAAA,IACJ,GAAG,gBAAgB;AAAA,IACnB;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAMF,QAAM,qBAAqB,OAAO,eAA+B,CAAC,MAChE,MAAM;AAAA,IACJ,GAAG,gBAAgB;AAAA,IACnB;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,IACV;AAAA,EACF;AAEF,SAAO;AAAA,IACL;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
@@ -0,0 +1,52 @@
1
+ import { getConfiguration } from "@intlayer/config/client";
2
+ import { fetcher } from './fetcher.mjs';
3
+ const getTagAPI = (authAPIOptions = {}, intlayerConfig) => {
4
+ const { backendURL } = (intlayerConfig ?? getConfiguration()).editor;
5
+ const PROJECT_API_ROUTE = `${backendURL}/api/tag`;
6
+ const getTags = async (filters, otherOptions = {}) => await fetcher(
7
+ PROJECT_API_ROUTE,
8
+ authAPIOptions,
9
+ otherOptions,
10
+ {
11
+ params: filters
12
+ }
13
+ );
14
+ const addTag = async (tag, otherOptions = {}) => await fetcher(
15
+ `${PROJECT_API_ROUTE}`,
16
+ authAPIOptions,
17
+ otherOptions,
18
+ {
19
+ method: "POST",
20
+ body: tag
21
+ }
22
+ );
23
+ const updateTag = async (tagId, tag, otherOptions = {}) => await fetcher(
24
+ `${PROJECT_API_ROUTE}/${tagId}`,
25
+ authAPIOptions,
26
+ otherOptions,
27
+ {
28
+ method: "PUT",
29
+ body: tag
30
+ }
31
+ );
32
+ const deleteTag = async (tagId, otherOptions = {}) => await fetcher(
33
+ `${PROJECT_API_ROUTE}/${tagId}`,
34
+ authAPIOptions,
35
+ otherOptions,
36
+ {
37
+ method: "DELETE"
38
+ }
39
+ );
40
+ return {
41
+ getTags,
42
+ addTag,
43
+ updateTag,
44
+ deleteTag
45
+ };
46
+ };
47
+ const tagAPI = getTagAPI();
48
+ export {
49
+ getTagAPI,
50
+ tagAPI
51
+ };
52
+ //# sourceMappingURL=tag.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/tag.ts"],"sourcesContent":["import type {\n AddTagBody,\n AddTagResult,\n DeleteTagParams,\n DeleteTagResult,\n GetTagsParams,\n GetTagsResult,\n UpdateTagBody,\n UpdateTagParams,\n UpdateTagResult,\n // @ts-ignore @intlayer/backend not build yet\n} from '@intlayer/backend';\nimport { getConfiguration, type IntlayerConfig } from '@intlayer/config/client';\nimport { fetcher, type FetcherOptions } from './fetcher';\n\nexport const getTagAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const { backendURL } = (intlayerConfig ?? getConfiguration()).editor;\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 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\nexport const tagAPI = getTagAPI();\n"],"mappings":"AAYA,SAAS,wBAA6C;AACtD,SAAS,eAAoC;AAEtC,MAAM,YAAY,CACvB,iBAAiC,CAAC,GAClC,mBACG;AACH,QAAM,EAAE,WAAW,KAAK,kBAAkB,iBAAiB,GAAG;AAC9D,QAAM,oBAAoB,GAAG,UAAU;AAMvC,QAAM,UAAU,OACd,SACA,eAA+B,CAAC,MAEhC,MAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,IACV;AAAA,EACF;AAMF,QAAM,SAAS,OAAO,KAAiB,eAA+B,CAAC,MACrE,MAAM;AAAA,IACJ,GAAG,iBAAiB;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,MACR,MAAM;AAAA,IACR;AAAA,EACF;AAMF,QAAM,YAAY,OAChB,OACA,KACA,eAA+B,CAAC,MAEhC,MAAM;AAAA,IACJ,GAAG,iBAAiB,IAAI,KAAK;AAAA,IAC7B;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,MACR,MAAM;AAAA,IACR;AAAA,EACF;AAMF,QAAM,YAAY,OAChB,OAEA,eAA+B,CAAC,MAEhC,MAAM;AAAA,IACJ,GAAG,iBAAiB,IAAI,KAAK;AAAA,IAC7B;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,IACV;AAAA,EACF;AAEF,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAEO,MAAM,SAAS,UAAU;","names":[]}
@@ -0,0 +1,70 @@
1
+ import { getConfiguration } from "@intlayer/config/client";
2
+ import { fetcher } from './fetcher.mjs';
3
+ const getUserAPI = (authAPIOptions = {}, intlayerConfig) => {
4
+ const { backendURL } = (intlayerConfig ?? getConfiguration()).editor;
5
+ const USER_API_ROUTE = `${backendURL}/api/user`;
6
+ const getUsers = async (filters, otherOptions = {}) => await fetcher(
7
+ USER_API_ROUTE,
8
+ authAPIOptions,
9
+ otherOptions,
10
+ {
11
+ params: filters
12
+ }
13
+ );
14
+ const getUserById = async (userId, otherOptions = {}) => await fetcher(
15
+ `${USER_API_ROUTE}/${userId}`,
16
+ authAPIOptions,
17
+ otherOptions
18
+ );
19
+ const getUserByEmail = async (email, otherOptions = {}) => await fetcher(
20
+ `${USER_API_ROUTE}/email/${email}`,
21
+ authAPIOptions,
22
+ otherOptions
23
+ );
24
+ const getUserByAccount = async (providerAccountId, provider, otherOptions = {}) => await fetcher(
25
+ `${USER_API_ROUTE}/account/${provider}/${providerAccountId}`,
26
+ authAPIOptions,
27
+ otherOptions
28
+ );
29
+ const createUser = async (user, otherOptions = {}) => await fetcher(
30
+ `${USER_API_ROUTE}/`,
31
+ authAPIOptions,
32
+ otherOptions,
33
+ {
34
+ method: "POST",
35
+ body: user
36
+ }
37
+ );
38
+ const updateUser = async (user, otherOptions = {}) => await fetcher(
39
+ `${USER_API_ROUTE}`,
40
+ authAPIOptions,
41
+ otherOptions,
42
+ {
43
+ method: "PUT",
44
+ body: user
45
+ }
46
+ );
47
+ const deleteUser = async (userId, otherOptions = {}) => await fetcher(
48
+ `${USER_API_ROUTE}/${userId}`,
49
+ authAPIOptions,
50
+ otherOptions,
51
+ {
52
+ method: "DELETE"
53
+ }
54
+ );
55
+ return {
56
+ createUser,
57
+ getUsers,
58
+ getUserById,
59
+ getUserByAccount,
60
+ getUserByEmail,
61
+ updateUser,
62
+ deleteUser
63
+ };
64
+ };
65
+ const userAPI = getUserAPI();
66
+ export {
67
+ getUserAPI,
68
+ userAPI
69
+ };
70
+ //# sourceMappingURL=user.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/user.ts"],"sourcesContent":["import 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 // @ts-ignore @intlayer/backend not build yet\n} from '@intlayer/backend';\nimport { getConfiguration, type IntlayerConfig } from '@intlayer/config/client';\nimport { fetcher, type FetcherOptions } from './fetcher';\n\nexport const getUserAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const { backendURL } = (intlayerConfig ?? getConfiguration()).editor;\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 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\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\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\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 return {\n createUser,\n getUsers,\n getUserById,\n getUserByAccount,\n getUserByEmail,\n updateUser,\n deleteUser,\n };\n};\n\nexport const userAPI = getUserAPI();\n"],"mappings":"AAeA,SAAS,wBAA6C;AACtD,SAAS,eAAoC;AAEtC,MAAM,aAAa,CACxB,iBAAiC,CAAC,GAClC,mBACG;AACH,QAAM,EAAE,WAAW,KAAK,kBAAkB,iBAAiB,GAAG;AAC9D,QAAM,iBAAiB,GAAG,UAAU;AAOpC,QAAM,WAAW,OACf,SACA,eAA+B,CAAC,MAEhC,MAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,IACV;AAAA,EACF;AAOF,QAAM,cAAc,OAClB,QACA,eAA+B,CAAC,MAEhC,MAAM;AAAA,IACJ,GAAG,cAAc,IAAI,MAAM;AAAA,IAC3B;AAAA,IACA;AAAA,EACF;AAOF,QAAM,iBAAiB,OACrB,OACA,eAA+B,CAAC,MAEhC,MAAM;AAAA,IACJ,GAAG,cAAc,UAAU,KAAK;AAAA,IAChC;AAAA,IACA;AAAA,EACF;AAOF,QAAM,mBAAmB,OACvB,mBACA,UACA,eAA+B,CAAC,MAEhC,MAAM;AAAA,IACJ,GAAG,cAAc,YAAY,QAAQ,IAAI,iBAAiB;AAAA,IAC1D;AAAA,IACA;AAAA,EACF;AAOF,QAAM,aAAa,OACjB,MACA,eAA+B,CAAC,MAEhC,MAAM;AAAA,IACJ,GAAG,cAAc;AAAA,IACjB;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,MACR,MAAM;AAAA,IACR;AAAA,EACF;AAOF,QAAM,aAAa,OACjB,MACA,eAA+B,CAAC,MAEhC,MAAM;AAAA,IACJ,GAAG,cAAc;AAAA,IACjB;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,MACR,MAAM;AAAA,IACR;AAAA,EACF;AAOF,QAAM,aAAa,OACjB,QACA,eAA+B,CAAC,MAEhC,MAAM;AAAA,IACJ,GAAG,cAAc,IAAI,MAAM;AAAA,IAC3B;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,IACV;AAAA,EACF;AAEF,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAEO,MAAM,UAAU,WAAW;","names":[]}