@intlayer/design-system 5.2.4 → 5.2.6

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