@levo-so/core 0.1.64 → 0.1.71

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 (3) hide show
  1. package/dist/index.d.ts +1976 -1784
  2. package/dist/index.js +461 -635
  3. package/package.json +5 -4
package/dist/index.d.ts CHANGED
@@ -1,1784 +1,1976 @@
1
- import * as wretch_addons_queryString from 'wretch/addons/queryString';
2
- import * as wretch from 'wretch';
3
-
4
- declare const MediaKindList: readonly ["image", "video", "audio", "document"];
5
- declare const MediaKind: Record<"image" | "video" | "audio" | "document", "image" | "video" | "audio" | "document">;
6
-
7
- interface IFaviconSrcset {
8
- "16": string;
9
- "32": string;
10
- "57": string;
11
- "60": string;
12
- "72": string;
13
- "76": string;
14
- "96": string;
15
- "114": string;
16
- "120": string;
17
- "144": string;
18
- "152": string;
19
- "180": string;
20
- "192": string;
21
- }
22
- interface IMedia {
23
- id: string;
24
- workspace_id: string;
25
- filename: string;
26
- kind: (typeof MediaKindList)[number];
27
- location: string;
28
- path: string;
29
- srcset?: {
30
- "320w": string;
31
- "640w": string;
32
- "750w": string;
33
- "828w": string;
34
- "1080w": string;
35
- "1200w": string;
36
- "1920w": string;
37
- path: string;
38
- };
39
- description: string;
40
- metadata: {
41
- encoding?: string;
42
- mimetype: string;
43
- size: number;
44
- etag?: string;
45
- };
46
- created_at?: Date;
47
- created_by?: string;
48
- updated_at?: Date;
49
- updated_by?: string;
50
- }
51
- type IFaviconMedia = Omit<IMedia, "srcset"> & {
52
- srcset: IFaviconSrcset;
53
- };
54
- type IMediaObject = Pick<IMedia, "id" | "location" | "srcset" | "kind"> & {
55
- mimetype?: IMedia["metadata"]["mimetype"];
56
- };
57
- type IFaviconMediaObject = Omit<IMediaObject, "srcset"> & {
58
- srcset: IFaviconSrcset;
59
- };
60
-
61
- type JSONContent = {
62
- type?: string;
63
- attrs?: Record<string, any>;
64
- content?: JSONContent[];
65
- marks?: {
66
- type: string;
67
- attrs?: Record<string, any>;
68
- [key: string]: any;
69
- }[];
70
- text?: string;
71
- [key: string]: any;
72
- };
73
- interface IContent {
74
- json: JSONContent;
75
- html: string;
76
- nodes?: any[];
77
- }
78
- interface IPost {
79
- _id: string;
80
- blog: string;
81
- slug: string;
82
- title: string;
83
- summary: string;
84
- content: IContent;
85
- status: string;
86
- cover_image?: IMediaObject;
87
- reading_time: number;
88
- canonical_url: string;
89
- og_image?: IMediaObject | null;
90
- og_title: string;
91
- og_description: string;
92
- meta_title: string;
93
- meta_description: string;
94
- authors?: {
95
- first_name: string;
96
- last_name: string;
97
- slug: string;
98
- bio: string;
99
- profile_picture: {
100
- location: string;
101
- };
102
- }[];
103
- settings: Record<string, any>;
104
- in_review_at?: Date;
105
- approved_at?: Date;
106
- published_at?: string | null;
107
- created_at: string;
108
- updated_at: Date;
109
- deleted_at?: Date;
110
- tags?: {
111
- _id: string;
112
- name: string;
113
- slug: string;
114
- }[];
115
- categories?: {
116
- _id: string;
117
- name: string;
118
- slug: string;
119
- }[];
120
- }
121
-
122
- interface IAuthor {
123
- _id: string;
124
- public_id: string;
125
- slug: string;
126
- first_name: string;
127
- last_name: string;
128
- profile_picture: any;
129
- active_at: Date;
130
- }
131
- interface IMe {
132
- _id: string;
133
- public_id: string;
134
- slug: string;
135
- first_name: string;
136
- last_name: string;
137
- email: string;
138
- bio: string;
139
- website: string;
140
- profile_picture: any;
141
- og_image: any;
142
- og_title: string;
143
- og_description: string;
144
- meta_title: string;
145
- meta_description: string;
146
- last_access_at: Date;
147
- active_at: Date;
148
- created_at: Date;
149
- updated_at: Date;
150
- }
151
-
152
- interface IBlogCategory {
153
- posts: IPost[];
154
- _id: string;
155
- blog: string;
156
- slug: string;
157
- name: string;
158
- description: string;
159
- og_image?: IMediaObject;
160
- og_title: string;
161
- og_description: string;
162
- meta_title: string;
163
- meta_description: string;
164
- created_at: Date;
165
- updated_at: Date;
166
- created_by: Date;
167
- updated_by: Date;
168
- }
169
-
170
- interface IBlogTag {
171
- posts: IPost[];
172
- _id: string;
173
- blog: string;
174
- slug: string;
175
- name: string;
176
- description: string;
177
- og_image?: any;
178
- og_title: string;
179
- og_description: string;
180
- meta_title: string;
181
- meta_description: string;
182
- created_at: Date;
183
- updated_at: Date;
184
- created_by: Date;
185
- updated_by: Date;
186
- }
187
-
188
- interface IBlog {
189
- _id: string;
190
- slug: string;
191
- name: string;
192
- status: string;
193
- description: string;
194
- og_image?: string;
195
- og_title?: string;
196
- og_description?: string;
197
- meta_title?: string;
198
- meta_description?: string;
199
- created_at: string;
200
- updated_at: string;
201
- created_by: string;
202
- updated_by: string;
203
- }
204
- declare namespace BlogClient {
205
- interface CoverImage {
206
- _id: string;
207
- location: string;
208
- mimetype: string;
209
- kind: string;
210
- external: boolean;
211
- }
212
- interface CategoriesEntity {
213
- _id: string;
214
- slug: string;
215
- name: string;
216
- }
217
- interface AuthorsEntity {
218
- posts?: string[] | null;
219
- _id: string;
220
- public_id: string;
221
- slug: string;
222
- first_name: string;
223
- last_name: string;
224
- email: string;
225
- bio: string;
226
- website: string;
227
- profile_picture?: null | {
228
- location: string;
229
- };
230
- og_image: string;
231
- og_title: string;
232
- og_description: string;
233
- meta_title: string;
234
- meta_description: string;
235
- last_access_at: string;
236
- active_at: string;
237
- created_at: string;
238
- updated_at: string;
239
- }
240
- type BlogData = IPost;
241
- interface OptionParams {
242
- workspace_id: string;
243
- params?: Record<string, string>;
244
- }
245
- }
246
-
247
- declare const CommonFieldInterfacesList: readonly ["TextWidget", "CurrencyWidget", "TextareaWidget", "GeocoderWidget", "MultiGeocoderWidget", "DropdownWidget", "ToggleCheckboxWidget", "RadioWidget", "NumberWidget", "EmailWidget", "PhoneWidget", "URLWidget", "DateWidget", "TimeWidget", "SwitchWidget", "RichTextWidget", "DateTimeWidget", "CheckboxWidget", "ImageUploadWidget", "MultiImageUploadWidget", "FileUploadWidget", "MultiFileUploadWidget", "MultiDropdownWidget", "MultiTextWidget"];
248
- declare const ComplexFieldInterfacesList: readonly ["CollectionWidget", "ArrayWidget", "RecordWidget", "JSONWidget", "SlugWidget"];
249
- declare const FieldInterfacesList: readonly ["TextWidget", "CurrencyWidget", "TextareaWidget", "GeocoderWidget", "MultiGeocoderWidget", "DropdownWidget", "ToggleCheckboxWidget", "RadioWidget", "NumberWidget", "EmailWidget", "PhoneWidget", "URLWidget", "DateWidget", "TimeWidget", "SwitchWidget", "RichTextWidget", "DateTimeWidget", "CheckboxWidget", "ImageUploadWidget", "MultiImageUploadWidget", "FileUploadWidget", "MultiFileUploadWidget", "MultiDropdownWidget", "MultiTextWidget", "CollectionWidget", "ArrayWidget", "RecordWidget", "JSONWidget", "SlugWidget"];
250
- declare const CommonFieldIntefaces: Record<"TextWidget" | "CurrencyWidget" | "TextareaWidget" | "GeocoderWidget" | "MultiGeocoderWidget" | "DropdownWidget" | "ToggleCheckboxWidget" | "RadioWidget" | "NumberWidget" | "EmailWidget" | "PhoneWidget" | "URLWidget" | "DateWidget" | "TimeWidget" | "SwitchWidget" | "RichTextWidget" | "DateTimeWidget" | "CheckboxWidget" | "ImageUploadWidget" | "MultiImageUploadWidget" | "FileUploadWidget" | "MultiFileUploadWidget" | "MultiDropdownWidget" | "MultiTextWidget", "TextWidget" | "CurrencyWidget" | "TextareaWidget" | "GeocoderWidget" | "MultiGeocoderWidget" | "DropdownWidget" | "ToggleCheckboxWidget" | "RadioWidget" | "NumberWidget" | "EmailWidget" | "PhoneWidget" | "URLWidget" | "DateWidget" | "TimeWidget" | "SwitchWidget" | "RichTextWidget" | "DateTimeWidget" | "CheckboxWidget" | "ImageUploadWidget" | "MultiImageUploadWidget" | "FileUploadWidget" | "MultiFileUploadWidget" | "MultiDropdownWidget" | "MultiTextWidget">;
251
- declare const FieldInterfaces: Record<"TextWidget" | "CurrencyWidget" | "TextareaWidget" | "GeocoderWidget" | "MultiGeocoderWidget" | "DropdownWidget" | "ToggleCheckboxWidget" | "RadioWidget" | "NumberWidget" | "EmailWidget" | "PhoneWidget" | "URLWidget" | "DateWidget" | "TimeWidget" | "SwitchWidget" | "RichTextWidget" | "DateTimeWidget" | "CheckboxWidget" | "ImageUploadWidget" | "MultiImageUploadWidget" | "FileUploadWidget" | "MultiFileUploadWidget" | "MultiDropdownWidget" | "MultiTextWidget" | "CollectionWidget" | "ArrayWidget" | "RecordWidget" | "JSONWidget" | "SlugWidget", "TextWidget" | "CurrencyWidget" | "TextareaWidget" | "GeocoderWidget" | "MultiGeocoderWidget" | "DropdownWidget" | "ToggleCheckboxWidget" | "RadioWidget" | "NumberWidget" | "EmailWidget" | "PhoneWidget" | "URLWidget" | "DateWidget" | "TimeWidget" | "SwitchWidget" | "RichTextWidget" | "DateTimeWidget" | "CheckboxWidget" | "ImageUploadWidget" | "MultiImageUploadWidget" | "FileUploadWidget" | "MultiFileUploadWidget" | "MultiDropdownWidget" | "MultiTextWidget" | "CollectionWidget" | "ArrayWidget" | "RecordWidget" | "JSONWidget" | "SlugWidget">;
252
-
253
- declare const FieldKindList: readonly ["collection", "record", "group", "public-id", "string", "array-string", "number", "array-number", "date", "array-date", "boolean", "array-boolean", "json", "array-json", "file", "array-file", "location", "array-location", "richtext", "identifier"];
254
- declare const FieldKind: {
255
- identifier: "identifier";
256
- collection: "collection";
257
- "public-id": "public-id";
258
- string: "string";
259
- number: "number";
260
- boolean: "boolean";
261
- date: "date";
262
- json: "json";
263
- "array-string": "array-string";
264
- "array-number": "array-number";
265
- "array-date": "array-date";
266
- "array-boolean": "array-boolean";
267
- file: "file";
268
- "array-file": "array-file";
269
- record: "record";
270
- group: "group";
271
- location: "location";
272
- "array-location": "array-location";
273
- richtext: "richtext";
274
- "array-json": "array-json";
275
- };
276
- declare const interfaceKinds: Record<(typeof FieldInterfacesList)[number], (typeof FieldKindList)[number]>;
277
-
278
- declare const defaultByKinds: Record<(typeof FieldKindList)[number], any>;
279
-
280
- declare const formatsByInterface: Record<(typeof FieldInterfacesList)[number], string[]>;
281
-
282
- declare const LEVO_INTEGRATIONS: {
283
- readonly beacon: "so.levo.beacon";
284
- readonly blog: "so.levo.blog";
285
- readonly event: "so.levo.event";
286
- readonly membership: "so.levo.membership";
287
- readonly payment: "so.levo.payment";
288
- readonly community: "so.levo.community";
289
- readonly search_console: "com.google.search_console";
290
- };
291
- declare const LEVO_INTEGRATIONS_LIST: ("so.levo.beacon" | "so.levo.blog" | "so.levo.event" | "so.levo.membership" | "so.levo.payment" | "so.levo.community" | "com.google.search_console")[];
292
- type ILevoIntegrationList = (typeof LEVO_INTEGRATIONS)[keyof typeof LEVO_INTEGRATIONS][];
293
- type ILevoIntegrationInstance = {
294
- id: string;
295
- name: string;
296
- publisher: string;
297
- description: string;
298
- url: string | null;
299
- logo: string | null;
300
- dashboard_url: string | null;
301
- sidebar_icon: string | null;
302
- show_on_sidebar: boolean;
303
- key: string;
304
- };
305
-
306
- declare const LevoOAuthProviderList: readonly ["google", "linkedin", "microsoft"];
307
- type ILevoOAuthProvider = (typeof LevoOAuthProviderList)[number];
308
-
309
- /**
310
- * Defines the structure for a field in a generic schema system. Levo Collection builds its own types on top of this, so this type is not used directly.
311
- */
312
- interface IField {
313
- /** Unique identifier for the field. */
314
- id: string;
315
- /** Unique key for the field, used for referencing. */
316
- key: string;
317
- /** The kind/type of the field (e.g., text, number, date). */
318
- kind: (typeof FieldKindList)[number];
319
- /** The widget/component type used to render this field. */
320
- field_interface: (typeof FieldInterfacesList)[number] | "HeadingWidget" | "ButtonWidget" | "ImageWidget" | "MultiImageWidget" | "TypographyWidget" | "LayoutWidget" | "RepeatableWidget" | "TitleWidget" | "CardWidget" | "LinkWidget" | "IframeWidget";
321
- /** Label for the field, displayed in the UI. */
322
- label: string;
323
- /** Helper text shown below the field. */
324
- helper_text?: string;
325
- /** Placeholder text for the field input. */
326
- placeholder?: string;
327
- /** Default value for the field. */
328
- default_value?: any;
329
- /** Whether the field is read-only. */
330
- readonly?: boolean;
331
- /** Nested fields, if this field is a group or composite. */
332
- fields?: IField[];
333
- /** Additional options for configuring the field. */
334
- options?: Record<string, any>;
335
- /** Whether the field is hidden from the UI. */
336
- hidden?: boolean;
337
- /** Whether the field is editable. */
338
- editable?: boolean;
339
- /** Whether the field is required. */
340
- required?: boolean;
341
- /** Whether the field value must be unique. */
342
- unique?: boolean;
343
- /** Minimum value or length for the field. */
344
- min?: string | number | null;
345
- /** Maximum value or length for the field. */
346
- max?: string | number | null;
347
- /** Allowed formats for the field value. */
348
- formats?: string[];
349
- /** Allowed values for the field (for select/dropdown fields). */
350
- values?: any[];
351
- /** */
352
- created_at?: string;
353
- /** */
354
- updated_at?: string;
355
- }
356
- /**
357
- * Used for making partial updates to fields, especially nested fields. This type is not used directly in most Levo Collection code, but Levo Collection types are based on it.
358
- */
359
- interface IFieldUpdate extends Omit<IField, "fields"> {
360
- /** Nested fields to update, provided as partials. */
361
- fields: Partial<IField>[];
362
- }
363
-
364
- type Prettify<T> = {
365
- [K in keyof T]: T[K];
366
- };
367
- type Mandatory<T, K extends keyof T> = Prettify<Pick<T, K> & Partial<Omit<T, K>>>;
368
- type DeepPartial<T> = {
369
- [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
370
- };
371
-
372
- interface IEmojiData {
373
- label: string;
374
- tags?: string[];
375
- unicode: string;
376
- }
377
- interface IIconData {
378
- id: string;
379
- label: string;
380
- tags?: string[];
381
- svgCode: string;
382
- }
383
- interface IIconCat {
384
- name: string;
385
- slug: string;
386
- emojis: IEmojiData[] | IIconData[];
387
- }
388
- interface IIcon {
389
- kind: "emoji" | "custom" | "icon";
390
- data: IEmojiData | IMediaObject | IIconData;
391
- }
392
-
393
- declare const LogicalOperators: {
394
- AND: "AND";
395
- OR: "OR";
396
- };
397
- type LogicalOperators = keyof typeof LogicalOperators;
398
- type FieldType = string | number | Date | boolean | null;
399
- type ComparableFieldType = number | Date;
400
- declare const ComparableOperators: {
401
- equals: "equals";
402
- not: "not";
403
- in: "in";
404
- not_in: "not_in";
405
- gt: "gt";
406
- gte: "gte";
407
- lt: "lt";
408
- lte: "lte";
409
- contains: "contains";
410
- not_contains: "not_contains";
411
- starts_with: "starts_with";
412
- not_starts_with: "not_starts_with";
413
- ends_with: "ends_with";
414
- not_ends_with: "not_ends_with";
415
- empty: "empty";
416
- has: "has";
417
- between: "between";
418
- within: "within";
419
- is_empty: "is_empty";
420
- is_not_empty: "is_not_empty";
421
- };
422
- type WithinFilterType = {
423
- latitude: number;
424
- longitude: number;
425
- distance: number;
426
- unit?: "kilometers" | "miles" | "meters" | "feet";
427
- };
428
- type ComparableFilter<T extends string = string> = {
429
- [ComparableOperators.equals]?: FieldType;
430
- } | {
431
- [ComparableOperators.not]?: FieldType;
432
- } | {
433
- [ComparableOperators.in]?: FieldType[];
434
- } | {
435
- [ComparableOperators.not_in]?: FieldType[];
436
- } | {
437
- [ComparableOperators.gt]?: ComparableFieldType;
438
- } | {
439
- [ComparableOperators.gte]?: ComparableFieldType;
440
- } | {
441
- [ComparableOperators.lt]?: ComparableFieldType;
442
- } | {
443
- [ComparableOperators.lte]?: ComparableFieldType;
444
- } | {
445
- [ComparableOperators.contains]?: string;
446
- } | {
447
- [ComparableOperators.not_contains]?: string;
448
- } | {
449
- [ComparableOperators.starts_with]?: string;
450
- } | {
451
- [ComparableOperators.not_starts_with]?: string;
452
- } | {
453
- [ComparableOperators.ends_with]?: string;
454
- } | {
455
- [ComparableOperators.not_ends_with]?: string;
456
- } | {
457
- [ComparableOperators.between]?: ComparableFieldType[];
458
- } | {
459
- [ComparableOperators.is_empty]?: boolean;
460
- } | {
461
- [ComparableOperators.is_not_empty]?: boolean;
462
- } | {
463
- [ComparableOperators.empty]?: boolean;
464
- } | {
465
- [ComparableOperators.has]?: Record<string, FieldType>;
466
- } | {
467
- [ComparableOperators.within]?: WithinFilterType;
468
- };
469
- type LogicalFilter<T extends string = string> = {
470
- [LogicalOperators.AND]: Filter<T>[];
471
- [LogicalOperators.OR]?: never;
472
- } | {
473
- [LogicalOperators.OR]: Filter<T>[];
474
- [LogicalOperators.AND]?: never;
475
- };
476
- type FieldFilter<T extends string = string> = Partial<Record<T, ComparableFilter<T> | FieldType>>;
477
- type Filter<T extends string = string> = LogicalFilter<T> | FieldFilter<T>;
478
- declare namespace LevoQuery {
479
- type Select<Fields extends string = string> = Partial<Record<Fields, boolean | {
480
- select: Record<string, boolean>;
481
- }>>;
482
- type Sort<Fields extends string = string> = Partial<Record<Fields, "asc" | "desc">>;
483
- type Include<Fields extends string = string> = Partial<Record<Fields, boolean | Pick<FindQuery<Fields>, "select" | "sort" | "include" | "limit">>>;
484
- type Where<Fields extends string = string> = Filter<Fields>;
485
- type FindQuery<Fields extends string = string> = Partial<{
486
- page: number;
487
- limit: number;
488
- select: Select<Fields>;
489
- where: Where<Fields>;
490
- sort: Sort<Fields>;
491
- include: Include<Fields>;
492
- search: string;
493
- }>;
494
- }
495
-
496
- /**
497
- * Defines the basic structure for a collection schema, including its sections, fields, and configuration. Levo Collection uses its own types built on top of this, so this type is not used directly.
498
- */
499
- interface ISchema {
500
- /** Unique identifier for the schema. */
501
- id: string;
502
- /** Name of the schema. */
503
- name: string;
504
- /** Description of the schema. */
505
- description: string;
506
- /** Unique key for referencing the schema. */
507
- key: string;
508
- /** Sections that make up the schema, each containing fields. */
509
- sections: ISection[];
510
- /** Field key used as the title for items in the schema. */
511
- title_field: string;
512
- /** */
513
- cover_image_field?: string;
514
- /** Icon representing the schema. */
515
- icon: null | IIcon;
516
- /** */
517
- created_at?: string;
518
- /** */
519
- module_name?: string;
520
- /** Views for customizing how the schema is presented. */
521
- views?: ICollectionViews[];
522
- }
523
- /**
524
- * Defines the structure for a view configuration in a collection schema. Levo Collection uses its own types built on top of this, so this type is not used directly in most Levo Collection code.
525
- */
526
- interface ICollectionViews {
527
- /** Unique identifier for the view. */
528
- id: string;
529
- /** Slug for the view, used in URLs. */
530
- slug: string;
531
- /** Title of the view. */
532
- title: string;
533
- }
534
- /**
535
- * Defines the structure for a section in a schema, grouping related fields together. Levo Collection uses its own types built on top of this, so this type is not used directly in most Levo Collection code.
536
- */
537
- interface ISection {
538
- /** Unique identifier for the section. */
539
- id: string;
540
- /** Label for the section, displayed in the UI. */
541
- label: string;
542
- /** Unique key for referencing the section. */
543
- key: string;
544
- /** Helper text for the section. */
545
- helper_text: string;
546
- /** Whether the section is hidden from the UI. */
547
- hidden: boolean;
548
- /** Fields contained within this section. */
549
- fields: IField[];
550
- }
551
-
552
- /**
553
- * Represents a section in a Levo Collection schema, grouping related fields together.
554
- */
555
- interface ILemaSection extends Omit<ISection, "fields"> {
556
- /** Fields contained within this section. */
557
- fields: ILemaField[];
558
- }
559
-
560
- /**
561
- * Represents an icon object used in collections.
562
- * @see IIcon
563
- */
564
-
565
- interface INotificationData {
566
- id?: string;
567
- kind: string;
568
- subkind: string;
569
- enabled?: boolean;
570
- condition?: LevoQuery.Where;
571
- options: {
572
- to_email: string | string[];
573
- subject?: string;
574
- template_key: string;
575
- from_name: string;
576
- reply_to?: string;
577
- cc_email?: string[];
578
- bcc_email?: string[];
579
- info: {
580
- show_download_button?: boolean;
581
- hide_fields?: string[];
582
- body?: string;
583
- subject?: string;
584
- richtext?: string;
585
- };
586
- };
587
- }
588
- interface INotificationWithTrigger extends INotificationData {
589
- trigger: "on_submit" | "on_update";
590
- }
591
- /**
592
- * Defines the schema structure for a Levo Collection.
593
- *
594
- * A Levo Collection is a feature of the Levo platform that enables dynamic form rendering using the `@levo-so/react-collection` library.
595
- * This interface describes the schema used to generate forms, including sections, fields, and configuration options.
596
- * The schema is referenced anywhere a Levo Collection is required in the Levo ecosystem.
597
- *
598
- * For more details, see the documentation in external/react-collection/docs/readme.md.
599
- */
600
- interface ILemaCollection {
601
- /** Unique identifier for the collection schema. */
602
- id: string;
603
- /** Unique key used as URL slug and can be used to fetch the collection schema. */
604
- key: string;
605
- /** Array of sections that define the structure and fields of the form. */
606
- sections: ILemaSection[];
607
- /** Optional array of views for customizing how the collection is presented. */
608
- views?: ICollectionViews[];
609
- /** Optional workspace ID to which this collection belongs. */
610
- workspace_id?: string;
611
- /** Name of the collection schema. */
612
- name: string;
613
- /** Optional description of the collection schema. */
614
- description?: string | null;
615
- /** Optional icon representing the collection. */
616
- icon?: IIcon | null;
617
- /** Optional field name used as the title for items in the collection. */
618
- title_field?: string | null;
619
- /** Optional field name used for email in the collection. */
620
- email_field?: string | null;
621
- /** Optional field name used for mobile in the collection. */
622
- mobile_field?: string | null;
623
- /** Whether the collection is hidden from the UI. */
624
- hidden?: boolean;
625
- /** Whether the collection is read-only. */
626
- readonly?: boolean;
627
- /** Arbitrary settings for the collection schema. */
628
- settings?: Record<string, any>;
629
- /** Optional module name associated with the collection. */
630
- module_name?: string | null;
631
- /** Optional configuration for actions to perform on submit. */
632
- on_submit?: INotificationData[];
633
- /** Optional configuration for actions to perform on update. */
634
- on_update?: INotificationData[];
635
- /** Date or string representing when the collection was created. */
636
- created_at?: Date | string;
637
- /** Date or string representing when the collection was last updated. */
638
- updated_at?: Date | string;
639
- /** Whether the collection allows draft items. */
640
- allow_draft?: boolean;
641
- }
642
- /**
643
- * Represents a value within a collection, with a unique ID and arbitrary properties.
644
- */
645
- interface ICollectionValue {
646
- /** Unique identifier for the value. */
647
- id: string;
648
- /** Additional arbitrary properties for the value. */
649
- [x: string]: unknown;
650
- }
651
-
652
- type ILemaCollectionRelationship = "o2m" | "m2o" | "o2o" | "m2m";
653
- type ILemaRelationOnDelete = "CASCADE" | "SET_NULL" | "RESTRICT";
654
- type ILemaRelation = {
655
- relationship: ILemaCollectionRelationship | string;
656
- related_field: string;
657
- related_collection_key: string;
658
- field: string;
659
- collection_key: string;
660
- on_delete?: ILemaRelationOnDelete;
661
- };
662
-
663
- /**
664
- * Options for configuring the behavior and appearance of a field in a Levo Collection schema.
665
- */
666
- interface ILemaFieldOptions {
667
- /** Whether to link the email field with a member profile. */
668
- link_with_member_profile?: boolean;
669
- /** Key of the referenced collection for collection widget. */
670
- collection_key?: string;
671
- /** ID of the referenced collection for collection widget. */
672
- collection_id?: string;
673
- /** Key of the reference field in the related collection. */
674
- reference_field_key?: string;
675
- /** Key of the label field in the related collection. */
676
- label_field_key?: string | null;
677
- /** Whether the current collection has many connected items. */
678
- current_have_many_connected?: boolean;
679
- /** Whether the connected collection has many current items. */
680
- connected_have_many_current?: boolean;
681
- /** Relationship type or object for the collection widget. */
682
- relationship?: ILemaCollectionRelationship | string;
683
- /** Action to take on delete for the relationship. */
684
- on_delete?: ILemaRelationOnDelete;
685
- /** Slug for the field, used in URLs or as a unique identifier. */
686
- slug?: string;
687
- /** Currency code for currency widget. */
688
- currency_code?: string;
689
- disableCountryGuess?: boolean;
690
- /** Location type for location widget. */
691
- location_type?: string;
692
- /** Country for location widget. */
693
- country?: string;
694
- /** Whether to allow custom input in dropdown widget. */
695
- custom_input?: boolean;
696
- /** The referenced collection object for schema editor. */
697
- collection?: ILemaCollection | null;
698
- /** Whether to disable validation for this field. */
699
- disableValidation?: boolean;
700
- /** Validation presets for the field. */
701
- validationsPresets?: string[];
702
- /** Whether to verify email/phone values or not */
703
- verification?: boolean;
704
- }
705
- /**
706
- * Represents a field in a Levo Collection schema, including its configuration and options.
707
- */
708
- type ILemaField = Mandatory<Omit<IField, "fields" | "options">, "key" | "kind" | "label" | "id"> & {
709
- /** Field interface type, determines the widget/component to render. */
710
- field_interface: (typeof FieldInterfacesList)[number];
711
- /** Nested fields, if this field is a group or composite. */
712
- fields?: ILemaField[];
713
- /** Field options for configuring widget behavior. */
714
- options: ILemaFieldOptions;
715
- };
716
-
717
- type ICollectionsView = "table" | "kanban" | "calendar" | "cards";
718
- interface IGroupBy {
719
- label: string;
720
- value: string;
721
- field: ILemaField;
722
- }
723
- interface ICollectionLayoutOptions {
724
- groupBy?: IGroupBy | null;
725
- title?: string;
726
- description?: string;
727
- columnsOrder?: string[];
728
- selectedColumns?: string[];
729
- selectedFields?: string[];
730
- /** Field key for cover image (kanban) */
731
- coverImage?: string;
732
- /** Field key for card header (kanban) - defaults to created_at if not set */
733
- headerField?: string;
734
- /** Array of field keys to display as info points below description (kanban) */
735
- infoFields?: string[];
736
- }
737
- interface ICollectionLayout {
738
- kind: ICollectionsView;
739
- options: ICollectionLayoutOptions;
740
- }
741
- interface ICollectionQuery {
742
- where: Record<string, any>;
743
- sort?: Record<string, any>;
744
- }
745
- interface ICollectionView {
746
- id: string;
747
- workspace_id: string;
748
- slug: string;
749
- collection_id: string;
750
- title: string;
751
- description: string;
752
- layout: ICollectionLayout;
753
- query: ICollectionQuery;
754
- options: Record<string, any>;
755
- created_at: string;
756
- updated_at: string;
757
- }
758
-
759
- interface IDraftEntry {
760
- _id: string;
761
- _account: string;
762
- _status: "draft" | "submitted";
763
- [x: string]: any;
764
- created_at: string;
765
- updated_at: string;
766
- }
767
-
768
- interface IGeocoderLocation extends Partial<google.maps.places.PlaceResult> {
769
- place_name: string;
770
- latitude?: number;
771
- longitude?: number;
772
- }
773
-
774
- declare namespace LevoEvent {
775
- interface Root {
776
- _id: string;
777
- cover_image: IMediaObject | null;
778
- contact_email?: string;
779
- title: string;
780
- kind: "virtual" | "in_person";
781
- timing: string;
782
- url: string | null;
783
- location: IGeocoderLocation | null;
784
- is_location_public?: boolean;
785
- is_url_public?: boolean;
786
- starts_at?: string | null;
787
- ends_at?: string | null;
788
- cadence: string;
789
- repeat_every: number;
790
- description: string;
791
- slug: string;
792
- status: "draft" | "canceled" | "published";
793
- accept_registration: boolean;
794
- max_capacity: number;
795
- banners: IMediaObject[];
796
- created_at: Date;
797
- created_by: string;
798
- updated_at: Date;
799
- updated_by: string;
800
- external_ticketing?: string;
801
- ticket_order?: "alphabetical-asc" | "alphabetical-desc" | "price-asc" | "price-desc" | "custom";
802
- series?: {
803
- _id: string;
804
- slug: string;
805
- name: string;
806
- description?: string;
807
- cover_image?: IMediaObject | null;
808
- status?: string;
809
- created_at?: string;
810
- updated_at?: string;
811
- };
812
- }
813
- namespace Ticket {
814
- interface Tax {
815
- _id: string;
816
- label: string;
817
- percentage: number;
818
- country_code: string;
819
- }
820
- interface Root {
821
- _id: string;
822
- event: string;
823
- icon: IMediaObject | null;
824
- title: string;
825
- description: string;
826
- quantity: number | null;
827
- starts_at: Date | null;
828
- ends_at: Date | null;
829
- waitlist_enabled: boolean;
830
- requires_approval: boolean;
831
- hidden: boolean;
832
- allow_to_upgrade: boolean;
833
- include_in_upgrade: boolean;
834
- enforce_max_quantity: boolean;
835
- status: string;
836
- offerings: string[];
837
- coupons: string[];
838
- sale_count: number;
839
- currency: string;
840
- unit_amount: number;
841
- base_price: number;
842
- created_at: Date | string;
843
- created_by: string;
844
- updated_at: Date | string;
845
- updated_by: string;
846
- tax_enabled?: boolean;
847
- tax_inclusive?: boolean;
848
- taxes?: Tax[] | string[];
849
- }
850
- type Create = Pick<Root, "title" | "description" | "quantity" | "starts_at" | "ends_at" | "waitlist_enabled" | "hidden" | "enforce_max_quantity" | "offerings" | "coupons">;
851
- }
852
- namespace Coupon {
853
- interface Root {
854
- _id: string;
855
- event: string;
856
- code: string;
857
- description: string | null;
858
- kind: string;
859
- percent_off: number | null;
860
- amount_off: number | null;
861
- currency: string;
862
- starts_at: Date | null;
863
- expires_at: Date | null;
864
- max_redemptions: number | null;
865
- minimum_amount: number | null;
866
- is_public: boolean;
867
- created_at: Date;
868
- created_by: string;
869
- updated_at: Date;
870
- updated_by: string;
871
- status: string;
872
- tickets: string[];
873
- }
874
- type Create = Pick<Root, "code" | "description" | "kind" | "percent_off" | "amount_off" | "currency" | "starts_at" | "expires_at" | "max_redemptions" | "minimum_amount" | "is_public" | "tickets">;
875
- type CreateBulk = Pick<Root, "description" | "kind" | "percent_off" | "amount_off" | "currency" | "starts_at" | "expires_at" | "max_redemptions" | "minimum_amount" | "is_public" | "tickets"> & {
876
- coupon_count: number;
877
- code_length: number;
878
- };
879
- type Update = Partial<Pick<Root, "code" | "description" | "kind" | "percent_off" | "amount_off" | "currency" | "starts_at" | "expires_at" | "max_redemptions" | "minimum_amount" | "is_public" | "tickets">>;
880
- type Validate = {
881
- base_amount: number;
882
- sale_amount: number;
883
- discountable_amount: number;
884
- discount: number;
885
- };
886
- }
887
- namespace Offering {
888
- interface Root {
889
- _id: string;
890
- event: string;
891
- title: string;
892
- description: string;
893
- enabled: boolean;
894
- checkin_count: number;
895
- tickets: string[];
896
- attendees: string[];
897
- created_at: Date;
898
- created_by: string;
899
- updated_at: Date;
900
- updated_by: string;
901
- }
902
- type Create = Pick<Root, "title" | "description" | "enabled" | "tickets">;
903
- type Update = Partial<Pick<Root, "title" | "description" | "enabled" | "tickets">>;
904
- }
905
- namespace Attendee {
906
- interface Root {
907
- _id: string;
908
- public_id: string;
909
- name: string;
910
- email: string;
911
- mobile: string | null;
912
- event: string;
913
- booking: Booking.Root;
914
- ticket: Pick<LevoEvent.Ticket.Root, "_id" | "title" | "currency" | "quantity" | "status" | "unit_amount">;
915
- price: string;
916
- account: string | null;
917
- status: string;
918
- created_at: Date;
919
- updated_at: Date;
920
- }
921
- }
922
- namespace Booking {
923
- interface Root {
924
- _id: string;
925
- slug: string;
926
- public_id: string;
927
- quantity: number;
928
- unit_amount: number;
929
- total_amount?: number;
930
- discount: number;
931
- currency: string;
932
- payment_link: string | null;
933
- account: string | null;
934
- event: string;
935
- coupon: string | null;
936
- code: string | null;
937
- status: string;
938
- paid: boolean;
939
- info: Record<string, any>;
940
- taxes?: Array<{
941
- id: string;
942
- label: string;
943
- percentage: number;
944
- amount: number;
945
- }>;
946
- qr_image: IMediaObject & {
947
- width: number;
948
- height: number;
949
- };
950
- created_at: Date;
951
- updated_at: Date;
952
- attendees: LevoEvent.Attendee.Root[];
953
- }
954
- type Create = Omit<Pick<Root, "event" | "coupon">, "attendees"> & {
955
- attendees: Mandatory<LevoEvent.Attendee.Root, "name" | "ticket" | "email">;
956
- };
957
- }
958
- namespace Series {
959
- interface Root {
960
- _id: string;
961
- slug: string;
962
- name: string;
963
- description: string;
964
- cover_image: string | null;
965
- status: "published" | string;
966
- created_at: string;
967
- updated_at: string;
968
- events: any[];
969
- }
970
- interface Create {
971
- name: string;
972
- }
973
- interface Update {
974
- name: string;
975
- }
976
- }
977
- }
978
- /**
979
- * Main Object
980
- */
981
- interface IAttendee {
982
- checkin_at?: Date | null;
983
- _id: string;
984
- public_id: string;
985
- name: string;
986
- email: string;
987
- mobile: string | null;
988
- event: string;
989
- booking: string;
990
- ticket: Record<string, string>;
991
- price: string;
992
- account?: any;
993
- status: string;
994
- created_at: string;
995
- updated_at: string;
996
- }
997
- interface IBooking {
998
- _id: string;
999
- public_id: string;
1000
- quantity: number;
1001
- unit_amount: number;
1002
- total_amount?: number;
1003
- event: string;
1004
- currency: string;
1005
- account: string;
1006
- coupon?: null;
1007
- status: string;
1008
- paid: boolean;
1009
- discount: number;
1010
- taxes?: Array<{
1011
- id: string;
1012
- label: string;
1013
- percentage: number;
1014
- amount: number;
1015
- }>;
1016
- created_at: string;
1017
- updated_at: string;
1018
- attendees?: IAttendee[];
1019
- }
1020
-
1021
- declare namespace ILevoMembership {
1022
- interface sub_account_oauth_credentials {
1023
- provider: string;
1024
- oauth_id: string;
1025
- }
1026
- /**
1027
- * The account object of the member
1028
- */
1029
- export interface Account {
1030
- _id: string;
1031
- first_name: string | null;
1032
- last_name: string | null;
1033
- slug: string;
1034
- username: string;
1035
- email: string;
1036
- display_email: string;
1037
- reducted_email: string;
1038
- email_verified: boolean;
1039
- email_verified_at: string | null;
1040
- verified_at: string | null;
1041
- mobile: string | null;
1042
- reducted_mobile: string | null;
1043
- mobile_verified: boolean;
1044
- mobile_verified_at: string | null;
1045
- profile_picture: IMediaObject | null;
1046
- oauth_credentials: sub_account_oauth_credentials[];
1047
- account_locked_at: Date | string | null;
1048
- credentials_expired_at: Date | string | null;
1049
- deactivated_at: Date | string | null;
1050
- last_access_at: Date | string | null;
1051
- flagged_at: Date | string | null;
1052
- created_at: Date | string;
1053
- updated_at: Date | string;
1054
- deleted_at: Date | string | null;
1055
- }
1056
- /**
1057
- * the otp object with its code and content
1058
- */
1059
- export interface Otp {
1060
- /**
1061
- * the ID of the Otp
1062
- */
1063
- _id: string;
1064
- /**
1065
- * the email or mobile number to send the Otp to
1066
- */
1067
- content: string;
1068
- /**
1069
- * the Otp code received in email or sms
1070
- */
1071
- code: string;
1072
- }
1073
- export type OAuthURLProvider = (typeof LevoOAuthProviderList)[number];
1074
- /**
1075
- * The list of URLs for OAuth providers to redirect to
1076
- * This can be used in the OAuth Buttons like "Continue with Google" etc.
1077
- *
1078
- * @example
1079
- * ```javascript
1080
- * {
1081
- * "google": 'https://public-api.levo.so/v1/membership/auth/oauth/google?redirect_uri=https://example.com&workspace=my-workspace',
1082
- * "microsoft": 'https://public-api.levo.so/v1/membership/auth/oauth/microsoft?redirect_uri=https://example.com&workspace=my-workspace',
1083
- * "linkedin": 'https://public-api.levo.so/v1/membership/auth/oauth/linkedin?redirect_uri=https://example.com&workspace=my-workspace'
1084
- * }
1085
- * ```
1086
- */
1087
- export type OAuthURLList = Record<OAuthURLProvider, string | null>;
1088
- export namespace Request {
1089
- /**
1090
- *
1091
- * `content` - the email or mobile number to send the Otp to
1092
- *
1093
- * @example
1094
- * ```json
1095
- * {
1096
- * "content": "example@mailinator.com",
1097
- * "redirect_uri": "https://example.com/protected-page"
1098
- * }
1099
- * ```
1100
- */
1101
- type RequestMagicLink = Pick<Otp, "content"> & {
1102
- redirect_uri?: string;
1103
- };
1104
- /**
1105
- *
1106
- * `content` - the email or mobile number to send the Otp to
1107
- *
1108
- * @example
1109
- * ```json
1110
- * {
1111
- * "content": "example@mailinator.com"
1112
- * }
1113
- * ```
1114
- */
1115
- type RequestOtp = Pick<Otp, "content"> & {
1116
- medium?: "email" | "whatsapp";
1117
- };
1118
- /**
1119
- * `content` - the email or mobile number to send the Otp to
1120
- *
1121
- * `code` - the Otp code received in email or sms
1122
- *
1123
- * @example
1124
- * ```json
1125
- * {
1126
- * "content": "example@mailinator.com",
1127
- * "code": "1234"
1128
- * }
1129
- * ```
1130
- */
1131
- type SignInWithOtp = Pick<Otp, "content" | "code">;
1132
- /**
1133
- * `email` - the email of the account
1134
- *
1135
- * `password` - the password of the account
1136
- *
1137
- * @example
1138
- * ```json
1139
- * {
1140
- * "email": "example@mailinator.com",
1141
- * "password": "strongpasswordhere"
1142
- * }
1143
- * ```
1144
- */
1145
- type SignInWithPassword = {
1146
- email: Account["email"];
1147
- password: string;
1148
- };
1149
- /**
1150
- * @property {string | null} [first_name] - the first name of the account
1151
- * @property {string | null} [last_name] - the last name of the account
1152
- * @property {string} email - the email of the account
1153
- * @property {string} password - the password of the account
1154
- *
1155
- * @example
1156
- * ```json
1157
- * {
1158
- * "email": "example@mailinator.com",
1159
- * "password": "strongpasswordhere"
1160
- * }
1161
- * ```
1162
- * @example
1163
- * ```json
1164
- * {
1165
- * "first_name": "John",
1166
- * "last_name": "Doe",
1167
- * "email": "example@mailinator.com",
1168
- * "password": "strongpasswordhere"
1169
- * }
1170
- * ```
1171
- * @example
1172
- * ```json
1173
- * {
1174
- * "first_name": null,
1175
- * "last_name": null,
1176
- * "email": "example@mailinator.com",
1177
- * "password": "strongpasswordhere"
1178
- * }
1179
- * ```
1180
- */
1181
- type SignUpWithPassword = Partial<Pick<Account, "first_name" | "last_name">> & Pick<Account, "email"> & {
1182
- password: string;
1183
- };
1184
- /**
1185
- * @property {string | null} [first_name] - the first name of the account (optional)
1186
- * @property {string | null} [last_name] - the last name of the account (optional)
1187
- * @property {string} [username] - the username of the account (optional)
1188
- * @property {IMediaObject} [profile_picture] - the profile picture object for the account (optional)
1189
- */
1190
- type UpdateMe = Partial<Pick<Account, "first_name" | "last_name" | "profile_picture" | "username">>;
1191
- /**
1192
- * @property {string} [password] - the first name of the account (optional)
1193
- */
1194
- type CreatePassword = {
1195
- password: string;
1196
- };
1197
- }
1198
- export { };
1199
- }
1200
-
1201
- interface IOrganization {
1202
- _id: string;
1203
- accounts: string[];
1204
- approval_status: string | null;
1205
- approval_updated_at: string | null;
1206
- approval_updated_by: string | null;
1207
- created_at: string | null;
1208
- deleted_at: string | null;
1209
- member_count: number | null;
1210
- name: string;
1211
- owner: string;
1212
- referral_code: string;
1213
- referral_count: number | null;
1214
- size: string;
1215
- updated_at: string | null;
1216
- badge_granted_at: string | null;
1217
- logo: IMediaObject | null;
1218
- icon: IMediaObject | null;
1219
- }
1220
-
1221
- declare const FORUM_POST_KIND: {
1222
- readonly post: "post";
1223
- readonly poll: "poll";
1224
- readonly gallery: "gallery";
1225
- readonly link: "link";
1226
- };
1227
- declare const ForumPostKindExpandedList: Array<keyof typeof FORUM_POST_KIND>;
1228
- type ForumPostKind = (typeof ForumPostKindExpandedList)[number];
1229
- declare const FORUM_POST_STATUS: {
1230
- readonly draft: "draft";
1231
- readonly published: "published";
1232
- readonly unpublished: "unpublished";
1233
- readonly archived: "archived";
1234
- readonly flagged: "flagged";
1235
- readonly pending_moderation: "pending_moderation";
1236
- };
1237
- type ForumPostStatus = (typeof FORUM_POST_STATUS)[keyof typeof FORUM_POST_STATUS];
1238
- interface IForumPostOption {
1239
- _id: string;
1240
- count: number;
1241
- label: string;
1242
- }
1243
- interface IForumPostLinkMetaData {
1244
- meta_title: string;
1245
- meta_description: string;
1246
- og_image: IMediaObject | null;
1247
- }
1248
- interface IForumPost {
1249
- _id: string;
1250
- comments_count: number;
1251
- created_at: string;
1252
- created_by?: ILevoMembership.Account | null;
1253
- expires_at?: string | null;
1254
- kind: ForumPostKind;
1255
- upvote_count: number;
1256
- upvoted_at: string | null;
1257
- downvote_count: number;
1258
- downvoted_at: string | null;
1259
- media: IMediaObject[];
1260
- metadata: Partial<IForumPostLinkMetaData> | null;
1261
- published_at: string | null;
1262
- show_participant_list: boolean;
1263
- show_participant_vote: boolean;
1264
- slug: string;
1265
- url: string;
1266
- title: string;
1267
- content?: string;
1268
- updated_at: string;
1269
- deleted_at: string | null;
1270
- deleted_by: string | null;
1271
- vote_count?: number | null;
1272
- total_votes?: number | null;
1273
- user_voted_option?: string | null;
1274
- options: IForumPostOption[];
1275
- thread: string | null;
1276
- resource_type: string;
1277
- status?: ForumPostStatus;
1278
- organization: IOrganization | null;
1279
- categories: IForumCategory[];
1280
- }
1281
-
1282
- interface IForumCategory {
1283
- posts: IForumPost[];
1284
- _id: string;
1285
- forum: string;
1286
- slug: string;
1287
- name: string;
1288
- description: string;
1289
- og_image?: IMediaObject;
1290
- og_title: string;
1291
- og_description: string;
1292
- meta_title: string;
1293
- meta_description: string;
1294
- created_at: string;
1295
- updated_at: string;
1296
- created_by: string;
1297
- updated_by: string;
1298
- }
1299
-
1300
- declare const COMMENT_STATUS: {
1301
- readonly published: "published";
1302
- readonly unpublished: "unpublished";
1303
- readonly archived: "archived";
1304
- readonly flagged: "flagged";
1305
- readonly pending_moderation: "pending_moderation";
1306
- };
1307
- type CommentStatus = (typeof COMMENT_STATUS)[keyof typeof COMMENT_STATUS];
1308
- /**
1309
- * Comment thread settings
1310
- */
1311
- interface ICommentThreadSettings {
1312
- auto_approve: boolean;
1313
- max_depth: number;
1314
- moderation_enabled: boolean;
1315
- }
1316
- /**
1317
- * Comment thread metadata
1318
- */
1319
- interface IThread {
1320
- _id: string;
1321
- comment_count: number;
1322
- created_at: string;
1323
- last_comment_at: string;
1324
- resource_id: string;
1325
- resource_type: string;
1326
- settings: ICommentThreadSettings;
1327
- status: string;
1328
- updated_at: string;
1329
- }
1330
- interface IComment {
1331
- _id: string;
1332
- author: ILevoMembership.Account | null;
1333
- content: string;
1334
- created_at: string;
1335
- edited_at: string | null;
1336
- flag_count: number;
1337
- parent: IComment | null;
1338
- status: string;
1339
- thread: IThread;
1340
- updated_at: string;
1341
- moderation_reason: string;
1342
- reply_count: number;
1343
- replies: IComment[];
1344
- user_flagged: boolean;
1345
- user_liked: boolean;
1346
- upvote_count: number;
1347
- downvote_count: number;
1348
- organization: IOrganization | null;
1349
- post?: IForumPost;
1350
- }
1351
- interface ICommentsUserEngagement {
1352
- comment_id: string;
1353
- user_flagged: boolean;
1354
- user_liked: boolean;
1355
- upvoted_at: string | null;
1356
- downvoted_at: string | null;
1357
- }
1358
-
1359
- interface IForum {
1360
- _id: string;
1361
- name: string;
1362
- slug: string;
1363
- description: string;
1364
- status: string;
1365
- settings: IForumSettings;
1366
- created_at: string;
1367
- }
1368
- interface IForumSettings {
1369
- enable_ai_moderation_for_comment: boolean;
1370
- enable_auto_approve_for_comment: boolean;
1371
- allow_reporting_for_comment: boolean;
1372
- allow_moderator_to_delete_comment: boolean;
1373
- allow_moderator_to_unpublish_comment: boolean;
1374
- enable_ai_moderation_for_post: boolean;
1375
- enable_auto_approve_for_post: boolean;
1376
- allow_reporting_for_post: boolean;
1377
- allow_moderator_to_delete_post: boolean;
1378
- allow_moderator_to_unpublish_post: boolean;
1379
- allow_users_to_create_post: boolean;
1380
- invite_only: boolean;
1381
- allow_join_requests: boolean;
1382
- allow_public_view_for_post: boolean;
1383
- allow_public_view_for_comment: boolean;
1384
- }
1385
-
1386
- /**
1387
- * Forum Member Object
1388
- *
1389
- * forum: Forum ID
1390
- *
1391
- * account: Membership
1392
- */
1393
- interface IForumMember {
1394
- _id: string;
1395
- forum: string;
1396
- account: ILevoMembership.Account;
1397
- created_by: ILevoMembership.Account;
1398
- created_at: string;
1399
- updated_at: string;
1400
- }
1401
-
1402
- /**
1403
- * Forum Join Request Object
1404
- *
1405
- * Represents a user's request to join an invite-only forum
1406
- */
1407
- interface IForumJoinRequest {
1408
- _id: string;
1409
- forum: string;
1410
- account: ILevoMembership.Account;
1411
- message?: string;
1412
- created_at: string;
1413
- updated_at: string;
1414
- }
1415
- /**
1416
- * Response from GET /v1/community/:forum/member/get-me
1417
- *
1418
- * Contains both member status and pending join request
1419
- */
1420
- interface IForumMembershipStatus {
1421
- member: IForumMember | null;
1422
- join_request: IForumJoinRequest | null;
1423
- }
1424
-
1425
- interface IForumTag {
1426
- posts: IForumPost[];
1427
- _id: string;
1428
- forum: string;
1429
- slug: string;
1430
- name: string;
1431
- description: string;
1432
- og_image?: IMediaObject;
1433
- og_title: string;
1434
- og_description: string;
1435
- meta_title: string;
1436
- meta_description: string;
1437
- created_at: string;
1438
- updated_at: string;
1439
- created_by: string;
1440
- updated_by: string;
1441
- }
1442
-
1443
- interface IMeta {
1444
- total: number;
1445
- pages: number;
1446
- }
1447
- interface IResponseMultiple<T = Record<string, unknown>, U = IMeta> {
1448
- status: boolean;
1449
- content: {
1450
- meta: U;
1451
- data: T[];
1452
- };
1453
- }
1454
- interface IResponseSingle<T = Record<string, unknown>, Meta = any> {
1455
- status: boolean;
1456
- content: {
1457
- data: T;
1458
- meta?: Meta;
1459
- };
1460
- }
1461
- interface IResponseMyCategory<T = Record<string, unknown>> {
1462
- status: boolean;
1463
- content: {
1464
- data: T[];
1465
- };
1466
- }
1467
- interface IFieldError {
1468
- param: string;
1469
- message: string;
1470
- }
1471
- interface IErrorContent {
1472
- status: number;
1473
- code: string;
1474
- title: string;
1475
- description: string;
1476
- type?: string;
1477
- errors?: IFieldError[];
1478
- }
1479
- interface IResponseError {
1480
- status: false;
1481
- content: IErrorContent;
1482
- }
1483
- type IFilter = Record<string, unknown>;
1484
- type IErrorParams = {
1485
- message: string;
1486
- param: string;
1487
- };
1488
-
1489
- interface IPlanPrice {
1490
- id: string;
1491
- plan_id: string;
1492
- period: "month" | "year";
1493
- unit_amount: number;
1494
- currency: string;
1495
- reference_id: string;
1496
- provider: string;
1497
- created_at: string;
1498
- updated_at: string;
1499
- }
1500
- interface IPlanGroup {
1501
- id: string;
1502
- name: string;
1503
- created_at: Date;
1504
- updated_at: Date;
1505
- }
1506
- interface IPlanFeature {
1507
- title: string;
1508
- description: string | null;
1509
- sort_order: number;
1510
- is_active: boolean | null;
1511
- }
1512
- type PlanKind = "addon" | "base";
1513
- interface IPlan {
1514
- name: string;
1515
- id: string;
1516
- created_at: Date;
1517
- updated_at: Date;
1518
- plan_group_id: string;
1519
- description: string;
1520
- kind: PlanKind;
1521
- is_trial: boolean;
1522
- price: IPlanPrice[];
1523
- features: IPlanFeature[];
1524
- recommended: boolean;
1525
- is_enterprise: boolean;
1526
- plan_group: IPlanGroup;
1527
- }
1528
- interface ISubscription {
1529
- object: string;
1530
- id: string;
1531
- customer_details: Record<string, unknown>;
1532
- payment_details: Record<string, unknown>;
1533
- start_date: string;
1534
- end_date: string;
1535
- plan: Partial<Pick<IPlan, "id" | "name" | "is_enterprise">>;
1536
- price: Partial<IPlanPrice>;
1537
- cancelled_at: string | null;
1538
- cancel_at_next_billing_date: boolean;
1539
- status: "active" | "cancelled" | "past_due" | "trialing" | "incomplete" | "trial_expired";
1540
- plan_id?: string;
1541
- price_id?: string;
1542
- }
1543
- interface IDefaultPermissionsObject {
1544
- status?: "enabled" | "disabled" | "hidden";
1545
- create?: boolean;
1546
- modify?: boolean;
1547
- delete?: boolean;
1548
- archive?: boolean;
1549
- duplicate?: boolean;
1550
- export?: boolean;
1551
- upload?: boolean;
1552
- list_actions?: boolean;
1553
- }
1554
- type IModuleAccessControl = {
1555
- dashboard_config: IDefaultPermissionsObject;
1556
- studio_config: IDefaultPermissionsObject & {
1557
- addBlocks: boolean;
1558
- version: string;
1559
- preview_url: string | null;
1560
- modules: {
1561
- my_blocks: IDefaultPermissionsObject;
1562
- };
1563
- };
1564
- collections_config: IDefaultPermissionsObject & {
1565
- modules: {
1566
- records: IDefaultPermissionsObject;
1567
- };
1568
- };
1569
- media_config: IDefaultPermissionsObject;
1570
- events_config: IDefaultPermissionsObject;
1571
- blogs_config: IDefaultPermissionsObject;
1572
- memberships_config: IDefaultPermissionsObject;
1573
- insights_config: IDefaultPermissionsObject;
1574
- settings_config: IDefaultPermissionsObject;
1575
- };
1576
- interface IFeatureFlags extends Partial<IModuleAccessControl> {
1577
- branding?: boolean;
1578
- }
1579
- interface IEmailAddress {
1580
- id: string;
1581
- email: string;
1582
- is_primary: boolean;
1583
- }
1584
- interface IPhoneNumber {
1585
- id: string;
1586
- phone: string;
1587
- is_primary: boolean;
1588
- }
1589
- interface IAddress {
1590
- id: string;
1591
- unit?: string;
1592
- street: string;
1593
- landmark?: string;
1594
- city: string;
1595
- state: string;
1596
- zip: string;
1597
- country: string;
1598
- is_primary: boolean;
1599
- }
1600
- interface IContactInfo {
1601
- emails?: IEmailAddress[];
1602
- phones?: IPhoneNumber[];
1603
- addresses?: IAddress[];
1604
- }
1605
- interface IWorkspace {
1606
- id: string;
1607
- public_id: string;
1608
- name: string;
1609
- slug: string;
1610
- domain: string;
1611
- status: string;
1612
- logo?: IMediaObject | null;
1613
- deployed_at?: null;
1614
- created_at: string;
1615
- updated_at: string;
1616
- deleted_at?: null;
1617
- integrations?: ILevoIntegrationList | ILevoIntegrationInstance[];
1618
- description: any;
1619
- icon: IMediaObject | null;
1620
- workspace_id: string;
1621
- industry: string;
1622
- countries: string[];
1623
- info: {
1624
- locations?: {
1625
- place_name: string;
1626
- }[];
1627
- ai_onboarding?: {
1628
- business_profile: {
1629
- name: string;
1630
- location: string;
1631
- description: string;
1632
- category: string;
1633
- subcategory: string;
1634
- category_confidence: number;
1635
- };
1636
- };
1637
- contact_info?: IContactInfo;
1638
- social_media?: {
1639
- facebook?: string;
1640
- twitter?: string;
1641
- linkedin?: string;
1642
- instagram?: string;
1643
- };
1644
- /** Whether user has an existing website or is creating new */
1645
- website_status?: "existing" | "new";
1646
- };
1647
- settings: {
1648
- head_code?: string;
1649
- [key: string]: any;
1650
- };
1651
- page_count: number;
1652
- domain_count: number;
1653
- feature_flag?: IFeatureFlags;
1654
- onboarded_at?: string | null;
1655
- theme?: any;
1656
- host_domain: string | null;
1657
- proxy_domain: string | null;
1658
- subscription: ISubscription | null;
1659
- }
1660
-
1661
- interface ICoreOptions {
1662
- apiUrl: string;
1663
- workspace: WorkspaceID | null;
1664
- appName?: string;
1665
- NODE_ENV: string;
1666
- APP_MODE: string;
1667
- }
1668
- type WorkspaceID = `W${string}`;
1669
-
1670
- interface IPageContext {
1671
- url: string;
1672
- id?: string;
1673
- referrer?: string;
1674
- title?: string;
1675
- }
1676
-
1677
- interface IBatchOptions {
1678
- logApiUrl?: string;
1679
- }
1680
-
1681
- declare enum LogLevel {
1682
- debug = 0,
1683
- info = 1,
1684
- warn = 2,
1685
- error = 3,
1686
- off = 100
1687
- }
1688
- interface ILoggerOptions extends IBatchOptions {
1689
- level?: LogLevel;
1690
- enableRemote?: boolean;
1691
- context?: Record<string, any>;
1692
- }
1693
-
1694
- interface ILevoClientOptions extends ICoreOptions {
1695
- pageContext?: IPageContext | null;
1696
- loggerOptions?: ILoggerOptions;
1697
- }
1698
- declare const createLevoClient: (options: ILevoClientOptions) => {
1699
- readonly apiUrl: string;
1700
- readonly workspace: `W${string}` | null;
1701
- readonly blog: {
1702
- getAllBlogs: (blog_key: string, data?: LevoQuery.FindQuery, options?: BlogClient.OptionParams) => Promise<IResponseMultiple<BlogClient.BlogData>>;
1703
- getSingleBlog: (blog_key: string, slug: string, options?: BlogClient.OptionParams) => Promise<IResponseSingle<BlogClient.BlogData>>;
1704
- };
1705
- readonly membership: {
1706
- getOAuthURL: (options?: wretch.WretchOptions) => Promise<ILevoMembership.OAuthURLList>;
1707
- signOut: <T = {
1708
- status: boolean;
1709
- }>(options?: wretch.WretchOptions) => Promise<T>;
1710
- getMe: <T = ILevoMembership.Account>(options?: wretch.WretchOptions) => Promise<T>;
1711
- updateMe: <T = ILevoMembership.Account>(data: ILevoMembership.Request.UpdateMe, options?: wretch.WretchOptions) => Promise<T>;
1712
- createPassword: <T = ILevoMembership.Account>(data: ILevoMembership.Request.CreatePassword, options?: wretch.WretchOptions) => Promise<T>;
1713
- isLoggedIn: <T = ILevoMembership.Account>(options?: wretch.WretchOptions) => Promise<T | null>;
1714
- requestMagicLink: (data: ILevoMembership.Request.RequestMagicLink, options?: wretch.WretchOptions) => Promise<Pick<ILevoMembership.Otp, "_id" | "content">>;
1715
- requestOtp: (data: ILevoMembership.Request.RequestOtp, options?: wretch.WretchOptions) => Promise<Pick<ILevoMembership.Otp, "_id" | "content">>;
1716
- signInWithOtp: <T = ILevoMembership.Account>(data: ILevoMembership.Request.SignInWithOtp, options?: wretch.WretchOptions) => Promise<T>;
1717
- signInWithPassword: <T = ILevoMembership.Account>(data: ILevoMembership.Request.SignInWithPassword, options?: wretch.WretchOptions) => Promise<T>;
1718
- signUpWithPassword: <T = ILevoMembership.Account>(data: ILevoMembership.Request.SignUpWithPassword, options?: wretch.WretchOptions) => Promise<T>;
1719
- };
1720
- readonly collection: {
1721
- getAllCollections: (data?: LevoQuery.FindQuery<"name" | "id" | "workspace_id" | "description" | "created_at" | "updated_at" | "key" | "readonly" | "hidden" | "icon" | "on_submit" | "on_update" | "sections" | "views" | "title_field" | "email_field" | "mobile_field" | "settings" | "module_name" | "allow_draft">, options?: wretch.WretchOptions) => Promise<IResponseMultiple<ILemaCollection>>;
1722
- getCollectionByIDExpanded: <T = ILemaCollection>(id: string, options?: wretch.WretchOptions) => Promise<IResponseSingle<T>>;
1723
- createCollection: (data: ILemaCollection) => Promise<IResponseSingle<ILemaCollection>>;
1724
- saveCollectionData: ({ collection_id, data, options, }: {
1725
- collection_id: string;
1726
- data: any;
1727
- options?: wretch.WretchOptions;
1728
- }) => Promise<IResponseSingle<any>>;
1729
- getCollectionContentList: ({ collection_key, page, search, limit, where, }: {
1730
- collection_key: string;
1731
- } & LevoQuery.FindQuery) => Promise<IResponseMultiple<Record<string, unknown>>>;
1732
- saveDraftEntry: (collection_key: string, data: any) => Promise<IResponseSingle<IDraftEntry>>;
1733
- editDraftEntry: (collection_key: string, id: string, data: any) => Promise<IResponseSingle<IDraftEntry>>;
1734
- getDraftEntry: (collection_key: string) => Promise<IResponseMultiple<IDraftEntry>>;
1735
- submitDraftEntry: (collection_key: string, data: any) => Promise<IResponseSingle<IDraftEntry>>;
1736
- getFilters: (collectionId: string, options?: wretch.WretchOptions) => Promise<IResponseMultiple<ILemaCollection["sections"][number]["fields"][number]>>;
1737
- };
1738
- readonly media: {
1739
- mediaBulkUpload: (formData: FormData, options?: wretch.WretchOptions) => Promise<IResponseMultiple<IMedia>>;
1740
- getAllMedia: (data?: LevoQuery.FindQuery) => Promise<IResponseMultiple<IMedia>>;
1741
- };
1742
- readonly logger: {
1743
- debug: (...args: any[]) => void;
1744
- info: (...args: any[]) => void;
1745
- warn: (...args: any[]) => void;
1746
- error: (...args: any[]) => void;
1747
- };
1748
- readonly levoFetch: wretch_addons_queryString.QueryStringAddon & wretch.Wretch<wretch_addons_queryString.QueryStringAddon, unknown, undefined>;
1749
- readonly APP_MODE: string;
1750
- readonly NODE_ENV: string;
1751
- readonly pageContext: IPageContext | null;
1752
- updatePageContext: (newContext: IPageContext | null) => void;
1753
- updateWorkspace: (workspace: string | null) => void;
1754
- };
1755
- type ILevoClient = ReturnType<typeof createLevoClient>;
1756
-
1757
- declare const formatImagePath: (string: string) => string;
1758
-
1759
- /**
1760
- * Enhanced error class that matches backend response structure
1761
- */
1762
- declare class LevoError extends Error {
1763
- code: string;
1764
- title: string;
1765
- status: number;
1766
- type?: string;
1767
- errors?: IFieldError[];
1768
- constructor(data: IErrorContent);
1769
- /**
1770
- * Get validation errors for form fields
1771
- */
1772
- get fieldErrors(): IFieldError[];
1773
- /**
1774
- * Check if this is a validation error with field-specific errors
1775
- */
1776
- get hasFieldErrors(): boolean;
1777
- }
1778
-
1779
- declare const getLevoError: (error: any) => LevoError;
1780
-
1781
- declare const listToColumn: <T extends string>(columns: readonly string[]) => Record<T, string>;
1782
- declare const listToRecord: <T extends string>(columns: readonly string[]) => { [K in T]: K; };
1783
-
1784
- export { BlogClient, COMMENT_STATUS, type CommentStatus, CommonFieldIntefaces, CommonFieldInterfacesList, type ComparableFilter, ComparableOperators, ComplexFieldInterfacesList, type DeepPartial, FORUM_POST_KIND, FORUM_POST_STATUS, type FieldFilter, FieldInterfaces, FieldInterfacesList, FieldKind, FieldKindList, type FieldType, type Filter, type ForumPostKind, ForumPostKindExpandedList, type ForumPostStatus, type IAddress, type IAttendee, type IAuthor, type IBlog, type IBlogCategory, type IBlogTag, type IBooking, type ICollectionLayout, type ICollectionLayoutOptions, type ICollectionQuery, type ICollectionValue, type ICollectionView, type ICollectionViews, type ICollectionsView, type IComment, type ICommentThreadSettings, type ICommentsUserEngagement, type IContactInfo, type IContent, type IDefaultPermissionsObject, type IDraftEntry, type IEmailAddress, type IEmojiData, type IErrorContent, type IErrorParams, type IFaviconMedia, type IFaviconMediaObject, type IFeatureFlags, type IField, type IFieldError, type IFieldUpdate, type IFilter, type IForum, type IForumCategory, type IForumJoinRequest, type IForumMember, type IForumMembershipStatus, type IForumPost, type IForumPostOption, type IForumSettings, type IForumTag, type IGeocoderLocation, type IGroupBy, type IIcon, type IIconCat, type IIconData, type ILemaCollection, type ILemaCollectionRelationship, type ILemaField, type ILemaFieldOptions, type ILemaRelation, type ILemaRelationOnDelete, type ILemaSection, type ILevoClient, type ILevoClientOptions, type ILevoIntegrationInstance, type ILevoIntegrationList, ILevoMembership, type ILevoOAuthProvider, type IMe, type IMedia, type IMediaObject, type IMeta, type IModuleAccessControl, type INotificationData, type INotificationWithTrigger, type IOrganization, type IPhoneNumber, type IPlan, type IPlanFeature, type IPlanGroup, type IPlanPrice, type IPost, type IResponseError, type IResponseMultiple, type IResponseMyCategory, type IResponseSingle, type ISchema, type ISection, type ISubscription, type IThread, type IWorkspace, LEVO_INTEGRATIONS, LEVO_INTEGRATIONS_LIST, LevoError, LevoEvent, LevoOAuthProviderList, LevoQuery, type LogicalFilter, LogicalOperators, type Mandatory, MediaKind, MediaKindList, type PlanKind, type Prettify, type WithinFilterType, type WorkspaceID, createLevoClient, defaultByKinds, formatImagePath, formatsByInterface, getLevoError, interfaceKinds, listToColumn, listToRecord };
1
+ import { QueryStringAddon } from 'wretch/addons/queryString';
2
+ import { Wretch } from 'wretch';
3
+ import { WretchOptions } from 'wretch';
4
+
5
+ export declare const AnalyticsEvents: {
6
+ "bevy.collection.filled": "bevy.collection.filled";
7
+ "bevy.collection.submitted": "bevy.collection.submitted";
8
+ "bevy.collection.view": "bevy.collection.view";
9
+ "block.view": "block.view";
10
+ "blog.post.view": "blog.post.view";
11
+ "event.booking.confirmed": "event.booking.confirmed";
12
+ "event.booking.initiated": "event.booking.initiated";
13
+ "event.booking.pending": "event.booking.pending";
14
+ "event.coupon.applied": "event.coupon.applied";
15
+ "event.event.view": "event.event.view";
16
+ "form.change": "form.change";
17
+ "form.submit": "form.submit";
18
+ "membership.account.signin": "membership.account.signin";
19
+ "membership.account.signout": "membership.account.signout";
20
+ "membership.account.signup": "membership.account.signup";
21
+ "button.click": "button.click";
22
+ "page.bounce": "page.bounce";
23
+ "page.click": "page.click";
24
+ "page.copy": "page.copy";
25
+ "page.impression": "page.impression";
26
+ "page.scroll": "page.scroll";
27
+ "page.view": "page.view";
28
+ "page.selection": "page.selection";
29
+ "user.active": "user.active";
30
+ "user.idle": "user.idle";
31
+ };
32
+
33
+ export declare const AnalyticsEventsList: readonly ["bevy.collection.filled", "bevy.collection.submitted", "bevy.collection.view", "block.view", "blog.post.view", "event.booking.confirmed", "event.booking.initiated", "event.booking.pending", "event.coupon.applied", "event.event.view", "form.change", "form.submit", "membership.account.signin", "membership.account.signout", "membership.account.signup", "button.click", "page.bounce", "page.click", "page.copy", "page.impression", "page.scroll", "page.view", "page.selection", "user.active", "user.idle"];
34
+
35
+ export declare type AnalyticsEventType = (typeof AnalyticsEventsList)[number];
36
+
37
+ export declare namespace BlogClient {
38
+ export interface CoverImage {
39
+ _id: string;
40
+ location: string;
41
+ mimetype: string;
42
+ kind: string;
43
+ external: boolean;
44
+ }
45
+ export interface CategoriesEntity {
46
+ _id: string;
47
+ slug: string;
48
+ name: string;
49
+ }
50
+ export interface AuthorsEntity {
51
+ posts?: string[] | null;
52
+ _id: string;
53
+ public_id: string;
54
+ slug: string;
55
+ first_name: string;
56
+ last_name: string;
57
+ email: string;
58
+ bio: string;
59
+ website: string;
60
+ profile_picture?: null | {
61
+ location: string;
62
+ };
63
+ og_image: string;
64
+ og_title: string;
65
+ og_description: string;
66
+ meta_title: string;
67
+ meta_description: string;
68
+ last_access_at: string;
69
+ active_at: string;
70
+ created_at: string;
71
+ updated_at: string;
72
+ }
73
+ export type BlogData = IPost;
74
+ export interface OptionParams {
75
+ workspace_id: string;
76
+ params?: Record<string, string>;
77
+ }
78
+ }
79
+
80
+ export declare const COMMENT_STATUS: {
81
+ readonly published: "published";
82
+ readonly unpublished: "unpublished";
83
+ readonly archived: "archived";
84
+ readonly flagged: "flagged";
85
+ readonly pending_moderation: "pending_moderation";
86
+ };
87
+
88
+ export declare type CommentStatus = (typeof COMMENT_STATUS)[keyof typeof COMMENT_STATUS];
89
+
90
+ export declare const CommonFieldIntefaces: Record<"TextWidget" | "CurrencyWidget" | "TextareaWidget" | "GeocoderWidget" | "MultiGeocoderWidget" | "DropdownWidget" | "ToggleCheckboxWidget" | "RadioWidget" | "NumberWidget" | "EmailWidget" | "PhoneWidget" | "URLWidget" | "DateWidget" | "TimeWidget" | "SwitchWidget" | "RichTextWidget" | "DateTimeWidget" | "CheckboxWidget" | "ImageUploadWidget" | "MultiImageUploadWidget" | "FileUploadWidget" | "MultiFileUploadWidget" | "MultiDropdownWidget" | "MultiTextWidget", "TextWidget" | "CurrencyWidget" | "TextareaWidget" | "GeocoderWidget" | "MultiGeocoderWidget" | "DropdownWidget" | "ToggleCheckboxWidget" | "RadioWidget" | "NumberWidget" | "EmailWidget" | "PhoneWidget" | "URLWidget" | "DateWidget" | "TimeWidget" | "SwitchWidget" | "RichTextWidget" | "DateTimeWidget" | "CheckboxWidget" | "ImageUploadWidget" | "MultiImageUploadWidget" | "FileUploadWidget" | "MultiFileUploadWidget" | "MultiDropdownWidget" | "MultiTextWidget">;
91
+
92
+ export declare const CommonFieldInterfacesList: readonly ["TextWidget", "CurrencyWidget", "TextareaWidget", "GeocoderWidget", "MultiGeocoderWidget", "DropdownWidget", "ToggleCheckboxWidget", "RadioWidget", "NumberWidget", "EmailWidget", "PhoneWidget", "URLWidget", "DateWidget", "TimeWidget", "SwitchWidget", "RichTextWidget", "DateTimeWidget", "CheckboxWidget", "ImageUploadWidget", "MultiImageUploadWidget", "FileUploadWidget", "MultiFileUploadWidget", "MultiDropdownWidget", "MultiTextWidget"];
93
+
94
+ declare type ComparableFieldType = number | Date;
95
+
96
+ export declare type ComparableFilter<T extends string = string> = {
97
+ [ComparableOperators.equals]?: FieldType;
98
+ } | {
99
+ [ComparableOperators.not]?: FieldType;
100
+ } | {
101
+ [ComparableOperators.in]?: FieldType[];
102
+ } | {
103
+ [ComparableOperators.not_in]?: FieldType[];
104
+ } | {
105
+ [ComparableOperators.gt]?: ComparableFieldType;
106
+ } | {
107
+ [ComparableOperators.gte]?: ComparableFieldType;
108
+ } | {
109
+ [ComparableOperators.lt]?: ComparableFieldType;
110
+ } | {
111
+ [ComparableOperators.lte]?: ComparableFieldType;
112
+ } | {
113
+ [ComparableOperators.contains]?: string;
114
+ } | {
115
+ [ComparableOperators.not_contains]?: string;
116
+ } | {
117
+ [ComparableOperators.starts_with]?: string;
118
+ } | {
119
+ [ComparableOperators.not_starts_with]?: string;
120
+ } | {
121
+ [ComparableOperators.ends_with]?: string;
122
+ } | {
123
+ [ComparableOperators.not_ends_with]?: string;
124
+ } | {
125
+ [ComparableOperators.between]?: ComparableFieldType[];
126
+ } | {
127
+ [ComparableOperators.is_empty]?: boolean;
128
+ } | {
129
+ [ComparableOperators.is_not_empty]?: boolean;
130
+ } | {
131
+ [ComparableOperators.empty]?: boolean;
132
+ } | {
133
+ [ComparableOperators.has]?: Record<string, FieldType>;
134
+ } | {
135
+ [ComparableOperators.within]?: WithinFilterType;
136
+ };
137
+
138
+ export declare const ComparableOperators: {
139
+ equals: "equals";
140
+ not: "not";
141
+ in: "in";
142
+ not_in: "not_in";
143
+ gt: "gt";
144
+ gte: "gte";
145
+ lt: "lt";
146
+ lte: "lte";
147
+ contains: "contains";
148
+ not_contains: "not_contains";
149
+ starts_with: "starts_with";
150
+ not_starts_with: "not_starts_with";
151
+ ends_with: "ends_with";
152
+ not_ends_with: "not_ends_with";
153
+ empty: "empty";
154
+ has: "has";
155
+ between: "between";
156
+ within: "within";
157
+ is_empty: "is_empty";
158
+ is_not_empty: "is_not_empty";
159
+ };
160
+
161
+ export declare const ComplexFieldInterfacesList: readonly ["CollectionWidget", "ArrayWidget", "RecordWidget", "JSONWidget", "SlugWidget"];
162
+
163
+ export declare const createLevoClient: (options: ILevoClientOptions) => {
164
+ readonly apiUrl: string;
165
+ readonly workspace: `W${string}` | null;
166
+ readonly blog: {
167
+ getAllBlogs: (blog_key: string, data?: import("./types").LevoQuery.FindQuery, options?: import("./types").BlogClient.OptionParams) => Promise<IResponseMultiple<import("./types").BlogClient.BlogData>>;
168
+ getSingleBlog: (blog_key: string, slug: string, options?: import("./types").BlogClient.OptionParams) => Promise<IResponseSingle<import("./types").BlogClient.BlogData>>;
169
+ };
170
+ readonly membership: {
171
+ getOAuthURL: (options?: WretchOptions) => Promise<import("./types").ILevoMembership.OAuthURLList>;
172
+ signOut: <T = {
173
+ status: boolean;
174
+ }>(options?: WretchOptions) => Promise<T>;
175
+ getMe: <T = import("./types").ILevoMembership.Account>(options?: WretchOptions) => Promise<T>;
176
+ updateMe: <T = import("./types").ILevoMembership.Account>(data: import("./types").ILevoMembership.Request.UpdateMe, options?: WretchOptions) => Promise<T>;
177
+ createPassword: <T = import("./types").ILevoMembership.Account>(data: import("./types").ILevoMembership.Request.CreatePassword, options?: WretchOptions) => Promise<T>;
178
+ isLoggedIn: <T = import("./types").ILevoMembership.Account>(options?: WretchOptions) => Promise<T | null>;
179
+ requestMagicLink: (data: import("./types").ILevoMembership.Request.RequestMagicLink, options?: WretchOptions) => Promise<Pick<import("./types").ILevoMembership.Otp, "_id" | "content">>;
180
+ requestOtp: (data: import("./types").ILevoMembership.Request.RequestOtp, options?: WretchOptions) => Promise<Pick<import("./types").ILevoMembership.Otp, "_id" | "content">>;
181
+ signInWithOtp: <T = import("./types").ILevoMembership.Account>(data: import("./types").ILevoMembership.Request.SignInWithOtp, options?: WretchOptions) => Promise<T>;
182
+ signInWithPassword: <T = import("./types").ILevoMembership.Account>(data: import("./types").ILevoMembership.Request.SignInWithPassword, options?: WretchOptions) => Promise<T>;
183
+ signUpWithPassword: <T = import("./types").ILevoMembership.Account>(data: import("./types").ILevoMembership.Request.SignUpWithPassword, options?: WretchOptions) => Promise<T>;
184
+ };
185
+ readonly collection: {
186
+ getAllCollections: (data?: import("./types").LevoQuery.FindQuery<"name" | "workspace_id" | "created_at" | "id" | "description" | "updated_at" | "key" | "readonly" | "hidden" | "icon" | "on_submit" | "on_update" | "sections" | "views" | "title_field" | "email_field" | "mobile_field" | "settings" | "module_name" | "allow_draft">, options?: WretchOptions) => Promise<IResponseMultiple<ILemaCollection>>;
187
+ getCollectionByIDExpanded: <T = ILemaCollection>(id: string, options?: WretchOptions) => Promise<IResponseSingle<T>>;
188
+ createCollection: (data: ILemaCollection) => Promise<IResponseSingle<ILemaCollection>>;
189
+ saveCollectionData: ({ collection_id, data, options, }: {
190
+ collection_id: string;
191
+ data: any;
192
+ options?: WretchOptions;
193
+ }) => Promise<IResponseSingle<any>>;
194
+ getCollectionContentList: ({ collection_key, page, search, limit, where, }: {
195
+ collection_key: string;
196
+ } & import("./types").LevoQuery.FindQuery) => Promise<IResponseMultiple<Record<string, unknown>>>;
197
+ saveDraftEntry: (collection_key: string, data: any) => Promise<IResponseSingle<IDraftEntry>>;
198
+ editDraftEntry: (collection_key: string, id: string, data: any) => Promise<IResponseSingle<IDraftEntry>>;
199
+ getDraftEntry: (collection_key: string) => Promise<IResponseMultiple<IDraftEntry>>;
200
+ submitDraftEntry: (collection_key: string, data: any) => Promise<IResponseSingle<IDraftEntry>>;
201
+ getFilters: (collectionId: string, options?: WretchOptions) => Promise<IResponseMultiple<ILemaCollection["sections"][number]["fields"][number]>>;
202
+ };
203
+ readonly media: {
204
+ mediaBulkUpload: (formData: FormData, options?: WretchOptions) => Promise<IResponseMultiple<IMedia>>;
205
+ getAllMedia: (data?: import("./types").LevoQuery.FindQuery) => Promise<IResponseMultiple<IMedia>>;
206
+ };
207
+ readonly logger: {
208
+ debug: (...args: any[]) => void;
209
+ info: (...args: any[]) => void;
210
+ warn: (...args: any[]) => void;
211
+ error: (...args: any[]) => void;
212
+ };
213
+ readonly fetch: QueryStringAddon & Wretch<QueryStringAddon, unknown, undefined>;
214
+ readonly APP_MODE: string;
215
+ readonly NODE_ENV: string;
216
+ readonly pageContext: IPageContext | null;
217
+ updatePageContext: (newContext: IPageContext | null) => void;
218
+ updateWorkspace: (workspace: string | null) => void;
219
+ };
220
+
221
+ export declare type DeepPartial<T> = {
222
+ [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
223
+ };
224
+
225
+ export declare const defaultByKinds: Record<(typeof FieldKindList)[number], any>;
226
+
227
+ export declare type FieldFilter<T extends string = string> = Partial<Record<T, ComparableFilter<T> | FieldType>>;
228
+
229
+ export declare const FieldInterfaces: Record<"TextWidget" | "CurrencyWidget" | "TextareaWidget" | "GeocoderWidget" | "MultiGeocoderWidget" | "DropdownWidget" | "ToggleCheckboxWidget" | "RadioWidget" | "NumberWidget" | "EmailWidget" | "PhoneWidget" | "URLWidget" | "DateWidget" | "TimeWidget" | "SwitchWidget" | "RichTextWidget" | "DateTimeWidget" | "CheckboxWidget" | "ImageUploadWidget" | "MultiImageUploadWidget" | "FileUploadWidget" | "MultiFileUploadWidget" | "MultiDropdownWidget" | "MultiTextWidget" | "CollectionWidget" | "ArrayWidget" | "RecordWidget" | "JSONWidget" | "SlugWidget", "TextWidget" | "CurrencyWidget" | "TextareaWidget" | "GeocoderWidget" | "MultiGeocoderWidget" | "DropdownWidget" | "ToggleCheckboxWidget" | "RadioWidget" | "NumberWidget" | "EmailWidget" | "PhoneWidget" | "URLWidget" | "DateWidget" | "TimeWidget" | "SwitchWidget" | "RichTextWidget" | "DateTimeWidget" | "CheckboxWidget" | "ImageUploadWidget" | "MultiImageUploadWidget" | "FileUploadWidget" | "MultiFileUploadWidget" | "MultiDropdownWidget" | "MultiTextWidget" | "CollectionWidget" | "ArrayWidget" | "RecordWidget" | "JSONWidget" | "SlugWidget">;
230
+
231
+ export declare const FieldInterfacesList: readonly ["TextWidget", "CurrencyWidget", "TextareaWidget", "GeocoderWidget", "MultiGeocoderWidget", "DropdownWidget", "ToggleCheckboxWidget", "RadioWidget", "NumberWidget", "EmailWidget", "PhoneWidget", "URLWidget", "DateWidget", "TimeWidget", "SwitchWidget", "RichTextWidget", "DateTimeWidget", "CheckboxWidget", "ImageUploadWidget", "MultiImageUploadWidget", "FileUploadWidget", "MultiFileUploadWidget", "MultiDropdownWidget", "MultiTextWidget", "CollectionWidget", "ArrayWidget", "RecordWidget", "JSONWidget", "SlugWidget"];
232
+
233
+ export declare const FieldKind: {
234
+ identifier: "identifier";
235
+ collection: "collection";
236
+ "public-id": "public-id";
237
+ string: "string";
238
+ number: "number";
239
+ boolean: "boolean";
240
+ date: "date";
241
+ json: "json";
242
+ "array-string": "array-string";
243
+ "array-number": "array-number";
244
+ "array-date": "array-date";
245
+ "array-boolean": "array-boolean";
246
+ file: "file";
247
+ "array-file": "array-file";
248
+ record: "record";
249
+ group: "group";
250
+ location: "location";
251
+ "array-location": "array-location";
252
+ richtext: "richtext";
253
+ "array-json": "array-json";
254
+ };
255
+
256
+ export declare const FieldKindList: readonly ["collection", "record", "group", "public-id", "string", "array-string", "number", "array-number", "date", "array-date", "boolean", "array-boolean", "json", "array-json", "file", "array-file", "location", "array-location", "richtext", "identifier"];
257
+
258
+ export declare type FieldType = string | number | Date | boolean | null;
259
+
260
+ export declare type Filter<T extends string = string> = LogicalFilter<T> | FieldFilter<T>;
261
+
262
+ export declare const formatImagePath: (string: string) => string;
263
+
264
+ export declare const formatsByInterface: Record<(typeof FieldInterfacesList)[number], string[]>;
265
+
266
+ export declare const FORUM_POST_KIND: {
267
+ readonly post: "post";
268
+ readonly poll: "poll";
269
+ readonly gallery: "gallery";
270
+ readonly link: "link";
271
+ };
272
+
273
+ export declare const FORUM_POST_STATUS: {
274
+ readonly draft: "draft";
275
+ readonly published: "published";
276
+ readonly unpublished: "unpublished";
277
+ readonly archived: "archived";
278
+ readonly flagged: "flagged";
279
+ readonly pending_moderation: "pending_moderation";
280
+ };
281
+
282
+ export declare type ForumPostKind = (typeof ForumPostKindExpandedList)[number];
283
+
284
+ export declare const ForumPostKindExpandedList: Array<keyof typeof FORUM_POST_KIND>;
285
+
286
+ export declare type ForumPostStatus = (typeof FORUM_POST_STATUS)[keyof typeof FORUM_POST_STATUS];
287
+
288
+ export declare const getLevoError: (error: any) => LevoError;
289
+
290
+ export declare interface IAddress {
291
+ id: string;
292
+ unit?: string;
293
+ street: string;
294
+ landmark?: string;
295
+ city: string;
296
+ state: string;
297
+ zip: string;
298
+ country: string;
299
+ is_primary: boolean;
300
+ }
301
+
302
+ /**
303
+ * Main Object
304
+ */
305
+ export declare interface IAttendee {
306
+ checkin_at?: Date | null;
307
+ _id: string;
308
+ public_id: string;
309
+ name: string;
310
+ email: string;
311
+ mobile: string | null;
312
+ event: string;
313
+ booking: string;
314
+ ticket: Record<string, string>;
315
+ price: string;
316
+ account?: any;
317
+ status: string;
318
+ created_at: string;
319
+ updated_at: string;
320
+ }
321
+
322
+ export declare interface IAuthor {
323
+ _id: string;
324
+ public_id: string;
325
+ slug: string;
326
+ first_name: string;
327
+ last_name: string;
328
+ profile_picture: any;
329
+ active_at: Date;
330
+ }
331
+
332
+ declare interface IBatchOptions {
333
+ logApiUrl?: string;
334
+ }
335
+
336
+ export declare interface IBlog {
337
+ _id: string;
338
+ slug: string;
339
+ name: string;
340
+ status: string;
341
+ description: string;
342
+ og_image?: string;
343
+ og_title?: string;
344
+ og_description?: string;
345
+ meta_title?: string;
346
+ meta_description?: string;
347
+ created_at: string;
348
+ updated_at: string;
349
+ created_by: string;
350
+ updated_by: string;
351
+ }
352
+
353
+ export declare interface IBlogCategory {
354
+ posts: IPost[];
355
+ _id: string;
356
+ blog: string;
357
+ slug: string;
358
+ name: string;
359
+ description: string;
360
+ og_image?: IMediaObject;
361
+ og_title: string;
362
+ og_description: string;
363
+ meta_title: string;
364
+ meta_description: string;
365
+ created_at: Date;
366
+ updated_at: Date;
367
+ created_by: Date;
368
+ updated_by: Date;
369
+ }
370
+
371
+ export declare interface IBlogTag {
372
+ posts: IPost[];
373
+ _id: string;
374
+ blog: string;
375
+ slug: string;
376
+ name: string;
377
+ description: string;
378
+ og_image?: any;
379
+ og_title: string;
380
+ og_description: string;
381
+ meta_title: string;
382
+ meta_description: string;
383
+ created_at: Date;
384
+ updated_at: Date;
385
+ created_by: Date;
386
+ updated_by: Date;
387
+ }
388
+
389
+ export declare interface IBooking {
390
+ _id: string;
391
+ public_id: string;
392
+ quantity: number;
393
+ unit_amount: number;
394
+ total_amount?: number;
395
+ event: string;
396
+ currency: string;
397
+ account: string;
398
+ coupon?: null;
399
+ status: string;
400
+ paid: boolean;
401
+ discount: number;
402
+ taxes?: Array<{
403
+ id: string;
404
+ label: string;
405
+ percentage: number;
406
+ amount: number;
407
+ }>;
408
+ created_at: string;
409
+ updated_at: string;
410
+ attendees?: IAttendee[];
411
+ }
412
+
413
+ export declare interface ICollectionLayout {
414
+ kind: ICollectionsView;
415
+ options: ICollectionLayoutOptions;
416
+ }
417
+
418
+ export declare interface ICollectionLayoutOptions {
419
+ groupBy?: IGroupBy | null;
420
+ title?: string;
421
+ description?: string;
422
+ columnsOrder?: string[];
423
+ selectedColumns?: string[];
424
+ selectedFields?: string[];
425
+ /** Field key for cover image (kanban) */
426
+ coverImage?: string;
427
+ /** Field key for card header (kanban) - defaults to created_at if not set */
428
+ headerField?: string;
429
+ /** Array of field keys to display as info points below description (kanban) */
430
+ infoFields?: string[];
431
+ }
432
+
433
+ export declare interface ICollectionQuery {
434
+ where: Record<string, any>;
435
+ sort?: Record<string, any>;
436
+ }
437
+
438
+ export declare type ICollectionsView = "table" | "kanban" | "calendar" | "cards";
439
+
440
+ /**
441
+ * Represents a value within a collection, with a unique ID and arbitrary properties.
442
+ */
443
+ export declare interface ICollectionValue {
444
+ /** Unique identifier for the value. */
445
+ id: string;
446
+ /** Additional arbitrary properties for the value. */
447
+ [x: string]: unknown;
448
+ }
449
+
450
+ export declare interface ICollectionView {
451
+ id: string;
452
+ workspace_id: string;
453
+ slug: string;
454
+ collection_id: string;
455
+ title: string;
456
+ description: string;
457
+ layout: ICollectionLayout;
458
+ query: ICollectionQuery;
459
+ options: Record<string, any>;
460
+ created_at: string;
461
+ updated_at: string;
462
+ }
463
+
464
+ /**
465
+ * Defines the structure for a view configuration in a collection schema. Levo Collection uses its own types built on top of this, so this type is not used directly in most Levo Collection code.
466
+ */
467
+ export declare interface ICollectionViews {
468
+ /** Unique identifier for the view. */
469
+ id: string;
470
+ /** Slug for the view, used in URLs. */
471
+ slug: string;
472
+ /** Title of the view. */
473
+ title: string;
474
+ }
475
+
476
+ export declare interface IComment {
477
+ _id: string;
478
+ author: ILevoMembership.Account | null;
479
+ content: string;
480
+ created_at: string;
481
+ edited_at: string | null;
482
+ flag_count: number;
483
+ parent: IComment | null;
484
+ status: string;
485
+ thread: IThread;
486
+ updated_at: string;
487
+ moderation_reason: string;
488
+ reply_count: number;
489
+ replies: IComment[];
490
+ user_flagged: boolean;
491
+ user_liked: boolean;
492
+ upvote_count: number;
493
+ downvote_count: number;
494
+ organization: IOrganization | null;
495
+ post?: IForumPost;
496
+ }
497
+
498
+ export declare interface ICommentsUserEngagement {
499
+ comment_id: string;
500
+ user_flagged: boolean;
501
+ user_liked: boolean;
502
+ upvoted_at: string | null;
503
+ downvoted_at: string | null;
504
+ }
505
+
506
+ /**
507
+ * Comment thread settings
508
+ */
509
+ export declare interface ICommentThreadSettings {
510
+ auto_approve: boolean;
511
+ max_depth: number;
512
+ moderation_enabled: boolean;
513
+ }
514
+
515
+ export declare interface IContactInfo {
516
+ emails?: IEmailAddress[];
517
+ phones?: IPhoneNumber[];
518
+ addresses?: IAddress[];
519
+ }
520
+
521
+ export declare interface IContent {
522
+ json: JSONContent;
523
+ html: string;
524
+ nodes?: any[];
525
+ }
526
+
527
+ declare interface ICoreOptions {
528
+ apiUrl: string;
529
+ workspace: WorkspaceID | null;
530
+ appName?: string;
531
+ NODE_ENV: string;
532
+ APP_MODE: string;
533
+ }
534
+
535
+ export declare interface IDefaultPermissionsObject {
536
+ status?: "enabled" | "disabled" | "hidden";
537
+ create?: boolean;
538
+ modify?: boolean;
539
+ delete?: boolean;
540
+ archive?: boolean;
541
+ duplicate?: boolean;
542
+ export?: boolean;
543
+ upload?: boolean;
544
+ list_actions?: boolean;
545
+ }
546
+
547
+ export declare interface IDraftEntry {
548
+ _id: string;
549
+ _account: string;
550
+ _status: "draft" | "submitted";
551
+ [x: string]: any;
552
+ created_at: string;
553
+ updated_at: string;
554
+ }
555
+
556
+ export declare interface IEmailAddress {
557
+ id: string;
558
+ email: string;
559
+ is_primary: boolean;
560
+ }
561
+
562
+ export declare interface IEmojiData {
563
+ label: string;
564
+ tags?: string[];
565
+ unicode: string;
566
+ }
567
+
568
+ export declare interface IErrorContent {
569
+ status: number;
570
+ code: string;
571
+ title: string;
572
+ description: string;
573
+ type?: string;
574
+ errors?: IFieldError[];
575
+ }
576
+
577
+ export declare type IErrorParams = {
578
+ message: string;
579
+ param: string;
580
+ };
581
+
582
+ export declare type IFaviconMedia = Omit<IMedia, "srcset"> & {
583
+ srcset: IFaviconSrcset;
584
+ };
585
+
586
+ export declare type IFaviconMediaObject = Omit<IMediaObject, "srcset"> & {
587
+ srcset: IFaviconSrcset;
588
+ };
589
+
590
+ declare interface IFaviconSrcset {
591
+ "16": string;
592
+ "32": string;
593
+ "57": string;
594
+ "60": string;
595
+ "72": string;
596
+ "76": string;
597
+ "96": string;
598
+ "114": string;
599
+ "120": string;
600
+ "144": string;
601
+ "152": string;
602
+ "180": string;
603
+ "192": string;
604
+ }
605
+
606
+ export declare interface IFeatureFlags extends Partial<IModuleAccessControl> {
607
+ branding?: boolean;
608
+ }
609
+
610
+ /**
611
+ * Defines the structure for a field in a generic schema system. Levo Collection builds its own types on top of this, so this type is not used directly.
612
+ */
613
+ export declare interface IField {
614
+ /** Unique identifier for the field. */
615
+ id: string;
616
+ /** Unique key for the field, used for referencing. */
617
+ key: string;
618
+ /** The kind/type of the field (e.g., text, number, date). */
619
+ kind: (typeof FieldKindList)[number];
620
+ /** The widget/component type used to render this field. */
621
+ field_interface: (typeof FieldInterfacesList)[number] | "HeadingWidget" | "ButtonWidget" | "ImageWidget" | "MultiImageWidget" | "TypographyWidget" | "LayoutWidget" | "RepeatableWidget" | "TitleWidget" | "CardWidget" | "LinkWidget" | "IframeWidget";
622
+ /** Label for the field, displayed in the UI. */
623
+ label: string;
624
+ /** Helper text shown below the field. */
625
+ helper_text?: string;
626
+ /** Placeholder text for the field input. */
627
+ placeholder?: string;
628
+ /** Default value for the field. */
629
+ default_value?: any;
630
+ /** Whether the field is read-only. */
631
+ readonly?: boolean;
632
+ /** Nested fields, if this field is a group or composite. */
633
+ fields?: IField[];
634
+ /** Additional options for configuring the field. */
635
+ options?: Record<string, any>;
636
+ /** Whether the field is hidden from the UI. */
637
+ hidden?: boolean;
638
+ /** Whether the field is editable. */
639
+ editable?: boolean;
640
+ /** Whether the field is required. */
641
+ required?: boolean;
642
+ /** Whether the field value must be unique. */
643
+ unique?: boolean;
644
+ /** Minimum value or length for the field. */
645
+ min?: string | number | null;
646
+ /** Maximum value or length for the field. */
647
+ max?: string | number | null;
648
+ /** Allowed formats for the field value. */
649
+ formats?: string[];
650
+ /** Allowed values for the field (for select/dropdown fields). */
651
+ values?: any[];
652
+ /** */
653
+ created_at?: string;
654
+ /** */
655
+ updated_at?: string;
656
+ }
657
+
658
+ export declare interface IFieldError {
659
+ param: string;
660
+ message: string;
661
+ }
662
+
663
+ /**
664
+ * Used for making partial updates to fields, especially nested fields. This type is not used directly in most Levo Collection code, but Levo Collection types are based on it.
665
+ */
666
+ export declare interface IFieldUpdate extends Omit<IField, "fields"> {
667
+ /** Nested fields to update, provided as partials. */
668
+ fields: Partial<IField>[];
669
+ }
670
+
671
+ export declare type IFilter = Record<string, unknown>;
672
+
673
+ export declare interface IForum {
674
+ _id: string;
675
+ name: string;
676
+ slug: string;
677
+ description: string;
678
+ status: string;
679
+ settings: IForumSettings;
680
+ created_at: string;
681
+ }
682
+
683
+ export declare interface IForumCategory {
684
+ posts: IForumPost[];
685
+ _id: string;
686
+ forum: string;
687
+ slug: string;
688
+ name: string;
689
+ description: string;
690
+ og_image?: IMediaObject;
691
+ og_title: string;
692
+ og_description: string;
693
+ meta_title: string;
694
+ meta_description: string;
695
+ created_at: string;
696
+ updated_at: string;
697
+ created_by: string;
698
+ updated_by: string;
699
+ }
700
+
701
+ /**
702
+ * Forum Join Request Object
703
+ *
704
+ * Represents a user's request to join an invite-only forum
705
+ */
706
+ export declare interface IForumJoinRequest {
707
+ _id: string;
708
+ forum: string;
709
+ account: ILevoMembership.Account;
710
+ message?: string;
711
+ created_at: string;
712
+ updated_at: string;
713
+ }
714
+
715
+ /**
716
+ * Forum Member Object
717
+ *
718
+ * forum: Forum ID
719
+ *
720
+ * account: Membership
721
+ */
722
+ export declare interface IForumMember {
723
+ _id: string;
724
+ forum: string;
725
+ account: ILevoMembership.Account;
726
+ created_by: ILevoMembership.Account;
727
+ created_at: string;
728
+ updated_at: string;
729
+ }
730
+
731
+ /**
732
+ * Response from GET /v1/community/:forum/member/get-me
733
+ *
734
+ * Contains both member status and pending join request
735
+ */
736
+ export declare interface IForumMembershipStatus {
737
+ member: IForumMember | null;
738
+ join_request: IForumJoinRequest | null;
739
+ }
740
+
741
+ export declare interface IForumPost {
742
+ _id: string;
743
+ comments_count: number;
744
+ created_at: string;
745
+ created_by?: ILevoMembership.Account | null;
746
+ expires_at?: string | null;
747
+ kind: ForumPostKind;
748
+ upvote_count: number;
749
+ upvoted_at: string | null;
750
+ downvote_count: number;
751
+ downvoted_at: string | null;
752
+ media: IMediaObject[];
753
+ metadata: Partial<IForumPostLinkMetaData> | null;
754
+ published_at: string | null;
755
+ show_participant_list: boolean;
756
+ show_participant_vote: boolean;
757
+ slug: string;
758
+ url: string;
759
+ title: string;
760
+ content?: string;
761
+ updated_at: string;
762
+ deleted_at: string | null;
763
+ deleted_by: string | null;
764
+ vote_count?: number | null;
765
+ total_votes?: number | null;
766
+ user_voted_option?: string | null;
767
+ options: IForumPostOption[];
768
+ thread: string | null;
769
+ resource_type: string;
770
+ status?: ForumPostStatus;
771
+ organization: IOrganization | null;
772
+ categories: IForumCategory[];
773
+ }
774
+
775
+ declare interface IForumPostLinkMetaData {
776
+ meta_title: string;
777
+ meta_description: string;
778
+ og_image: IMediaObject | null;
779
+ }
780
+
781
+ export declare interface IForumPostOption {
782
+ _id: string;
783
+ count: number;
784
+ label: string;
785
+ }
786
+
787
+ export declare interface IForumSettings {
788
+ enable_ai_moderation_for_comment: boolean;
789
+ enable_auto_approve_for_comment: boolean;
790
+ allow_reporting_for_comment: boolean;
791
+ allow_moderator_to_delete_comment: boolean;
792
+ allow_moderator_to_unpublish_comment: boolean;
793
+ enable_ai_moderation_for_post: boolean;
794
+ enable_auto_approve_for_post: boolean;
795
+ allow_reporting_for_post: boolean;
796
+ allow_moderator_to_delete_post: boolean;
797
+ allow_moderator_to_unpublish_post: boolean;
798
+ allow_users_to_create_post: boolean;
799
+ invite_only: boolean;
800
+ allow_join_requests: boolean;
801
+ allow_public_view_for_post: boolean;
802
+ allow_public_view_for_comment: boolean;
803
+ }
804
+
805
+ export declare interface IForumTag {
806
+ posts: IForumPost[];
807
+ _id: string;
808
+ forum: string;
809
+ slug: string;
810
+ name: string;
811
+ description: string;
812
+ og_image?: IMediaObject;
813
+ og_title: string;
814
+ og_description: string;
815
+ meta_title: string;
816
+ meta_description: string;
817
+ created_at: string;
818
+ updated_at: string;
819
+ created_by: string;
820
+ updated_by: string;
821
+ }
822
+
823
+ export declare interface IGeocoderLocation extends Partial<google.maps.places.PlaceResult> {
824
+ place_name: string;
825
+ latitude?: number;
826
+ longitude?: number;
827
+ }
828
+
829
+ export declare interface IGroupBy {
830
+ label: string;
831
+ value: string;
832
+ field: ILemaField;
833
+ }
834
+
835
+ export declare interface IIcon {
836
+ kind: "emoji" | "custom" | "icon";
837
+ data: IEmojiData | IMediaObject | IIconData;
838
+ }
839
+
840
+ export declare interface IIconCat {
841
+ name: string;
842
+ slug: string;
843
+ emojis: IEmojiData[] | IIconData[];
844
+ }
845
+
846
+ export declare interface IIconData {
847
+ id: string;
848
+ label: string;
849
+ tags?: string[];
850
+ svgCode: string;
851
+ }
852
+
853
+ /**
854
+ * Defines the schema structure for a Levo Collection.
855
+ *
856
+ * A Levo Collection is a feature of the Levo platform that enables dynamic form rendering using the `@levo-so/react-collection` library.
857
+ * This interface describes the schema used to generate forms, including sections, fields, and configuration options.
858
+ * The schema is referenced anywhere a Levo Collection is required in the Levo ecosystem.
859
+ *
860
+ * For more details, see the documentation in external/react-collection/docs/readme.md.
861
+ */
862
+ export declare interface ILemaCollection {
863
+ /** Unique identifier for the collection schema. */
864
+ id: string;
865
+ /** Unique key used as URL slug and can be used to fetch the collection schema. */
866
+ key: string;
867
+ /** Array of sections that define the structure and fields of the form. */
868
+ sections: ILemaSection[];
869
+ /** Optional array of views for customizing how the collection is presented. */
870
+ views?: ICollectionViews[];
871
+ /** Optional workspace ID to which this collection belongs. */
872
+ workspace_id?: string;
873
+ /** Name of the collection schema. */
874
+ name: string;
875
+ /** Optional description of the collection schema. */
876
+ description?: string | null;
877
+ /** Optional icon representing the collection. */
878
+ icon?: IIcon | null;
879
+ /** Optional field name used as the title for items in the collection. */
880
+ title_field?: string | null;
881
+ /** Optional field name used for email in the collection. */
882
+ email_field?: string | null;
883
+ /** Optional field name used for mobile in the collection. */
884
+ mobile_field?: string | null;
885
+ /** Whether the collection is hidden from the UI. */
886
+ hidden?: boolean;
887
+ /** Whether the collection is read-only. */
888
+ readonly?: boolean;
889
+ /** Arbitrary settings for the collection schema. */
890
+ settings?: Record<string, any>;
891
+ /** Optional module name associated with the collection. */
892
+ module_name?: string | null;
893
+ /** Optional configuration for actions to perform on submit. */
894
+ on_submit?: INotificationData[];
895
+ /** Optional configuration for actions to perform on update. */
896
+ on_update?: INotificationData[];
897
+ /** Date or string representing when the collection was created. */
898
+ created_at?: Date | string;
899
+ /** Date or string representing when the collection was last updated. */
900
+ updated_at?: Date | string;
901
+ /** Whether the collection allows draft items. */
902
+ allow_draft?: boolean;
903
+ }
904
+
905
+ export declare type ILemaCollectionRelationship = "o2m" | "m2o" | "o2o" | "m2m";
906
+
907
+ /**
908
+ * Represents a field in a Levo Collection schema, including its configuration and options.
909
+ */
910
+ export declare type ILemaField = Mandatory<Omit<IField, "fields" | "options">, "key" | "kind" | "label" | "id"> & {
911
+ /** Field interface type, determines the widget/component to render. */
912
+ field_interface: (typeof FieldInterfacesList)[number];
913
+ /** Nested fields, if this field is a group or composite. */
914
+ fields?: ILemaField[];
915
+ /** Field options for configuring widget behavior. */
916
+ options: ILemaFieldOptions;
917
+ };
918
+
919
+ /**
920
+ * Options for configuring the behavior and appearance of a field in a Levo Collection schema.
921
+ */
922
+ export declare interface ILemaFieldOptions {
923
+ /** Whether to link the email field with a member profile. */
924
+ link_with_member_profile?: boolean;
925
+ /** Key of the referenced collection for collection widget. */
926
+ collection_key?: string;
927
+ /** ID of the referenced collection for collection widget. */
928
+ collection_id?: string;
929
+ /** Key of the reference field in the related collection. */
930
+ reference_field_key?: string;
931
+ /** Key of the label field in the related collection. */
932
+ label_field_key?: string | null;
933
+ /** Whether the current collection has many connected items. */
934
+ current_have_many_connected?: boolean;
935
+ /** Whether the connected collection has many current items. */
936
+ connected_have_many_current?: boolean;
937
+ /** Relationship type or object for the collection widget. */
938
+ relationship?: ILemaCollectionRelationship | string;
939
+ /** Action to take on delete for the relationship. */
940
+ on_delete?: ILemaRelationOnDelete;
941
+ /** Slug for the field, used in URLs or as a unique identifier. */
942
+ slug?: string;
943
+ /** Currency code for currency widget. */
944
+ currency_code?: string;
945
+ disableCountryGuess?: boolean;
946
+ /** Location type for location widget. */
947
+ location_type?: string;
948
+ /** Country for location widget. */
949
+ country?: string;
950
+ /** Whether to allow custom input in dropdown widget. */
951
+ custom_input?: boolean;
952
+ /** The referenced collection object for schema editor. */
953
+ collection?: ILemaCollection | null;
954
+ /** Whether to disable validation for this field. */
955
+ disableValidation?: boolean;
956
+ /** Validation presets for the field. */
957
+ validationsPresets?: string[];
958
+ /** Whether to verify email/phone values or not */
959
+ verification?: boolean;
960
+ }
961
+
962
+ export declare type ILemaRelation = {
963
+ relationship: ILemaCollectionRelationship | string;
964
+ related_field: string;
965
+ related_collection_key: string;
966
+ field: string;
967
+ collection_key: string;
968
+ on_delete?: ILemaRelationOnDelete;
969
+ };
970
+
971
+ export declare type ILemaRelationOnDelete = "CASCADE" | "SET_NULL" | "RESTRICT";
972
+
973
+ /**
974
+ * Represents a section in a Levo Collection schema, grouping related fields together.
975
+ */
976
+ export declare interface ILemaSection extends Omit<ISection, "fields"> {
977
+ /** Fields contained within this section. */
978
+ fields: ILemaField[];
979
+ }
980
+
981
+ export declare namespace ILevoAudience {
982
+ export interface Traits {
983
+ private_mode: boolean;
984
+ dark_mode: boolean;
985
+ locale: string;
986
+ timezone: string;
987
+ referrer: {
988
+ type: string;
989
+ referrer: Record<string, string>;
990
+ data: Record<string, string>;
991
+ };
992
+ properties: Record<string, any>;
993
+ withLock?: boolean;
994
+ }
995
+ export type BaseProperties = Traits & {
996
+ resource: string;
997
+ identifier: string;
998
+ };
999
+ export interface BlockProperties {
1000
+ id: string;
1001
+ }
1002
+ export interface ActivityProperties {
1003
+ seconds_idle?: number;
1004
+ seconds_active?: number;
1005
+ }
1006
+ export interface ScrollProperties {
1007
+ percent: number;
1008
+ }
1009
+ export type Properties = Partial<BaseProperties & BlockProperties & ActivityProperties & ScrollProperties> & Partial<Omit<BaseInput, "workspace_id" | "tab_count" | "tab_id">> & Record<string, any>;
1010
+ export type EventProperties = {
1011
+ properties: Properties;
1012
+ traits: Traits;
1013
+ event: AnalyticsEventType;
1014
+ type: "track" | "page" | "identify";
1015
+ userId: string | null;
1016
+ };
1017
+ export type BaseInput = {
1018
+ workspace_id: string;
1019
+ site_id?: string;
1020
+ hostname: string;
1021
+ pathname: string;
1022
+ page_title: string;
1023
+ url: string;
1024
+ created_at: string;
1025
+ tab_id: string;
1026
+ tab_count: number;
1027
+ };
1028
+ export type WelcomeInput = Traits & BaseInput;
1029
+ export type WelcomeResponse = {
1030
+ session: string;
1031
+ device: string;
1032
+ };
1033
+ export type CollectInput = BaseInput & {
1034
+ session_id?: string;
1035
+ device_id?: string;
1036
+ event: AnalyticsEventType;
1037
+ version?: number;
1038
+ properties: Properties;
1039
+ resource: string;
1040
+ identifier: string | undefined;
1041
+ };
1042
+ export type ActivityStatus = {
1043
+ isIdle: boolean;
1044
+ isDisabled: boolean;
1045
+ active: number;
1046
+ idle: number;
1047
+ };
1048
+ }
1049
+
1050
+ export declare type ILevoClient = ReturnType<typeof createLevoClient>;
1051
+
1052
+ export declare interface ILevoClientOptions extends ICoreOptions {
1053
+ pageContext?: IPageContext | null;
1054
+ loggerOptions?: ILoggerOptions;
1055
+ }
1056
+
1057
+ export declare type ILevoIntegrationInstance = {
1058
+ id: string;
1059
+ name: string;
1060
+ publisher: string;
1061
+ description: string;
1062
+ url: string | null;
1063
+ logo: string | null;
1064
+ dashboard_url: string | null;
1065
+ sidebar_icon: string | null;
1066
+ show_on_sidebar: boolean;
1067
+ key: string;
1068
+ };
1069
+
1070
+ export declare type ILevoIntegrationList = (typeof LEVO_INTEGRATIONS)[keyof typeof LEVO_INTEGRATIONS][];
1071
+
1072
+ export declare namespace ILevoMembership {
1073
+ export interface sub_account_oauth_credentials {
1074
+ provider: string;
1075
+ oauth_id: string;
1076
+ }
1077
+ /**
1078
+ * The account object of the member
1079
+ */
1080
+ export interface Account {
1081
+ _id: string;
1082
+ first_name: string | null;
1083
+ last_name: string | null;
1084
+ slug: string;
1085
+ username: string;
1086
+ email: string;
1087
+ display_email: string;
1088
+ reducted_email: string;
1089
+ email_verified: boolean;
1090
+ email_verified_at: string | null;
1091
+ verified_at: string | null;
1092
+ mobile: string | null;
1093
+ reducted_mobile: string | null;
1094
+ mobile_verified: boolean;
1095
+ mobile_verified_at: string | null;
1096
+ profile_picture: IMediaObject | null;
1097
+ oauth_credentials: sub_account_oauth_credentials[];
1098
+ account_locked_at: Date | string | null;
1099
+ credentials_expired_at: Date | string | null;
1100
+ deactivated_at: Date | string | null;
1101
+ last_access_at: Date | string | null;
1102
+ flagged_at: Date | string | null;
1103
+ created_at: Date | string;
1104
+ updated_at: Date | string;
1105
+ deleted_at: Date | string | null;
1106
+ }
1107
+ /**
1108
+ * the otp object with its code and content
1109
+ */
1110
+ export interface Otp {
1111
+ /**
1112
+ * the ID of the Otp
1113
+ */
1114
+ _id: string;
1115
+ /**
1116
+ * the email or mobile number to send the Otp to
1117
+ */
1118
+ content: string;
1119
+ /**
1120
+ * the Otp code received in email or sms
1121
+ */
1122
+ code: string;
1123
+ }
1124
+ export type OAuthURLProvider = (typeof LevoOAuthProviderList)[number];
1125
+ /**
1126
+ * The list of URLs for OAuth providers to redirect to
1127
+ * This can be used in the OAuth Buttons like "Continue with Google" etc.
1128
+ *
1129
+ * @example
1130
+ * ```javascript
1131
+ * {
1132
+ * "google": 'https://public-api.levo.so/v1/membership/auth/oauth/google?redirect_uri=https://example.com&workspace=my-workspace',
1133
+ * "microsoft": 'https://public-api.levo.so/v1/membership/auth/oauth/microsoft?redirect_uri=https://example.com&workspace=my-workspace',
1134
+ * "linkedin": 'https://public-api.levo.so/v1/membership/auth/oauth/linkedin?redirect_uri=https://example.com&workspace=my-workspace'
1135
+ * }
1136
+ * ```
1137
+ */
1138
+ export type OAuthURLList = Record<OAuthURLProvider, string | null>;
1139
+ export namespace Request {
1140
+ /**
1141
+ *
1142
+ * `content` - the email or mobile number to send the Otp to
1143
+ *
1144
+ * @example
1145
+ * ```json
1146
+ * {
1147
+ * "content": "example@mailinator.com",
1148
+ * "redirect_uri": "https://example.com/protected-page"
1149
+ * }
1150
+ * ```
1151
+ */
1152
+ export type RequestMagicLink = Pick<Otp, "content"> & {
1153
+ redirect_uri?: string;
1154
+ };
1155
+ /**
1156
+ *
1157
+ * `content` - the email or mobile number to send the Otp to
1158
+ *
1159
+ * @example
1160
+ * ```json
1161
+ * {
1162
+ * "content": "example@mailinator.com"
1163
+ * }
1164
+ * ```
1165
+ */
1166
+ export type RequestOtp = Pick<Otp, "content"> & {
1167
+ medium?: "email" | "whatsapp";
1168
+ };
1169
+ /**
1170
+ * `content` - the email or mobile number to send the Otp to
1171
+ *
1172
+ * `code` - the Otp code received in email or sms
1173
+ *
1174
+ * @example
1175
+ * ```json
1176
+ * {
1177
+ * "content": "example@mailinator.com",
1178
+ * "code": "1234"
1179
+ * }
1180
+ * ```
1181
+ */
1182
+ export type SignInWithOtp = Pick<Otp, "content" | "code">;
1183
+ /**
1184
+ * `email` - the email of the account
1185
+ *
1186
+ * `password` - the password of the account
1187
+ *
1188
+ * @example
1189
+ * ```json
1190
+ * {
1191
+ * "email": "example@mailinator.com",
1192
+ * "password": "strongpasswordhere"
1193
+ * }
1194
+ * ```
1195
+ */
1196
+ export type SignInWithPassword = {
1197
+ email: Account["email"];
1198
+ password: string;
1199
+ };
1200
+ /**
1201
+ * @property {string | null} [first_name] - the first name of the account
1202
+ * @property {string | null} [last_name] - the last name of the account
1203
+ * @property {string} email - the email of the account
1204
+ * @property {string} password - the password of the account
1205
+ *
1206
+ * @example
1207
+ * ```json
1208
+ * {
1209
+ * "email": "example@mailinator.com",
1210
+ * "password": "strongpasswordhere"
1211
+ * }
1212
+ * ```
1213
+ * @example
1214
+ * ```json
1215
+ * {
1216
+ * "first_name": "John",
1217
+ * "last_name": "Doe",
1218
+ * "email": "example@mailinator.com",
1219
+ * "password": "strongpasswordhere"
1220
+ * }
1221
+ * ```
1222
+ * @example
1223
+ * ```json
1224
+ * {
1225
+ * "first_name": null,
1226
+ * "last_name": null,
1227
+ * "email": "example@mailinator.com",
1228
+ * "password": "strongpasswordhere"
1229
+ * }
1230
+ * ```
1231
+ */
1232
+ export type SignUpWithPassword = Partial<Pick<Account, "first_name" | "last_name">> & Pick<Account, "email"> & {
1233
+ password: string;
1234
+ };
1235
+ /**
1236
+ * @property {string | null} [first_name] - the first name of the account (optional)
1237
+ * @property {string | null} [last_name] - the last name of the account (optional)
1238
+ * @property {string} [username] - the username of the account (optional)
1239
+ * @property {IMediaObject} [profile_picture] - the profile picture object for the account (optional)
1240
+ */
1241
+ export type UpdateMe = Partial<Pick<Account, "first_name" | "last_name" | "profile_picture" | "username">>;
1242
+ /**
1243
+ * @property {string} [password] - the first name of the account (optional)
1244
+ */
1245
+ export type CreatePassword = {
1246
+ password: string;
1247
+ };
1248
+ }
1249
+ {};
1250
+ }
1251
+
1252
+ export declare type ILevoOAuthProvider = (typeof LevoOAuthProviderList)[number];
1253
+
1254
+ declare interface ILoggerOptions extends IBatchOptions {
1255
+ level?: LogLevel;
1256
+ enableRemote?: boolean;
1257
+ context?: Record<string, any>;
1258
+ }
1259
+
1260
+ export declare interface IMe {
1261
+ _id: string;
1262
+ public_id: string;
1263
+ slug: string;
1264
+ first_name: string;
1265
+ last_name: string;
1266
+ email: string;
1267
+ bio: string;
1268
+ website: string;
1269
+ profile_picture: any;
1270
+ og_image: any;
1271
+ og_title: string;
1272
+ og_description: string;
1273
+ meta_title: string;
1274
+ meta_description: string;
1275
+ last_access_at: Date;
1276
+ active_at: Date;
1277
+ created_at: Date;
1278
+ updated_at: Date;
1279
+ }
1280
+
1281
+ export declare interface IMedia {
1282
+ id: string;
1283
+ workspace_id: string;
1284
+ filename: string;
1285
+ kind: (typeof MediaKindList)[number];
1286
+ location: string;
1287
+ path: string;
1288
+ srcset?: {
1289
+ "320w": string;
1290
+ "640w": string;
1291
+ "750w": string;
1292
+ "828w": string;
1293
+ "1080w": string;
1294
+ "1200w": string;
1295
+ "1920w": string;
1296
+ path: string;
1297
+ };
1298
+ description: string;
1299
+ metadata: {
1300
+ encoding?: string;
1301
+ mimetype: string;
1302
+ size: number;
1303
+ etag?: string;
1304
+ };
1305
+ created_at?: Date;
1306
+ created_by?: string;
1307
+ updated_at?: Date;
1308
+ updated_by?: string;
1309
+ }
1310
+
1311
+ export declare type IMediaObject = Pick<IMedia, "id" | "location" | "srcset" | "kind"> & {
1312
+ mimetype?: IMedia["metadata"]["mimetype"];
1313
+ };
1314
+
1315
+ export declare interface IMeta {
1316
+ total: number;
1317
+ pages: number;
1318
+ }
1319
+
1320
+ export declare type IModuleAccessControl = {
1321
+ dashboard_config: IDefaultPermissionsObject;
1322
+ studio_config: IDefaultPermissionsObject & {
1323
+ addBlocks: boolean;
1324
+ version: string;
1325
+ preview_url: string | null;
1326
+ modules: {
1327
+ my_blocks: IDefaultPermissionsObject;
1328
+ };
1329
+ };
1330
+ collections_config: IDefaultPermissionsObject & {
1331
+ modules: {
1332
+ records: IDefaultPermissionsObject;
1333
+ };
1334
+ };
1335
+ media_config: IDefaultPermissionsObject;
1336
+ events_config: IDefaultPermissionsObject;
1337
+ blogs_config: IDefaultPermissionsObject;
1338
+ memberships_config: IDefaultPermissionsObject;
1339
+ insights_config: IDefaultPermissionsObject;
1340
+ settings_config: IDefaultPermissionsObject;
1341
+ };
1342
+
1343
+ export declare interface INotificationData {
1344
+ id?: string;
1345
+ kind: string;
1346
+ subkind: string;
1347
+ enabled?: boolean;
1348
+ condition?: LevoQuery.Where;
1349
+ options: {
1350
+ to_email: string | string[];
1351
+ subject?: string;
1352
+ template_key: string;
1353
+ from_name: string;
1354
+ reply_to?: string;
1355
+ cc_email?: string[];
1356
+ bcc_email?: string[];
1357
+ info: {
1358
+ show_download_button?: boolean;
1359
+ hide_fields?: string[];
1360
+ body?: string;
1361
+ subject?: string;
1362
+ richtext?: string;
1363
+ };
1364
+ };
1365
+ }
1366
+
1367
+ export declare interface INotificationWithTrigger extends INotificationData {
1368
+ trigger: "on_submit" | "on_update";
1369
+ }
1370
+
1371
+ export declare const interfaceKinds: Record<(typeof FieldInterfacesList)[number], (typeof FieldKindList)[number]>;
1372
+
1373
+ export declare interface IOrganization {
1374
+ _id: string;
1375
+ accounts: string[];
1376
+ approval_status: string | null;
1377
+ approval_updated_at: string | null;
1378
+ approval_updated_by: string | null;
1379
+ created_at: string | null;
1380
+ deleted_at: string | null;
1381
+ member_count: number | null;
1382
+ name: string;
1383
+ owner: string;
1384
+ referral_code: string;
1385
+ referral_count: number | null;
1386
+ size: string;
1387
+ updated_at: string | null;
1388
+ badge_granted_at: string | null;
1389
+ logo: IMediaObject | null;
1390
+ icon: IMediaObject | null;
1391
+ }
1392
+
1393
+ declare interface IPageContext {
1394
+ url: string;
1395
+ id?: string;
1396
+ referrer?: string;
1397
+ title?: string;
1398
+ }
1399
+
1400
+ export declare interface IPhoneNumber {
1401
+ id: string;
1402
+ phone: string;
1403
+ is_primary: boolean;
1404
+ }
1405
+
1406
+ export declare interface IPlan {
1407
+ name: string;
1408
+ id: string;
1409
+ created_at: Date;
1410
+ updated_at: Date;
1411
+ plan_group_id: string;
1412
+ description: string;
1413
+ kind: PlanKind;
1414
+ is_trial: boolean;
1415
+ price: IPlanPrice[];
1416
+ features: IPlanFeature[];
1417
+ recommended: boolean;
1418
+ is_enterprise: boolean;
1419
+ plan_group: IPlanGroup;
1420
+ }
1421
+
1422
+ export declare interface IPlanFeature {
1423
+ title: string;
1424
+ description: string | null;
1425
+ sort_order: number;
1426
+ is_active: boolean | null;
1427
+ }
1428
+
1429
+ export declare interface IPlanGroup {
1430
+ id: string;
1431
+ name: string;
1432
+ created_at: Date;
1433
+ updated_at: Date;
1434
+ }
1435
+
1436
+ export declare interface IPlanPrice {
1437
+ id: string;
1438
+ plan_id: string;
1439
+ period: "month" | "year";
1440
+ unit_amount: number;
1441
+ currency: string;
1442
+ reference_id: string;
1443
+ provider: string;
1444
+ created_at: string;
1445
+ updated_at: string;
1446
+ }
1447
+
1448
+ export declare interface IPost {
1449
+ _id: string;
1450
+ blog: string;
1451
+ slug: string;
1452
+ title: string;
1453
+ summary: string;
1454
+ content: IContent;
1455
+ status: string;
1456
+ cover_image?: IMediaObject;
1457
+ reading_time: number;
1458
+ canonical_url: string;
1459
+ og_image?: IMediaObject | null;
1460
+ og_title: string;
1461
+ og_description: string;
1462
+ meta_title: string;
1463
+ meta_description: string;
1464
+ authors?: {
1465
+ first_name: string;
1466
+ last_name: string;
1467
+ slug: string;
1468
+ bio: string;
1469
+ profile_picture: {
1470
+ location: string;
1471
+ };
1472
+ }[];
1473
+ settings: Record<string, any>;
1474
+ in_review_at?: Date;
1475
+ approved_at?: Date;
1476
+ published_at?: string | null;
1477
+ created_at: string;
1478
+ updated_at: Date;
1479
+ deleted_at?: Date;
1480
+ tags?: {
1481
+ _id: string;
1482
+ name: string;
1483
+ slug: string;
1484
+ }[];
1485
+ categories?: {
1486
+ _id: string;
1487
+ name: string;
1488
+ slug: string;
1489
+ }[];
1490
+ }
1491
+
1492
+ export declare interface IResponseError {
1493
+ status: false;
1494
+ content: IErrorContent;
1495
+ }
1496
+
1497
+ export declare interface IResponseMultiple<T = Record<string, unknown>, U = IMeta> {
1498
+ status: boolean;
1499
+ content: {
1500
+ meta: U;
1501
+ data: T[];
1502
+ };
1503
+ }
1504
+
1505
+ export declare interface IResponseMyCategory<T = Record<string, unknown>> {
1506
+ status: boolean;
1507
+ content: {
1508
+ data: T[];
1509
+ };
1510
+ }
1511
+
1512
+ export declare interface IResponseSingle<T = Record<string, unknown>, Meta = any> {
1513
+ status: boolean;
1514
+ content: {
1515
+ data: T;
1516
+ meta?: Meta;
1517
+ };
1518
+ }
1519
+
1520
+ /**
1521
+ * Defines the basic structure for a collection schema, including its sections, fields, and configuration. Levo Collection uses its own types built on top of this, so this type is not used directly.
1522
+ */
1523
+ export declare interface ISchema {
1524
+ /** Unique identifier for the schema. */
1525
+ id: string;
1526
+ /** Name of the schema. */
1527
+ name: string;
1528
+ /** Description of the schema. */
1529
+ description: string;
1530
+ /** Unique key for referencing the schema. */
1531
+ key: string;
1532
+ /** Sections that make up the schema, each containing fields. */
1533
+ sections: ISection[];
1534
+ /** Field key used as the title for items in the schema. */
1535
+ title_field: string;
1536
+ /** */
1537
+ cover_image_field?: string;
1538
+ /** Icon representing the schema. */
1539
+ icon: null | IIcon;
1540
+ /** */
1541
+ created_at?: string;
1542
+ /** */
1543
+ module_name?: string;
1544
+ /** Views for customizing how the schema is presented. */
1545
+ views?: ICollectionViews[];
1546
+ }
1547
+
1548
+ /**
1549
+ * Defines the structure for a section in a schema, grouping related fields together. Levo Collection uses its own types built on top of this, so this type is not used directly in most Levo Collection code.
1550
+ */
1551
+ export declare interface ISection {
1552
+ /** Unique identifier for the section. */
1553
+ id: string;
1554
+ /** Label for the section, displayed in the UI. */
1555
+ label: string;
1556
+ /** Unique key for referencing the section. */
1557
+ key: string;
1558
+ /** Helper text for the section. */
1559
+ helper_text: string;
1560
+ /** Whether the section is hidden from the UI. */
1561
+ hidden: boolean;
1562
+ /** Fields contained within this section. */
1563
+ fields: IField[];
1564
+ }
1565
+
1566
+ export declare interface ISubscription {
1567
+ object: string;
1568
+ id: string;
1569
+ customer_details: Record<string, unknown>;
1570
+ payment_details: Record<string, unknown>;
1571
+ start_date: string;
1572
+ end_date: string;
1573
+ plan: Partial<Pick<IPlan, "id" | "name" | "is_enterprise">>;
1574
+ price: Partial<IPlanPrice>;
1575
+ cancelled_at: string | null;
1576
+ cancel_at_next_billing_date: boolean;
1577
+ status: "active" | "cancelled" | "past_due" | "trialing" | "incomplete" | "trial_expired";
1578
+ plan_id?: string;
1579
+ price_id?: string;
1580
+ }
1581
+
1582
+ /**
1583
+ * Comment thread metadata
1584
+ */
1585
+ export declare interface IThread {
1586
+ _id: string;
1587
+ comment_count: number;
1588
+ created_at: string;
1589
+ last_comment_at: string;
1590
+ resource_id: string;
1591
+ resource_type: string;
1592
+ settings: ICommentThreadSettings;
1593
+ status: string;
1594
+ updated_at: string;
1595
+ }
1596
+
1597
+ export declare interface IWorkspace {
1598
+ id: string;
1599
+ public_id: string;
1600
+ name: string;
1601
+ slug: string;
1602
+ domain: string;
1603
+ status: string;
1604
+ logo?: IMediaObject | null;
1605
+ deployed_at?: null;
1606
+ created_at: string;
1607
+ updated_at: string;
1608
+ deleted_at?: null;
1609
+ integrations?: ILevoIntegrationList | ILevoIntegrationInstance[];
1610
+ description: any;
1611
+ icon: IMediaObject | null;
1612
+ workspace_id: string;
1613
+ industry: string;
1614
+ countries: string[];
1615
+ info: {
1616
+ locations?: {
1617
+ place_name: string;
1618
+ }[];
1619
+ ai_onboarding?: {
1620
+ business_profile: {
1621
+ name: string;
1622
+ location: string;
1623
+ description: string;
1624
+ category: string;
1625
+ subcategory: string;
1626
+ category_confidence: number;
1627
+ };
1628
+ };
1629
+ contact_info?: IContactInfo;
1630
+ social_media?: {
1631
+ facebook?: string;
1632
+ twitter?: string;
1633
+ linkedin?: string;
1634
+ instagram?: string;
1635
+ };
1636
+ /** Whether user has an existing website or is creating new */
1637
+ website_status?: "existing" | "new";
1638
+ };
1639
+ settings: {
1640
+ head_code?: string;
1641
+ [key: string]: any;
1642
+ };
1643
+ page_count: number;
1644
+ domain_count: number;
1645
+ feature_flag?: IFeatureFlags;
1646
+ onboarded_at?: string | null;
1647
+ theme?: any;
1648
+ host_domain: string | null;
1649
+ proxy_domain: string | null;
1650
+ subscription: ISubscription | null;
1651
+ }
1652
+
1653
+ declare type JSONContent = {
1654
+ type?: string;
1655
+ attrs?: Record<string, any>;
1656
+ content?: JSONContent[];
1657
+ marks?: {
1658
+ type: string;
1659
+ attrs?: Record<string, any>;
1660
+ [key: string]: any;
1661
+ }[];
1662
+ text?: string;
1663
+ [key: string]: any;
1664
+ };
1665
+
1666
+ export declare const LEVO_INTEGRATIONS: {
1667
+ readonly beacon: "so.levo.beacon";
1668
+ readonly blog: "so.levo.blog";
1669
+ readonly event: "so.levo.event";
1670
+ readonly membership: "so.levo.membership";
1671
+ readonly payment: "so.levo.payment";
1672
+ readonly community: "so.levo.community";
1673
+ readonly search_console: "com.google.search_console";
1674
+ };
1675
+
1676
+ export declare const LEVO_INTEGRATIONS_LIST: ("so.levo.beacon" | "so.levo.blog" | "so.levo.event" | "so.levo.membership" | "so.levo.payment" | "so.levo.community" | "com.google.search_console")[];
1677
+
1678
+ /**
1679
+ * Enhanced error class that matches backend response structure
1680
+ */
1681
+ export declare class LevoError extends Error {
1682
+ code: string;
1683
+ title: string;
1684
+ status: number;
1685
+ type?: string;
1686
+ errors?: IFieldError[];
1687
+ constructor(data: IErrorContent);
1688
+ /**
1689
+ * Get validation errors for form fields
1690
+ */
1691
+ get fieldErrors(): IFieldError[];
1692
+ /**
1693
+ * Check if this is a validation error with field-specific errors
1694
+ */
1695
+ get hasFieldErrors(): boolean;
1696
+ }
1697
+
1698
+ export declare namespace LevoEvent {
1699
+ export interface Root {
1700
+ _id: string;
1701
+ cover_image: IMediaObject | null;
1702
+ contact_email?: string;
1703
+ title: string;
1704
+ kind: "virtual" | "in_person";
1705
+ timing: string;
1706
+ url: string | null;
1707
+ location: IGeocoderLocation | null;
1708
+ is_location_public?: boolean;
1709
+ is_url_public?: boolean;
1710
+ starts_at?: string | null;
1711
+ ends_at?: string | null;
1712
+ cadence: string;
1713
+ repeat_every: number;
1714
+ description: string;
1715
+ slug: string;
1716
+ status: "draft" | "canceled" | "published";
1717
+ accept_registration: boolean;
1718
+ max_capacity: number;
1719
+ banners: IMediaObject[];
1720
+ created_at: Date;
1721
+ created_by: string;
1722
+ updated_at: Date;
1723
+ updated_by: string;
1724
+ external_ticketing?: string;
1725
+ ticket_order?: "alphabetical-asc" | "alphabetical-desc" | "price-asc" | "price-desc" | "custom";
1726
+ series?: {
1727
+ _id: string;
1728
+ slug: string;
1729
+ name: string;
1730
+ description?: string;
1731
+ cover_image?: IMediaObject | null;
1732
+ status?: string;
1733
+ created_at?: string;
1734
+ updated_at?: string;
1735
+ };
1736
+ }
1737
+ export namespace Ticket {
1738
+ export interface Tax {
1739
+ _id: string;
1740
+ label: string;
1741
+ percentage: number;
1742
+ country_code: string;
1743
+ }
1744
+ export interface Root {
1745
+ _id: string;
1746
+ event: string;
1747
+ icon: IMediaObject | null;
1748
+ title: string;
1749
+ description: string;
1750
+ quantity: number | null;
1751
+ starts_at: Date | null;
1752
+ ends_at: Date | null;
1753
+ waitlist_enabled: boolean;
1754
+ requires_approval: boolean;
1755
+ hidden: boolean;
1756
+ allow_to_upgrade: boolean;
1757
+ include_in_upgrade: boolean;
1758
+ enforce_max_quantity: boolean;
1759
+ status: string;
1760
+ offerings: string[];
1761
+ coupons: string[];
1762
+ sale_count: number;
1763
+ currency: string;
1764
+ unit_amount: number;
1765
+ base_price: number;
1766
+ created_at: Date | string;
1767
+ created_by: string;
1768
+ updated_at: Date | string;
1769
+ updated_by: string;
1770
+ tax_enabled?: boolean;
1771
+ tax_inclusive?: boolean;
1772
+ taxes?: Tax[] | string[];
1773
+ }
1774
+ export type Create = Pick<Root, "title" | "description" | "quantity" | "starts_at" | "ends_at" | "waitlist_enabled" | "hidden" | "enforce_max_quantity" | "offerings" | "coupons">;
1775
+ }
1776
+ export namespace Coupon {
1777
+ export interface Root {
1778
+ _id: string;
1779
+ event: string;
1780
+ code: string;
1781
+ description: string | null;
1782
+ kind: string;
1783
+ percent_off: number | null;
1784
+ amount_off: number | null;
1785
+ currency: string;
1786
+ starts_at: Date | null;
1787
+ expires_at: Date | null;
1788
+ max_redemptions: number | null;
1789
+ minimum_amount: number | null;
1790
+ is_public: boolean;
1791
+ created_at: Date;
1792
+ created_by: string;
1793
+ updated_at: Date;
1794
+ updated_by: string;
1795
+ status: string;
1796
+ tickets: string[];
1797
+ }
1798
+ export type Create = Pick<Root, "code" | "description" | "kind" | "percent_off" | "amount_off" | "currency" | "starts_at" | "expires_at" | "max_redemptions" | "minimum_amount" | "is_public" | "tickets">;
1799
+ export type CreateBulk = Pick<Root, "description" | "kind" | "percent_off" | "amount_off" | "currency" | "starts_at" | "expires_at" | "max_redemptions" | "minimum_amount" | "is_public" | "tickets"> & {
1800
+ coupon_count: number;
1801
+ code_length: number;
1802
+ };
1803
+ export type Update = Partial<Pick<Root, "code" | "description" | "kind" | "percent_off" | "amount_off" | "currency" | "starts_at" | "expires_at" | "max_redemptions" | "minimum_amount" | "is_public" | "tickets">>;
1804
+ export type Validate = {
1805
+ base_amount: number;
1806
+ sale_amount: number;
1807
+ discountable_amount: number;
1808
+ discount: number;
1809
+ };
1810
+ }
1811
+ export namespace Offering {
1812
+ export interface Root {
1813
+ _id: string;
1814
+ event: string;
1815
+ title: string;
1816
+ description: string;
1817
+ enabled: boolean;
1818
+ checkin_count: number;
1819
+ tickets: string[];
1820
+ attendees: string[];
1821
+ created_at: Date;
1822
+ created_by: string;
1823
+ updated_at: Date;
1824
+ updated_by: string;
1825
+ }
1826
+ export type Create = Pick<Root, "title" | "description" | "enabled" | "tickets">;
1827
+ export type Update = Partial<Pick<Root, "title" | "description" | "enabled" | "tickets">>;
1828
+ }
1829
+ export namespace Attendee {
1830
+ export interface Root {
1831
+ _id: string;
1832
+ public_id: string;
1833
+ name: string;
1834
+ email: string;
1835
+ mobile: string | null;
1836
+ event: string;
1837
+ booking: Booking.Root;
1838
+ ticket: Pick<LevoEvent.Ticket.Root, "_id" | "title" | "currency" | "quantity" | "status" | "unit_amount">;
1839
+ price: string;
1840
+ account: string | null;
1841
+ status: string;
1842
+ created_at: Date;
1843
+ updated_at: Date;
1844
+ }
1845
+ }
1846
+ export namespace Booking {
1847
+ export interface Root {
1848
+ _id: string;
1849
+ slug: string;
1850
+ public_id: string;
1851
+ quantity: number;
1852
+ unit_amount: number;
1853
+ total_amount?: number;
1854
+ discount: number;
1855
+ currency: string;
1856
+ payment_link: string | null;
1857
+ account: string | null;
1858
+ event: string;
1859
+ coupon: string | null;
1860
+ code: string | null;
1861
+ status: string;
1862
+ paid: boolean;
1863
+ info: Record<string, any>;
1864
+ taxes?: Array<{
1865
+ id: string;
1866
+ label: string;
1867
+ percentage: number;
1868
+ amount: number;
1869
+ }>;
1870
+ qr_image: IMediaObject & {
1871
+ width: number;
1872
+ height: number;
1873
+ };
1874
+ /** Invoice PDF file (same shape as qr_image), null if not generated */
1875
+ invoice: (IMediaObject & {
1876
+ width: number;
1877
+ height: number;
1878
+ }) | null;
1879
+ created_at: Date;
1880
+ updated_at: Date;
1881
+ attendees: LevoEvent.Attendee.Root[];
1882
+ }
1883
+ export type Create = Omit<Pick<Root, "event" | "coupon">, "attendees"> & {
1884
+ attendees: Mandatory<LevoEvent.Attendee.Root, "name" | "ticket" | "email">;
1885
+ };
1886
+ }
1887
+ export namespace Series {
1888
+ export interface Root {
1889
+ _id: string;
1890
+ slug: string;
1891
+ name: string;
1892
+ description: string;
1893
+ cover_image: string | null;
1894
+ status: "published" | string;
1895
+ created_at: string;
1896
+ updated_at: string;
1897
+ events: any[];
1898
+ }
1899
+ export interface Create {
1900
+ name: string;
1901
+ }
1902
+ export interface Update {
1903
+ name: string;
1904
+ }
1905
+ }
1906
+ }
1907
+
1908
+ export declare const LevoOAuthProviderList: readonly ["google", "linkedin", "microsoft"];
1909
+
1910
+ export declare namespace LevoQuery {
1911
+ export type Select<Fields extends string = string> = Partial<Record<Fields, boolean | {
1912
+ select: Record<string, boolean>;
1913
+ }>>;
1914
+ export type Sort<Fields extends string = string> = Partial<Record<Fields, "asc" | "desc">>;
1915
+ export type Include<Fields extends string = string> = Partial<Record<Fields, boolean | Pick<FindQuery<Fields>, "select" | "sort" | "include" | "limit">>>;
1916
+ export type Where<Fields extends string = string> = Filter<Fields>;
1917
+ export type FindQuery<Fields extends string = string> = Partial<{
1918
+ page: number;
1919
+ limit: number;
1920
+ select: Select<Fields>;
1921
+ where: Where<Fields>;
1922
+ sort: Sort<Fields>;
1923
+ include: Include<Fields>;
1924
+ search: string;
1925
+ }>;
1926
+ }
1927
+
1928
+ export declare const listToColumn: <T extends string>(columns: readonly string[]) => Record<T, string>;
1929
+
1930
+ export declare const listToRecord: <T extends string>(columns: readonly string[]) => { [K in T]: K; };
1931
+
1932
+ export declare type LogicalFilter<T extends string = string> = {
1933
+ [LogicalOperators.AND]: Filter<T>[];
1934
+ [LogicalOperators.OR]?: never;
1935
+ } | {
1936
+ [LogicalOperators.OR]: Filter<T>[];
1937
+ [LogicalOperators.AND]?: never;
1938
+ };
1939
+
1940
+ export declare const LogicalOperators: {
1941
+ AND: "AND";
1942
+ OR: "OR";
1943
+ };
1944
+
1945
+ export declare type LogicalOperators = keyof typeof LogicalOperators;
1946
+
1947
+ declare enum LogLevel {
1948
+ debug = 0,
1949
+ info = 1,
1950
+ warn = 2,
1951
+ error = 3,
1952
+ off = 100
1953
+ }
1954
+
1955
+ export declare type Mandatory<T, K extends keyof T> = Prettify<Pick<T, K> & Partial<Omit<T, K>>>;
1956
+
1957
+ export declare const MediaKind: Record<"image" | "video" | "audio" | "document", "image" | "video" | "audio" | "document">;
1958
+
1959
+ export declare const MediaKindList: readonly ["image", "video", "audio", "document"];
1960
+
1961
+ export declare type PlanKind = "addon" | "base";
1962
+
1963
+ export declare type Prettify<T> = {
1964
+ [K in keyof T]: T[K];
1965
+ };
1966
+
1967
+ export declare type WithinFilterType = {
1968
+ latitude: number;
1969
+ longitude: number;
1970
+ distance: number;
1971
+ unit?: "kilometers" | "miles" | "meters" | "feet";
1972
+ };
1973
+
1974
+ export declare type WorkspaceID = `W${string}`;
1975
+
1976
+ export { }