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