@levo-so/core 0.1.81 → 0.1.105

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 +378 -79
  2. package/dist/index.js +616 -698
  3. package/package.json +20 -21
package/dist/index.d.ts CHANGED
@@ -183,7 +183,7 @@ export declare const createLevoClient: (options: ILevoClientOptions) => {
183
183
  signUpWithPassword: <T = import("./types").ILevoMembership.Account>(data: import("./types").ILevoMembership.Request.SignUpWithPassword, options?: WretchOptions) => Promise<T>;
184
184
  };
185
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>>;
186
+ getAllCollections: (data?: import("./types").LevoQuery.FindQuery<"name" | "workspace_id" | "created_at" | "id" | "kind" | "description" | "updated_at" | "icon" | "key" | "readonly" | "hidden" | "on_submit" | "on_update" | "module_name" | "allow_public_submit" | "public_submit_set_by" | "sections" | "views" | "title_field" | "email_field" | "mobile_field" | "settings" | "allow_draft" | "allow_public_view" | "public_view_set_by" | "public_view_set_by_account" | "public_submit_set_by_account" | "entry_count">, options?: WretchOptions) => Promise<IResponseMultiple<ILemaCollection>>;
187
187
  getCollectionByIDExpanded: <T = ILemaCollection>(id: string, options?: WretchOptions) => Promise<IResponseSingle<T>>;
188
188
  createCollection: (data: ILemaCollection) => Promise<IResponseSingle<ILemaCollection>>;
189
189
  saveCollectionData: ({ collection_id, data, options, }: {
@@ -201,14 +201,21 @@ export declare const createLevoClient: (options: ILevoClientOptions) => {
201
201
  getFilters: (collectionId: string, options?: WretchOptions) => Promise<IResponseMultiple<ILemaCollection["sections"][number]["fields"][number]>>;
202
202
  };
203
203
  readonly media: {
204
- mediaBulkUpload: (formData: FormData, options?: WretchOptions) => Promise<IResponseMultiple<IMedia>>;
204
+ mediaBulkUpload: (formData: FormData, options?: WretchOptions, context?: IMediaUploadContext) => Promise<IResponseMultiple<IMedia>>;
205
205
  getAllMedia: (data?: import("./types").LevoQuery.FindQuery) => Promise<IResponseMultiple<IMedia>>;
206
206
  };
207
207
  readonly logger: {
208
208
  debug: (...args: any[]) => void;
209
209
  info: (...args: any[]) => void;
210
210
  warn: (...args: any[]) => void;
211
- error: (...args: any[]) => void;
211
+ error: {
212
+ (message: string): void;
213
+ <T extends {
214
+ exception?: unknown;
215
+ [key: string]: any;
216
+ }>(message: string, props: T extends Error ? never : T): void;
217
+ };
218
+ attachMiddleware: (mw: ILevoLoggerMiddleware) => (() => void);
212
219
  };
213
220
  readonly fetch: QueryStringAddon & Wretch<QueryStringAddon, unknown, undefined>;
214
221
  readonly APP_MODE: string;
@@ -218,12 +225,43 @@ export declare const createLevoClient: (options: ILevoClientOptions) => {
218
225
  updateWorkspace: (workspace: string | null) => void;
219
226
  };
220
227
 
228
+ /**
229
+ * @description base factory that includes levo workspace details, analytics tools & fetch client
230
+ */
231
+ declare const createLevoControl: (options: ICoreOptions) => {
232
+ workspace: WorkspaceID | null;
233
+ readonly appName: string | undefined;
234
+ readonly apiUrl: string;
235
+ readonly NODE_ENV: string;
236
+ readonly APP_MODE: string;
237
+ };
238
+
239
+ export declare const createLevoLogger: (core: ILevoControl, options?: ILoggerOptions) => {
240
+ debug: (...args: any[]) => void;
241
+ info: (...args: any[]) => void;
242
+ warn: (...args: any[]) => void;
243
+ error: {
244
+ (message: string): void;
245
+ <T extends {
246
+ exception?: unknown;
247
+ [key: string]: any;
248
+ }>(message: string, props: NotError<T>): void;
249
+ };
250
+ attachMiddleware: (mw: ILevoLoggerMiddleware) => (() => void);
251
+ };
252
+
221
253
  export declare type DeepPartial<T> = {
222
254
  [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
223
255
  };
224
256
 
225
257
  export declare const defaultByKinds: Record<(typeof FieldKindList)[number], any>;
226
258
 
259
+ /**
260
+ * Define a named logger middleware. Name is used for dedup — attaching
261
+ * a middleware with the same name replaces the previous one.
262
+ */
263
+ export declare const defineLevoLoggerMiddleware: (name: string, callback: (core: ILevoControl, level: LogLevel, args: any[]) => void) => ILevoLoggerMiddleware;
264
+
227
265
  export declare type FieldFilter<T extends string = string> = Partial<Record<T, ComparableFilter<T> | FieldType>>;
228
266
 
229
267
  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">;
@@ -285,6 +323,12 @@ export declare const ForumPostKindExpandedList: Array<keyof typeof FORUM_POST_KI
285
323
 
286
324
  export declare type ForumPostStatus = (typeof FORUM_POST_STATUS)[keyof typeof FORUM_POST_STATUS];
287
325
 
326
+ /**
327
+ * Derives the collection kind client-side when the API field is absent.
328
+ * Matches the server derivation exactly.
329
+ */
330
+ export declare const getCollectionKind: (collection: Pick<ILemaCollection, "module_name" | "allow_public_submit" | "public_submit_set_by">) => ICollectionKind;
331
+
288
332
  export declare const getLevoError: (error: any) => LevoError;
289
333
 
290
334
  export declare interface IAddress {
@@ -329,10 +373,6 @@ export declare interface IAuthor {
329
373
  active_at: Date;
330
374
  }
331
375
 
332
- declare interface IBatchOptions {
333
- logApiUrl?: string;
334
- }
335
-
336
376
  export declare interface IBlog {
337
377
  _id: string;
338
378
  slug: string;
@@ -349,6 +389,13 @@ export declare interface IBlog {
349
389
  created_by: string;
350
390
  updated_by: string;
351
391
  studio_config: IModuleStudioConfig[];
392
+ icon?: IIcon | null;
393
+ /**
394
+ * Default brief applied to every post in this blog. Merges per-field with
395
+ * `post.brief`; per-post values win. Setting `documents: ["DC_BRAND_GUIDE"]`
396
+ * here means every post is audited against that guide unless overridden.
397
+ */
398
+ brief_defaults?: IBrief | null;
352
399
  }
353
400
 
354
401
  export declare interface IBlogCategory {
@@ -411,6 +458,68 @@ export declare interface IBooking {
411
458
  attendees?: IAttendee[];
412
459
  }
413
460
 
461
+ export declare interface IBrief {
462
+ /** PR... persona id. Falls back to `post.target_persona` when null. */
463
+ persona_id?: string | null;
464
+ /** Reserved — server accepts but doesn't yet route on it. */
465
+ writer_id?: string | null;
466
+ /** DC... ai_document ids (brand guide, compliance, research). */
467
+ documents?: string[] | null;
468
+ intent?: IBriefIntent | null;
469
+ focus_keyword?: string | null;
470
+ /** Semantic anchor; falls back to focus_keyword for drift checks. */
471
+ core_topic?: string | null;
472
+ funnel_stage?: IBriefFunnelStage | null;
473
+ brand_placement?: IBriefBrandPlacement | null;
474
+ word_limit?: IBriefWordLimit | null;
475
+ topic_drift?: IBriefTopicDrift | null;
476
+ cta_targets?: IBriefCtaTargets | null;
477
+ }
478
+
479
+ export declare type IBriefBrandPlacement = "soft" | "standard" | "strong";
480
+
481
+ export declare interface IBriefCtaTargets {
482
+ top?: boolean;
483
+ mid?: boolean;
484
+ bottom?: boolean;
485
+ }
486
+
487
+ export declare type IBriefFunnelStage = "tofu" | "mofu" | "bofu";
488
+
489
+ export declare type IBriefIntent = "educate" | "persuade" | "compare" | "convert";
490
+
491
+ /**
492
+ * Snapshot of the merged brief at audit-run time, returned on the audit doc.
493
+ * `null` when both `post.brief` and `blog.brief_defaults` are empty.
494
+ */
495
+ export declare interface IBriefSnapshot {
496
+ brief: IBrief;
497
+ documents: IBriefSnapshotDocument[];
498
+ }
499
+
500
+ /**
501
+ * Document fingerprint embedded in the audit response. The body itself is not
502
+ * inlined — only sha256 + length, used for drift detection on the audit cache key.
503
+ */
504
+ export declare interface IBriefSnapshotDocument {
505
+ id: string;
506
+ title: string;
507
+ tags: string[];
508
+ body_sha256: string;
509
+ length: number;
510
+ }
511
+
512
+ export declare type IBriefTopicDrift = "tight" | "normal" | "loose";
513
+
514
+ export declare interface IBriefWordLimit {
515
+ target: number;
516
+ /** Default 0.2 (±20%) when omitted on the wire. */
517
+ tolerance?: number;
518
+ }
519
+
520
+ /** Structural kind of a collection object. Read-only, derived server-side. */
521
+ export declare type ICollectionKind = "collection" | "form" | "module";
522
+
414
523
  export declare interface ICollectionLayout {
415
524
  kind: ICollectionsView;
416
525
  options: ICollectionLayoutOptions;
@@ -431,6 +540,9 @@ export declare interface ICollectionLayoutOptions {
431
540
  infoFields?: string[];
432
541
  }
433
542
 
543
+ /** Access level for collection-level public visibility or submission. */
544
+ export declare type ICollectionPublicAccess = "public" | "members" | "own" | null;
545
+
434
546
  export declare interface ICollectionQuery {
435
547
  where: Record<string, any>;
436
548
  sort?: Record<string, any>;
@@ -533,17 +645,7 @@ declare interface ICoreOptions {
533
645
  APP_MODE: string;
534
646
  }
535
647
 
536
- export declare interface IDefaultPermissionsObject {
537
- status?: "enabled" | "disabled" | "hidden";
538
- create?: boolean;
539
- modify?: boolean;
540
- delete?: boolean;
541
- archive?: boolean;
542
- duplicate?: boolean;
543
- export?: boolean;
544
- upload?: boolean;
545
- list_actions?: boolean;
546
- }
648
+ export declare type IDelayUnit = "minutes" | "hours" | "days";
547
649
 
548
650
  export declare interface IDraftEntry {
549
651
  _id: string;
@@ -573,6 +675,9 @@ export declare interface IErrorContent {
573
675
  description: string;
574
676
  type?: string;
575
677
  errors?: IFieldError[];
678
+ url?: string;
679
+ /** Raw response body from the server, preserved for debugging/error tracking. */
680
+ responseData?: unknown;
576
681
  }
577
682
 
578
683
  export declare type IErrorParams = {
@@ -604,8 +709,37 @@ declare interface IFaviconSrcset {
604
709
  "192": string;
605
710
  }
606
711
 
607
- export declare interface IFeatureFlags extends Partial<IModuleAccessControl> {
712
+ /**
713
+ * Public surface of per-workspace feature flags exposed via the external SDK.
714
+ * Only fields renderer/SDK consumers need at runtime belong here. A small,
715
+ * runtime-facing subset of `studio_config` (currently `kb_chat` and
716
+ * `kb_chat_preview_only`) is included so the published site can gate the
717
+ * visitor AI chat widget; the full admin-only studio_config / blogs_config
718
+ * shape remains in `@levo/types` `IFeatureFlags` and is not part of the SDK
719
+ * contract.
720
+ */
721
+ export declare interface IFeatureFlags {
722
+ /** Controls the "Powered by Levo" badge on rendered workspace sites. */
608
723
  branding?: boolean;
724
+ /**
725
+ * Only the subset of studio_config the public site renderer needs at
726
+ * runtime. The full studio_config shape stays in `@levo/types`.
727
+ */
728
+ studio_config?: {
729
+ /** Visitor-facing AI chat widget on the published site. Default off. */
730
+ kb_chat?: boolean;
731
+ /**
732
+ * When true (default) the KB chat only mounts on preview deployments.
733
+ * Flip to false per-workspace to release the widget to production.
734
+ */
735
+ kb_chat_preview_only?: boolean;
736
+ /**
737
+ * Launcher shape for the visitor AI chat. `"bar"` (default) renders the
738
+ * centered morphing pill at the bottom of the viewport; `"fab"` renders
739
+ * the bottom-right floating action button + popover panel.
740
+ */
741
+ kb_chat_variant?: "bar" | "fab";
742
+ };
609
743
  }
610
744
 
611
745
  /**
@@ -678,7 +812,9 @@ export declare interface IForum {
678
812
  description: string;
679
813
  status: string;
680
814
  settings: IForumSettings;
815
+ listing_page_url?: string;
681
816
  created_at: string;
817
+ studio_config?: IModuleStudioConfig[];
682
818
  }
683
819
 
684
820
  export declare interface IForumCategory {
@@ -854,11 +990,9 @@ export declare interface IIconData {
854
990
  /**
855
991
  * Defines the schema structure for a Levo Collection.
856
992
  *
857
- * A Levo Collection is a feature of the Levo platform that enables dynamic form rendering using the `@levo-so/react-collection` library.
993
+ * A Levo Collection is a feature of the Levo platform that enables dynamic form rendering using the `@levo.libraries/react-collection` library.
858
994
  * This interface describes the schema used to generate forms, including sections, fields, and configuration options.
859
995
  * The schema is referenced anywhere a Levo Collection is required in the Levo ecosystem.
860
- *
861
- * For more details, see the documentation in external/react-collection/docs/readme.md.
862
996
  */
863
997
  export declare interface ILemaCollection {
864
998
  /** Unique identifier for the collection schema. */
@@ -901,6 +1035,33 @@ export declare interface ILemaCollection {
901
1035
  updated_at?: Date | string;
902
1036
  /** Whether the collection allows draft items. */
903
1037
  allow_draft?: boolean;
1038
+ /** Structural kind — read-only, derived server-side. Use getCollectionKind() if absent. */
1039
+ kind?: ICollectionKind;
1040
+ /** Collection-level public view access level. null = private/disabled. */
1041
+ allow_public_view?: ICollectionPublicAccess;
1042
+ /** Collection-level public submit access level. null = private/disabled. */
1043
+ allow_public_submit?: ICollectionPublicAccess;
1044
+ /** Account ID who manually set the public view flag. null = auto-set by system. */
1045
+ public_view_set_by?: string | null;
1046
+ /** Account ID who manually set the public submit flag. null = auto-set by system. */
1047
+ public_submit_set_by?: string | null;
1048
+ /** Expanded account details for who set public view. */
1049
+ public_view_set_by_account?: ILemaCollectionAccount | null;
1050
+ /** Expanded account details for who set public submit. */
1051
+ public_submit_set_by_account?: ILemaCollectionAccount | null;
1052
+ /** Number of entries in the collection. Returned by listing API. */
1053
+ entry_count?: number;
1054
+ }
1055
+
1056
+ /** Account details embedded in collection responses for _set_by fields. */
1057
+ export declare interface ILemaCollectionAccount {
1058
+ id: string;
1059
+ first_name: string;
1060
+ last_name: string;
1061
+ email: string;
1062
+ profile_picture?: {
1063
+ location: string;
1064
+ } | null;
904
1065
  }
905
1066
 
906
1067
  export declare type ILemaCollectionRelationship = "o2m" | "m2o" | "o2o" | "m2m";
@@ -915,6 +1076,10 @@ export declare type ILemaField = Mandatory<Omit<IField, "fields" | "options">, "
915
1076
  fields?: ILemaField[];
916
1077
  /** Field options for configuring widget behavior. */
917
1078
  options: ILemaFieldOptions;
1079
+ /** Whether this field is visible publicly. */
1080
+ allow_public_view?: boolean;
1081
+ /** Whether this field accepts public submissions. */
1082
+ allow_public_submit?: boolean;
918
1083
  };
919
1084
 
920
1085
  /**
@@ -958,6 +1123,10 @@ export declare interface ILemaFieldOptions {
958
1123
  validationsPresets?: string[];
959
1124
  /** Whether to verify email/phone values or not */
960
1125
  verification?: boolean;
1126
+ /** Restrict upload widget to specific media types (e.g. ["image", "document"]). All types allowed when absent. */
1127
+ allowed_upload_types?: string[];
1128
+ /** Restrict upload widget to specific file extensions (e.g. ["pdf", "docx"]). All extensions for the allowed types when absent. */
1129
+ allowed_extensions?: string[];
961
1130
  }
962
1131
 
963
1132
  export declare type ILemaRelation = {
@@ -1055,20 +1224,12 @@ export declare interface ILevoClientOptions extends ICoreOptions {
1055
1224
  loggerOptions?: ILoggerOptions;
1056
1225
  }
1057
1226
 
1058
- export declare type ILevoIntegrationInstance = {
1059
- id: string;
1060
- name: string;
1061
- publisher: string;
1062
- description: string;
1063
- url: string | null;
1064
- logo: string | null;
1065
- dashboard_url: string | null;
1066
- sidebar_icon: string | null;
1067
- show_on_sidebar: boolean;
1068
- key: string;
1069
- };
1227
+ declare type ILevoControl = ReturnType<typeof createLevoControl>;
1070
1228
 
1071
- export declare type ILevoIntegrationList = (typeof LEVO_INTEGRATIONS)[keyof typeof LEVO_INTEGRATIONS][];
1229
+ export declare interface ILevoLoggerMiddleware {
1230
+ name: string;
1231
+ callback: (core: ILevoControl, level: LogLevel, args: any[]) => void;
1232
+ }
1072
1233
 
1073
1234
  export declare namespace ILevoMembership {
1074
1235
  export interface sub_account_oauth_credentials {
@@ -1247,15 +1408,13 @@ export declare namespace ILevoMembership {
1247
1408
  password: string;
1248
1409
  };
1249
1410
  }
1250
- {};
1411
+ export {};
1251
1412
  }
1252
1413
 
1253
1414
  export declare type ILevoOAuthProvider = (typeof LevoOAuthProviderList)[number];
1254
1415
 
1255
- declare interface ILoggerOptions extends IBatchOptions {
1416
+ export declare interface ILoggerOptions {
1256
1417
  level?: LogLevel;
1257
- enableRemote?: boolean;
1258
- context?: Record<string, any>;
1259
1418
  }
1260
1419
 
1261
1420
  export declare interface IMe {
@@ -1313,34 +1472,23 @@ export declare type IMediaObject = Pick<IMedia, "id" | "location" | "srcset" | "
1313
1472
  mimetype?: IMedia["metadata"]["mimetype"];
1314
1473
  };
1315
1474
 
1475
+ /** Source context attached to a media upload so the backend can record where the file originated. */
1476
+ export declare interface IMediaUploadContext {
1477
+ /** The product module the upload belongs to (e.g. "community", "blog"). */
1478
+ module: "community" | "collection" | "blog" | "event" | "membership" | "beacon" | "studio" | "ai";
1479
+ /** Module-specific resource key (e.g. blog slug, collection key, event slug). */
1480
+ identifier: string;
1481
+ /** Schema field key within the module (e.g. "cover_image", "attachment"). */
1482
+ field_key?: string;
1483
+ /** Human-readable field label (e.g. "Cover Image", "Attachment"). */
1484
+ field_label?: string;
1485
+ }
1486
+
1316
1487
  export declare interface IMeta {
1317
1488
  total: number;
1318
1489
  pages: number;
1319
1490
  }
1320
1491
 
1321
- export declare type IModuleAccessControl = {
1322
- dashboard_config: IDefaultPermissionsObject;
1323
- studio_config: IDefaultPermissionsObject & {
1324
- addBlocks: boolean;
1325
- version: string;
1326
- preview_url: string | null;
1327
- modules: {
1328
- my_blocks: IDefaultPermissionsObject;
1329
- };
1330
- };
1331
- collections_config: IDefaultPermissionsObject & {
1332
- modules: {
1333
- records: IDefaultPermissionsObject;
1334
- };
1335
- };
1336
- media_config: IDefaultPermissionsObject;
1337
- events_config: IDefaultPermissionsObject;
1338
- blogs_config: IDefaultPermissionsObject;
1339
- memberships_config: IDefaultPermissionsObject;
1340
- insights_config: IDefaultPermissionsObject;
1341
- settings_config: IDefaultPermissionsObject;
1342
- };
1343
-
1344
1492
  export declare interface IModuleStudioConfig {
1345
1493
  page_id: string;
1346
1494
  preview_url: string;
@@ -1363,7 +1511,10 @@ export declare interface INotificationData {
1363
1511
  reply_to?: string;
1364
1512
  cc_email?: string[];
1365
1513
  bcc_email?: string[];
1514
+ delay_value?: number;
1515
+ delay_unit?: IDelayUnit;
1366
1516
  info: {
1517
+ title?: string;
1367
1518
  show_download_button?: boolean;
1368
1519
  hide_fields?: string[];
1369
1520
  body?: string;
@@ -1479,6 +1630,10 @@ export declare interface IPost {
1479
1630
  location: string;
1480
1631
  };
1481
1632
  }[];
1633
+ /** Staff account who created the post. Immutable. `null` for legacy/unbackfilled posts. */
1634
+ created_by?: IPostStaffAccount | null;
1635
+ /** Staff account who last edited the post. Re-stamped on every save. `null` for legacy/unbackfilled posts. */
1636
+ updated_by?: IPostStaffAccount | null;
1482
1637
  settings: Record<string, any>;
1483
1638
  in_review_at?: Date;
1484
1639
  approved_at?: Date;
@@ -1496,6 +1651,75 @@ export declare interface IPost {
1496
1651
  name: string;
1497
1652
  slug: string;
1498
1653
  }[];
1654
+ /** Latest completed audit for this post. `null` when never audited. Platform list only. */
1655
+ audit?: IPostAuditSummary | null;
1656
+ /** True while a pending/running audit exists for this post. Independent of `audit`. */
1657
+ is_auditing?: boolean;
1658
+ /**
1659
+ * Per-post writing/audit brief. All fields optional; absent fields fall
1660
+ * through to the parent blog's `brief_defaults`.
1661
+ */
1662
+ brief?: IBrief | null;
1663
+ }
1664
+
1665
+ export declare interface IPostAuditDimensionGrade {
1666
+ key: string;
1667
+ name: string;
1668
+ grade: IPostAuditGrade;
1669
+ }
1670
+
1671
+ /**
1672
+ * Counts of recommended fixes by severity. `total` includes any unknown
1673
+ * severities so the headline number stays honest if the BE enum grows.
1674
+ */
1675
+ export declare interface IPostAuditFixesCount {
1676
+ high: number;
1677
+ medium: number;
1678
+ low: number;
1679
+ total: number;
1680
+ }
1681
+
1682
+ export declare type IPostAuditGrade = "A+" | "A" | "B" | "C" | "D" | "F";
1683
+
1684
+ export declare type IPostAuditMode = "quick" | "full";
1685
+
1686
+ /**
1687
+ * Lightweight audit summary attached to each post in the platform list response.
1688
+ * Full body (signals, fixes, execution) lives on `GET /v1/agents/audit/:id`.
1689
+ */
1690
+ export declare interface IPostAuditSummary {
1691
+ id: string;
1692
+ mode: IPostAuditMode;
1693
+ overall_grade: IPostAuditGrade;
1694
+ overall_score: number;
1695
+ dimensions: IPostAuditDimensionGrade[];
1696
+ fixes_count: IPostAuditFixesCount;
1697
+ completed_at: string;
1698
+ /** True when post.updated_at > audit.completed_at — any post edit flags it. */
1699
+ is_stale: boolean;
1700
+ }
1701
+
1702
+ /**
1703
+ * Staff account audit shape returned for `created_by` / `updated_by` on blog posts.
1704
+ * Distinct from the editorial `authors` byline — this is the internal CMS audit trail.
1705
+ */
1706
+ export declare interface IPostStaffAccount {
1707
+ _id: string;
1708
+ first_name: string;
1709
+ last_name: string;
1710
+ username?: string;
1711
+ slug?: string;
1712
+ profile_picture?: {
1713
+ location: string;
1714
+ } | null;
1715
+ last_access_at?: string | null;
1716
+ }
1717
+
1718
+ export declare interface IRemoteLoggerMiddlewareOptions {
1719
+ /** URL of the log ingestion API */
1720
+ logApiUrl: string;
1721
+ /** Extra static context merged into every log payload */
1722
+ context?: Record<string, any>;
1499
1723
  }
1500
1724
 
1501
1725
  export declare interface IResponseError {
@@ -1586,6 +1810,8 @@ export declare interface ISubscription {
1586
1810
  status: "active" | "cancelled" | "past_due" | "trialing" | "incomplete" | "trial_expired";
1587
1811
  plan_id?: string;
1588
1812
  price_id?: string;
1813
+ provider?: string;
1814
+ customer_id?: string;
1589
1815
  }
1590
1816
 
1591
1817
  /**
@@ -1615,7 +1841,6 @@ export declare interface IWorkspace {
1615
1841
  created_at: string;
1616
1842
  updated_at: string;
1617
1843
  deleted_at?: null;
1618
- integrations?: ILevoIntegrationList | ILevoIntegrationInstance[];
1619
1844
  description: any;
1620
1845
  icon: IMediaObject | null;
1621
1846
  workspace_id: string;
@@ -1672,18 +1897,6 @@ declare type JSONContent = {
1672
1897
  [key: string]: any;
1673
1898
  };
1674
1899
 
1675
- export declare const LEVO_INTEGRATIONS: {
1676
- readonly beacon: "so.levo.beacon";
1677
- readonly blog: "so.levo.blog";
1678
- readonly event: "so.levo.event";
1679
- readonly membership: "so.levo.membership";
1680
- readonly payment: "so.levo.payment";
1681
- readonly community: "so.levo.community";
1682
- readonly search_console: "com.google.search_console";
1683
- };
1684
-
1685
- 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")[];
1686
-
1687
1900
  /**
1688
1901
  * Enhanced error class that matches backend response structure
1689
1902
  */
@@ -1693,6 +1906,9 @@ export declare class LevoError extends Error {
1693
1906
  status: number;
1694
1907
  type?: string;
1695
1908
  errors?: IFieldError[];
1909
+ url?: string;
1910
+ /** Raw response body from the server, preserved for debugging/error tracking. */
1911
+ responseData?: unknown;
1696
1912
  constructor(data: IErrorContent);
1697
1913
  /**
1698
1914
  * Get validation errors for form fields
@@ -1724,6 +1940,7 @@ export declare namespace LevoEvent {
1724
1940
  slug: string;
1725
1941
  status: "draft" | "canceled" | "published";
1726
1942
  accept_registration: boolean;
1943
+ one_attendee_per_account: boolean;
1727
1944
  max_capacity: number;
1728
1945
  banners: IMediaObject[];
1729
1946
  created_at: Date;
@@ -1764,6 +1981,7 @@ export declare namespace LevoEvent {
1764
1981
  hidden: boolean;
1765
1982
  allow_to_upgrade: boolean;
1766
1983
  include_in_upgrade: boolean;
1984
+ one_attendee_per_account: boolean;
1767
1985
  enforce_max_quantity: boolean;
1768
1986
  status: string;
1769
1987
  offerings: string[];
@@ -1796,6 +2014,11 @@ export declare namespace LevoEvent {
1796
2014
  expires_at: Date | null;
1797
2015
  max_redemptions: number | null;
1798
2016
  minimum_amount: number | null;
2017
+ /** Minimum transaction amount required to use this coupon */
2018
+ min_trnx_amount: number | null;
2019
+ /** Maximum discount amount cap (for percent coupons) */
2020
+ max_amount_off: number | null;
2021
+ redeem_count: number;
1799
2022
  is_public: boolean;
1800
2023
  created_at: Date;
1801
2024
  created_by: string;
@@ -1838,19 +2061,41 @@ export declare namespace LevoEvent {
1838
2061
  export namespace Attendee {
1839
2062
  export interface Root {
1840
2063
  _id: string;
2064
+ slug: string;
1841
2065
  public_id: string;
1842
2066
  name: string;
1843
2067
  email: string;
1844
2068
  mobile: string | null;
1845
2069
  event: string;
2070
+ organization: string;
2071
+ designation: string;
2072
+ details: Record<string, any>;
1846
2073
  booking: Booking.Root;
1847
2074
  ticket: Pick<LevoEvent.Ticket.Root, "_id" | "title" | "currency" | "quantity" | "status" | "unit_amount">;
1848
2075
  price: string;
1849
- account: string | null;
2076
+ /** Raw string ID, or populated account object when `include.account` is used */
2077
+ account: string | IAttendeeAccount | null;
1850
2078
  status: string;
2079
+ info: Record<string, any>;
2080
+ qr_image: IMediaObject & {
2081
+ width: number;
2082
+ height: number;
2083
+ };
2084
+ checkin_at: Date | null;
1851
2085
  created_at: Date;
1852
2086
  updated_at: Date;
1853
2087
  }
2088
+ /** Populated account shape returned when `include.account` is used in the query */
2089
+ export interface IAttendeeAccount {
2090
+ _id: string;
2091
+ reducted_email?: string;
2092
+ reducted_mobile?: string;
2093
+ slug?: string;
2094
+ username?: string;
2095
+ profile_picture?: {
2096
+ location: string;
2097
+ };
2098
+ }
1854
2099
  }
1855
2100
  export namespace Booking {
1856
2101
  export interface Root {
@@ -1869,13 +2114,17 @@ export declare namespace LevoEvent {
1869
2114
  code: string | null;
1870
2115
  status: string;
1871
2116
  paid: boolean;
2117
+ tax_inclusive: boolean;
2118
+ is_business_purchase: boolean;
2119
+ billing_details: IBillingDetails | null;
1872
2120
  info: Record<string, any>;
1873
2121
  taxes?: Array<{
1874
2122
  id: string;
1875
2123
  label: string;
1876
- percentage: number;
2124
+ percentage?: number;
1877
2125
  amount: number;
1878
- }>;
2126
+ }> | Record<string, never>;
2127
+ payment_details: IPaymentDetail[];
1879
2128
  qr_image: IMediaObject & {
1880
2129
  width: number;
1881
2130
  height: number;
@@ -1885,10 +2134,49 @@ export declare namespace LevoEvent {
1885
2134
  width: number;
1886
2135
  height: number;
1887
2136
  }) | null;
2137
+ /** How this booking was created: public (website), manual (dashboard), csv (import) */
2138
+ source: "public" | "manual" | "csv";
2139
+ /** Visit ID or null — populated when `include._visit` is used */
2140
+ _visit: string | null;
2141
+ _page: IBookingPage | null;
2142
+ upgraded_at: Date | null;
1888
2143
  created_at: Date;
1889
2144
  updated_at: Date;
1890
2145
  attendees: LevoEvent.Attendee.Root[];
1891
2146
  }
2147
+ export interface IBillingDetails {
2148
+ name: string;
2149
+ tax_id?: string;
2150
+ address?: {
2151
+ line1: string;
2152
+ line2?: string;
2153
+ city: string;
2154
+ state: string;
2155
+ postal_code: string;
2156
+ country_code: string;
2157
+ };
2158
+ }
2159
+ export interface IPaymentDetail {
2160
+ order_id: string;
2161
+ link_id: string;
2162
+ payment_kind: string;
2163
+ payment_id: string;
2164
+ provider: string;
2165
+ kind: string;
2166
+ identifier: string;
2167
+ amount: number;
2168
+ currency: string;
2169
+ status: string;
2170
+ info: Record<string, any>;
2171
+ created_at: string;
2172
+ }
2173
+ export interface IBookingPage {
2174
+ url: string;
2175
+ hostname: string;
2176
+ pathname: string;
2177
+ id: string;
2178
+ title: string;
2179
+ }
1892
2180
  export type Create = Omit<Pick<Root, "event" | "coupon">, "attendees"> & {
1893
2181
  attendees: Mandatory<LevoEvent.Attendee.Root, "name" | "ticket" | "email">;
1894
2182
  };
@@ -1900,6 +2188,7 @@ export declare namespace LevoEvent {
1900
2188
  name: string;
1901
2189
  description: string;
1902
2190
  cover_image: string | null;
2191
+ icon?: IIcon | null;
1903
2192
  status: "published" | string;
1904
2193
  created_at: string;
1905
2194
  updated_at: string;
@@ -1911,6 +2200,7 @@ export declare namespace LevoEvent {
1911
2200
  }
1912
2201
  export interface Update {
1913
2202
  name: string;
2203
+ icon?: IIcon | null;
1914
2204
  }
1915
2205
  }
1916
2206
  }
@@ -1954,7 +2244,7 @@ export declare const LogicalOperators: {
1954
2244
 
1955
2245
  export declare type LogicalOperators = keyof typeof LogicalOperators;
1956
2246
 
1957
- declare enum LogLevel {
2247
+ export declare enum LogLevel {
1958
2248
  debug = 0,
1959
2249
  info = 1,
1960
2250
  warn = 2,
@@ -1968,12 +2258,21 @@ export declare const MediaKind: Record<"image" | "video" | "audio" | "document",
1968
2258
 
1969
2259
  export declare const MediaKindList: readonly ["image", "video", "audio", "document"];
1970
2260
 
2261
+ /** Reject types assignable to Error — forces `{ exception }` wrapping at the call site. */
2262
+ declare type NotError<T> = T extends Error ? never : T;
2263
+
1971
2264
  export declare type PlanKind = "addon" | "base";
1972
2265
 
1973
2266
  export declare type Prettify<T> = {
1974
2267
  [K in keyof T]: T[K];
1975
2268
  };
1976
2269
 
2270
+ /**
2271
+ * Middleware that batches error logs and sends them to a remote API.
2272
+ * Only forwards `LogLevel.error` — lower levels are ignored.
2273
+ */
2274
+ export declare const remoteLoggerMiddleware: (options: IRemoteLoggerMiddlewareOptions) => ILevoLoggerMiddleware;
2275
+
1977
2276
  export declare type WithinFilterType = {
1978
2277
  latitude: number;
1979
2278
  longitude: number;