@levo-so/core 0.1.49 → 0.1.52

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 (69) hide show
  1. package/dist/client.d.ts +26 -26
  2. package/dist/constants/index.d.ts +1 -0
  3. package/dist/constants/integration.d.ts +25 -0
  4. package/dist/index.js +179 -96
  5. package/dist/modules/blog.d.ts +2 -2
  6. package/dist/modules/collection.d.ts +6 -6
  7. package/dist/modules/membership.d.ts +4 -4
  8. package/dist/types/blog/index.d.ts +0 -7
  9. package/dist/types/collection/lemaCollection.d.ts +38 -5
  10. package/dist/types/collection/lemaField.d.ts +27 -3
  11. package/dist/types/collection/lemaSection.d.ts +4 -0
  12. package/dist/types/emoji.d.ts +2 -1
  13. package/dist/types/event.d.ts +211 -0
  14. package/dist/types/index.d.ts +3 -0
  15. package/dist/types/location.d.ts +6 -0
  16. package/dist/types/membership/index.d.ts +2 -17
  17. package/dist/types/query.d.ts +15 -11
  18. package/dist/types/schema/field.d.ts +29 -1
  19. package/dist/types/schema/schema.d.ts +29 -0
  20. package/dist/types/workspace.d.ts +138 -0
  21. package/dist/utils/LevoError.d.ts +16 -18
  22. package/dist/utils/getLevoError.d.ts +0 -1
  23. package/package.json +12 -39
  24. package/dist/constants/collection/defaultByKind.d.ts.map +0 -1
  25. package/dist/constants/collection/fieldInterfaceFormat.d.ts.map +0 -1
  26. package/dist/constants/collection/fieldInterfaces.d.ts.map +0 -1
  27. package/dist/constants/collection/fieldKind.d.ts.map +0 -1
  28. package/dist/constants/index.d.ts.map +0 -1
  29. package/dist/constants/media.d.ts.map +0 -1
  30. package/dist/constants/oauthProvider.d.ts.map +0 -1
  31. package/dist/control/audience.d.ts.map +0 -1
  32. package/dist/control/index.d.ts.map +0 -1
  33. package/dist/logger/batch.d.ts.map +0 -1
  34. package/dist/logger/index.d.ts.map +0 -1
  35. package/dist/modules/blog.d.ts.map +0 -1
  36. package/dist/modules/collection.d.ts.map +0 -1
  37. package/dist/modules/media.d.ts.map +0 -1
  38. package/dist/modules/membership.d.ts.map +0 -1
  39. package/dist/types/audience.d.ts.map +0 -1
  40. package/dist/types/blog/author.d.ts.map +0 -1
  41. package/dist/types/blog/blogClient.d.ts.map +0 -1
  42. package/dist/types/blog/category.d.ts.map +0 -1
  43. package/dist/types/blog/index.d.ts.map +0 -1
  44. package/dist/types/blog/post.d.ts.map +0 -1
  45. package/dist/types/blog/tag.d.ts.map +0 -1
  46. package/dist/types/collection/collectionView.d.ts.map +0 -1
  47. package/dist/types/collection/draft.d.ts.map +0 -1
  48. package/dist/types/collection/index.d.ts.map +0 -1
  49. package/dist/types/collection/lemaCollection.d.ts.map +0 -1
  50. package/dist/types/collection/lemaField.d.ts.map +0 -1
  51. package/dist/types/collection/lemaSection.d.ts.map +0 -1
  52. package/dist/types/collection/relation.d.ts.map +0 -1
  53. package/dist/types/emoji.d.ts.map +0 -1
  54. package/dist/types/index.d.ts.map +0 -1
  55. package/dist/types/levo-query.d.ts.map +0 -1
  56. package/dist/types/media.d.ts.map +0 -1
  57. package/dist/types/membership/index.d.ts.map +0 -1
  58. package/dist/types/query.d.ts.map +0 -1
  59. package/dist/types/schema/field.d.ts.map +0 -1
  60. package/dist/types/schema/index.d.ts.map +0 -1
  61. package/dist/types/schema/schema.d.ts.map +0 -1
  62. package/dist/types/utils.d.ts.map +0 -1
  63. package/dist/utils/LevoError.d.ts.map +0 -1
  64. package/dist/utils/formatImagePath.d.ts.map +0 -1
  65. package/dist/utils/getLevoError.d.ts.map +0 -1
  66. package/dist/utils/getUserProperties.d.ts.map +0 -1
  67. package/dist/utils/isIncognito.d.ts.map +0 -1
  68. package/dist/utils/listToX.d.ts.map +0 -1
  69. package/dist/utils/lock.d.ts.map +0 -1
@@ -55,13 +55,6 @@ export declare namespace BlogClient {
55
55
  created_at: string;
56
56
  updated_at: string;
57
57
  }
58
- interface IBlogResponse {
59
- meta: {
60
- pages: number;
61
- filter_count: number;
62
- };
63
- data: IPost[];
64
- }
65
58
  type BlogData = IPost;
66
59
  interface OptionParams {
67
60
  workspace_id: string;
@@ -1,33 +1,66 @@
1
+ /**
2
+ * Represents an icon object used in collections.
3
+ * @see IIcon
4
+ */
1
5
  import type { IIcon } from "../emoji";
2
6
  import type { ICollectionViews } from "../schema/schema";
3
7
  import type { ILemaSection } from "./lemaSection";
8
+ /**
9
+ * Defines the schema structure for a Levo Collection.
10
+ *
11
+ * A Levo Collection is a feature of the Levo platform that enables dynamic form rendering using the `@levo-so/react-collection` library.
12
+ * This interface describes the schema used to generate forms, including sections, fields, and configuration options.
13
+ * The schema is referenced anywhere a Levo Collection is required in the Levo ecosystem.
14
+ *
15
+ * For more details, see the documentation in external/react-collection/docs/readme.md.
16
+ */
4
17
  export interface ILemaCollection {
18
+ /** Unique identifier for the collection schema. */
5
19
  id: string;
20
+ /** Unique key used as URL slug and can be used to fetch the collection schema. */
6
21
  key: string;
22
+ /** Array of sections that define the structure and fields of the form. */
7
23
  sections: ILemaSection[];
24
+ /** Optional array of views for customizing how the collection is presented. */
8
25
  views?: ICollectionViews[];
26
+ /** Optional workspace ID to which this collection belongs. */
9
27
  workspace_id?: string;
28
+ /** Name of the collection schema. */
10
29
  name: string;
30
+ /** Optional description of the collection schema. */
11
31
  description?: string | null;
32
+ /** Optional icon representing the collection. */
12
33
  icon?: IIcon | null;
34
+ /** Optional field name used as the title for items in the collection. */
13
35
  title_field?: string | null;
36
+ /** Optional field name used for email in the collection. */
37
+ email_field?: string | null;
38
+ /** Whether the collection is hidden from the UI. */
14
39
  hidden?: boolean;
40
+ /** Whether the collection is read-only. */
15
41
  readonly?: boolean;
42
+ /** Arbitrary settings for the collection schema. */
16
43
  settings?: Record<string, any>;
44
+ /** Optional module name associated with the collection. */
17
45
  module_name?: string | null;
46
+ /** Optional configuration for actions to perform on submit. */
18
47
  on_submit?: Record<string, any>;
48
+ /** Optional configuration for actions to perform on update. */
19
49
  on_update?: Record<string, any>;
50
+ /** Date or string representing when the collection was created. */
20
51
  created_at?: Date | string;
52
+ /** Date or string representing when the collection was last updated. */
21
53
  updated_at?: Date | string;
54
+ /** Whether the collection allows draft items. */
22
55
  allow_draft?: boolean;
23
56
  }
24
- export interface ILemaIndex {
25
- name: string;
26
- columns: string[];
27
- kind: "FULLTEXT" | "UNIQUE";
28
- }
57
+ /**
58
+ * Represents a value within a collection, with a unique ID and arbitrary properties.
59
+ */
29
60
  export interface ICollectionValue {
61
+ /** Unique identifier for the value. */
30
62
  id: string;
63
+ /** Additional arbitrary properties for the value. */
31
64
  [x: string]: unknown;
32
65
  }
33
66
  //# sourceMappingURL=lemaCollection.d.ts.map
@@ -3,29 +3,53 @@ import type { IField } from "../schema/field";
3
3
  import type { Mandatory } from "../utils";
4
4
  import type { ILemaCollection } from "./lemaCollection";
5
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
+ */
6
9
  export interface ILemaFieldOptions {
10
+ /** Whether to link the email field with a member profile. */
7
11
  link_with_member_profile?: boolean;
12
+ /** Key of the referenced collection for collection widget. */
8
13
  collection_key?: string;
14
+ /** ID of the referenced collection for collection widget. */
9
15
  collection_id?: string;
16
+ /** Key of the reference field in the related collection. */
10
17
  reference_field_key?: string;
18
+ /** Key of the label field in the related collection. */
11
19
  label_field_key?: string | null;
20
+ /** Whether the current collection has many connected items. */
12
21
  current_have_many_connected?: boolean;
22
+ /** Whether the connected collection has many current items. */
13
23
  connected_have_many_current?: boolean;
24
+ /** Relationship type or object for the collection widget. */
14
25
  relationship?: ILemaCollectionRelationship | string;
26
+ /** Action to take on delete for the relationship. */
15
27
  on_delete?: ILemaRelationOnDelete;
16
- /**
17
- * Slug Options
18
- */
28
+ /** Slug for the field, used in URLs or as a unique identifier. */
19
29
  slug?: string;
30
+ /** Currency code for currency widget. */
20
31
  currency_code?: string;
32
+ disableCountryGuess?: boolean;
33
+ /** Location type for location widget. */
21
34
  location_type?: string;
35
+ /** Country for location widget. */
36
+ country?: string;
37
+ /** Whether to allow custom input in dropdown widget. */
22
38
  custom_input?: boolean;
39
+ /** The referenced collection object for schema editor. */
23
40
  collection?: ILemaCollection | null;
41
+ /** Whether to disable validation for this field. */
24
42
  disableValidation?: boolean;
25
43
  }
44
+ /**
45
+ * Represents a field in a Levo Collection schema, including its configuration and options.
46
+ */
26
47
  export type ILemaField = Mandatory<Omit<IField, "fields" | "options">, "key" | "kind" | "label" | "id"> & {
48
+ /** Field interface type, determines the widget/component to render. */
27
49
  field_interface: (typeof FieldInterfacesList)[number];
50
+ /** Nested fields, if this field is a group or composite. */
28
51
  fields?: ILemaField[];
52
+ /** Field options for configuring widget behavior. */
29
53
  options: ILemaFieldOptions;
30
54
  };
31
55
  //# sourceMappingURL=lemaField.d.ts.map
@@ -1,6 +1,10 @@
1
1
  import type { ISection } from "../schema/schema";
2
2
  import type { ILemaField } from "./lemaField";
3
+ /**
4
+ * Represents a section in a Levo Collection schema, grouping related fields together.
5
+ */
3
6
  export interface ILemaSection extends Omit<ISection, "fields"> {
7
+ /** Fields contained within this section. */
4
8
  fields: ILemaField[];
5
9
  }
6
10
  //# sourceMappingURL=lemaSection.d.ts.map
@@ -5,9 +5,10 @@ export interface IEmojiData {
5
5
  unicode: string;
6
6
  }
7
7
  export interface IIconData {
8
+ id: string;
8
9
  label: string;
9
10
  tags?: string[];
10
- componentName: string;
11
+ svgCode: string;
11
12
  }
12
13
  export interface IIconCat {
13
14
  name: string;
@@ -0,0 +1,211 @@
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
+ starts_at?: string | null;
14
+ ends_at?: string | null;
15
+ cadence: string;
16
+ repeat_every: number;
17
+ description: string;
18
+ slug: string;
19
+ status: "draft" | "canceled" | "published";
20
+ accept_registration: boolean;
21
+ max_capacity: number;
22
+ banners: IMediaObject[];
23
+ created_at: Date;
24
+ created_by: string;
25
+ updated_at: Date;
26
+ updated_by: string;
27
+ external_ticketing?: string;
28
+ }
29
+ namespace Ticket {
30
+ interface Root {
31
+ _id: string;
32
+ event: string;
33
+ icon: IMediaObject | null;
34
+ title: string;
35
+ description: string;
36
+ quantity: number | null;
37
+ starts_at: Date | null;
38
+ ends_at: Date | null;
39
+ waitlist_enabled: boolean;
40
+ requires_approval: boolean;
41
+ hidden: boolean;
42
+ allow_to_upgrade: boolean;
43
+ include_in_upgrade: boolean;
44
+ enforce_max_quantity: boolean;
45
+ status: string;
46
+ offerings: string[];
47
+ coupons: string[];
48
+ sale_count: number;
49
+ currency: string;
50
+ unit_amount: number;
51
+ base_price: number;
52
+ created_at: Date | string;
53
+ created_by: string;
54
+ updated_at: Date | string;
55
+ updated_by: string;
56
+ }
57
+ type Create = Pick<Root, "title" | "description" | "quantity" | "starts_at" | "ends_at" | "waitlist_enabled" | "hidden" | "enforce_max_quantity" | "offerings" | "coupons">;
58
+ }
59
+ namespace Coupon {
60
+ interface Root {
61
+ _id: string;
62
+ event: string;
63
+ code: string;
64
+ kind: string;
65
+ percent_off: number | null;
66
+ amount_off: number | null;
67
+ currency: string;
68
+ starts_at: Date | null;
69
+ expires_at: Date | null;
70
+ max_redemptions: number | null;
71
+ minimum_amount: number | null;
72
+ created_at: Date;
73
+ created_by: string;
74
+ updated_at: Date;
75
+ updated_by: string;
76
+ status: string;
77
+ tickets: string[];
78
+ }
79
+ type Create = Pick<Root, "code" | "kind" | "percent_off" | "amount_off" | "currency" | "starts_at" | "expires_at" | "max_redemptions" | "minimum_amount" | "tickets">;
80
+ type CreateBulk = Pick<Root, "kind" | "percent_off" | "amount_off" | "currency" | "starts_at" | "expires_at" | "max_redemptions" | "minimum_amount" | "tickets"> & {
81
+ coupon_count: number;
82
+ code_length: number;
83
+ };
84
+ type Update = Partial<Pick<Root, "code" | "kind" | "percent_off" | "amount_off" | "currency" | "starts_at" | "expires_at" | "max_redemptions" | "minimum_amount" | "tickets">>;
85
+ type Validate = {
86
+ base_amount: number;
87
+ sale_amount: number;
88
+ discountable_amount: number;
89
+ discount: number;
90
+ };
91
+ }
92
+ namespace Offering {
93
+ interface Root {
94
+ _id: string;
95
+ event: string;
96
+ title: string;
97
+ description: string;
98
+ enabled: boolean;
99
+ checkin_count: number;
100
+ tickets: string[];
101
+ attendees: string[];
102
+ created_at: Date;
103
+ created_by: string;
104
+ updated_at: Date;
105
+ updated_by: string;
106
+ }
107
+ type Create = Pick<Root, "title" | "description" | "enabled" | "tickets">;
108
+ type Update = Partial<Pick<Root, "title" | "description" | "enabled" | "tickets">>;
109
+ }
110
+ namespace Attendee {
111
+ interface Root {
112
+ _id: string;
113
+ public_id: string;
114
+ name: string;
115
+ email: string;
116
+ mobile: string | null;
117
+ event: string;
118
+ booking: Booking.Root;
119
+ ticket: Pick<LevoEvent.Ticket.Root, "_id" | "title" | "currency" | "quantity" | "status" | "unit_amount">;
120
+ price: string;
121
+ account: string | null;
122
+ status: string;
123
+ created_at: Date;
124
+ updated_at: Date;
125
+ }
126
+ }
127
+ namespace Booking {
128
+ interface Root {
129
+ _id: string;
130
+ slug: string;
131
+ public_id: string;
132
+ quantity: number;
133
+ unit_amount: number;
134
+ discount: number;
135
+ currency: string;
136
+ payment_link: string | null;
137
+ account: string | null;
138
+ event: string;
139
+ coupon: string | null;
140
+ code: string | null;
141
+ status: string;
142
+ paid: boolean;
143
+ info: Record<string, any>;
144
+ qr_image: IMediaObject & {
145
+ width: number;
146
+ height: number;
147
+ };
148
+ created_at: Date;
149
+ updated_at: Date;
150
+ attendees: LevoEvent.Attendee.Root[];
151
+ }
152
+ type Create = Omit<Pick<Root, "event" | "coupon">, "attendees"> & {
153
+ attendees: Mandatory<LevoEvent.Attendee.Root, "name" | "ticket" | "email">;
154
+ };
155
+ }
156
+ namespace Series {
157
+ interface Root {
158
+ _id: string;
159
+ slug: string;
160
+ name: string;
161
+ description: string;
162
+ cover_image: string | null;
163
+ status: "published" | string;
164
+ created_at: string;
165
+ updated_at: string;
166
+ events: any[];
167
+ }
168
+ interface Create {
169
+ name: string;
170
+ }
171
+ interface Update {
172
+ name: string;
173
+ }
174
+ }
175
+ }
176
+ /**
177
+ * Main Object
178
+ */
179
+ export interface IAttendee {
180
+ checkin_at?: Date | null;
181
+ _id: string;
182
+ public_id: string;
183
+ name: string;
184
+ email: string;
185
+ mobile: string | null;
186
+ event: string;
187
+ booking: string;
188
+ ticket: Record<string, string>;
189
+ price: string;
190
+ account?: any;
191
+ status: string;
192
+ created_at: string;
193
+ updated_at: string;
194
+ }
195
+ export interface IBooking {
196
+ _id: string;
197
+ public_id: string;
198
+ quantity: number;
199
+ unit_amount: number;
200
+ event: string;
201
+ currency: string;
202
+ account: string;
203
+ coupon?: null;
204
+ status: string;
205
+ paid: boolean;
206
+ discount: number;
207
+ created_at: string;
208
+ updated_at: string;
209
+ attendees?: IAttendee[];
210
+ }
211
+ //# sourceMappingURL=event.d.ts.map
@@ -8,4 +8,7 @@ export * from "./levo-query";
8
8
  export * from "./media";
9
9
  export * from "./query";
10
10
  export * from "./utils";
11
+ export * from "./workspace";
12
+ export * from "./event";
13
+ export * from "./location";
11
14
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,6 @@
1
+ export interface IGeocoderLocation extends Partial<google.maps.places.PlaceResult> {
2
+ place_name: string;
3
+ latitude?: number;
4
+ longitude?: number;
5
+ }
6
+ //# sourceMappingURL=location.d.ts.map
@@ -1,7 +1,5 @@
1
1
  import type { LevoOAuthProviderList } from "../../constants/oauthProvider";
2
- import type { ILevoError } from "../../utils/LevoError";
3
2
  import type { IMediaObject } from "../media";
4
- import type { IResponseSingle } from "../query";
5
3
  export declare namespace ILevoMembership {
6
4
  interface sub_account_oauth_credentials {
7
5
  provider: string;
@@ -20,6 +18,8 @@ export declare namespace ILevoMembership {
20
18
  display_email: string;
21
19
  reducted_email: string;
22
20
  email_verified: boolean;
21
+ email_verified_at: string | null;
22
+ verified_at: string | null;
23
23
  mobile: string | null;
24
24
  reducted_mobile: string | null;
25
25
  mobile_verified: boolean;
@@ -175,21 +175,6 @@ export declare namespace ILevoMembership {
175
175
  password: string;
176
176
  };
177
177
  }
178
- export namespace Response {
179
- type Error = {
180
- status: false;
181
- content: ILevoError;
182
- };
183
- type ListOAuthURLs = IResponseSingle<ILevoMembership.OAuthURLList>;
184
- type SignOut = IResponseSingle<ILevoMembership.Account>;
185
- type GetMe = IResponseSingle<ILevoMembership.Account>;
186
- type RequestOtp = IResponseSingle<Pick<ILevoMembership.Otp, "_id" | "content">>;
187
- type RequestMagicLink = IResponseSingle<Pick<ILevoMembership.Otp, "_id" | "content">>;
188
- type SignInWithOtp = IResponseSingle<ILevoMembership.Account>;
189
- type SignInWithPassword = IResponseSingle<ILevoMembership.Account>;
190
- type SignUpWithPassword = IResponseSingle<ILevoMembership.Account>;
191
- type UpdateMe = IResponseSingle<ILevoMembership.Account>;
192
- }
193
178
  export {};
194
179
  }
195
180
  //# sourceMappingURL=index.d.ts.map
@@ -22,18 +22,22 @@ export interface IResponseMyCategory<T = Record<string, unknown>> {
22
22
  data: T[];
23
23
  };
24
24
  }
25
- export type IResponseError<T = Record<string, unknown>> = {
25
+ export interface IFieldError {
26
+ param: string;
27
+ message: string;
28
+ }
29
+ export interface IErrorContent {
30
+ status: number;
31
+ code: string;
32
+ title: string;
33
+ description: string;
34
+ type?: string;
35
+ errors?: IFieldError[];
36
+ }
37
+ export interface IResponseError {
26
38
  status: false;
27
- errors?: T[];
28
- content?: {
29
- status: number;
30
- code: string;
31
- title: string;
32
- description: string;
33
- type: string;
34
- "request-id": string;
35
- } & T;
36
- };
39
+ content: IErrorContent;
40
+ }
37
41
  export type IFilter = Record<string, unknown>;
38
42
  export type IErrorParams = {
39
43
  message: string;
@@ -1,28 +1,56 @@
1
1
  import type { FieldInterfacesList, FieldKindList } from "../../constants";
2
+ /**
3
+ * 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.
4
+ */
2
5
  export interface IField {
6
+ /** Unique identifier for the field. */
3
7
  id: string;
8
+ /** Unique key for the field, used for referencing. */
4
9
  key: string;
10
+ /** The kind/type of the field (e.g., text, number, date). */
5
11
  kind: (typeof FieldKindList)[number];
6
- field_interface: (typeof FieldInterfacesList)[number] | "HeadingWidget" | "ButtonWidget" | "ImageWidget" | "MultiImageWidget" | "TypographyWidget" | "LayoutWidget" | "RepeatableWidget" | "TitleWidget" | "CardWidget" | "LinkWidget";
12
+ /** The widget/component type used to render this field. */
13
+ field_interface: (typeof FieldInterfacesList)[number] | "HeadingWidget" | "ButtonWidget" | "ImageWidget" | "MultiImageWidget" | "TypographyWidget" | "LayoutWidget" | "RepeatableWidget" | "TitleWidget" | "CardWidget" | "LinkWidget" | "IframeWidget";
14
+ /** Label for the field, displayed in the UI. */
7
15
  label: string;
16
+ /** Helper text shown below the field. */
8
17
  helper_text?: string;
18
+ /** Placeholder text for the field input. */
9
19
  placeholder?: string;
20
+ /** Default value for the field. */
10
21
  default_value?: any;
22
+ /** Whether the field is read-only. */
11
23
  readonly?: boolean;
24
+ /** Nested fields, if this field is a group or composite. */
12
25
  fields?: IField[];
26
+ /** Additional options for configuring the field. */
13
27
  options?: Record<string, any>;
28
+ /** Whether the field is hidden from the UI. */
14
29
  hidden?: boolean;
30
+ /** Whether the field is editable. */
15
31
  editable?: boolean;
32
+ /** Whether the field is required. */
16
33
  required?: boolean;
34
+ /** Whether the field value must be unique. */
17
35
  unique?: boolean;
36
+ /** Minimum value or length for the field. */
18
37
  min?: string | number | null;
38
+ /** Maximum value or length for the field. */
19
39
  max?: string | number | null;
40
+ /** Allowed formats for the field value. */
20
41
  formats?: string[];
42
+ /** Allowed values for the field (for select/dropdown fields). */
21
43
  values?: any[];
44
+ /** */
22
45
  created_at?: string;
46
+ /** */
23
47
  updated_at?: string;
24
48
  }
49
+ /**
50
+ * 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.
51
+ */
25
52
  export interface IFieldUpdate extends Omit<IField, "fields"> {
53
+ /** Nested fields to update, provided as partials. */
26
54
  fields: Partial<IField>[];
27
55
  }
28
56
  //# sourceMappingURL=field.d.ts.map
@@ -1,29 +1,58 @@
1
1
  import type { IIcon } from "../emoji";
2
2
  import type { IField } from "./field";
3
+ /**
4
+ * 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.
5
+ */
3
6
  export interface ISchema {
7
+ /** Unique identifier for the schema. */
4
8
  id: string;
9
+ /** Name of the schema. */
5
10
  name: string;
11
+ /** Description of the schema. */
6
12
  description: string;
13
+ /** Unique key for referencing the schema. */
7
14
  key: string;
15
+ /** Sections that make up the schema, each containing fields. */
8
16
  sections: ISection[];
17
+ /** Field key used as the title for items in the schema. */
9
18
  title_field: string;
19
+ /** */
10
20
  cover_image_field?: string;
21
+ /** Icon representing the schema. */
11
22
  icon: null | IIcon;
23
+ /** */
12
24
  created_at?: string;
25
+ /** */
13
26
  module_name?: string;
27
+ /** Views for customizing how the schema is presented. */
14
28
  views?: ICollectionViews[];
15
29
  }
30
+ /**
31
+ * 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.
32
+ */
16
33
  export interface ICollectionViews {
34
+ /** Unique identifier for the view. */
17
35
  id: string;
36
+ /** Slug for the view, used in URLs. */
18
37
  slug: string;
38
+ /** Title of the view. */
19
39
  title: string;
20
40
  }
41
+ /**
42
+ * 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.
43
+ */
21
44
  export interface ISection {
45
+ /** Unique identifier for the section. */
22
46
  id: string;
47
+ /** Label for the section, displayed in the UI. */
23
48
  label: string;
49
+ /** Unique key for referencing the section. */
24
50
  key: string;
51
+ /** Helper text for the section. */
25
52
  helper_text: string;
53
+ /** Whether the section is hidden from the UI. */
26
54
  hidden: boolean;
55
+ /** Fields contained within this section. */
27
56
  fields: IField[];
28
57
  }
29
58
  //# sourceMappingURL=schema.d.ts.map