@levo-so/core 0.1.59 → 0.1.61

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 (55) hide show
  1. package/dist/index.d.ts +1789 -8
  2. package/dist/index.js +262 -881
  3. package/package.json +3 -9
  4. package/dist/client.d.ts +0 -82
  5. package/dist/constants/collection/defaultByKind.d.ts +0 -3
  6. package/dist/constants/collection/fieldInterfaceFormat.d.ts +0 -3
  7. package/dist/constants/collection/fieldInterfaces.d.ts +0 -6
  8. package/dist/constants/collection/fieldKind.d.ts +0 -26
  9. package/dist/constants/index.d.ts +0 -8
  10. package/dist/constants/integration.d.ts +0 -23
  11. package/dist/constants/media.d.ts +0 -3
  12. package/dist/constants/oauthProvider.d.ts +0 -3
  13. package/dist/control/audience.d.ts +0 -22
  14. package/dist/control/index.d.ts +0 -23
  15. package/dist/httpClient.d.ts +0 -13
  16. package/dist/logger/batch.d.ts +0 -9
  17. package/dist/logger/index.d.ts +0 -22
  18. package/dist/modules/blog.d.ts +0 -10
  19. package/dist/modules/collection.d.ts +0 -26
  20. package/dist/modules/media.d.ts +0 -11
  21. package/dist/modules/membership.d.ts +0 -21
  22. package/dist/types/audience.d.ts +0 -100
  23. package/dist/types/blog/author.d.ts +0 -30
  24. package/dist/types/blog/blogClient.d.ts +0 -51
  25. package/dist/types/blog/category.d.ts +0 -20
  26. package/dist/types/blog/index.d.ts +0 -64
  27. package/dist/types/blog/post.d.ts +0 -63
  28. package/dist/types/blog/tag.d.ts +0 -19
  29. package/dist/types/collection/collectionView.d.ts +0 -36
  30. package/dist/types/collection/draft.d.ts +0 -9
  31. package/dist/types/collection/index.d.ts +0 -7
  32. package/dist/types/collection/lemaCollection.d.ts +0 -95
  33. package/dist/types/collection/lemaField.d.ts +0 -55
  34. package/dist/types/collection/lemaSection.d.ts +0 -10
  35. package/dist/types/collection/relation.d.ts +0 -11
  36. package/dist/types/emoji.d.ts +0 -22
  37. package/dist/types/event.d.ts +0 -225
  38. package/dist/types/index.d.ts +0 -14
  39. package/dist/types/levo-query.d.ts +0 -104
  40. package/dist/types/location.d.ts +0 -6
  41. package/dist/types/media.d.ts +0 -56
  42. package/dist/types/membership/index.d.ts +0 -182
  43. package/dist/types/query.d.ts +0 -46
  44. package/dist/types/schema/field.d.ts +0 -56
  45. package/dist/types/schema/index.d.ts +0 -3
  46. package/dist/types/schema/schema.d.ts +0 -58
  47. package/dist/types/utils.d.ts +0 -8
  48. package/dist/types/workspace.d.ts +0 -172
  49. package/dist/utils/LevoError.d.ts +0 -21
  50. package/dist/utils/formatImagePath.d.ts +0 -3
  51. package/dist/utils/getLevoError.d.ts +0 -3
  52. package/dist/utils/getUserProperties.d.ts +0 -8
  53. package/dist/utils/isIncognito.d.ts +0 -9
  54. package/dist/utils/listToX.d.ts +0 -3
  55. package/dist/utils/lock.d.ts +0 -21
@@ -1,64 +0,0 @@
1
- import type { IPost } from "./post";
2
- export * from "./post";
3
- export * from "./author";
4
- export * from "./category";
5
- export * from "./tag";
6
- export interface IBlog {
7
- _id: string;
8
- slug: string;
9
- name: string;
10
- status: string;
11
- description: string;
12
- og_image?: string;
13
- og_title?: string;
14
- og_description?: string;
15
- meta_title?: string;
16
- meta_description?: string;
17
- created_at: string;
18
- updated_at: string;
19
- created_by: string;
20
- updated_by: string;
21
- }
22
- export declare namespace BlogClient {
23
- interface CoverImage {
24
- _id: string;
25
- location: string;
26
- mimetype: string;
27
- kind: string;
28
- external: boolean;
29
- }
30
- interface CategoriesEntity {
31
- _id: string;
32
- slug: string;
33
- name: string;
34
- }
35
- interface AuthorsEntity {
36
- posts?: string[] | null;
37
- _id: string;
38
- public_id: string;
39
- slug: string;
40
- first_name: string;
41
- last_name: string;
42
- email: string;
43
- bio: string;
44
- website: string;
45
- profile_picture?: null | {
46
- location: string;
47
- };
48
- og_image: string;
49
- og_title: string;
50
- og_description: string;
51
- meta_title: string;
52
- meta_description: string;
53
- last_access_at: string;
54
- active_at: string;
55
- created_at: string;
56
- updated_at: string;
57
- }
58
- type BlogData = IPost;
59
- interface OptionParams {
60
- workspace_id: string;
61
- params?: Record<string, string>;
62
- }
63
- }
64
- //# sourceMappingURL=index.d.ts.map
@@ -1,63 +0,0 @@
1
- import type { IMediaObject } from "../media";
2
- type JSONContent = {
3
- type?: string;
4
- attrs?: Record<string, any>;
5
- content?: JSONContent[];
6
- marks?: {
7
- type: string;
8
- attrs?: Record<string, any>;
9
- [key: string]: any;
10
- }[];
11
- text?: string;
12
- [key: string]: any;
13
- };
14
- export interface IContent {
15
- json: JSONContent;
16
- html: string;
17
- nodes?: any[];
18
- }
19
- export interface IPost {
20
- _id: string;
21
- blog: string;
22
- slug: string;
23
- title: string;
24
- summary: string;
25
- content: IContent;
26
- status: string;
27
- cover_image?: IMediaObject;
28
- reading_time: number;
29
- canonical_url: string;
30
- og_image?: IMediaObject | null;
31
- og_title: string;
32
- og_description: string;
33
- meta_title: string;
34
- meta_description: string;
35
- authors?: {
36
- first_name: string;
37
- last_name: string;
38
- slug: string;
39
- bio: string;
40
- profile_picture: {
41
- location: string;
42
- };
43
- }[];
44
- settings: Record<string, any>;
45
- in_review_at?: Date;
46
- approved_at?: Date;
47
- published_at?: string | null;
48
- created_at: string;
49
- updated_at: Date;
50
- deleted_at?: Date;
51
- tags?: {
52
- _id: string;
53
- name: string;
54
- slug: string;
55
- }[];
56
- categories?: {
57
- _id: string;
58
- name: string;
59
- slug: string;
60
- }[];
61
- }
62
- export {};
63
- //# sourceMappingURL=post.d.ts.map
@@ -1,19 +0,0 @@
1
- import type { IPost } from "./post";
2
- export interface IBlogTag {
3
- posts: IPost[];
4
- _id: string;
5
- blog: string;
6
- slug: string;
7
- name: string;
8
- description: string;
9
- og_image?: any;
10
- og_title: string;
11
- og_description: string;
12
- meta_title: string;
13
- meta_description: string;
14
- created_at: Date;
15
- updated_at: Date;
16
- created_by: Date;
17
- updated_by: Date;
18
- }
19
- //# sourceMappingURL=tag.d.ts.map
@@ -1,36 +0,0 @@
1
- import type { ILemaField } from "./lemaField";
2
- export type ICollectionsView = "table" | "kanban" | "calendar";
3
- export interface IGroupBy {
4
- label: string;
5
- value: string;
6
- field: ILemaField;
7
- }
8
- export interface ICollectionLayoutOptions {
9
- groupBy?: IGroupBy | null;
10
- title?: string;
11
- description?: string;
12
- columnsOrder?: string[];
13
- selectedColumns?: string[];
14
- }
15
- export interface ICollectionLayout {
16
- kind: ICollectionsView;
17
- options: ICollectionLayoutOptions;
18
- }
19
- export interface ICollectionQuery {
20
- where: Record<string, any>;
21
- sort?: Record<string, any>;
22
- }
23
- export interface ICollectionView {
24
- id: string;
25
- workspace_id: string;
26
- slug: string;
27
- collection_id: string;
28
- title: string;
29
- description: string;
30
- layout: ICollectionLayout;
31
- query: ICollectionQuery;
32
- options: Record<string, any>;
33
- created_at: string;
34
- updated_at: string;
35
- }
36
- //# sourceMappingURL=collectionView.d.ts.map
@@ -1,9 +0,0 @@
1
- export interface IDraftEntry {
2
- _id: string;
3
- _account: string;
4
- _status: "draft" | "submitted";
5
- [x: string]: any;
6
- created_at: string;
7
- updated_at: string;
8
- }
9
- //# sourceMappingURL=draft.d.ts.map
@@ -1,7 +0,0 @@
1
- export * from "./collectionView";
2
- export * from "./lemaCollection";
3
- export * from "./lemaField";
4
- export * from "./lemaSection";
5
- export * from "./relation";
6
- export * from "./draft";
7
- //# sourceMappingURL=index.d.ts.map
@@ -1,95 +0,0 @@
1
- /**
2
- * Represents an icon object used in collections.
3
- * @see IIcon
4
- */
5
- import type { IIcon } from "../emoji";
6
- import { LevoQuery } from "../levo-query";
7
- import type { ICollectionViews } from "../schema/schema";
8
- import type { ILemaSection } from "./lemaSection";
9
- export interface INotificationData {
10
- id?: string;
11
- kind: string;
12
- subkind: string;
13
- enabled?: boolean;
14
- condition?: LevoQuery.Where;
15
- options: {
16
- to_email: string | string[];
17
- subject?: string;
18
- template_key: string;
19
- from_name: string;
20
- reply_to?: string;
21
- cc_email?: string[];
22
- bcc_email?: string[];
23
- info: {
24
- show_download_button?: boolean;
25
- hide_fields?: string[];
26
- body?: string;
27
- subject?: string;
28
- richtext?: string;
29
- };
30
- };
31
- }
32
- export interface INotificationWithTrigger extends INotificationData {
33
- trigger: "on_submit" | "on_update";
34
- }
35
- /**
36
- * Defines the schema structure for a Levo Collection.
37
- *
38
- * A Levo Collection is a feature of the Levo platform that enables dynamic form rendering using the `@levo-so/react-collection` library.
39
- * This interface describes the schema used to generate forms, including sections, fields, and configuration options.
40
- * The schema is referenced anywhere a Levo Collection is required in the Levo ecosystem.
41
- *
42
- * For more details, see the documentation in external/react-collection/docs/readme.md.
43
- */
44
- export interface ILemaCollection {
45
- /** Unique identifier for the collection schema. */
46
- id: string;
47
- /** Unique key used as URL slug and can be used to fetch the collection schema. */
48
- key: string;
49
- /** Array of sections that define the structure and fields of the form. */
50
- sections: ILemaSection[];
51
- /** Optional array of views for customizing how the collection is presented. */
52
- views?: ICollectionViews[];
53
- /** Optional workspace ID to which this collection belongs. */
54
- workspace_id?: string;
55
- /** Name of the collection schema. */
56
- name: string;
57
- /** Optional description of the collection schema. */
58
- description?: string | null;
59
- /** Optional icon representing the collection. */
60
- icon?: IIcon | null;
61
- /** Optional field name used as the title for items in the collection. */
62
- title_field?: string | null;
63
- /** Optional field name used for email in the collection. */
64
- email_field?: string | null;
65
- /** Optional field name used for mobile in the collection. */
66
- mobile_field?: string | null;
67
- /** Whether the collection is hidden from the UI. */
68
- hidden?: boolean;
69
- /** Whether the collection is read-only. */
70
- readonly?: boolean;
71
- /** Arbitrary settings for the collection schema. */
72
- settings?: Record<string, any>;
73
- /** Optional module name associated with the collection. */
74
- module_name?: string | null;
75
- /** Optional configuration for actions to perform on submit. */
76
- on_submit?: INotificationData[];
77
- /** Optional configuration for actions to perform on update. */
78
- on_update?: INotificationData[];
79
- /** Date or string representing when the collection was created. */
80
- created_at?: Date | string;
81
- /** Date or string representing when the collection was last updated. */
82
- updated_at?: Date | string;
83
- /** Whether the collection allows draft items. */
84
- allow_draft?: boolean;
85
- }
86
- /**
87
- * Represents a value within a collection, with a unique ID and arbitrary properties.
88
- */
89
- export interface ICollectionValue {
90
- /** Unique identifier for the value. */
91
- id: string;
92
- /** Additional arbitrary properties for the value. */
93
- [x: string]: unknown;
94
- }
95
- //# sourceMappingURL=lemaCollection.d.ts.map
@@ -1,55 +0,0 @@
1
- import type { FieldInterfacesList } from "../../constants";
2
- import type { IField } from "../schema/field";
3
- import type { Mandatory } from "../utils";
4
- import type { ILemaCollection } from "./lemaCollection";
5
- import type { ILemaCollectionRelationship, ILemaRelationOnDelete } from "./relation";
6
- /**
7
- * Options for configuring the behavior and appearance of a field in a Levo Collection schema.
8
- */
9
- export interface ILemaFieldOptions {
10
- /** Whether to link the email field with a member profile. */
11
- link_with_member_profile?: boolean;
12
- /** Key of the referenced collection for collection widget. */
13
- collection_key?: string;
14
- /** ID of the referenced collection for collection widget. */
15
- collection_id?: string;
16
- /** Key of the reference field in the related collection. */
17
- reference_field_key?: string;
18
- /** Key of the label field in the related collection. */
19
- label_field_key?: string | null;
20
- /** Whether the current collection has many connected items. */
21
- current_have_many_connected?: boolean;
22
- /** Whether the connected collection has many current items. */
23
- connected_have_many_current?: boolean;
24
- /** Relationship type or object for the collection widget. */
25
- relationship?: ILemaCollectionRelationship | string;
26
- /** Action to take on delete for the relationship. */
27
- on_delete?: ILemaRelationOnDelete;
28
- /** Slug for the field, used in URLs or as a unique identifier. */
29
- slug?: string;
30
- /** Currency code for currency widget. */
31
- currency_code?: string;
32
- disableCountryGuess?: boolean;
33
- /** Location type for location widget. */
34
- location_type?: string;
35
- /** Country for location widget. */
36
- country?: string;
37
- /** Whether to allow custom input in dropdown widget. */
38
- custom_input?: boolean;
39
- /** The referenced collection object for schema editor. */
40
- collection?: ILemaCollection | null;
41
- /** Whether to disable validation for this field. */
42
- disableValidation?: boolean;
43
- }
44
- /**
45
- * Represents a field in a Levo Collection schema, including its configuration and options.
46
- */
47
- export type ILemaField = Mandatory<Omit<IField, "fields" | "options">, "key" | "kind" | "label" | "id"> & {
48
- /** Field interface type, determines the widget/component to render. */
49
- field_interface: (typeof FieldInterfacesList)[number];
50
- /** Nested fields, if this field is a group or composite. */
51
- fields?: ILemaField[];
52
- /** Field options for configuring widget behavior. */
53
- options: ILemaFieldOptions;
54
- };
55
- //# sourceMappingURL=lemaField.d.ts.map
@@ -1,10 +0,0 @@
1
- import type { ISection } from "../schema/schema";
2
- import type { ILemaField } from "./lemaField";
3
- /**
4
- * Represents a section in a Levo Collection schema, grouping related fields together.
5
- */
6
- export interface ILemaSection extends Omit<ISection, "fields"> {
7
- /** Fields contained within this section. */
8
- fields: ILemaField[];
9
- }
10
- //# sourceMappingURL=lemaSection.d.ts.map
@@ -1,11 +0,0 @@
1
- export type ILemaCollectionRelationship = "o2m" | "m2o" | "o2o" | "m2m";
2
- export type ILemaRelationOnDelete = "CASCADE" | "SET_NULL" | "RESTRICT";
3
- export type ILemaRelation = {
4
- relationship: ILemaCollectionRelationship | string;
5
- related_field: string;
6
- related_collection_key: string;
7
- field: string;
8
- collection_key: string;
9
- on_delete?: ILemaRelationOnDelete;
10
- };
11
- //# sourceMappingURL=relation.d.ts.map
@@ -1,22 +0,0 @@
1
- import type { IMediaObject } from "./media";
2
- export interface IEmojiData {
3
- label: string;
4
- tags?: string[];
5
- unicode: string;
6
- }
7
- export interface IIconData {
8
- id: string;
9
- label: string;
10
- tags?: string[];
11
- svgCode: string;
12
- }
13
- export interface IIconCat {
14
- name: string;
15
- slug: string;
16
- emojis: IEmojiData[] | IIconData[];
17
- }
18
- export interface IIcon {
19
- kind: "emoji" | "custom" | "icon";
20
- data: IEmojiData | IMediaObject | IIconData;
21
- }
22
- //# sourceMappingURL=emoji.d.ts.map
@@ -1,225 +0,0 @@
1
- import type { IMediaObject, Mandatory } from "@levo-so/core";
2
- import { IGeocoderLocation } from "./location";
3
- export declare namespace LevoEvent {
4
- interface Root {
5
- _id: string;
6
- cover_image: IMediaObject | null;
7
- contact_email?: string;
8
- title: string;
9
- kind: "virtual" | "in_person";
10
- timing: string;
11
- url: string | null;
12
- location: IGeocoderLocation | null;
13
- is_location_public?: boolean;
14
- is_url_public?: boolean;
15
- starts_at?: string | null;
16
- ends_at?: string | null;
17
- cadence: string;
18
- repeat_every: number;
19
- description: string;
20
- slug: string;
21
- status: "draft" | "canceled" | "published";
22
- accept_registration: boolean;
23
- max_capacity: number;
24
- banners: IMediaObject[];
25
- created_at: Date;
26
- created_by: string;
27
- updated_at: Date;
28
- updated_by: string;
29
- external_ticketing?: string;
30
- ticket_order?: "alphabetical-asc" | "alphabetical-desc" | "price-asc" | "price-desc" | "custom";
31
- series?: {
32
- _id: string;
33
- slug: string;
34
- name: string;
35
- description?: string;
36
- cover_image?: IMediaObject | null;
37
- status?: string;
38
- created_at?: string;
39
- updated_at?: string;
40
- };
41
- }
42
- namespace Ticket {
43
- interface Root {
44
- _id: string;
45
- event: string;
46
- icon: IMediaObject | null;
47
- title: string;
48
- description: string;
49
- quantity: number | null;
50
- starts_at: Date | null;
51
- ends_at: Date | null;
52
- waitlist_enabled: boolean;
53
- requires_approval: boolean;
54
- hidden: boolean;
55
- allow_to_upgrade: boolean;
56
- include_in_upgrade: boolean;
57
- enforce_max_quantity: boolean;
58
- status: string;
59
- offerings: string[];
60
- coupons: string[];
61
- sale_count: number;
62
- currency: string;
63
- unit_amount: number;
64
- base_price: number;
65
- created_at: Date | string;
66
- created_by: string;
67
- updated_at: Date | string;
68
- updated_by: string;
69
- }
70
- type Create = Pick<Root, "title" | "description" | "quantity" | "starts_at" | "ends_at" | "waitlist_enabled" | "hidden" | "enforce_max_quantity" | "offerings" | "coupons">;
71
- }
72
- namespace Coupon {
73
- interface Root {
74
- _id: string;
75
- event: string;
76
- code: string;
77
- kind: string;
78
- percent_off: number | null;
79
- amount_off: number | null;
80
- currency: string;
81
- starts_at: Date | null;
82
- expires_at: Date | null;
83
- max_redemptions: number | null;
84
- minimum_amount: number | null;
85
- is_public: boolean;
86
- created_at: Date;
87
- created_by: string;
88
- updated_at: Date;
89
- updated_by: string;
90
- status: string;
91
- tickets: string[];
92
- }
93
- type Create = Pick<Root, "code" | "kind" | "percent_off" | "amount_off" | "currency" | "starts_at" | "expires_at" | "max_redemptions" | "minimum_amount" | "is_public" | "tickets">;
94
- type CreateBulk = Pick<Root, "kind" | "percent_off" | "amount_off" | "currency" | "starts_at" | "expires_at" | "max_redemptions" | "minimum_amount" | "is_public" | "tickets"> & {
95
- coupon_count: number;
96
- code_length: number;
97
- };
98
- type Update = Partial<Pick<Root, "code" | "kind" | "percent_off" | "amount_off" | "currency" | "starts_at" | "expires_at" | "max_redemptions" | "minimum_amount" | "is_public" | "tickets">>;
99
- type Validate = {
100
- base_amount: number;
101
- sale_amount: number;
102
- discountable_amount: number;
103
- discount: number;
104
- };
105
- }
106
- namespace Offering {
107
- interface Root {
108
- _id: string;
109
- event: string;
110
- title: string;
111
- description: string;
112
- enabled: boolean;
113
- checkin_count: number;
114
- tickets: string[];
115
- attendees: string[];
116
- created_at: Date;
117
- created_by: string;
118
- updated_at: Date;
119
- updated_by: string;
120
- }
121
- type Create = Pick<Root, "title" | "description" | "enabled" | "tickets">;
122
- type Update = Partial<Pick<Root, "title" | "description" | "enabled" | "tickets">>;
123
- }
124
- namespace Attendee {
125
- interface Root {
126
- _id: string;
127
- public_id: string;
128
- name: string;
129
- email: string;
130
- mobile: string | null;
131
- event: string;
132
- booking: Booking.Root;
133
- ticket: Pick<LevoEvent.Ticket.Root, "_id" | "title" | "currency" | "quantity" | "status" | "unit_amount">;
134
- price: string;
135
- account: string | null;
136
- status: string;
137
- created_at: Date;
138
- updated_at: Date;
139
- }
140
- }
141
- namespace Booking {
142
- interface Root {
143
- _id: string;
144
- slug: string;
145
- public_id: string;
146
- quantity: number;
147
- unit_amount: number;
148
- discount: number;
149
- currency: string;
150
- payment_link: string | null;
151
- account: string | null;
152
- event: string;
153
- coupon: string | null;
154
- code: string | null;
155
- status: string;
156
- paid: boolean;
157
- info: Record<string, any>;
158
- qr_image: IMediaObject & {
159
- width: number;
160
- height: number;
161
- };
162
- created_at: Date;
163
- updated_at: Date;
164
- attendees: LevoEvent.Attendee.Root[];
165
- }
166
- type Create = Omit<Pick<Root, "event" | "coupon">, "attendees"> & {
167
- attendees: Mandatory<LevoEvent.Attendee.Root, "name" | "ticket" | "email">;
168
- };
169
- }
170
- namespace Series {
171
- interface Root {
172
- _id: string;
173
- slug: string;
174
- name: string;
175
- description: string;
176
- cover_image: string | null;
177
- status: "published" | string;
178
- created_at: string;
179
- updated_at: string;
180
- events: any[];
181
- }
182
- interface Create {
183
- name: string;
184
- }
185
- interface Update {
186
- name: string;
187
- }
188
- }
189
- }
190
- /**
191
- * Main Object
192
- */
193
- export interface IAttendee {
194
- checkin_at?: Date | null;
195
- _id: string;
196
- public_id: string;
197
- name: string;
198
- email: string;
199
- mobile: string | null;
200
- event: string;
201
- booking: string;
202
- ticket: Record<string, string>;
203
- price: string;
204
- account?: any;
205
- status: string;
206
- created_at: string;
207
- updated_at: string;
208
- }
209
- export interface IBooking {
210
- _id: string;
211
- public_id: string;
212
- quantity: number;
213
- unit_amount: number;
214
- event: string;
215
- currency: string;
216
- account: string;
217
- coupon?: null;
218
- status: string;
219
- paid: boolean;
220
- discount: number;
221
- created_at: string;
222
- updated_at: string;
223
- attendees?: IAttendee[];
224
- }
225
- //# sourceMappingURL=event.d.ts.map
@@ -1,14 +0,0 @@
1
- export * from "./blog";
2
- export * from "./collection";
3
- export * from "./membership";
4
- export * from "./schema";
5
- export * from "./audience";
6
- export * from "./emoji";
7
- export * from "./levo-query";
8
- export * from "./media";
9
- export * from "./query";
10
- export * from "./utils";
11
- export * from "./workspace";
12
- export * from "./event";
13
- export * from "./location";
14
- //# sourceMappingURL=index.d.ts.map