@levo-so/core 0.1.50 → 0.1.54

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/client.d.ts CHANGED
@@ -18,52 +18,52 @@ export declare const createLevoClient: (options: ILevoClientOptions) => {
18
18
  current_tab: string;
19
19
  all_tabs: string;
20
20
  };
21
- initiate: (properties: import("./types").ILevoAudience.Properties) => Promise<any>;
21
+ initiate: (properties: import(".").ILevoAudience.Properties) => Promise<any>;
22
22
  identify: (options?: {
23
23
  withLock?: boolean;
24
24
  }) => Promise<void>;
25
- track: <T extends import("./types").ILevoAudience.Properties>(event: import("./types").AnalyticsEventType, properties: T & import("./types").ILevoAudience.Properties) => Promise<any>;
26
- bounce: (properties: import("./types").ILevoAudience.Properties) => Promise<void>;
25
+ track: <T extends import(".").ILevoAudience.Properties>(event: import(".").AnalyticsEventType, properties: T & import(".").ILevoAudience.Properties) => Promise<any>;
26
+ bounce: (properties: import(".").ILevoAudience.Properties) => Promise<void>;
27
27
  };
28
28
  readonly blog: {
29
- getAllBlogs: (blog_key: string, data?: import("./types").LevoQuery.FindQuery, options?: import("./types").BlogClient.OptionParams) => Promise<import("./types").IResponseMultiple<import("./types").BlogClient.BlogData>>;
30
- getSingleBlog: (blog_key: string, slug: string, options?: import("./types").BlogClient.OptionParams) => Promise<import("./types").IResponseSingle<import("./types").BlogClient.BlogData>>;
29
+ getAllBlogs: (blog_key: string, data?: import(".").LevoQuery.FindQuery, options?: import(".").BlogClient.OptionParams) => Promise<import(".").IResponseMultiple<import(".").BlogClient.BlogData>>;
30
+ getSingleBlog: (blog_key: string, slug: string, options?: import(".").BlogClient.OptionParams) => Promise<import(".").IResponseSingle<import(".").BlogClient.BlogData>>;
31
31
  };
32
32
  readonly membership: {
33
- getOAuthURL: (options?: import("wretch").WretchOptions) => Promise<import("./types").ILevoMembership.OAuthURLList>;
33
+ getOAuthURL: (options?: import("wretch").WretchOptions) => Promise<import(".").ILevoMembership.OAuthURLList>;
34
34
  signOut: <T = {
35
35
  status: boolean;
36
36
  }>(options?: import("wretch").WretchOptions) => Promise<T>;
37
- getMe: <T = import("./types").ILevoMembership.Account>(options?: import("wretch").WretchOptions) => Promise<T>;
38
- updateMe: <T = import("./types").ILevoMembership.Account>(data: import("./types").ILevoMembership.Request.UpdateMe, options?: import("wretch").WretchOptions) => Promise<T>;
39
- createPassword: <T = import("./types").ILevoMembership.Account>(data: import("./types").ILevoMembership.Request.CreatePassword, options?: import("wretch").WretchOptions) => Promise<T>;
40
- isLoggedIn: <T = import("./types").ILevoMembership.Account>(options?: import("wretch").WretchOptions) => Promise<T | null>;
41
- requestMagicLink: (data: import("./types").ILevoMembership.Request.RequestMagicLink, options?: import("wretch").WretchOptions) => Promise<Pick<import("./types").ILevoMembership.Otp, "_id" | "content">>;
42
- requestOtp: (data: import("./types").ILevoMembership.Request.RequestOtp, options?: import("wretch").WretchOptions) => Promise<Pick<import("./types").ILevoMembership.Otp, "_id" | "content">>;
43
- signInWithOtp: <T = import("./types").ILevoMembership.Account>(data: import("./types").ILevoMembership.Request.SignInWithOtp, options?: import("wretch").WretchOptions) => Promise<T>;
44
- signInWithPassword: <T = import("./types").ILevoMembership.Account>(data: import("./types").ILevoMembership.Request.SignInWithPassword, options?: import("wretch").WretchOptions) => Promise<T>;
45
- signUpWithPassword: <T = import("./types").ILevoMembership.Account>(data: import("./types").ILevoMembership.Request.SignUpWithPassword, options?: import("wretch").WretchOptions) => Promise<T>;
37
+ getMe: <T = import(".").ILevoMembership.Account>(options?: import("wretch").WretchOptions) => Promise<T>;
38
+ updateMe: <T = import(".").ILevoMembership.Account>(data: import(".").ILevoMembership.Request.UpdateMe, options?: import("wretch").WretchOptions) => Promise<T>;
39
+ createPassword: <T = import(".").ILevoMembership.Account>(data: import(".").ILevoMembership.Request.CreatePassword, options?: import("wretch").WretchOptions) => Promise<T>;
40
+ isLoggedIn: <T = import(".").ILevoMembership.Account>(options?: import("wretch").WretchOptions) => Promise<T | null>;
41
+ requestMagicLink: (data: import(".").ILevoMembership.Request.RequestMagicLink, options?: import("wretch").WretchOptions) => Promise<Pick<import(".").ILevoMembership.Otp, "_id" | "content">>;
42
+ requestOtp: (data: import(".").ILevoMembership.Request.RequestOtp, options?: import("wretch").WretchOptions) => Promise<Pick<import(".").ILevoMembership.Otp, "_id" | "content">>;
43
+ signInWithOtp: <T = import(".").ILevoMembership.Account>(data: import(".").ILevoMembership.Request.SignInWithOtp, options?: import("wretch").WretchOptions) => Promise<T>;
44
+ signInWithPassword: <T = import(".").ILevoMembership.Account>(data: import(".").ILevoMembership.Request.SignInWithPassword, options?: import("wretch").WretchOptions) => Promise<T>;
45
+ signUpWithPassword: <T = import(".").ILevoMembership.Account>(data: import(".").ILevoMembership.Request.SignUpWithPassword, options?: import("wretch").WretchOptions) => Promise<T>;
46
46
  };
47
47
  readonly collection: {
48
- getAllCollections: (data?: import("./types").LevoQuery.FindQuery<"id" | "workspace_id" | "description" | "created_at" | "updated_at" | "key" | "readonly" | "hidden" | "icon" | "name" | "sections" | "views" | "title_field" | "email_field" | "settings" | "module_name" | "on_submit" | "on_update" | "allow_draft">, options?: import("wretch").WretchOptions) => Promise<import("./types").IResponseMultiple<import("./types").ILemaCollection>>;
49
- getCollectionByIDExpanded: <T = import("./types").ILemaCollection>(id: string, options?: import("wretch").WretchOptions) => Promise<import("./types").IResponseSingle<T>>;
50
- createCollection: (data: import("./types").ILemaCollection) => Promise<import("./types").IResponseSingle<import("./types").ILemaCollection>>;
48
+ getAllCollections: (data?: import(".").LevoQuery.FindQuery<"id" | "workspace_id" | "description" | "created_at" | "updated_at" | "key" | "readonly" | "hidden" | "icon" | "name" | "sections" | "views" | "title_field" | "email_field" | "settings" | "module_name" | "on_submit" | "on_update" | "allow_draft">, options?: import("wretch").WretchOptions) => Promise<import(".").IResponseMultiple<import(".").ILemaCollection>>;
49
+ getCollectionByIDExpanded: <T = import(".").ILemaCollection>(id: string, options?: import("wretch").WretchOptions) => Promise<import(".").IResponseSingle<T>>;
50
+ createCollection: (data: import(".").ILemaCollection) => Promise<import(".").IResponseSingle<import(".").ILemaCollection>>;
51
51
  saveCollectionData: ({ collection_id, data, options, }: {
52
52
  collection_id: string;
53
53
  data: any;
54
54
  options?: import("wretch").WretchOptions;
55
- }) => Promise<import("./types").IResponseSingle<any>>;
55
+ }) => Promise<import(".").IResponseSingle<any>>;
56
56
  getCollectionContentList: ({ collection_key, page, search, limit, where, }: {
57
57
  collection_key: string;
58
- } & import("./types").LevoQuery.FindQuery) => Promise<import("./types").IResponseMultiple<Record<string, unknown>>>;
59
- saveDraftEntry: (collection_key: string, data: any) => Promise<import("./types").IResponseSingle<import("./types").IDraftEntry>>;
60
- editDraftEntry: (collection_key: string, id: string, data: any) => Promise<import("./types").IResponseSingle<import("./types").IDraftEntry>>;
61
- getDraftEntry: (collection_key: string) => Promise<import("./types").IResponseMultiple<import("./types").IDraftEntry>>;
62
- submitDraftEntry: (collection_key: string, data: any) => Promise<import("./types").IResponseSingle<import("./types").IDraftEntry>>;
58
+ } & import(".").LevoQuery.FindQuery) => Promise<import(".").IResponseMultiple<Record<string, unknown>>>;
59
+ saveDraftEntry: (collection_key: string, data: any) => Promise<import(".").IResponseSingle<import(".").IDraftEntry>>;
60
+ editDraftEntry: (collection_key: string, id: string, data: any) => Promise<import(".").IResponseSingle<import(".").IDraftEntry>>;
61
+ getDraftEntry: (collection_key: string) => Promise<import(".").IResponseMultiple<import(".").IDraftEntry>>;
62
+ submitDraftEntry: (collection_key: string, data: any) => Promise<import(".").IResponseSingle<import(".").IDraftEntry>>;
63
63
  };
64
64
  readonly media: {
65
- mediaBulkUpload: (formData: FormData, options?: import("wretch").WretchOptions) => Promise<import("./types").IResponseMultiple<import("./types").IMedia>>;
66
- getAllMedia: (data?: import("./types").LevoQuery.FindQuery) => Promise<import("./types").IResponseMultiple<import("./types").IMedia>>;
65
+ mediaBulkUpload: (formData: FormData, options?: import("wretch").WretchOptions) => Promise<import(".").IResponseMultiple<import(".").IMedia>>;
66
+ getAllMedia: (data?: import(".").LevoQuery.FindQuery) => Promise<import(".").IResponseMultiple<import(".").IMedia>>;
67
67
  };
68
68
  readonly logger: {
69
69
  debug: (...args: any[]) => void;
@@ -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
@@ -9,4 +9,6 @@ export * from "./media";
9
9
  export * from "./query";
10
10
  export * from "./utils";
11
11
  export * from "./workspace";
12
+ export * from "./event";
13
+ export * from "./location";
12
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
@@ -18,6 +18,8 @@ export declare namespace ILevoMembership {
18
18
  display_email: string;
19
19
  reducted_email: string;
20
20
  email_verified: boolean;
21
+ email_verified_at: string | null;
22
+ verified_at: string | null;
21
23
  mobile: string | null;
22
24
  reducted_mobile: string | null;
23
25
  mobile_verified: boolean;
@@ -1,5 +1,59 @@
1
1
  import type { ILevoIntegrationInstance, ILevoIntegrationList } from "../constants/integration";
2
2
  import type { IMediaObject } from "./media";
3
+ export interface IPlanPrice {
4
+ id: string;
5
+ plan_id: string;
6
+ period: "month" | "year";
7
+ unit_amount: number;
8
+ currency: string;
9
+ reference_id: string;
10
+ provider: string;
11
+ created_at: string;
12
+ updated_at: string;
13
+ }
14
+ export interface IPlanGroup {
15
+ id: string;
16
+ name: string;
17
+ created_at: Date;
18
+ updated_at: Date;
19
+ }
20
+ export interface IPlanFeature {
21
+ title: string;
22
+ description: string | null;
23
+ sort_order: number;
24
+ is_active: boolean | null;
25
+ }
26
+ export type PlanKind = "addon" | "base";
27
+ export interface IPlan {
28
+ name: string;
29
+ id: string;
30
+ created_at: Date;
31
+ updated_at: Date;
32
+ plan_group_id: string;
33
+ description: string;
34
+ kind: PlanKind;
35
+ is_trial: boolean;
36
+ price: IPlanPrice[];
37
+ features: IPlanFeature[];
38
+ recommended: boolean;
39
+ is_enterprise: boolean;
40
+ plan_group: IPlanGroup;
41
+ }
42
+ export interface ISubscription {
43
+ object: string;
44
+ id: string;
45
+ customer_details: Record<string, unknown>;
46
+ payment_details: Record<string, unknown>;
47
+ start_date: string;
48
+ end_date: string;
49
+ plan: Partial<Pick<IPlan, "id" | "name" | "is_enterprise">>;
50
+ price: Partial<IPlanPrice>;
51
+ cancelled_at: string | null;
52
+ cancel_at_next_billing_date: boolean;
53
+ status: "active" | "cancelled" | "past_due" | "trialing" | "incomplete";
54
+ plan_id?: string;
55
+ price_id?: string;
56
+ }
3
57
  export interface IDefaultPermissionsObject {
4
58
  status?: "enabled" | "disabled" | "hidden";
5
59
  create?: boolean;
@@ -53,7 +107,21 @@ export interface IWorkspace {
53
107
  icon: IMediaObject | null;
54
108
  workspace_id: string;
55
109
  industry: string;
56
- info: Record<string, any>;
110
+ info: {
111
+ locations?: {
112
+ place_name: string;
113
+ }[];
114
+ ai_onboarding?: {
115
+ business_profile: {
116
+ name: string;
117
+ location: string;
118
+ description: string;
119
+ category: string;
120
+ subcategory: string;
121
+ category_confidence: number;
122
+ };
123
+ };
124
+ };
57
125
  settings: {
58
126
  head_code?: string;
59
127
  [key: string]: any;
@@ -65,6 +133,6 @@ export interface IWorkspace {
65
133
  theme?: any;
66
134
  host_domain: string | null;
67
135
  proxy_domain: string | null;
68
- subscription_status?: string;
136
+ subscription: ISubscription | null;
69
137
  }
70
138
  //# sourceMappingURL=workspace.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@levo-so/core",
3
- "version": "0.1.50",
3
+ "version": "0.1.54",
4
4
  "author": "Levo Engineering <devs@theinternetfolks.com>",
5
5
  "description": "Levo common utilities",
6
6
  "type": "module",
@@ -33,7 +33,7 @@
33
33
  "@levo/ts-config": "workspace:*",
34
34
  "@types/lodash-es": "4.17.12",
35
35
  "tsup": "8.2.4",
36
- "typescript": "5.8.2"
36
+ "typescript": "5.8.3"
37
37
  },
38
38
  "main": "./dist/index.js",
39
39
  "module": "./dist/index.js",