@intlayer/design-system 4.1.4 → 4.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/dist/.vite/manifest.json +58 -11
  2. package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.cjs +1 -1
  3. package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.mjs +1 -1
  4. package/dist/components/Auth/SignUpForm/SignUpForm.cjs +2 -1
  5. package/dist/components/Auth/SignUpForm/SignUpForm.cjs.map +1 -1
  6. package/dist/components/Auth/SignUpForm/SignUpForm.d.ts.map +1 -1
  7. package/dist/components/Auth/SignUpForm/SignUpForm.mjs +3 -2
  8. package/dist/components/Auth/SignUpForm/SignUpForm.mjs.map +1 -1
  9. package/dist/components/Auth/SignUpForm/signUpForm.content.cjs +181 -179
  10. package/dist/components/Auth/SignUpForm/signUpForm.content.cjs.map +1 -1
  11. package/dist/components/Auth/SignUpForm/signUpForm.content.d.ts +25 -21
  12. package/dist/components/Auth/SignUpForm/signUpForm.content.d.ts.map +1 -1
  13. package/dist/components/Auth/SignUpForm/signUpForm.content.mjs +181 -178
  14. package/dist/components/Auth/SignUpForm/signUpForm.content.mjs.map +1 -1
  15. package/dist/components/Auth/VerifyEmailForm/VerifyEmailForm.cjs +79 -0
  16. package/dist/components/Auth/VerifyEmailForm/VerifyEmailForm.cjs.map +1 -0
  17. package/dist/components/Auth/VerifyEmailForm/VerifyEmailForm.d.ts +10 -0
  18. package/dist/components/Auth/VerifyEmailForm/VerifyEmailForm.d.ts.map +1 -0
  19. package/dist/components/Auth/VerifyEmailForm/VerifyEmailForm.mjs +79 -0
  20. package/dist/components/Auth/VerifyEmailForm/VerifyEmailForm.mjs.map +1 -0
  21. package/dist/components/Auth/VerifyEmailForm/VerifyEmailSchema.cjs +8 -0
  22. package/dist/components/Auth/VerifyEmailForm/VerifyEmailSchema.cjs.map +1 -0
  23. package/dist/components/Auth/VerifyEmailForm/VerifyEmailSchema.d.ts +4 -0
  24. package/dist/components/Auth/VerifyEmailForm/VerifyEmailSchema.d.ts.map +1 -0
  25. package/dist/components/Auth/VerifyEmailForm/VerifyEmailSchema.mjs +8 -0
  26. package/dist/components/Auth/VerifyEmailForm/VerifyEmailSchema.mjs.map +1 -0
  27. package/dist/components/Auth/VerifyEmailForm/index.cjs +5 -0
  28. package/dist/components/Auth/VerifyEmailForm/index.cjs.map +1 -0
  29. package/dist/components/Auth/VerifyEmailForm/index.content.cjs +73 -0
  30. package/dist/components/Auth/VerifyEmailForm/index.content.cjs.map +1 -0
  31. package/dist/components/Auth/VerifyEmailForm/index.content.d.ts +15 -0
  32. package/dist/components/Auth/VerifyEmailForm/index.content.d.ts.map +1 -0
  33. package/dist/components/Auth/VerifyEmailForm/index.content.mjs +74 -0
  34. package/dist/components/Auth/VerifyEmailForm/index.content.mjs.map +1 -0
  35. package/dist/components/Auth/VerifyEmailForm/index.d.ts +2 -0
  36. package/dist/components/Auth/VerifyEmailForm/index.d.ts.map +1 -0
  37. package/dist/components/Auth/VerifyEmailForm/index.mjs +5 -0
  38. package/dist/components/Auth/VerifyEmailForm/index.mjs.map +1 -0
  39. package/dist/components/Auth/index.cjs +2 -0
  40. package/dist/components/Auth/index.cjs.map +1 -1
  41. package/dist/components/Auth/index.d.ts +1 -0
  42. package/dist/components/Auth/index.d.ts.map +1 -1
  43. package/dist/components/Auth/index.mjs +2 -0
  44. package/dist/components/Auth/index.mjs.map +1 -1
  45. package/dist/components/Auth/useAuth/useCSRF.d.ts +1 -1
  46. package/dist/components/Auth/useAuth/useOAuth2.d.ts +1 -1
  47. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs +4 -1
  48. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs.map +1 -1
  49. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs +4 -1
  50. package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs.map +1 -1
  51. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs +5 -1
  52. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs.map +1 -1
  53. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs +5 -1
  54. package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs.map +1 -1
  55. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs +3 -1
  56. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs.map +1 -1
  57. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs +3 -1
  58. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs.map +1 -1
  59. package/dist/components/index.cjs +2 -0
  60. package/dist/components/index.cjs.map +1 -1
  61. package/dist/components/index.mjs +2 -0
  62. package/dist/components/index.mjs.map +1 -1
  63. package/dist/hooks/intlayerAPIHooks.d.ts +48 -48
  64. package/dist/hooks/intlayerAPIHooks.d.ts.map +1 -1
  65. package/dist/hooks/useGetAllDictionaries.d.ts +1 -1
  66. package/dist/hooks/useGetAllDictionaries.d.ts.map +1 -1
  67. package/dist/hooks/useIntlayerAPI.d.ts +59 -58
  68. package/dist/hooks/useIntlayerAPI.d.ts.map +1 -1
  69. package/dist/index-B0Lvoony.js +712 -0
  70. package/dist/index-B0Lvoony.js.map +1 -0
  71. package/dist/index-CKhNmnU1.cjs +711 -0
  72. package/dist/index-CKhNmnU1.cjs.map +1 -0
  73. package/dist/navigation-CE0LMHcY.cjs +8538 -0
  74. package/dist/navigation-CE0LMHcY.cjs.map +1 -0
  75. package/dist/navigation-DFabQmdZ.js +914 -0
  76. package/dist/navigation-DFabQmdZ.js.map +1 -0
  77. package/dist/navigation-DRtAVQJF.js +8521 -0
  78. package/dist/navigation-DRtAVQJF.js.map +1 -0
  79. package/dist/navigation-a7EfWhxz.cjs +913 -0
  80. package/dist/navigation-a7EfWhxz.cjs.map +1 -0
  81. package/dist/tailwind.css +1 -1
  82. package/package.json +19 -19
@@ -0,0 +1,712 @@
1
+ import { getConfiguration } from "@intlayer/config/client";
2
+ const fetcherOptions = {
3
+ method: "GET",
4
+ // Default HTTP method
5
+ headers: {
6
+ "Content-Type": "application/json"
7
+ // Default content type
8
+ },
9
+ credentials: "include"
10
+ // Include cookies in the request
11
+ };
12
+ const removeUndefined = (obj) => {
13
+ Object.keys(obj).forEach((key) => {
14
+ if (obj[key] === void 0) {
15
+ delete obj[key];
16
+ }
17
+ });
18
+ return obj;
19
+ };
20
+ const deepMerge = (objects) => objects.reduce((acc, obj) => {
21
+ const acc1 = acc ?? {};
22
+ const obj1 = removeUndefined(obj ?? {});
23
+ if (typeof acc1 === "object" && typeof obj1 === "object") {
24
+ return { ...acc1, ...obj1 };
25
+ }
26
+ return obj1 ?? acc1;
27
+ }, {});
28
+ const fetcher = async (url, ...options) => {
29
+ const { signal } = new AbortController();
30
+ let paramsString = "";
31
+ let bodyString = void 0;
32
+ const otherOptions = options.map(
33
+ ({ body, params: params2, headers, ...otherOptions2 }) => otherOptions2
34
+ );
35
+ const mergedOptions = deepMerge([fetcherOptions, ...otherOptions]);
36
+ const mergedHeaders = deepMerge([
37
+ fetcherOptions.headers,
38
+ ...options.map((option) => option.headers)
39
+ ]);
40
+ const params = deepMerge(options.map((option) => option.params));
41
+ const method = mergedOptions.method;
42
+ if (method !== "GET" && method !== "HEAD") {
43
+ const body = deepMerge(options.map((option) => option.body));
44
+ if (mergedHeaders?.["Content-Type"] === "application/x-www-form-urlencoded") {
45
+ bodyString = new URLSearchParams(
46
+ body
47
+ ).toString();
48
+ } else {
49
+ bodyString = JSON.stringify(body);
50
+ }
51
+ }
52
+ if (Object.entries(params).length > 0) {
53
+ paramsString = `?${new URLSearchParams(
54
+ params
55
+ ).toString()}`;
56
+ }
57
+ const formattedOptions = {
58
+ ...mergedOptions,
59
+ headers: mergedHeaders,
60
+ body: bodyString,
61
+ signal
62
+ };
63
+ const urlResult = `${url}${paramsString}`;
64
+ const response = await fetch(urlResult, formattedOptions);
65
+ if (!response.ok) {
66
+ const result = await response.json();
67
+ console.error(result);
68
+ throw new Error(JSON.stringify(result.error) ?? "An error occurred");
69
+ }
70
+ return await response.json();
71
+ };
72
+ const getAiAPI = (authAPIOptions = {}, intlayerConfig) => {
73
+ const { backendURL } = getConfiguration().editor;
74
+ const AI_API_ROUTE = `${backendURL}/api/ai`;
75
+ const auditContentDeclaration = async (body, otherOptions = {}) => await fetcher(
76
+ `${AI_API_ROUTE}/audit/content-declaration`,
77
+ authAPIOptions,
78
+ otherOptions,
79
+ {
80
+ method: "POST",
81
+ body
82
+ }
83
+ );
84
+ const auditContentDeclarationField = async (body, otherOptions = {}) => await fetcher(
85
+ `${AI_API_ROUTE}/audit/content-declaration/field`,
86
+ authAPIOptions,
87
+ otherOptions,
88
+ {
89
+ method: "POST",
90
+ body
91
+ }
92
+ );
93
+ const auditContentDeclarationMetadata = async (body, otherOptions = {}) => await fetcher(
94
+ `${AI_API_ROUTE}/audit/content-declaration/metadata`,
95
+ authAPIOptions,
96
+ otherOptions,
97
+ {
98
+ method: "POST",
99
+ body
100
+ }
101
+ );
102
+ const auditTag = async (body, otherOptions = {}) => await fetcher(
103
+ `${AI_API_ROUTE}/audit/tag`,
104
+ authAPIOptions,
105
+ otherOptions,
106
+ {
107
+ method: "POST",
108
+ body
109
+ }
110
+ );
111
+ const askDocQuestion = async (body, otherOptions = {}) => await fetcher(
112
+ `${AI_API_ROUTE}/ask`,
113
+ authAPIOptions,
114
+ otherOptions,
115
+ {
116
+ method: "POST",
117
+ body
118
+ }
119
+ );
120
+ return {
121
+ auditContentDeclaration,
122
+ auditContentDeclarationField,
123
+ auditContentDeclarationMetadata,
124
+ auditTag,
125
+ askDocQuestion
126
+ };
127
+ };
128
+ getAiAPI();
129
+ const getAuthAPI = (authAPIOptions = {}, intlayerConfig) => {
130
+ const { backendURL, clientId, clientSecret } = getConfiguration().editor;
131
+ const AUTH_API_ROUTE = `${backendURL}/api/auth`;
132
+ const login = async (user, otherOptions = {}) => await fetcher(
133
+ `${AUTH_API_ROUTE}/login`,
134
+ authAPIOptions,
135
+ otherOptions,
136
+ {
137
+ method: "POST",
138
+ body: user
139
+ }
140
+ );
141
+ const getLoginWithGitHubURL = (params) => {
142
+ const searchParams = new URLSearchParams(params);
143
+ return `${AUTH_API_ROUTE}/login/github?${searchParams.toString()}`;
144
+ };
145
+ const getLoginWithGoogleURL = (params) => {
146
+ const searchParams = new URLSearchParams(params);
147
+ return `${AUTH_API_ROUTE}/login/google?${searchParams.toString()}`;
148
+ };
149
+ const register = async (user, query = {}, otherOptions = {}) => await fetcher(
150
+ `${AUTH_API_ROUTE}/register`,
151
+ authAPIOptions,
152
+ otherOptions,
153
+ {
154
+ method: "POST",
155
+ body: user,
156
+ params: query
157
+ }
158
+ );
159
+ const logout = async (otherOptions = {}) => await fetcher(
160
+ `${AUTH_API_ROUTE}/logout`,
161
+ authAPIOptions,
162
+ otherOptions,
163
+ {
164
+ method: "POST"
165
+ }
166
+ );
167
+ const askResetPassword = async (email, otherOptions = {}) => await fetcher(
168
+ `${AUTH_API_ROUTE}/password/reset`,
169
+ authAPIOptions,
170
+ otherOptions,
171
+ {
172
+ method: "POST",
173
+ body: { email }
174
+ }
175
+ );
176
+ const resetPassword = async (params, otherOptions = {}) => await fetcher(
177
+ `${AUTH_API_ROUTE}/password/reset`,
178
+ authAPIOptions,
179
+ otherOptions,
180
+ { params, method: "POST" }
181
+ );
182
+ const changePassword = async (data, otherOptions = {}) => await fetcher(
183
+ `${AUTH_API_ROUTE}/password`,
184
+ authAPIOptions,
185
+ otherOptions,
186
+ {
187
+ method: "PUT",
188
+ body: data
189
+ }
190
+ );
191
+ const checkIfUserHasPassword = async (otherOptions = {}) => await fetcher(
192
+ `${AUTH_API_ROUTE}/password/has`,
193
+ authAPIOptions,
194
+ otherOptions,
195
+ {
196
+ method: "GET"
197
+ }
198
+ );
199
+ const verifyEmail = async ({ userId, secret }, otherOptions = {}) => await fetcher(
200
+ `${AUTH_API_ROUTE}/active/${userId}/${secret}`,
201
+ authAPIOptions,
202
+ otherOptions,
203
+ {
204
+ method: "PUT"
205
+ }
206
+ );
207
+ const getVerifyEmailStatusURL = (userId) => `${AUTH_API_ROUTE}/verify-email-status/${String(userId)}`;
208
+ const createSession = async (data, otherOptions = {}) => await fetcher(
209
+ `${AUTH_API_ROUTE}/session`,
210
+ authAPIOptions,
211
+ otherOptions,
212
+ {
213
+ method: "POST",
214
+ body: data
215
+ }
216
+ );
217
+ const getSession = async (sessionToken, otherOptions = {}) => await fetcher(
218
+ `${backendURL}/session`,
219
+ authAPIOptions,
220
+ otherOptions,
221
+ { params: { session_token: sessionToken } }
222
+ );
223
+ const getCSRFToken = async (otherOptions = {}) => await fetcher(
224
+ `${backendURL}/csrf-token`,
225
+ authAPIOptions,
226
+ otherOptions
227
+ );
228
+ const getOAuth2AccessToken = async (otherOptions = {}) => await fetcher(
229
+ `${backendURL}/oauth2/token`,
230
+ authAPIOptions,
231
+ otherOptions,
232
+ {
233
+ method: "POST",
234
+ headers: {
235
+ "Content-Type": "application/x-www-form-urlencoded"
236
+ },
237
+ body: {
238
+ grant_type: "client_credentials",
239
+ client_id: clientId,
240
+ client_secret: clientSecret
241
+ }
242
+ }
243
+ );
244
+ return {
245
+ login,
246
+ getLoginWithGitHubURL,
247
+ getLoginWithGoogleURL,
248
+ register,
249
+ logout,
250
+ resetPassword,
251
+ askResetPassword,
252
+ checkIfUserHasPassword,
253
+ verifyEmail,
254
+ getVerifyEmailStatusURL,
255
+ changePassword,
256
+ createSession,
257
+ getSession,
258
+ getCSRFToken,
259
+ getOAuth2AccessToken
260
+ };
261
+ };
262
+ getAuthAPI();
263
+ const getDictionaryAPI = (authAPIOptions = {}, intlayerConfig) => {
264
+ const { backendURL } = getConfiguration().editor;
265
+ const PROJECT_API_ROUTE = `${backendURL}/api/dictionary`;
266
+ const getDictionaries = async (filters, otherOptions = {}) => await fetcher(
267
+ PROJECT_API_ROUTE,
268
+ authAPIOptions,
269
+ otherOptions,
270
+ {
271
+ params: filters
272
+ }
273
+ );
274
+ const getDictionariesKeys = async (otherOptions = {}) => await fetcher(
275
+ `${PROJECT_API_ROUTE}/keys`,
276
+ authAPIOptions,
277
+ otherOptions
278
+ );
279
+ const getDictionary = async (dictionaryKey, version, otherOptions = {}) => await fetcher(
280
+ `${PROJECT_API_ROUTE}/${dictionaryKey}`,
281
+ authAPIOptions,
282
+ otherOptions,
283
+ {
284
+ params: version ? { version: version.toString() } : void 0
285
+ }
286
+ );
287
+ const addDictionary = async (dictionary, otherOptions = {}) => await fetcher(
288
+ `${PROJECT_API_ROUTE}`,
289
+ authAPIOptions,
290
+ otherOptions,
291
+ {
292
+ method: "POST",
293
+ body: dictionary
294
+ }
295
+ );
296
+ const pushDictionaries = async (dictionaries, otherOptions = {}) => await fetcher(
297
+ `${PROJECT_API_ROUTE}`,
298
+ authAPIOptions,
299
+ otherOptions,
300
+ {
301
+ method: "PATCH",
302
+ body: { dictionaries }
303
+ }
304
+ );
305
+ const updateDictionary = async (dictionaryId, dictionary, otherOptions = {}) => await fetcher(
306
+ `${PROJECT_API_ROUTE}/${dictionaryId}`,
307
+ authAPIOptions,
308
+ otherOptions,
309
+ {
310
+ method: "PUT",
311
+ body: dictionary
312
+ }
313
+ );
314
+ const deleteDictionary = async (id, otherOptions = {}) => await fetcher(
315
+ `${PROJECT_API_ROUTE}`,
316
+ authAPIOptions,
317
+ otherOptions,
318
+ {
319
+ method: "DELETE",
320
+ body: { id }
321
+ }
322
+ );
323
+ return {
324
+ getDictionaries,
325
+ getDictionariesKeys,
326
+ getDictionary,
327
+ pushDictionaries,
328
+ addDictionary,
329
+ updateDictionary,
330
+ deleteDictionary
331
+ };
332
+ };
333
+ getDictionaryAPI();
334
+ const getEditorAPI = (authAPIOptions = {}, intlayerConfig) => {
335
+ const { editorURL } = getConfiguration().editor;
336
+ const EDITOR_API_ROUTE = `${editorURL}/api`;
337
+ const getConfiguration$1 = async (otherOptions = {}) => {
338
+ const response = await fetcher(
339
+ `${EDITOR_API_ROUTE}/config`,
340
+ authAPIOptions,
341
+ otherOptions
342
+ );
343
+ return response.data;
344
+ };
345
+ const writeDictionary = async (dictionary, otherOptions = {}) => {
346
+ await fetcher(
347
+ `${EDITOR_API_ROUTE}/dictionary`,
348
+ authAPIOptions,
349
+ otherOptions,
350
+ {
351
+ method: "POST",
352
+ body: dictionary
353
+ }
354
+ );
355
+ };
356
+ return {
357
+ getConfiguration: getConfiguration$1,
358
+ writeDictionary
359
+ };
360
+ };
361
+ getEditorAPI();
362
+ const getOrganizationAPI = (authAPIOptions = {}, intlayerConfig) => {
363
+ const { backendURL } = getConfiguration().editor;
364
+ const ORGANIZATION_API_ROUTE = `${backendURL}/api/organization`;
365
+ const getOrganizations = async (filters, otherOptions = {}) => await fetcher(
366
+ ORGANIZATION_API_ROUTE,
367
+ authAPIOptions,
368
+ otherOptions,
369
+ {
370
+ params: filters
371
+ }
372
+ );
373
+ const getOrganization = async (organizationId, otherOptions = {}) => await fetcher(
374
+ `${ORGANIZATION_API_ROUTE}/${String(organizationId)}`,
375
+ authAPIOptions,
376
+ otherOptions
377
+ );
378
+ const addOrganization = async (organization, otherOptions = {}) => await fetcher(
379
+ ORGANIZATION_API_ROUTE,
380
+ authAPIOptions,
381
+ otherOptions,
382
+ {
383
+ method: "POST",
384
+ body: organization
385
+ }
386
+ );
387
+ const updateOrganization = async (organization, otherOptions = {}) => fetcher(
388
+ ORGANIZATION_API_ROUTE,
389
+ authAPIOptions,
390
+ otherOptions,
391
+ {
392
+ method: "PUT",
393
+ body: organization
394
+ }
395
+ );
396
+ const updateOrganizationMembers = async (body, otherOptions = {}) => fetcher(
397
+ `${ORGANIZATION_API_ROUTE}/members`,
398
+ authAPIOptions,
399
+ otherOptions,
400
+ {
401
+ method: "PUT",
402
+ body
403
+ }
404
+ );
405
+ const addOrganizationMember = async (body, otherOptions = {}) => fetcher(
406
+ `${ORGANIZATION_API_ROUTE}/member`,
407
+ authAPIOptions,
408
+ otherOptions,
409
+ {
410
+ method: "POST",
411
+ body
412
+ }
413
+ );
414
+ const deleteOrganization = async (otherOptions = {}) => await fetcher(
415
+ ORGANIZATION_API_ROUTE,
416
+ authAPIOptions,
417
+ otherOptions,
418
+ {
419
+ method: "DELETE"
420
+ }
421
+ );
422
+ const selectOrganization = async (organizationId, otherOptions = {}) => await fetcher(
423
+ `${ORGANIZATION_API_ROUTE}/${String(organizationId)}`,
424
+ authAPIOptions,
425
+ otherOptions,
426
+ {
427
+ method: "PUT"
428
+ }
429
+ );
430
+ const unselectOrganization = async (otherOptions = {}) => await fetcher(
431
+ `${ORGANIZATION_API_ROUTE}/logout`,
432
+ authAPIOptions,
433
+ otherOptions,
434
+ {
435
+ method: "POST"
436
+ }
437
+ );
438
+ return {
439
+ getOrganizations,
440
+ getOrganization,
441
+ addOrganization,
442
+ addOrganizationMember,
443
+ updateOrganization,
444
+ updateOrganizationMembers,
445
+ deleteOrganization,
446
+ selectOrganization,
447
+ unselectOrganization
448
+ };
449
+ };
450
+ getOrganizationAPI();
451
+ const getProjectAPI = (authAPIOptions = {}, intlayerConfig) => {
452
+ const { backendURL } = getConfiguration().editor;
453
+ const PROJECT_API_ROUTE = `${backendURL}/api/project`;
454
+ const getProjects = async (filters, otherOptions = {}) => await fetcher(
455
+ PROJECT_API_ROUTE,
456
+ authAPIOptions,
457
+ otherOptions,
458
+ {
459
+ params: filters
460
+ }
461
+ );
462
+ const addProject = async (project, otherOptions = {}) => await fetcher(
463
+ `${PROJECT_API_ROUTE}`,
464
+ authAPIOptions,
465
+ otherOptions,
466
+ {
467
+ method: "POST",
468
+ body: project
469
+ }
470
+ );
471
+ const updateProject = async (project, otherOptions = {}) => await fetcher(
472
+ `${PROJECT_API_ROUTE}`,
473
+ authAPIOptions,
474
+ otherOptions,
475
+ {
476
+ method: "PUT",
477
+ body: project
478
+ }
479
+ );
480
+ const updateProjectMembers = async (body, otherOptions = {}) => await fetcher(
481
+ `${PROJECT_API_ROUTE}/members`,
482
+ authAPIOptions,
483
+ otherOptions,
484
+ {
485
+ method: "PUT",
486
+ body
487
+ }
488
+ );
489
+ const pushProjectConfiguration = async (projectConfiguration, otherOptions = {}) => await fetcher(
490
+ `${PROJECT_API_ROUTE}/configuration`,
491
+ authAPIOptions,
492
+ otherOptions,
493
+ {
494
+ method: "PUT",
495
+ body: projectConfiguration
496
+ }
497
+ );
498
+ const deleteProject = async (otherOptions = {}) => await fetcher(
499
+ `${PROJECT_API_ROUTE}`,
500
+ authAPIOptions,
501
+ otherOptions,
502
+ {
503
+ method: "DELETE"
504
+ }
505
+ );
506
+ const selectProject = async (projectId, otherOptions = {}) => await fetcher(
507
+ `${PROJECT_API_ROUTE}/${String(projectId)}`,
508
+ authAPIOptions,
509
+ otherOptions,
510
+ {
511
+ method: "PUT"
512
+ }
513
+ );
514
+ const unselectProject = async (otherOptions = {}) => await fetcher(
515
+ `${PROJECT_API_ROUTE}/logout`,
516
+ authAPIOptions,
517
+ otherOptions,
518
+ {
519
+ method: "POST"
520
+ }
521
+ );
522
+ const addNewAccessKey = async (accessKey, otherOptions = {}) => await fetcher(
523
+ `${PROJECT_API_ROUTE}/access_key`,
524
+ authAPIOptions,
525
+ otherOptions,
526
+ {
527
+ method: "POST",
528
+ body: accessKey
529
+ }
530
+ );
531
+ const deleteAccessKey = async (clientId, otherOptions = {}) => await fetcher(
532
+ `${PROJECT_API_ROUTE}/access_key`,
533
+ authAPIOptions,
534
+ otherOptions,
535
+ {
536
+ method: "DELETE",
537
+ body: { clientId }
538
+ }
539
+ );
540
+ const refreshAccessKey = async (clientId, otherOptions = {}) => await fetcher(
541
+ `${PROJECT_API_ROUTE}/access_key`,
542
+ authAPIOptions,
543
+ otherOptions,
544
+ {
545
+ method: "PATCH",
546
+ body: { clientId }
547
+ }
548
+ );
549
+ return {
550
+ getProjects,
551
+ addProject,
552
+ updateProject,
553
+ updateProjectMembers,
554
+ pushProjectConfiguration,
555
+ deleteProject,
556
+ selectProject,
557
+ unselectProject,
558
+ addNewAccessKey,
559
+ deleteAccessKey,
560
+ refreshAccessKey
561
+ };
562
+ };
563
+ getProjectAPI();
564
+ const getStripeAPI = (authAPIOptions = {}, intlayerConfig) => {
565
+ const backendURL = getConfiguration().editor.backendURL;
566
+ const STRIPE_API_ROUTE = `${backendURL}/api/stripe`;
567
+ const getSubscription = async (body, otherOptions = {}) => await fetcher(
568
+ `${STRIPE_API_ROUTE}/create-subscription`,
569
+ authAPIOptions,
570
+ otherOptions,
571
+ {
572
+ method: "POST",
573
+ body
574
+ }
575
+ );
576
+ const cancelSubscription = async (otherOptions = {}) => await fetcher(
577
+ `${STRIPE_API_ROUTE}/cancel-subscription`,
578
+ authAPIOptions,
579
+ otherOptions,
580
+ {
581
+ method: "POST"
582
+ }
583
+ );
584
+ return {
585
+ getSubscription,
586
+ cancelSubscription
587
+ };
588
+ };
589
+ const getTagAPI = (authAPIOptions = {}, intlayerConfig) => {
590
+ const { backendURL } = getConfiguration().editor;
591
+ const PROJECT_API_ROUTE = `${backendURL}/api/tag`;
592
+ const getTags = async (filters, otherOptions = {}) => await fetcher(
593
+ PROJECT_API_ROUTE,
594
+ authAPIOptions,
595
+ otherOptions,
596
+ {
597
+ params: filters
598
+ }
599
+ );
600
+ const addTag = async (tag, otherOptions = {}) => await fetcher(
601
+ `${PROJECT_API_ROUTE}`,
602
+ authAPIOptions,
603
+ otherOptions,
604
+ {
605
+ method: "POST",
606
+ body: tag
607
+ }
608
+ );
609
+ const updateTag = async (tagId, tag, otherOptions = {}) => await fetcher(
610
+ `${PROJECT_API_ROUTE}/${tagId}`,
611
+ authAPIOptions,
612
+ otherOptions,
613
+ {
614
+ method: "PUT",
615
+ body: tag
616
+ }
617
+ );
618
+ const deleteTag = async (tagId, otherOptions = {}) => await fetcher(
619
+ `${PROJECT_API_ROUTE}/${tagId}`,
620
+ authAPIOptions,
621
+ otherOptions,
622
+ {
623
+ method: "DELETE"
624
+ }
625
+ );
626
+ return {
627
+ getTags,
628
+ addTag,
629
+ updateTag,
630
+ deleteTag
631
+ };
632
+ };
633
+ getTagAPI();
634
+ const getUserAPI = (authAPIOptions = {}, intlayerConfig) => {
635
+ const { backendURL } = getConfiguration().editor;
636
+ const USER_API_ROUTE = `${backendURL}/api/user`;
637
+ const getUsers = async (filters, otherOptions = {}) => await fetcher(
638
+ USER_API_ROUTE,
639
+ authAPIOptions,
640
+ otherOptions,
641
+ {
642
+ params: filters
643
+ }
644
+ );
645
+ const getUserById = async (userId, otherOptions = {}) => await fetcher(
646
+ `${USER_API_ROUTE}/${userId}`,
647
+ authAPIOptions,
648
+ otherOptions
649
+ );
650
+ const getUserByEmail = async (email, otherOptions = {}) => await fetcher(
651
+ `${USER_API_ROUTE}/email/${email}`,
652
+ authAPIOptions,
653
+ otherOptions
654
+ );
655
+ const getUserByAccount = async (providerAccountId, provider, otherOptions = {}) => await fetcher(
656
+ `${USER_API_ROUTE}/account/${provider}/${providerAccountId}`,
657
+ authAPIOptions,
658
+ otherOptions
659
+ );
660
+ const createUser = async (user, otherOptions = {}) => await fetcher(
661
+ `${USER_API_ROUTE}/`,
662
+ authAPIOptions,
663
+ otherOptions,
664
+ {
665
+ method: "POST",
666
+ body: user
667
+ }
668
+ );
669
+ const updateUser = async (user, otherOptions = {}) => await fetcher(
670
+ `${USER_API_ROUTE}`,
671
+ authAPIOptions,
672
+ otherOptions,
673
+ {
674
+ method: "PUT",
675
+ body: user
676
+ }
677
+ );
678
+ const deleteUser = async (userId, otherOptions = {}) => await fetcher(
679
+ `${USER_API_ROUTE}/${userId}`,
680
+ authAPIOptions,
681
+ otherOptions,
682
+ {
683
+ method: "DELETE"
684
+ }
685
+ );
686
+ return {
687
+ createUser,
688
+ getUsers,
689
+ getUserById,
690
+ getUserByAccount,
691
+ getUserByEmail,
692
+ updateUser,
693
+ deleteUser
694
+ };
695
+ };
696
+ getUserAPI();
697
+ const getIntlayerAPI = (authAPIOptions = {}, intlayerConfig) => ({
698
+ organization: getOrganizationAPI(authAPIOptions),
699
+ project: getProjectAPI(authAPIOptions),
700
+ user: getUserAPI(authAPIOptions),
701
+ auth: getAuthAPI(authAPIOptions),
702
+ dictionary: getDictionaryAPI(authAPIOptions),
703
+ stripe: getStripeAPI(authAPIOptions),
704
+ ai: getAiAPI(authAPIOptions),
705
+ tag: getTagAPI(authAPIOptions),
706
+ editor: getEditorAPI(authAPIOptions)
707
+ });
708
+ const intlayerAPI = getIntlayerAPI();
709
+ export {
710
+ intlayerAPI as i
711
+ };
712
+ //# sourceMappingURL=index-B0Lvoony.js.map