@levo-so/core 0.1.82 → 0.1.108
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.
- package/dist/index.d.ts +374 -79
- package/dist/index.js +683 -699
- package/package.json +21 -21
package/dist/index.js
CHANGED
|
@@ -1,700 +1,684 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { WretchError as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
}),
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
},
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
],
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
},
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
c as FieldKind,
|
|
683
|
-
ne as FieldKindList,
|
|
684
|
-
de as ForumPostKindExpandedList,
|
|
685
|
-
B as LEVO_INTEGRATIONS,
|
|
686
|
-
re as LEVO_INTEGRATIONS_LIST,
|
|
687
|
-
v as LevoError,
|
|
688
|
-
F as LevoOAuthProviderList,
|
|
689
|
-
se as MediaKind,
|
|
690
|
-
K as MediaKindList,
|
|
691
|
-
z as createLevoClient,
|
|
692
|
-
X as defaultByKinds,
|
|
693
|
-
ge as formatImagePath,
|
|
694
|
-
Y as formatsByInterface,
|
|
695
|
-
ce as getCollectionKind,
|
|
696
|
-
g as getLevoError,
|
|
697
|
-
oe as interfaceKinds,
|
|
698
|
-
ie as listToColumn,
|
|
699
|
-
J as listToRecord
|
|
1
|
+
import e from "wretch";
|
|
2
|
+
import t from "wretch/addons/queryString";
|
|
3
|
+
import { WretchError as n } from "wretch/resolver";
|
|
4
|
+
//#region src/control/index.ts
|
|
5
|
+
var r = /^W[A-Z0-9]{7}$/, i = (e) => {
|
|
6
|
+
let { appName: t, workspace: n = null, apiUrl: i = "https://public-api.levo.so", NODE_ENV: a = "", APP_MODE: o = "production" } = e;
|
|
7
|
+
if (n && !r.test(n)) throw Error(`Invalid workspace ID: ${n}. Workspace ID must be a string of the format "W[A-Z0-9]{7}".`);
|
|
8
|
+
let s = n;
|
|
9
|
+
return {
|
|
10
|
+
get workspace() {
|
|
11
|
+
return s;
|
|
12
|
+
},
|
|
13
|
+
set workspace(e) {
|
|
14
|
+
if (e && !r.test(e)) throw Error(`Invalid workspace ID: ${e}. Workspace ID must be a string of the format "W[A-Z0-9]{7}".`);
|
|
15
|
+
s = e;
|
|
16
|
+
},
|
|
17
|
+
get appName() {
|
|
18
|
+
return t;
|
|
19
|
+
},
|
|
20
|
+
get apiUrl() {
|
|
21
|
+
return i;
|
|
22
|
+
},
|
|
23
|
+
get NODE_ENV() {
|
|
24
|
+
return a;
|
|
25
|
+
},
|
|
26
|
+
get APP_MODE() {
|
|
27
|
+
return o;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
}, a = 3e4, o = (n, r) => {
|
|
31
|
+
let i = e(n.apiUrl).addon(t), o = (e = a) => {
|
|
32
|
+
let t = {
|
|
33
|
+
credentials: "include",
|
|
34
|
+
signal: AbortSignal.timeout(e),
|
|
35
|
+
headers: {}
|
|
36
|
+
};
|
|
37
|
+
return n.workspace && (t.headers = {
|
|
38
|
+
...t?.headers || {},
|
|
39
|
+
"Levo-Workspace": n.workspace
|
|
40
|
+
}), r && typeof r == "object" && Object.keys(r).length > 0 && (t.headers = {
|
|
41
|
+
...t?.headers || {},
|
|
42
|
+
"Levo-Page-Context": encodeURIComponent(JSON.stringify(r))
|
|
43
|
+
}), n.workspace ? i.options(t).query({ workspace: n.workspace }) : i.options(t);
|
|
44
|
+
};
|
|
45
|
+
return {
|
|
46
|
+
get instance() {
|
|
47
|
+
return o();
|
|
48
|
+
},
|
|
49
|
+
getInstance: o,
|
|
50
|
+
pageContext: r
|
|
51
|
+
};
|
|
52
|
+
}, s = (t = {}) => {
|
|
53
|
+
let { logApiUrl: n = "https://public-api.levo.so" } = t, r = n, i = /* @__PURE__ */ new Map(), a = Promise.resolve(), o = setTimeout(() => {}, 0), s = /* @__PURE__ */ new Date(), c = (e) => {
|
|
54
|
+
let t = JSON.stringify(e?.content ?? "{}"), n = e?.message ?? "";
|
|
55
|
+
i.set(`${n}${t}`, e);
|
|
56
|
+
}, l = async (t) => {
|
|
57
|
+
let n = `${r}/v1/apm/logs/json`, i = async () => e().url(n).post(t).res().catch((e) => console.error(e));
|
|
58
|
+
try {
|
|
59
|
+
if (typeof fetch > "u") throw Error("fetch is not defined");
|
|
60
|
+
if (typeof window < "u" && navigator.sendBeacon) try {
|
|
61
|
+
if (!navigator.sendBeacon.bind(navigator)(n, JSON.stringify(t))) return i();
|
|
62
|
+
} catch {
|
|
63
|
+
return i();
|
|
64
|
+
}
|
|
65
|
+
else return i();
|
|
66
|
+
} catch (e) {
|
|
67
|
+
console.warn(`Failed to send logs to server: ${e}`), t.forEach((e) => {
|
|
68
|
+
c(e);
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}, u = async () => {
|
|
72
|
+
let e = Array.from(i.values());
|
|
73
|
+
if (i.clear(), clearTimeout(o), await a, e.length === 0) {
|
|
74
|
+
s = /* @__PURE__ */ new Date();
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
try {
|
|
78
|
+
await l(e);
|
|
79
|
+
} catch (e) {
|
|
80
|
+
console.error("error sending logs", e);
|
|
81
|
+
} finally {
|
|
82
|
+
s = /* @__PURE__ */ new Date();
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
return {
|
|
86
|
+
ingest: (e) => {
|
|
87
|
+
n && ((Array.isArray(e) ? e : [e]).forEach((e) => {
|
|
88
|
+
c(e);
|
|
89
|
+
}), i.size >= 50 || s.getTime() < Date.now() - 1500 ? (clearTimeout(o), a = u()) : (clearTimeout(o), o = setTimeout(() => {
|
|
90
|
+
a = u();
|
|
91
|
+
}, 1500)));
|
|
92
|
+
},
|
|
93
|
+
flush: u
|
|
94
|
+
};
|
|
95
|
+
}, c = typeof window < "u", l = (e) => {
|
|
96
|
+
let t = "", n = e.map((e) => {
|
|
97
|
+
let n = "", r = !t;
|
|
98
|
+
return typeof e == "string" ? (n = e, r && (t = e)) : e instanceof Error ? (n = {
|
|
99
|
+
message: e.message,
|
|
100
|
+
name: e.name,
|
|
101
|
+
stack: e.stack
|
|
102
|
+
}, r && (t = e.message)) : typeof e == "object" ? n = e : (n = String(e), r && (t = String(e))), n;
|
|
103
|
+
}).filter(Boolean);
|
|
104
|
+
return !t && n.length > 0 && (t = "Default message (Check content for details)"), n?.length === 1 && n[0] === t ? {
|
|
105
|
+
message: t,
|
|
106
|
+
content: {}
|
|
107
|
+
} : {
|
|
108
|
+
message: t,
|
|
109
|
+
content: n
|
|
110
|
+
};
|
|
111
|
+
}, u = (e) => {
|
|
112
|
+
let { logApiUrl: t, context: n = {} } = e, r = s({ logApiUrl: t });
|
|
113
|
+
return f("remote-logger", (e, t, i) => {
|
|
114
|
+
if (t !== d.error) return;
|
|
115
|
+
let { content: a = {}, message: o } = l(i);
|
|
116
|
+
if (!o) return;
|
|
117
|
+
let s = {
|
|
118
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
119
|
+
level: "error",
|
|
120
|
+
workspace: e.workspace,
|
|
121
|
+
appName: e?.appName,
|
|
122
|
+
isBrowser: c,
|
|
123
|
+
...n,
|
|
124
|
+
message: o,
|
|
125
|
+
content: a
|
|
126
|
+
};
|
|
127
|
+
c && (s.hostname = window.location.hostname, s.pathname = window.location.pathname, s.url = window.location.href, s.page_title = window.document.title, s.userAgent = window.navigator.userAgent), r.ingest(s);
|
|
128
|
+
});
|
|
129
|
+
}, d = /* @__PURE__ */ function(e) {
|
|
130
|
+
return e[e.debug = 0] = "debug", e[e.info = 1] = "info", e[e.warn = 2] = "warn", e[e.error = 3] = "error", e[e.off = 100] = "off", e;
|
|
131
|
+
}({}), f = (e, t) => ({
|
|
132
|
+
name: e,
|
|
133
|
+
callback: t
|
|
134
|
+
}), p = (e, t = {}) => {
|
|
135
|
+
let { level: n = e.NODE_ENV === "development" ? d.debug : d.warn } = t, r = /* @__PURE__ */ new Map(), i = (e) => (r.set(e.name, e), () => {
|
|
136
|
+
r.delete(e.name);
|
|
137
|
+
}), a = (t, i) => {
|
|
138
|
+
let a = Array.isArray(i) ? i : [i];
|
|
139
|
+
if (!(t < n)) {
|
|
140
|
+
for (let [, n] of r) try {
|
|
141
|
+
n.callback(e, t, a);
|
|
142
|
+
} catch (e) {
|
|
143
|
+
console.error(`Logger middleware error in "${n.name}"`, {
|
|
144
|
+
error: e,
|
|
145
|
+
level: t,
|
|
146
|
+
messages: a
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
console.log(...a);
|
|
150
|
+
}
|
|
151
|
+
}, o = (...e) => {
|
|
152
|
+
a(d.debug, e);
|
|
153
|
+
}, s = (...e) => {
|
|
154
|
+
a(d.info, e);
|
|
155
|
+
}, c = (...e) => {
|
|
156
|
+
a(d.warn, e);
|
|
157
|
+
};
|
|
158
|
+
function l(e, t) {
|
|
159
|
+
let n = t === void 0 ? [e] : [e, t];
|
|
160
|
+
a(d.error, n);
|
|
161
|
+
}
|
|
162
|
+
return {
|
|
163
|
+
debug: o,
|
|
164
|
+
info: s,
|
|
165
|
+
warn: c,
|
|
166
|
+
error: l,
|
|
167
|
+
attachMiddleware: i
|
|
168
|
+
};
|
|
169
|
+
}, m = class extends Error {
|
|
170
|
+
code;
|
|
171
|
+
title;
|
|
172
|
+
status;
|
|
173
|
+
type;
|
|
174
|
+
errors;
|
|
175
|
+
url;
|
|
176
|
+
responseData;
|
|
177
|
+
constructor(e) {
|
|
178
|
+
super(e.description), this.name = "Levo Request Error", this.status = e.status, this.code = e.code, this.title = e.title, this.type = e.type, this.errors = e.errors, this.url = e.url, this.responseData = e.responseData;
|
|
179
|
+
}
|
|
180
|
+
get fieldErrors() {
|
|
181
|
+
return this.errors || [];
|
|
182
|
+
}
|
|
183
|
+
get hasFieldErrors() {
|
|
184
|
+
return !!this.errors?.length;
|
|
185
|
+
}
|
|
186
|
+
}, h = (e) => e instanceof n || e instanceof Error && "response" in e && "status" in e && "url" in e, g = (e) => {
|
|
187
|
+
if (e instanceof m) return e;
|
|
188
|
+
if (h(e)) {
|
|
189
|
+
let t = e?.json;
|
|
190
|
+
if (!t && (e?.text || e?.message)) try {
|
|
191
|
+
t = JSON.parse(e?.text || e?.message);
|
|
192
|
+
} catch {}
|
|
193
|
+
let n = t ?? e?.text;
|
|
194
|
+
if (t) {
|
|
195
|
+
let r = t;
|
|
196
|
+
return new m({
|
|
197
|
+
status: r?.content?.status || e?.status || 500,
|
|
198
|
+
code: r?.content?.code || "Unknown",
|
|
199
|
+
title: r?.content?.title || `HTTP ${e?.status || 500} Error`,
|
|
200
|
+
description: r?.content?.description || r?.content?.errors?.[0]?.message || `Request failed with status ${e?.status || 500}`,
|
|
201
|
+
type: r?.content?.type,
|
|
202
|
+
errors: r?.content?.errors,
|
|
203
|
+
url: e?.url,
|
|
204
|
+
responseData: n
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
return new m({
|
|
208
|
+
status: e?.status || 500,
|
|
209
|
+
code: "HTTP_ERROR",
|
|
210
|
+
title: `HTTP ${e?.status || 500} Error`,
|
|
211
|
+
description: `Request failed with status ${e?.status || 500}`,
|
|
212
|
+
url: e?.url,
|
|
213
|
+
responseData: n
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
if (e instanceof TypeError) {
|
|
217
|
+
if (e?.message.includes("Failed to fetch") || e?.message.includes("Network request failed") || e?.message.includes("fetch")) return new m({
|
|
218
|
+
status: 0,
|
|
219
|
+
code: "NETWORK_ERROR",
|
|
220
|
+
title: "Network Error",
|
|
221
|
+
description: "Unable to connect to the server. Please check your internet connection."
|
|
222
|
+
});
|
|
223
|
+
if (e?.message.includes("CORS") || e?.message.includes("cross-origin")) return new m({
|
|
224
|
+
status: 0,
|
|
225
|
+
code: "CORS_ERROR",
|
|
226
|
+
title: "CORS Error",
|
|
227
|
+
description: "Cross-origin request blocked. Please contact support."
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
return e?.name === "AbortError" || e instanceof DOMException ? new m({
|
|
231
|
+
status: 408,
|
|
232
|
+
code: "REQUEST_TIMEOUT",
|
|
233
|
+
title: "Request Timeout",
|
|
234
|
+
description: "The request was cancelled or timed out. Please try again."
|
|
235
|
+
}) : e?.request ? new m({
|
|
236
|
+
status: e?.response?.status || 500,
|
|
237
|
+
code: e?.code || "REQUEST_ERROR",
|
|
238
|
+
title: "Request Error",
|
|
239
|
+
description: e?.message || "An error occurred while making the request",
|
|
240
|
+
url: e?.config?.url || e?.request?.responseURL,
|
|
241
|
+
responseData: e?.response?.data
|
|
242
|
+
}) : new m({
|
|
243
|
+
status: 500,
|
|
244
|
+
code: "UNKNOWN_ERROR",
|
|
245
|
+
title: "Unexpected Error",
|
|
246
|
+
description: e?.message || "Something unexpected happened",
|
|
247
|
+
url: e?.url || e?.config?.url,
|
|
248
|
+
responseData: e?.response?.data ?? e?.data
|
|
249
|
+
});
|
|
250
|
+
}, _ = (e, t) => ({
|
|
251
|
+
getAllBlogs: async (e, n = {}, r) => t.instance.url(`/v1/blog/${e}/post/query`).query({ ...r?.params || {} }).options({ headers: { "Levo-Workspace": r?.workspace_id || void 0 } }).post(n).json().then((e) => e).catch((e) => {
|
|
252
|
+
throw g(e);
|
|
253
|
+
}),
|
|
254
|
+
getSingleBlog: async (e, n, r) => t.instance.url(`/v1/blog/${e}/post/${n}`).query({ ...r?.params || {} }).options({ headers: { "Levo-Workspace": r?.workspace_id || void 0 } }).get().json().then((e) => e).catch((e) => {
|
|
255
|
+
throw g(e);
|
|
256
|
+
})
|
|
257
|
+
}), v = (e, t) => ({
|
|
258
|
+
getAllCollections: async (e = {}, n = {}) => t.instance.url("/v1/bevy/collection/query").options(n).post(e).json().then((e) => e).catch((e) => {
|
|
259
|
+
throw g(e);
|
|
260
|
+
}),
|
|
261
|
+
getCollectionByIDExpanded: async (e, n = {}) => t.instance.url(`/v1/bevy/collection/${e}`).options(n).get().json().then((e) => e).catch((e) => {
|
|
262
|
+
throw g(e);
|
|
263
|
+
}),
|
|
264
|
+
createCollection: async (e) => t.instance.url("/v1/bevy/collection").post(e).json().then((e) => e).catch((e) => {
|
|
265
|
+
throw g(e);
|
|
266
|
+
}),
|
|
267
|
+
saveCollectionData: async ({ collection_id: e, data: n, options: r = {} }) => t.instance.url(`/v1/bevy/content/${e}`).options(r).post(n).json().then((e) => e).catch((e) => {
|
|
268
|
+
throw g(e);
|
|
269
|
+
}),
|
|
270
|
+
getCollectionContentList: async ({ collection_key: e, page: n, search: r, limit: i = 10, where: a }) => t.instance.url(`/v1/bevy/content/${e}/query`).post({
|
|
271
|
+
page: n,
|
|
272
|
+
limit: i,
|
|
273
|
+
search: r,
|
|
274
|
+
where: a
|
|
275
|
+
}).json().then((e) => e).catch((e) => {
|
|
276
|
+
throw g(e);
|
|
277
|
+
}),
|
|
278
|
+
saveDraftEntry: async (e, n) => t.instance.url(`/v1/bevy/content/${e}/save-entry`).post(n).json().then((e) => e).catch((e) => {
|
|
279
|
+
throw g(e);
|
|
280
|
+
}),
|
|
281
|
+
editDraftEntry: async (e, n, r) => t.instance.url(`/v1/bevy/content/${e}/${n}/edit-entry`).put(r).json().then((e) => e).catch((e) => {
|
|
282
|
+
throw g(e);
|
|
283
|
+
}),
|
|
284
|
+
getDraftEntry: async (e) => t.instance.url(`/v1/bevy/content/${e}/list-entry`).get().json().then((e) => e).catch((e) => {
|
|
285
|
+
throw g(e);
|
|
286
|
+
}),
|
|
287
|
+
submitDraftEntry: async (e, n) => t.instance.url(`/v1/bevy/content/${e}/submit-entry`).post(n).json().then((e) => e).catch((e) => {
|
|
288
|
+
throw g(e);
|
|
289
|
+
}),
|
|
290
|
+
getFilters: async (e, n = {}) => t.instance.url(`/v1/bevy/collection/${e}/get-filters`).options(n).get().json().then((e) => e).catch((e) => {
|
|
291
|
+
throw g(e);
|
|
292
|
+
})
|
|
293
|
+
}), y = 600 * 1e3, b = (e, t) => ({
|
|
294
|
+
mediaBulkUpload: async (e, n = {}, r) => {
|
|
295
|
+
let i = { ...n };
|
|
296
|
+
return delete i.signal, t.getInstance(y).url("/v1/assets/media/bulk").query(r ?? {}).options(i).post(e).json().then((e) => e).catch((e) => {
|
|
297
|
+
throw g(e);
|
|
298
|
+
});
|
|
299
|
+
},
|
|
300
|
+
getAllMedia: async (e = {}) => t.instance.url("/v1/assets/media/query").post(e).json().then((e) => e).catch((e) => {
|
|
301
|
+
throw g(e);
|
|
302
|
+
})
|
|
303
|
+
}), x = [
|
|
304
|
+
"google",
|
|
305
|
+
"linkedin",
|
|
306
|
+
"microsoft"
|
|
307
|
+
], S = (e, t) => {
|
|
308
|
+
let n = async (n = {}) => t.instance.url("/v1/membership/auth/oauth/get-redirect-url").options(n).get().json().then((n) => {
|
|
309
|
+
let r = n?.content?.data, i = Object.keys(r);
|
|
310
|
+
if (typeof window < "u") for (let n of i) {
|
|
311
|
+
let i = r[n];
|
|
312
|
+
if (i) {
|
|
313
|
+
let a = new URL(i), o = a.searchParams;
|
|
314
|
+
o.set("redirect_uri", window.location.href), e.workspace && o.set("workspace_id", e.workspace), t.pageContext && o.set("page_context", JSON.stringify(t.pageContext)), r[n] = a.toString();
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
return r;
|
|
318
|
+
}).catch(() => x.reduce((e, t) => (e[t] = null, e), {})), r = async (e = {}) => t.instance.url("/v1/membership/auth/sign-out").options(e).post("").json().then((e) => e?.content?.data).catch((e) => {
|
|
319
|
+
throw g(e);
|
|
320
|
+
}), i = async (e = {}) => t.instance.url("/v1/membership/auth/get-me").options(e).get().json().then((e) => e?.content?.data).catch((e) => {
|
|
321
|
+
throw g(e);
|
|
322
|
+
});
|
|
323
|
+
return {
|
|
324
|
+
getOAuthURL: n,
|
|
325
|
+
signOut: r,
|
|
326
|
+
getMe: i,
|
|
327
|
+
updateMe: async (e, n = {}) => t.instance.url("/v1/membership/auth/update-me").options(n).put(e).json().then((e) => e?.content?.data).catch((e) => {
|
|
328
|
+
throw g(e);
|
|
329
|
+
}),
|
|
330
|
+
createPassword: async (e, n = {}) => t.instance.url("/v1/membership/auth/change-password").options(n).put(e).json().then((e) => e?.content?.data).catch((e) => {
|
|
331
|
+
throw g(e);
|
|
332
|
+
}),
|
|
333
|
+
isLoggedIn: async (e = {}) => i(e).then((e) => e).catch(() => null),
|
|
334
|
+
requestMagicLink: async (e, n = {}) => (typeof window < "u" && !e.redirect_uri && (e.redirect_uri = window.location.href), t.instance.url("/v1/membership/auth/request-magic-link").options(n).post(e).json().then((e) => e?.content?.data).catch((e) => {
|
|
335
|
+
throw g(e);
|
|
336
|
+
})),
|
|
337
|
+
requestOtp: async (e, n = {}) => t.instance.url("/v1/membership/auth/request-otp").options(n).post(e).json().then((e) => e?.content?.data).catch((e) => {
|
|
338
|
+
throw g(e);
|
|
339
|
+
}),
|
|
340
|
+
signInWithOtp: async (e, n = {}) => t.instance.url("/v1/membership/auth/signin-with-otp").options(n).post(e).json().then((e) => e?.content?.data).catch((e) => {
|
|
341
|
+
throw g(e);
|
|
342
|
+
}),
|
|
343
|
+
signInWithPassword: async (e, n = {}) => t.instance.url("/v1/membership/auth/signin-with-password").options(n).post(e).json().then((e) => e?.content?.data).catch((e) => {
|
|
344
|
+
throw g(e);
|
|
345
|
+
}),
|
|
346
|
+
signUpWithPassword: async (e, n = {}) => t.instance.url("/v1/membership/auth/signup-with-password").options(n).post(e).json().then((e) => e?.content?.data).catch((e) => {
|
|
347
|
+
throw g(e);
|
|
348
|
+
})
|
|
349
|
+
};
|
|
350
|
+
}, C = (e) => {
|
|
351
|
+
let { pageContext: t = {
|
|
352
|
+
url: typeof window < "u" ? window?.location?.href : "",
|
|
353
|
+
referrer: typeof document < "u" ? document?.referrer : "",
|
|
354
|
+
title: typeof document < "u" ? document?.title : ""
|
|
355
|
+
}, loggerOptions: n = {}, ...r } = e, a = t, s = i(r), c = o(s, a), l = _(s, c), u = S(s, c), d = v(s, c), f = b(s, c), m = p(s, n);
|
|
356
|
+
return {
|
|
357
|
+
get apiUrl() {
|
|
358
|
+
return s.apiUrl;
|
|
359
|
+
},
|
|
360
|
+
get workspace() {
|
|
361
|
+
return s.workspace;
|
|
362
|
+
},
|
|
363
|
+
get blog() {
|
|
364
|
+
return l;
|
|
365
|
+
},
|
|
366
|
+
get membership() {
|
|
367
|
+
return u;
|
|
368
|
+
},
|
|
369
|
+
get collection() {
|
|
370
|
+
return d;
|
|
371
|
+
},
|
|
372
|
+
get media() {
|
|
373
|
+
return f;
|
|
374
|
+
},
|
|
375
|
+
get logger() {
|
|
376
|
+
return m;
|
|
377
|
+
},
|
|
378
|
+
get fetch() {
|
|
379
|
+
return c.instance;
|
|
380
|
+
},
|
|
381
|
+
get APP_MODE() {
|
|
382
|
+
return s.APP_MODE;
|
|
383
|
+
},
|
|
384
|
+
get NODE_ENV() {
|
|
385
|
+
return s.NODE_ENV;
|
|
386
|
+
},
|
|
387
|
+
get pageContext() {
|
|
388
|
+
return a;
|
|
389
|
+
},
|
|
390
|
+
updatePageContext: (e) => {
|
|
391
|
+
a = Object.assign({}, a, e);
|
|
392
|
+
},
|
|
393
|
+
updateWorkspace: (e) => {
|
|
394
|
+
s.workspace = e;
|
|
395
|
+
}
|
|
396
|
+
};
|
|
397
|
+
}, w = {
|
|
398
|
+
"public-id": "",
|
|
399
|
+
string: "",
|
|
400
|
+
number: null,
|
|
401
|
+
boolean: !1,
|
|
402
|
+
location: null,
|
|
403
|
+
file: null,
|
|
404
|
+
date: null,
|
|
405
|
+
identifier: null,
|
|
406
|
+
record: null,
|
|
407
|
+
group: [],
|
|
408
|
+
collection: {
|
|
409
|
+
m2o: null,
|
|
410
|
+
o2o: null,
|
|
411
|
+
m2m: []
|
|
412
|
+
},
|
|
413
|
+
richtext: {
|
|
414
|
+
html: "",
|
|
415
|
+
text: "",
|
|
416
|
+
json: []
|
|
417
|
+
},
|
|
418
|
+
json: {},
|
|
419
|
+
"array-string": [],
|
|
420
|
+
"array-number": [],
|
|
421
|
+
"array-file": [],
|
|
422
|
+
"array-json": [],
|
|
423
|
+
"array-date": [],
|
|
424
|
+
"array-boolean": [],
|
|
425
|
+
"array-location": []
|
|
426
|
+
}, T = {
|
|
427
|
+
ArrayWidget: [],
|
|
428
|
+
RecordWidget: [],
|
|
429
|
+
TextWidget: [],
|
|
430
|
+
MultiTextWidget: [],
|
|
431
|
+
CurrencyWidget: [],
|
|
432
|
+
TextareaWidget: [],
|
|
433
|
+
GeocoderWidget: [],
|
|
434
|
+
DropdownWidget: [],
|
|
435
|
+
ToggleCheckboxWidget: [],
|
|
436
|
+
RadioWidget: [],
|
|
437
|
+
NumberWidget: [],
|
|
438
|
+
EmailWidget: ["email"],
|
|
439
|
+
PhoneWidget: ["phone"],
|
|
440
|
+
URLWidget: ["url"],
|
|
441
|
+
DateWidget: [],
|
|
442
|
+
TimeWidget: [],
|
|
443
|
+
SwitchWidget: [],
|
|
444
|
+
RichTextWidget: [],
|
|
445
|
+
DateTimeWidget: [],
|
|
446
|
+
CheckboxWidget: [],
|
|
447
|
+
ImageUploadWidget: [],
|
|
448
|
+
MultiImageUploadWidget: [],
|
|
449
|
+
FileUploadWidget: [],
|
|
450
|
+
MultiFileUploadWidget: [],
|
|
451
|
+
MultiDropdownWidget: [],
|
|
452
|
+
CollectionWidget: [],
|
|
453
|
+
MultiGeocoderWidget: [],
|
|
454
|
+
JSONWidget: [],
|
|
455
|
+
SlugWidget: []
|
|
456
|
+
}, E = [
|
|
457
|
+
"TextWidget",
|
|
458
|
+
"CurrencyWidget",
|
|
459
|
+
"TextareaWidget",
|
|
460
|
+
"GeocoderWidget",
|
|
461
|
+
"MultiGeocoderWidget",
|
|
462
|
+
"DropdownWidget",
|
|
463
|
+
"ToggleCheckboxWidget",
|
|
464
|
+
"RadioWidget",
|
|
465
|
+
"NumberWidget",
|
|
466
|
+
"EmailWidget",
|
|
467
|
+
"PhoneWidget",
|
|
468
|
+
"URLWidget",
|
|
469
|
+
"DateWidget",
|
|
470
|
+
"TimeWidget",
|
|
471
|
+
"SwitchWidget",
|
|
472
|
+
"RichTextWidget",
|
|
473
|
+
"DateTimeWidget",
|
|
474
|
+
"CheckboxWidget",
|
|
475
|
+
"ImageUploadWidget",
|
|
476
|
+
"MultiImageUploadWidget",
|
|
477
|
+
"FileUploadWidget",
|
|
478
|
+
"MultiFileUploadWidget",
|
|
479
|
+
"MultiDropdownWidget",
|
|
480
|
+
"MultiTextWidget"
|
|
481
|
+
], D = [
|
|
482
|
+
"CollectionWidget",
|
|
483
|
+
"ArrayWidget",
|
|
484
|
+
"RecordWidget",
|
|
485
|
+
"JSONWidget",
|
|
486
|
+
"SlugWidget"
|
|
487
|
+
], O = [...E, ...D], k = E.reduce((e, t) => (e[t] = t, e), {}), A = O.reduce((e, t) => (e[t] = t, e), {}), j = [
|
|
488
|
+
"collection",
|
|
489
|
+
"record",
|
|
490
|
+
"group",
|
|
491
|
+
"public-id",
|
|
492
|
+
"string",
|
|
493
|
+
"array-string",
|
|
494
|
+
"number",
|
|
495
|
+
"array-number",
|
|
496
|
+
"date",
|
|
497
|
+
"array-date",
|
|
498
|
+
"boolean",
|
|
499
|
+
"array-boolean",
|
|
500
|
+
"json",
|
|
501
|
+
"array-json",
|
|
502
|
+
"file",
|
|
503
|
+
"array-file",
|
|
504
|
+
"location",
|
|
505
|
+
"array-location",
|
|
506
|
+
"richtext",
|
|
507
|
+
"identifier"
|
|
508
|
+
], M = {
|
|
509
|
+
identifier: "identifier",
|
|
510
|
+
collection: "collection",
|
|
511
|
+
"public-id": "public-id",
|
|
512
|
+
string: "string",
|
|
513
|
+
number: "number",
|
|
514
|
+
boolean: "boolean",
|
|
515
|
+
date: "date",
|
|
516
|
+
json: "json",
|
|
517
|
+
"array-string": "array-string",
|
|
518
|
+
"array-number": "array-number",
|
|
519
|
+
"array-date": "array-date",
|
|
520
|
+
"array-boolean": "array-boolean",
|
|
521
|
+
file: "file",
|
|
522
|
+
"array-file": "array-file",
|
|
523
|
+
record: "record",
|
|
524
|
+
group: "group",
|
|
525
|
+
location: "location",
|
|
526
|
+
"array-location": "array-location",
|
|
527
|
+
richtext: "richtext",
|
|
528
|
+
"array-json": "array-json"
|
|
529
|
+
}, N = {
|
|
530
|
+
ArrayWidget: M.group,
|
|
531
|
+
RecordWidget: M.record,
|
|
532
|
+
TextWidget: M.string,
|
|
533
|
+
TextareaWidget: M.string,
|
|
534
|
+
EmailWidget: M.string,
|
|
535
|
+
URLWidget: M.string,
|
|
536
|
+
CurrencyWidget: M.string,
|
|
537
|
+
NumberWidget: M.number,
|
|
538
|
+
PhoneWidget: M.string,
|
|
539
|
+
SlugWidget: M.string,
|
|
540
|
+
RichTextWidget: M.string,
|
|
541
|
+
DateWidget: M.date,
|
|
542
|
+
TimeWidget: M.string,
|
|
543
|
+
DateTimeWidget: M.date,
|
|
544
|
+
RadioWidget: M.string,
|
|
545
|
+
CheckboxWidget: M["array-string"],
|
|
546
|
+
ToggleCheckboxWidget: M.boolean,
|
|
547
|
+
SwitchWidget: M.boolean,
|
|
548
|
+
DropdownWidget: M.string,
|
|
549
|
+
MultiDropdownWidget: M["array-string"],
|
|
550
|
+
MultiTextWidget: M["array-string"],
|
|
551
|
+
FileUploadWidget: M.file,
|
|
552
|
+
MultiFileUploadWidget: M["array-file"],
|
|
553
|
+
MultiImageUploadWidget: M["array-file"],
|
|
554
|
+
ImageUploadWidget: M.file,
|
|
555
|
+
GeocoderWidget: M.location,
|
|
556
|
+
MultiGeocoderWidget: M["array-location"],
|
|
557
|
+
CollectionWidget: M.collection,
|
|
558
|
+
JSONWidget: M.json
|
|
559
|
+
}, P = [
|
|
560
|
+
"image",
|
|
561
|
+
"video",
|
|
562
|
+
"audio",
|
|
563
|
+
"document"
|
|
564
|
+
], F = P.reduce((e, t) => (e[t] = t, e), {}), I = (e) => e.reduce((e, t) => (e[t] = t, e), {}), L = (e) => e.reduce((e, t) => (e[t] = t, e), {}), R = [
|
|
565
|
+
"bevy.collection.filled",
|
|
566
|
+
"bevy.collection.submitted",
|
|
567
|
+
"bevy.collection.view",
|
|
568
|
+
"block.view",
|
|
569
|
+
"blog.post.view",
|
|
570
|
+
"event.booking.confirmed",
|
|
571
|
+
"event.booking.initiated",
|
|
572
|
+
"event.booking.pending",
|
|
573
|
+
"event.coupon.applied",
|
|
574
|
+
"event.event.view",
|
|
575
|
+
"form.change",
|
|
576
|
+
"form.submit",
|
|
577
|
+
"membership.account.signin",
|
|
578
|
+
"membership.account.signout",
|
|
579
|
+
"membership.account.signup",
|
|
580
|
+
"button.click",
|
|
581
|
+
"page.bounce",
|
|
582
|
+
"page.click",
|
|
583
|
+
"page.copy",
|
|
584
|
+
"page.impression",
|
|
585
|
+
"page.scroll",
|
|
586
|
+
"page.view",
|
|
587
|
+
"page.selection",
|
|
588
|
+
"user.active",
|
|
589
|
+
"user.idle"
|
|
590
|
+
], z = L(R), B = (e) => e.module_name ? "module" : e.allow_public_submit && !e.public_submit_set_by ? "form" : "collection", V = {
|
|
591
|
+
string: [
|
|
592
|
+
"equals",
|
|
593
|
+
"not",
|
|
594
|
+
"contains",
|
|
595
|
+
"not_contains",
|
|
596
|
+
"starts_with",
|
|
597
|
+
"not_starts_with",
|
|
598
|
+
"ends_with",
|
|
599
|
+
"not_ends_with",
|
|
600
|
+
"is_empty",
|
|
601
|
+
"is_not_empty"
|
|
602
|
+
],
|
|
603
|
+
number: [
|
|
604
|
+
"equals",
|
|
605
|
+
"not",
|
|
606
|
+
"gt",
|
|
607
|
+
"gte",
|
|
608
|
+
"lt",
|
|
609
|
+
"lte",
|
|
610
|
+
"is_empty",
|
|
611
|
+
"is_not_empty"
|
|
612
|
+
],
|
|
613
|
+
boolean: ["equals", "not"],
|
|
614
|
+
date: [
|
|
615
|
+
"equals",
|
|
616
|
+
"not",
|
|
617
|
+
"gt",
|
|
618
|
+
"gte",
|
|
619
|
+
"lt",
|
|
620
|
+
"lte",
|
|
621
|
+
"is_empty",
|
|
622
|
+
"is_not_empty"
|
|
623
|
+
],
|
|
624
|
+
"array-string": [
|
|
625
|
+
"contains",
|
|
626
|
+
"not_contains",
|
|
627
|
+
"is_empty",
|
|
628
|
+
"is_not_empty"
|
|
629
|
+
],
|
|
630
|
+
"array-number": [
|
|
631
|
+
"contains",
|
|
632
|
+
"not_contains",
|
|
633
|
+
"is_empty",
|
|
634
|
+
"is_not_empty"
|
|
635
|
+
],
|
|
636
|
+
"array-date": ["is_empty", "is_not_empty"],
|
|
637
|
+
"array-boolean": ["is_empty", "is_not_empty"],
|
|
638
|
+
file: ["is_empty", "is_not_empty"],
|
|
639
|
+
"array-file": ["is_empty", "is_not_empty"],
|
|
640
|
+
location: ["is_empty", "is_not_empty"],
|
|
641
|
+
"array-location": ["is_empty", "is_not_empty"],
|
|
642
|
+
richtext: ["is_empty", "is_not_empty"],
|
|
643
|
+
json: ["is_empty", "is_not_empty"],
|
|
644
|
+
"array-json": ["is_empty", "is_not_empty"],
|
|
645
|
+
collection: [
|
|
646
|
+
"equals",
|
|
647
|
+
"not",
|
|
648
|
+
"contains",
|
|
649
|
+
"not_contains",
|
|
650
|
+
"is_empty",
|
|
651
|
+
"is_not_empty"
|
|
652
|
+
],
|
|
653
|
+
"public-id": ["equals", "not"],
|
|
654
|
+
identifier: ["equals", "not"],
|
|
655
|
+
record: [],
|
|
656
|
+
group: []
|
|
657
|
+
}, H = {
|
|
658
|
+
published: "published",
|
|
659
|
+
unpublished: "unpublished",
|
|
660
|
+
archived: "archived",
|
|
661
|
+
flagged: "flagged",
|
|
662
|
+
pending_moderation: "pending_moderation"
|
|
663
|
+
}, U = {
|
|
664
|
+
post: "post",
|
|
665
|
+
poll: "poll",
|
|
666
|
+
gallery: "gallery",
|
|
667
|
+
link: "link"
|
|
668
|
+
}, W = Object.keys(U), G = {
|
|
669
|
+
draft: "draft",
|
|
670
|
+
published: "published",
|
|
671
|
+
unpublished: "unpublished",
|
|
672
|
+
archived: "archived",
|
|
673
|
+
flagged: "flagged",
|
|
674
|
+
pending_moderation: "pending_moderation"
|
|
675
|
+
}, K = (e) => {
|
|
676
|
+
let t = e.split("/"), n = t[t.length - 1];
|
|
677
|
+
if (n) {
|
|
678
|
+
let t = encodeURIComponent(n);
|
|
679
|
+
return e.replace(n, t);
|
|
680
|
+
}
|
|
681
|
+
return "";
|
|
700
682
|
};
|
|
683
|
+
//#endregion
|
|
684
|
+
export { z as AnalyticsEvents, R as AnalyticsEventsList, H as COMMENT_STATUS, k as CommonFieldIntefaces, E as CommonFieldInterfacesList, D as ComplexFieldInterfacesList, U as FORUM_POST_KIND, G as FORUM_POST_STATUS, A as FieldInterfaces, O as FieldInterfacesList, M as FieldKind, j as FieldKindList, W as ForumPostKindExpandedList, m as LevoError, x as LevoOAuthProviderList, d as LogLevel, F as MediaKind, P as MediaKindList, C as createLevoClient, p as createLevoLogger, w as defaultByKinds, f as defineLevoLoggerMiddleware, K as formatImagePath, T as formatsByInterface, B as getCollectionKind, g as getLevoError, N as interfaceKinds, I as listToColumn, L as listToRecord, V as operatorsByKind, u as remoteLoggerMiddleware };
|