@easy-cms/core 0.45.0 → 0.47.0

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/index.d.ts CHANGED
@@ -1,3 +1,6 @@
1
+ import { FieldCondition } from './conditions.js';
2
+ export { conditionIssues, matchesCondition } from './conditions.js';
3
+
1
4
  /** A document id. SQLite uses integers, Postgres may use either. */
2
5
  type ID = string | number;
3
6
  type Role = 'admin' | 'editor' | (string & {});
@@ -12,6 +15,11 @@ interface AuthUser {
12
15
  * backups, roles, other users' API keys).
13
16
  */
14
17
  readonly scoped?: boolean;
18
+ /**
19
+ * A member of the site, e.g. a customer (`auth.members.roles`): signs in on the site, never to
20
+ * the admin, and `isLoggedIn` doesn't count them.
21
+ */
22
+ readonly member?: boolean;
15
23
  readonly [field: string]: unknown;
16
24
  }
17
25
  /**
@@ -71,7 +79,13 @@ interface FieldAccess {
71
79
  readonly update?: FieldAccessFn;
72
80
  }
73
81
  declare const anyone: Access;
82
+ /**
83
+ * A signed-in user of the admin: not a site member (`auth.members`). What collections allow by
84
+ * default.
85
+ */
74
86
  declare const isLoggedIn: Access;
87
+ /** Anyone signed in, site members (e.g. customers) included. */
88
+ declare const isSignedIn: Access;
75
89
  declare const isAdmin: Access;
76
90
 
77
91
  /** What a preview token opens: one document of a collection, or one global. */
@@ -81,8 +95,11 @@ type PreviewTarget = {
81
95
  } | {
82
96
  readonly global: string;
83
97
  };
84
- /** Why a password link was sent: a forgotten password, or an invitation to a new account. */
85
- type PasswordPurpose = 'reset' | 'invite';
98
+ /**
99
+ * Why a link was sent: a forgotten password, an invitation to a new account, or (`verify`) to
100
+ * confirm the email of an account made by signing up.
101
+ */
102
+ type PasswordPurpose = 'reset' | 'invite' | 'verify';
86
103
 
87
104
  /** The cookie that carries a sign-in through the provider and back. */
88
105
  declare const SSO_COOKIE = "ecms-sso";
@@ -195,6 +212,29 @@ interface Session {
195
212
  readonly csrfToken: string;
196
213
  readonly expiresAt: string;
197
214
  }
215
+ interface SignupArgs {
216
+ readonly email: string;
217
+ readonly password: string;
218
+ readonly name?: string | undefined;
219
+ /** From `GET <api>/users/signup`: the form was loaded a moment ago. */
220
+ readonly token?: unknown;
221
+ /** The hidden field; bots fill it in. */
222
+ readonly honeypot?: unknown;
223
+ /** The Cloudflare Turnstile response, with `signup.turnstile`. */
224
+ readonly turnstile?: unknown;
225
+ readonly ip?: string | undefined;
226
+ /** The request's origin: used for the link only in development, without a site URL. */
227
+ readonly origin?: string | undefined;
228
+ readonly locale?: string | undefined;
229
+ /** The request's context (`onRequest`), e.g. the tenant: given to the users' hooks. */
230
+ readonly context?: RequestContext;
231
+ }
232
+ /** What signing up did: a link was emailed to confirm, or (without `verifyEmail`) a session. */
233
+ type SignupResult = {
234
+ readonly verify: true;
235
+ } | (Session & {
236
+ readonly verify: false;
237
+ });
198
238
  /** Where a password link is opened from, and the language of its email. */
199
239
  interface PasswordLinkOptions {
200
240
  /** The request's origin: used for the link only in development, when `serverURL` is not set. */
@@ -223,6 +263,29 @@ declare class Auth {
223
263
  setupCode?: string;
224
264
  ip?: string | undefined;
225
265
  }): Promise<Session>;
266
+ /** What a sign-up form needs: a token proving when it was loaded, and Turnstile's site key. */
267
+ signupForm(): {
268
+ token: string;
269
+ turnstile: string | null;
270
+ verifyEmail: boolean;
271
+ };
272
+ /**
273
+ * Creates a member's account (`auth.members.signup`). With `verifyEmail` (the default), emails
274
+ * a link to confirm the address and answers the same whether or not the email has an account;
275
+ * otherwise starts a session. Throws `ValidationError` for spam checks and bad input.
276
+ */
277
+ signup(args: SignupArgs): Promise<SignupResult>;
278
+ /** Confirms a member's email from the link, and signs them in. */
279
+ verifyEmail(args: {
280
+ token: string;
281
+ ip?: string | undefined;
282
+ }): Promise<Session>;
283
+ private mailVerifyLink;
284
+ /**
285
+ * A link to one of the site's pages for members (`auth.members.pages`), else to the admin's
286
+ * page of the same purpose.
287
+ */
288
+ private memberLink;
226
289
  hasUsers(): Promise<boolean>;
227
290
  /** Ends the session for a signed token. Unknown tokens are ignored. */
228
291
  logout(signedToken: string): Promise<void>;
@@ -374,12 +437,35 @@ interface Database {
374
437
  collection: string;
375
438
  data: Record<string, unknown>;
376
439
  }): Promise<RawDocument>;
377
- /** `data` holds the whole document after merging. Runs in one transaction. */
440
+ /**
441
+ * `data` holds the whole document after merging. Runs in one transaction. With `where`, only
442
+ * when the stored document matches it at the moment of writing (compare and set): `null` when
443
+ * it doesn't, and nothing is written.
444
+ */
378
445
  update(args: {
379
446
  collection: string;
380
447
  id: ID;
381
448
  data: Record<string, unknown>;
382
449
  }): Promise<RawDocument>;
450
+ update(args: {
451
+ collection: string;
452
+ id: ID;
453
+ data: Record<string, unknown>;
454
+ where: Where;
455
+ }): Promise<RawDocument | null>;
456
+ /**
457
+ * Adds `by` to a top-level number field in one statement, safe against concurrent calls; an
458
+ * empty value counts as 0. With `min` / `max`, only when the result stays within them. Returns
459
+ * the new value, or `null` when it would leave the bounds or the document is gone.
460
+ */
461
+ increment(args: {
462
+ collection: string;
463
+ id: ID;
464
+ field: string;
465
+ by: number;
466
+ min?: number | undefined;
467
+ max?: number | undefined;
468
+ }): Promise<number | null>;
383
469
  delete(args: {
384
470
  collection: string;
385
471
  id: ID;
@@ -623,8 +709,13 @@ type WithPluginFields<C extends Config, T extends {
623
709
  }, Key extends 'fields' | 'globalFields'> = [PluginFields<C, T['slug'], Key>] extends [never] ? T : Omit<T, 'fields'> & {
624
710
  readonly fields: readonly (T['fields'][number] | PluginFields<C, T['slug'], Key>)[];
625
711
  };
712
+ /**
713
+ * The config's own collections. A literal config without `collections` has none (only plugins
714
+ * add some); a loosely typed `Config` has any.
715
+ */
716
+ type OwnCollections<C extends Config> = 'collections' extends keyof C ? NonNullable<C['collections']>[number] : never;
626
717
  /** Every collection of a config, including the built-in ones and those plugins add. */
627
- type AllCollections<C extends Config> = NonNullable<C['collections']>[number] | BuiltinUsersCollection | BuiltinMediaCollection | ApiKeysOf<C> | FoldersOf<C> | PluginCollections<C>;
718
+ type AllCollections<C extends Config> = OwnCollections<C> | BuiltinUsersCollection | BuiltinMediaCollection | ApiKeysOf<C> | FoldersOf<C> | PluginCollections<C>;
628
719
  /** The built-in media collection; its documents are typed as `MediaDocument`. */
629
720
  interface BuiltinMediaCollection {
630
721
  readonly slug: 'media';
@@ -766,7 +857,7 @@ type InferGlobal<T extends FieldsOwner, C extends Config = Config> = Simplify<
766
857
  } ? {
767
858
  status: 'draft' | 'published';
768
859
  } : unknown) & FieldsValue<T['fields'], C>>;
769
- type CollectionSlug<C extends Config> = NonNullable<C['collections']>[number]['slug'] | 'users' | 'media' | ApiKeysOf<C>['slug'] | FoldersOf<C>['slug'] | PluginCollections<C>['slug'];
860
+ type CollectionSlug<C extends Config> = OwnCollections<C>['slug'] | 'users' | 'media' | ApiKeysOf<C>['slug'] | FoldersOf<C>['slug'] | PluginCollections<C>['slug'];
770
861
  type GlobalSlug<C extends Config> = NonNullable<C['globals']>[number]['slug'];
771
862
  /** Document type of a collection, e.g. `CollectionDocument<typeof config, 'posts'>`. */
772
863
  type CollectionDocument<C extends Config, S extends CollectionSlug<C>> = S extends 'media' ? MediaDocument : InferCollection<CollectionBySlug<C, S>, C>;
@@ -797,7 +888,10 @@ type InputValue<F extends Field> = F extends {
797
888
  readonly type: 'blocks';
798
889
  readonly blocks: infer B extends readonly Block[];
799
890
  } ? readonly BlockInput<B[number]>[] : FieldValue<F>;
800
- /** Required fields must be given, unless Easy CMS can fill them (default value, slug from another field). */
891
+ /**
892
+ * Required fields must be given, unless Easy CMS can fill them (default value, slug from another
893
+ * field) or a condition may hide them (`admin.condition`).
894
+ */
801
895
  type NeedsInput<F extends Field> = F extends {
802
896
  readonly required: true;
803
897
  } ? F extends {
@@ -805,6 +899,10 @@ type NeedsInput<F extends Field> = F extends {
805
899
  } ? never : F extends {
806
900
  readonly type: 'slug';
807
901
  readonly from: string;
902
+ } ? never : F extends {
903
+ readonly admin: {
904
+ readonly condition: object;
905
+ };
808
906
  } ? never : F : never;
809
907
  type FieldsInput<Fs extends readonly Field[]> = Simplify<{
810
908
  -readonly [F in NeedsInput<Visible<Fs>> as F['name']]: InputValue<F>;
@@ -1237,6 +1335,18 @@ interface UpdateOptions extends DepthOptions {
1237
1335
  * stays, and no version is added to the history.
1238
1336
  */
1239
1337
  readonly live?: boolean;
1338
+ /**
1339
+ * Saves only when the stored document still matches this at the moment of writing (compare and
1340
+ * set), e.g. `{ status: { equals: 'pending' } }` so that one of two concurrent calls wins.
1341
+ * `update()` then returns `null` when it doesn't match, after its `before*` hooks ran.
1342
+ */
1343
+ readonly where?: Where;
1344
+ }
1345
+ interface IncrementOptions {
1346
+ /** Only when the result stays at or above this, e.g. `0` for stock. */
1347
+ readonly min?: number;
1348
+ /** Only when the result stays at or below this. */
1349
+ readonly max?: number;
1240
1350
  }
1241
1351
  interface ReadOptions extends DepthOptions {
1242
1352
  /**
@@ -1261,8 +1371,8 @@ interface CreateEasyCMSOptions {
1261
1371
  readonly cwd?: string;
1262
1372
  /**
1263
1373
  * Run due scheduled jobs and webhook retries every minute in this process. Default: on when
1264
- * a collection or global has `schedule`, or `webhooks` is set. Turn it off where a cron calls
1265
- * `runJobs` (or `GET <api>/jobs/run`) instead.
1374
+ * a collection or global has `schedule`, or `webhooks`, `email` or `jobs` is set. Turn it off
1375
+ * where a cron calls `runJobs` (or `GET <api>/jobs/run`) instead.
1266
1376
  */
1267
1377
  readonly scheduler?: boolean;
1268
1378
  /** Default `verify` when `NODE_ENV=production`, otherwise `push`. */
@@ -1426,7 +1536,18 @@ declare class EasyCMS<C extends Config = Config> {
1426
1536
  /** Files at the top level are public. */
1427
1537
  private settleTopLevel;
1428
1538
  private settleFiles;
1429
- update<S extends Slug<C>>(collection: S, id: ID, data: Update<C, S>, options?: UpdateOptions): Promise<Doc<C, S>>;
1539
+ update<S extends Slug<C>>(collection: S, id: ID, data: Update<C, S>, options: UpdateOptions & {
1540
+ where: Where;
1541
+ }): Promise<Doc<C, S> | null>;
1542
+ update<S extends Slug<C>>(collection: S, id: ID, data: Update<C, S>, options?: UpdateOptions & {
1543
+ where?: undefined;
1544
+ }): Promise<Doc<C, S>>;
1545
+ /**
1546
+ * Adds `by` (negative to take away) to a top-level number field in one database statement, so
1547
+ * concurrent calls never lose a change, e.g. stock or a counter. Skips hooks, validation, access
1548
+ * and versions. Returns the new value, or `null` when `min` / `max` would be passed.
1549
+ */
1550
+ increment<S extends Slug<C>>(collection: S, id: ID, field: string, by: number, options?: IncrementOptions): Promise<number | null>;
1430
1551
  /**
1431
1552
  * Takes a document off the site: its status becomes `draft`. With versions and drafts, a plain
1432
1553
  * `update` with `status: 'draft'` only saves a draft and leaves the published document live;
@@ -1556,7 +1677,21 @@ declare class EasyCMS<C extends Config = Config> {
1556
1677
  sent: number;
1557
1678
  failed: number;
1558
1679
  };
1680
+ jobs: {
1681
+ ran: number;
1682
+ failed: number;
1683
+ };
1559
1684
  }>;
1685
+ /** `jobs` of the config that are due; when each last ran is kept in the database. */
1686
+ private runConfigJobs;
1687
+ /**
1688
+ * Sends an event of the app or a plugin (`events` in the config, e.g. `order.paid`) to the
1689
+ * webhooks that list it. Returns at once; deliveries are queued and retried like content changes.
1690
+ */
1691
+ emit(event: string, data: Record<string, unknown>, about?: {
1692
+ collection: string;
1693
+ id: ID;
1694
+ }): void;
1560
1695
  /**
1561
1696
  * Tries webhook deliveries that are due for another attempt. Deliveries are kept in the
1562
1697
  * database until they succeed, so they survive restarts.
@@ -1654,7 +1789,7 @@ declare class EasyCMS<C extends Config = Config> {
1654
1789
  /** Replaces published documents that have a newer draft with that draft. */
1655
1790
  private withDrafts;
1656
1791
  /** Sends webhook events for a change; `before` is the stored status before it, if any. */
1657
- private emit;
1792
+ private emitChange;
1658
1793
  /**
1659
1794
  * Writes the audit log entry for a change (`audit`): publishing, unpublishing and restoring
1660
1795
  * are told apart from other saves.
@@ -1728,6 +1863,15 @@ type AdminComponent = string | {
1728
1863
  };
1729
1864
  /** How the admin shows a field, with components from admin modules. */
1730
1865
  interface FieldAdmin {
1866
+ /** Help below the field's label. */
1867
+ readonly description?: Label;
1868
+ /** Its share of a row (`admin.layout`'s `row`). Default: an equal share. */
1869
+ readonly width?: '1/4' | '1/3' | '1/2' | '2/3' | '3/4' | 'full';
1870
+ /**
1871
+ * Shown only when its sibling fields match, e.g. `{ field: 'linkType', equals: 'external' }`.
1872
+ * A hidden field isn't required. See `FieldCondition`.
1873
+ */
1874
+ readonly condition?: FieldCondition;
1731
1875
  /** Shown instead of the field's input; the admin keeps the label and error messages. */
1732
1876
  readonly component?: AdminComponent;
1733
1877
  /** Shown below the field, e.g. a length meter or a preview. */
@@ -2097,6 +2241,7 @@ declare const DEFAULT_PASSWORD_EMAILS: {
2097
2241
  resetPassword: PasswordEmailFn;
2098
2242
  invite: PasswordEmailFn;
2099
2243
  passwordChanged: PasswordEmailFn;
2244
+ verifyEmail: PasswordEmailFn;
2100
2245
  };
2101
2246
 
2102
2247
  /**
@@ -2243,8 +2388,11 @@ type WebhookEvent = (typeof WEBHOOK_EVENTS)[number];
2243
2388
  interface WebhookConfig {
2244
2389
  /** Where to POST events. */
2245
2390
  readonly url: string;
2246
- /** Events to send. Default: all. */
2247
- readonly events?: readonly WebhookEvent[];
2391
+ /**
2392
+ * Events to send. Default: every content change. Events of the app or its plugins (`events`
2393
+ * in the config, e.g. `order.paid`) are sent only when listed here.
2394
+ */
2395
+ readonly events?: readonly (WebhookEvent | (string & {}))[];
2248
2396
  /** Collections to send events for. Default: all; `[]` for none. */
2249
2397
  readonly collections?: readonly string[];
2250
2398
  /** Globals to send events for. Default: all; `[]` for none. */
@@ -2256,11 +2404,15 @@ interface WebhookConfig {
2256
2404
  }
2257
2405
  /** What a webhook receives as JSON. */
2258
2406
  interface WebhookPayload {
2259
- readonly event: WebhookEvent;
2407
+ /** A content change (`WebhookEvent`), or an event of the app or a plugin, e.g. `order.paid`. */
2408
+ readonly event: string;
2260
2409
  readonly collection?: string;
2261
2410
  readonly global?: string;
2262
2411
  readonly id?: ID;
2263
- /** The stored document (every locale, no hidden fields); for `delete`, as it was. */
2412
+ /**
2413
+ * The stored document (every locale, no hidden fields); for `delete`, as it was. For an event of
2414
+ * the app or a plugin: what `cms.emit()` was given.
2415
+ */
2264
2416
  readonly doc: Record<string, unknown>;
2265
2417
  /** ISO time of the change. */
2266
2418
  readonly timestamp: string;
@@ -2338,17 +2490,72 @@ interface VersionsConfig {
2338
2490
  /** Versions kept per document; older ones are deleted. Default 50. */
2339
2491
  readonly max?: number;
2340
2492
  }
2493
+ /** A panel of an edit page's side column: a component, at the top or (default) below the rest. */
2494
+ type SidebarPanel = AdminComponent | {
2495
+ readonly tag: string;
2496
+ readonly props?: Readonly<Record<string, unknown>>;
2497
+ /** `top`: right below publishing, above the side fields. Default: below them. */
2498
+ readonly position?: 'top';
2499
+ };
2500
+ /**
2501
+ * Where the edit page puts its fields: tabs, collapsible sections and rows, by field name. Only
2502
+ * how they look: the data stays as the fields say. Fields not placed follow at the end (in the
2503
+ * first tab). Top-level fields; sidebar fields stay in the side column.
2504
+ *
2505
+ * ```ts
2506
+ * layout: [
2507
+ * { tab: 'Content', fields: ['title', { row: ['author', 'category'] }, 'body'] },
2508
+ * { tab: 'SEO', fields: ['meta'] },
2509
+ * ]
2510
+ * ```
2511
+ */
2512
+ type LayoutNode = string | {
2513
+ readonly row: readonly string[];
2514
+ } | {
2515
+ readonly collapsible: Label;
2516
+ /** Starts folded. */
2517
+ readonly collapsed?: boolean;
2518
+ readonly description?: Label;
2519
+ readonly fields: readonly LayoutNode[];
2520
+ } | {
2521
+ readonly tab: Label;
2522
+ readonly description?: Label;
2523
+ readonly fields: readonly LayoutNode[];
2524
+ };
2341
2525
  /** Custom admin components for a collection's or global's edit page. */
2342
2526
  interface ContainerAdmin {
2343
- /** Panels in the edit page's side column, below publishing (components from admin modules). */
2344
- readonly sidebar?: readonly AdminComponent[];
2527
+ /** Panels in the edit page's side column (components from admin modules). */
2528
+ readonly sidebar?: readonly SidebarPanel[];
2529
+ /** Tabs, collapsible sections and rows of the edit page. See `LayoutNode`. */
2530
+ readonly layout?: readonly LayoutNode[];
2531
+ /**
2532
+ * Its menu group: a group's id (`admin.nav`), e.g. `shop` or `shop.catalog`; `settings` for
2533
+ * Settings; or a label, which makes a group of that name. Default: Content for collections,
2534
+ * Settings › Site for globals.
2535
+ */
2536
+ readonly group?: 'settings' | Label;
2345
2537
  }
2346
2538
  interface CollectionAdmin extends ContainerAdmin {
2347
2539
  /**
2348
- * `settings` lists the collection under Settings in the admin menu (with Users and API keys)
2349
- * instead of with the content, e.g. for redirects or forms settings.
2540
+ * A number that needs attention, next to its menu item: the documents matching `where` (that
2541
+ * the user may read), e.g. orders to send. `tone`: `accent` (default), `warning` or `danger`.
2350
2542
  */
2351
- readonly group?: 'settings';
2543
+ readonly badge?: {
2544
+ readonly where: Where;
2545
+ readonly tone?: 'accent' | 'warning' | 'danger';
2546
+ /** What the number counts, for screen readers, e.g. `{ en: 'to send', th: 'รอจัดส่ง' }`. */
2547
+ readonly label?: Label;
2548
+ };
2549
+ /** The number of documents beside its menu item. Default `true`. */
2550
+ readonly count?: boolean;
2551
+ /** The list with no documents yet: what to say, and a link, e.g. to a guide. */
2552
+ readonly empty?: {
2553
+ readonly description?: Label;
2554
+ readonly link?: {
2555
+ readonly label: Label;
2556
+ readonly href: string;
2557
+ };
2558
+ };
2352
2559
  readonly list?: CollectionListAdmin;
2353
2560
  /**
2354
2561
  * With `auth.rbac`: the relationship field to `users` that names a document's owner, e.g.
@@ -2450,6 +2657,26 @@ interface AdminBrand {
2450
2657
  /** Main color as `#rrggbb`; lighter and darker shades are derived from it. */
2451
2658
  readonly color?: string;
2452
2659
  }
2660
+ /** A group of the admin menu (`admin.nav`). */
2661
+ interface NavGroup {
2662
+ /** Lowercase letters, digits and `-`; children are named `<parent>.<child>`, e.g. `shop.catalog`. */
2663
+ readonly id: string;
2664
+ readonly label: Label;
2665
+ readonly icon?: AdminIcon;
2666
+ /** Its place among the groups: lower first. Content is 0, the media library 10, Settings 1000. */
2667
+ readonly order?: number;
2668
+ /** Groups inside it, one level. */
2669
+ readonly children?: readonly Omit<NavGroup, 'children'>[];
2670
+ }
2671
+ /** An entry of the command palette (⌘K) that opens a page of the admin. */
2672
+ interface AdminCommand {
2673
+ readonly label: Label;
2674
+ /** A path in the admin, e.g. `/collections/orders?f_status=paid`. */
2675
+ readonly to: string;
2676
+ readonly icon?: AdminIcon;
2677
+ /** Words that find it besides its label. */
2678
+ readonly keywords?: readonly string[];
2679
+ }
2453
2680
  /** Who may see an admin page or dashboard widget. Default: every logged-in user. */
2454
2681
  type AdminViewAccess = (args: {
2455
2682
  readonly user: AuthUser;
@@ -2464,8 +2691,11 @@ interface AdminPage {
2464
2691
  readonly label: Label;
2465
2692
  /** Icon in the admin menu. Default `file-text`. */
2466
2693
  readonly icon?: AdminIcon;
2467
- /** Listed under Content (default) or Settings in the menu, or not listed (`false`): reached by links. */
2468
- readonly group?: 'content' | 'settings' | false;
2694
+ /**
2695
+ * Its menu group: `content` (default), `settings`, a group's id (`admin.nav`) or a label; `false`:
2696
+ * not listed, reached by links.
2697
+ */
2698
+ readonly group?: 'content' | 'settings' | false | Label;
2469
2699
  /** Who may open it. Pages a user may not open are left out of their admin. */
2470
2700
  readonly access?: AdminViewAccess;
2471
2701
  }
@@ -2497,6 +2727,15 @@ interface AdminConfig {
2497
2727
  * Collections not listed follow in config order, with the media library last.
2498
2728
  */
2499
2729
  readonly menu?: readonly string[];
2730
+ /**
2731
+ * The admin menu's groups, which collections, globals and pages name in `admin.group`, e.g.
2732
+ * `{ id: 'shop', label: 'Shop', icon: 'store', children: [{ id: 'catalog', label: 'Catalog' }] }`.
2733
+ * Built in: `content` and `settings` (with `site`, `people` and `system`); declaring one of
2734
+ * their ids changes its label, icon or order. Plugins declare their own.
2735
+ */
2736
+ readonly nav?: readonly NavGroup[];
2737
+ /** More entries of the command palette (⌘K), e.g. a plugin's page with a filter. */
2738
+ readonly commands?: readonly AdminCommand[];
2500
2739
  /**
2501
2740
  * JavaScript modules the admin loads after login, which define Web Components used by
2502
2741
  * fields (`admin.component`, `admin.after`) and edit pages (`admin.sidebar`). Each entry is a
@@ -2581,6 +2820,44 @@ interface RoutesConfig {
2581
2820
  /** Where the REST API is served. Default `/api/cms`. */
2582
2821
  readonly api?: string;
2583
2822
  }
2823
+ /**
2824
+ * People who sign in on the site rather than to the admin, e.g. customers of a shop.
2825
+ */
2826
+ interface MembersConfig {
2827
+ /**
2828
+ * Their roles, also listed in `roles`. Members never get into the admin, and access that
2829
+ * defaults to logged-in users (`isLoggedIn`) doesn't count them: give them access in the
2830
+ * collections they use, e.g. with `isSignedIn`.
2831
+ */
2832
+ readonly roles: readonly string[];
2833
+ /** Visitors create their own account: `POST <api>/users/signup`. */
2834
+ readonly signup?: MembersSignup;
2835
+ /**
2836
+ * The site's pages that open the links of members' emails, given `?token=`: paths on
2837
+ * `admin.siteUrl` (else `serverURL`), or full URLs. Without them, links go to the admin's pages.
2838
+ */
2839
+ readonly pages?: {
2840
+ /** Confirms the email of a new account: `POST <api>/users/verify-email` with the token. */
2841
+ readonly verifyEmail?: string;
2842
+ /** Sets a forgotten password: `POST <api>/users/reset-password` with the token. */
2843
+ readonly resetPassword?: string;
2844
+ };
2845
+ /** Your own text for the email that confirms an address. Default: English or Thai. */
2846
+ readonly emails?: {
2847
+ readonly verifyEmail?: PasswordEmailFn;
2848
+ };
2849
+ }
2850
+ interface MembersSignup {
2851
+ /** The role new accounts get: one of `members.roles`. */
2852
+ readonly role: string;
2853
+ /** New accounts confirm their email with a link before signing in. Default `true`. */
2854
+ readonly verifyEmail?: boolean;
2855
+ /** Cloudflare Turnstile, checked on every sign-up when set. */
2856
+ readonly turnstile?: {
2857
+ readonly siteKey: string;
2858
+ readonly secretKey: string;
2859
+ };
2860
+ }
2584
2861
  interface AuthConfig {
2585
2862
  /**
2586
2863
  * Roles a user can have. Must include `admin`. Default `['admin', 'editor']`. With `rbac`, these
@@ -2634,6 +2911,11 @@ interface AuthConfig {
2634
2911
  * no code is asked.
2635
2912
  */
2636
2913
  readonly setupCode?: string;
2914
+ /**
2915
+ * People who sign in on the site, not to the admin, e.g. customers: their roles, signing up,
2916
+ * and the pages their email links open.
2917
+ */
2918
+ readonly members?: MembersConfig;
2637
2919
  /** Your own text for the password emails, e.g. in your brand's voice. Default: English or Thai. */
2638
2920
  readonly emails?: {
2639
2921
  readonly resetPassword?: PasswordEmailFn;
@@ -2677,9 +2959,22 @@ interface EndpointRequest {
2677
2959
  json(): Promise<Record<string, unknown>>;
2678
2960
  }
2679
2961
  /**
2680
- * A custom REST endpoint, served under `routes.api`. Writes from the browser pass the same
2681
- * CSRF check as the built-in endpoints.
2962
+ * Work that runs with the scheduled jobs: every minute in a server, or each time a cron calls
2963
+ * `GET <api>/jobs/run`. E.g. a plugin's clean-up.
2682
2964
  */
2965
+ interface JobConfig {
2966
+ /** Unique, e.g. `ecommerce:carts`. */
2967
+ readonly name: string;
2968
+ /**
2969
+ * At most this often, in seconds. Default: every run. The last run is kept in the database, so
2970
+ * it holds across processes and serverless invocations.
2971
+ */
2972
+ readonly every?: number;
2973
+ readonly run: (args: {
2974
+ readonly cms: EasyCMS;
2975
+ readonly now: Date;
2976
+ }) => MaybePromise<unknown>;
2977
+ }
2683
2978
  /** An `easy-cms <name> [args…]` command. Built-in commands keep their names. */
2684
2979
  interface CliCommand {
2685
2980
  /** Lowercase, e.g. `nested:rebuild`. */
@@ -2696,6 +2991,10 @@ interface CliCommand {
2696
2991
  readonly log: (line: string) => void;
2697
2992
  }) => MaybePromise<number | undefined>;
2698
2993
  }
2994
+ /**
2995
+ * A custom REST endpoint, served under `routes.api`. Writes from the browser pass the same
2996
+ * CSRF check as the built-in endpoints.
2997
+ */
2699
2998
  interface Endpoint {
2700
2999
  /**
2701
3000
  * Path under the API, e.g. `/seo/generate` or `/stats/:collection`. The first segment must
@@ -2804,6 +3103,13 @@ interface Config {
2804
3103
  readonly cronSecret?: string;
2805
3104
  /** Endpoints notified when content changes, e.g. to rebuild a static site. */
2806
3105
  readonly webhooks?: readonly WebhookConfig[];
3106
+ /**
3107
+ * Events of the app or its plugins besides content changes, e.g. `order.paid`: sent with
3108
+ * `cms.emit()` to the webhooks that list them in `events`. Named `<area>.<what>`.
3109
+ */
3110
+ readonly events?: readonly string[];
3111
+ /** Work run with the scheduled jobs, e.g. a plugin's clean-up. */
3112
+ readonly jobs?: readonly JobConfig[];
2807
3113
  /** Content in several languages: fields with `localized: true` hold one value per locale. */
2808
3114
  readonly localization?: LocalizationConfig | null;
2809
3115
  readonly routes?: RoutesConfig;
@@ -2865,6 +3171,8 @@ interface ResolvedConfig extends Omit<Config, 'cors' | 'localization' | 'routes'
2865
3171
  readonly globals: readonly GlobalConfig[];
2866
3172
  readonly endpoints: readonly Endpoint[];
2867
3173
  readonly commands: readonly CliCommand[];
3174
+ readonly events: readonly string[];
3175
+ readonly jobs: readonly JobConfig[];
2868
3176
  readonly fieldTypes: readonly FieldTypeDefinition[];
2869
3177
  /** The config's plugins in order, with their `info` where they give one. */
2870
3178
  readonly installedPlugins: readonly Partial<PluginInfo>[];
@@ -3114,6 +3422,9 @@ declare function imageDimensions(data: Uint8Array, type: string): {
3114
3422
  height: number;
3115
3423
  } | undefined;
3116
3424
 
3425
+ /** The menu's groups that are always there. Declaring their ids changes labels, icons, order. */
3426
+ declare const BUILTIN_NAV: readonly NavGroup[];
3427
+
3117
3428
  declare const DEFAULT_DEPTH = 1;
3118
3429
  declare const MAX_DEPTH = 3;
3119
3430
  /** Loads the documents of one collection that the caller may see. */
@@ -3212,7 +3523,51 @@ declare function resolveAdminModule(specifier: string, cwd?: string): string | u
3212
3523
  interface AdminComponentRef {
3213
3524
  tag: string;
3214
3525
  props?: Record<string, unknown>;
3526
+ /** A side panel at the top of the side column (`position: 'top'`). */
3527
+ position?: 'top';
3528
+ }
3529
+ /** Where the edit page puts its fields (`admin.layout`), with unplaced fields filled in. */
3530
+ type AdminLayoutNode = {
3531
+ type: 'field';
3532
+ name: string;
3533
+ } | {
3534
+ type: 'row';
3535
+ fields: string[];
3536
+ } | {
3537
+ type: 'collapsible';
3538
+ label: Label;
3539
+ collapsed?: boolean;
3540
+ description?: Label;
3541
+ nodes: AdminLayoutNode[];
3542
+ } | {
3543
+ type: 'tab';
3544
+ label: Label;
3545
+ description?: Label;
3546
+ nodes: AdminLayoutNode[];
3547
+ };
3548
+ /** An entry of the admin menu. */
3549
+ type AdminNavItem = {
3550
+ kind: 'collection';
3551
+ slug: string;
3552
+ } | {
3553
+ kind: 'global';
3554
+ slug: string;
3555
+ } | {
3556
+ kind: 'page';
3557
+ path: string;
3558
+ } | {
3559
+ kind: 'view';
3560
+ view: 'roles' | 'sso' | 'backups' | 'email' | 'deliveries' | 'audit';
3561
+ };
3562
+ /** A group of the admin menu (`admin.nav`), with what this user may open in it. */
3563
+ interface AdminNavGroup {
3564
+ kind: 'group';
3565
+ id: string;
3566
+ label: Label;
3567
+ icon?: string;
3568
+ items: AdminNavNode[];
3215
3569
  }
3570
+ type AdminNavNode = AdminNavItem | AdminNavGroup;
3216
3571
  /** A field as the admin UI sees it: plain JSON, no functions. */
3217
3572
  interface AdminField {
3218
3573
  name: string;
@@ -3271,6 +3626,12 @@ interface AdminField {
3271
3626
  noCreate?: boolean;
3272
3627
  /** A field of an added type (`fieldTypes`), e.g. `color`; `type` is the base it's stored as. */
3273
3628
  customType?: string;
3629
+ /** Help below its label (`admin.description`). */
3630
+ description?: Label;
3631
+ /** Its share of a row (`admin.width`). */
3632
+ width?: string;
3633
+ /** Shown only when its siblings match (`admin.condition`). */
3634
+ condition?: FieldCondition;
3274
3635
  }
3275
3636
  interface AdminCollection {
3276
3637
  slug: string;
@@ -3291,8 +3652,23 @@ interface AdminCollection {
3291
3652
  fields: AdminField[];
3292
3653
  /** Panels from admin modules in the edit page's side column. */
3293
3654
  sidebar?: AdminComponentRef[];
3294
- /** Listed under Settings in the menu (users, API keys, `admin.group: 'settings'`). */
3295
- group?: 'settings';
3655
+ /** Tabs, sections and rows of the edit page (`admin.layout`). */
3656
+ layout?: AdminLayoutNode[];
3657
+ /** A number in the menu (`admin.badge`); the menu's counts come from `GET <api>/admin/counts`. */
3658
+ badge?: {
3659
+ tone: 'accent' | 'warning' | 'danger';
3660
+ label?: Label;
3661
+ };
3662
+ /** No document count beside it in the menu (`admin.count: false`). */
3663
+ noCount?: boolean;
3664
+ /** What the list says while it has no documents (`admin.empty`). */
3665
+ empty?: {
3666
+ description?: Label;
3667
+ link?: {
3668
+ label: Label;
3669
+ href: string;
3670
+ };
3671
+ };
3296
3672
  /** The list is a tree along this relationship field (`admin.list.tree`). */
3297
3673
  tree?: string;
3298
3674
  /** The list's default order (`admin.list.sort`). */
@@ -3325,6 +3701,8 @@ interface AdminGlobal {
3325
3701
  fields: AdminField[];
3326
3702
  /** Panels from admin modules in the edit page's side column. */
3327
3703
  sidebar?: AdminComponentRef[];
3704
+ /** Tabs, sections and rows of the edit page (`admin.layout`). */
3705
+ layout?: AdminLayoutNode[];
3328
3706
  permissions: {
3329
3707
  read: boolean;
3330
3708
  update: boolean;
@@ -3336,8 +3714,6 @@ interface AdminPageRef {
3336
3714
  path: string;
3337
3715
  label: Label;
3338
3716
  icon?: string;
3339
- /** Where it is listed in the menu; `false`: not listed. */
3340
- group: 'content' | 'settings' | false;
3341
3717
  component: AdminComponentRef;
3342
3718
  }
3343
3719
  /** A dashboard panel (`admin.dashboard`) this user may see. */
@@ -3353,6 +3729,15 @@ interface AdminSchema {
3353
3729
  passwordLinks: boolean;
3354
3730
  /** Menu order of collections (`admin.menu`); unlisted ones follow. */
3355
3731
  menu: string[];
3732
+ /** The menu: groups and what this user may open in them, in order. */
3733
+ nav: AdminNavNode[];
3734
+ /** More entries of the command palette (`admin.commands`). */
3735
+ commands: {
3736
+ label: Label;
3737
+ to: string;
3738
+ icon?: string;
3739
+ keywords?: string[];
3740
+ }[];
3356
3741
  /** Content locales, when the config has `localization`. */
3357
3742
  localization: {
3358
3743
  locales: string[];
@@ -3402,6 +3787,13 @@ interface AdminSchema {
3402
3787
  dashboard: AdminWidgetRef[];
3403
3788
  }
3404
3789
 
3790
+ interface SearchHit {
3791
+ readonly collection: string;
3792
+ readonly id: ID;
3793
+ readonly title: string;
3794
+ readonly status?: string;
3795
+ }
3796
+
3405
3797
  /** Something an admin should look at, shown on the dashboard with a link to how to fix it. */
3406
3798
  type AdminAttention =
3407
3799
  /** Webhook deliveries that failed for good in the last 7 days; `url`: the one failing most. */
@@ -3495,6 +3887,27 @@ declare function createRestHandler<C extends Config>(instance: EasyCMS<C>, optio
3495
3887
  declare function createRootEndpointHandler<C extends Config>(instance: EasyCMS<C>, options?: Pick<RestHandlerOptions, 'getClientIp'>): (request: Request) => Promise<Response | undefined>;
3496
3888
  declare function readCookie(request: Request, name: string): string | undefined;
3497
3889
 
3890
+ /** A token that proves the form `purpose` names was loaded at `now`: `<time>.<signature>`. */
3891
+ declare function formToken(secret: string, purpose: string, now?: number): string;
3892
+ /**
3893
+ * Checks a token: `ok` when the form was loaded at least `minTime` ms ago (people take a few
3894
+ * seconds; bots don't) and less than a day ago.
3895
+ */
3896
+ declare function checkFormToken(secret: string, purpose: string, token: unknown, minTime: number, now?: number): 'ok' | 'invalid' | 'too-fast' | 'expired';
3897
+ /**
3898
+ * Rate-limit keys for `subject` (e.g. an IP and a form) in the current and previous window of
3899
+ * `window` seconds. A hash with the window in it: no IP is kept, and keys from different
3900
+ * windows can't be linked.
3901
+ */
3902
+ declare function rateKeys(secret: string, subject: string, window: number, now?: number): {
3903
+ current: string;
3904
+ previous: string;
3905
+ };
3906
+ /** The hidden field bots fill in: a common name the form doesn't use. */
3907
+ declare function honeypotName(names: readonly string[]): string;
3908
+ /** Checks a Cloudflare Turnstile response with Cloudflare. */
3909
+ declare function verifyTurnstile(secretKey: string, response: unknown, ip: string | undefined, fetcher?: typeof fetch): Promise<boolean>;
3910
+
3498
3911
  /** Best-effort English singular: "categories" → "category". */
3499
3912
  declare function singularize(word: string): string;
3500
3913
  /**
@@ -3512,4 +3925,4 @@ declare function validateConfig(config: Config): ConfigIssue[];
3512
3925
  /** The version of `@easy-cms/core`, set when the package is built. */
3513
3926
  declare const VERSION: string;
3514
3927
 
3515
- export { ADMIN_ICONS, API_KEYS, API_KEY_GLOBAL_OPERATIONS, API_KEY_OPERATIONS, type Access, type AccessArgs, type AccessOptions, type AdminAttention, type AdminBackup, type AdminBackups, type AdminBrand, type AdminCollection, type AdminComponent, type AdminComponentRef, type AdminConfig, type AdminDeliveries, type AdminDelivery, type AdminEmail, type AdminEmailDelivery, type AdminField, type AdminFieldArgs, type AdminGlobal, type AdminIcon, type AdminLocale, type AdminPage, type AdminPageRef, type AdminRole, type AdminRoleChange, type AdminRoleField, type AdminRoleTarget, type AdminRoleView, type AdminRoles, type AdminSchema, type AdminSso, type AdminStatus, type AdminSwitcher, type AdminViewAccess, type AdminWebhookDelivery, type AdminWidgetRef, type AfterChangeHook, type AfterDeleteHook, type AfterReadHook, type ApiHandlerOptions, type ApiKeyContext, type ApiKeyGlobalOperation, type ApiKeyOperation, type ApiKeyPermissions, type ArrayField, type AuditChange, type AuditConfig, type AuditEntry, AuditLog, type AuditPage, type AuditVerification, Auth, type AuthConfig, type AuthProvider, type AuthProviderProfile, type AuthProviderRequest, type AuthUser, BUILTIN_COLLECTIONS, type BackupState, type BackupsConfig, type BeforeChangeHook, type BeforeDeleteHook, type BeforeValidateHook, type Block, type BlocksField, type BooleanField, type BuiltinApiKeysCollection, type BuiltinMediaCollection, type BuiltinMediaFoldersCollection, type BuiltinUsersCollection, type BundleHints, CONFIG_FILE_NAMES, CSRF_COOKIE, CSRF_HEADER, type CliCommand, type CollectionAccess, type CollectionAdmin, type CollectionConfig, type CollectionDocument, type CollectionHooks, type CollectionListAdmin, type CollectionSlug, type Config, ConfigError, type ConfigIssue, type ContainerAdmin, type CopyProgress, type CopyResult, type CreateEasyCMSOptions, type CreateInput, type CreateMigrationResult, type CustomField, type CustomFieldTypes, DEFAULT_ADMIN_PATH, DEFAULT_API_PATH, DEFAULT_DEPTH, DEFAULT_MAX_FILE_SIZE, DEFAULT_MAX_VERSIONS, DEFAULT_PASSWORD_EMAILS, DEFAULT_TOKEN_EXPIRATION, type DashboardWidget, type Database, type DatabaseAdapter, type DatabaseInitArgs, type DatabaseTransfer, type DateField, type DeliveryKind, type DeliveryState, type DepthOptions, type DirectUpload, type DocumentOf, EXTENSIONS, EasyCMS, EasyCMSError, type EmailAdapter, type EmailCheck, type EmailField, type EmailMessage, type EmailSetting, type Endpoint, type EndpointRequest, FIELD_TYPES, FIELD_TYPE_BASES, FOLDER_LEVELS, type Field, type FieldAccess, type FieldAccessFn, type FieldAdmin, type FieldError, type FieldRule, type FieldType, type FieldTypeBase, type FieldTypeDefinition, type FieldTypeValidateContext, type FieldValidate, type FieldValidateContext, type FieldValue, type FieldsInput, type FieldsValue, type FilterOptions, type FilterOptionsArgs, type FindArgs, type FindOptions, type FolderLevel, type FolderPermissions, ForbiddenError, type GlobalAccess, type GlobalConfig, type GlobalDocument, type GlobalHooks, type GlobalInput, type GlobalSlug, type GroupField, type ID, INTERNAL_COLLECTIONS, type ImageSize, type InferCollection, type InferGlobal, type JsonField, type Label, type LivePreview, type LoadConfigOptions, type LocalStorageOptions, type LocalizationConfig, type Logger, type LoginArgs, MAX_DEPTH, MEDIA, MEDIA_FOLDERS, MIME_GROUPS, MIN_PASSWORD_LENGTH, MIN_SECRET_LENGTH, type MediaDocument, MediaFolders, type MediaSize, type MigrationInfo, NotFoundError, type NumberField, type OnRequest, type OnRequestArgs, type Operation, type PaginatedDocs, type PasswordEmail, type PasswordEmailArgs, type PasswordEmailFn, type PasswordLinkOptions, PayloadTooLargeError, type Plugin, type PluginInfo, type PluginTypes, type PreviewTarget, type PreviewURL, QueryError, ROLE_OPERATIONS, type RawDocument, type ReadOptions, type RelationshipField, type RequestContext, type ResolvedConfig, type RestHandler, type RestHandlerOptions, type RichTextDocument, type RichTextField, type Role, type RoleOperation, type RolePermissions, Roles, type RoutesConfig, SESSION_COOKIE, SSO_COOKIE, type ScheduledJob, SchemaError, type SchemaMode, type SelectField, type SelectOption, type Session, type SlugField, type SlugOf, type SsoOutcome, type SsoProviderRef, type StorageAdapter, type StoredFile, type TextField, type TextareaField, TooManyRequestsError, type TypedPlugin, UnauthorizedError, type UpdateInput, type UpdateOptions, type UploadConfig, type UploadField, type UploadFromURLConfig, type UserIdentity, VERSION, ValidationError, type Version, type VersionSummary, type VersionsConfig, WEBHOOK_EVENTS, type WebhookConfig, type WebhookEvent, type WebhookPayload, type Where, type WhereOperators, anyone, applyDefaults, applyPlugins, configSignature, consoleEmail, consoleLogger, copyDatabase, createApiHandler, createEasyCMS, createRestHandler, createRootEndpointHandler, defineConfig, defineFieldType, definePlugin, expandMimeTypes, fillMissing, findConfigFile, generateSlugs, generateTypes, hasRows, hashPassword, imageDimensions, importConfig, isAdmin, isHasMany, isLoggedIn, isSystemAdmin, keyAllows, loadConfig, localStorage, mergeForUpdate, mimeAllowed, mimeAllowedBy, parseId, populate, readCookie, resolveAdminModule, resolveConfig, rowFields, sharedEasyCMS, silentLogger, singularize, slugify, sniffMimeType, uniqueWithinOf, validateConfig, validateFields, verifyPassword, writeBackupFile };
3928
+ export { ADMIN_ICONS, API_KEYS, API_KEY_GLOBAL_OPERATIONS, API_KEY_OPERATIONS, type Access, type AccessArgs, type AccessOptions, type AdminAttention, type AdminBackup, type AdminBackups, type AdminBrand, type AdminCollection, type AdminCommand, type AdminComponent, type AdminComponentRef, type AdminConfig, type AdminDeliveries, type AdminDelivery, type AdminEmail, type AdminEmailDelivery, type AdminField, type AdminFieldArgs, type AdminGlobal, type AdminIcon, type AdminLayoutNode, type AdminLocale, type AdminNavGroup, type AdminNavItem, type AdminNavNode, type AdminPage, type AdminPageRef, type AdminRole, type AdminRoleChange, type AdminRoleField, type AdminRoleTarget, type AdminRoleView, type AdminRoles, type AdminSchema, type AdminSso, type AdminStatus, type AdminSwitcher, type AdminViewAccess, type AdminWebhookDelivery, type AdminWidgetRef, type AfterChangeHook, type AfterDeleteHook, type AfterReadHook, type ApiHandlerOptions, type ApiKeyContext, type ApiKeyGlobalOperation, type ApiKeyOperation, type ApiKeyPermissions, type ArrayField, type AuditChange, type AuditConfig, type AuditEntry, AuditLog, type AuditPage, type AuditVerification, Auth, type AuthConfig, type AuthProvider, type AuthProviderProfile, type AuthProviderRequest, type AuthUser, BUILTIN_COLLECTIONS, BUILTIN_NAV, type BackupState, type BackupsConfig, type BeforeChangeHook, type BeforeDeleteHook, type BeforeValidateHook, type Block, type BlocksField, type BooleanField, type BuiltinApiKeysCollection, type BuiltinMediaCollection, type BuiltinMediaFoldersCollection, type BuiltinUsersCollection, type BundleHints, CONFIG_FILE_NAMES, CSRF_COOKIE, CSRF_HEADER, type CliCommand, type CollectionAccess, type CollectionAdmin, type CollectionConfig, type CollectionDocument, type CollectionHooks, type CollectionListAdmin, type CollectionSlug, type Config, ConfigError, type ConfigIssue, type ContainerAdmin, type CopyProgress, type CopyResult, type CreateEasyCMSOptions, type CreateInput, type CreateMigrationResult, type CustomField, type CustomFieldTypes, DEFAULT_ADMIN_PATH, DEFAULT_API_PATH, DEFAULT_DEPTH, DEFAULT_MAX_FILE_SIZE, DEFAULT_MAX_VERSIONS, DEFAULT_PASSWORD_EMAILS, DEFAULT_TOKEN_EXPIRATION, type DashboardWidget, type Database, type DatabaseAdapter, type DatabaseInitArgs, type DatabaseTransfer, type DateField, type DeliveryKind, type DeliveryState, type DepthOptions, type DirectUpload, type DocumentOf, EXTENSIONS, EasyCMS, EasyCMSError, type EmailAdapter, type EmailCheck, type EmailField, type EmailMessage, type EmailSetting, type Endpoint, type EndpointRequest, FIELD_TYPES, FIELD_TYPE_BASES, FOLDER_LEVELS, type Field, type FieldAccess, type FieldAccessFn, type FieldAdmin, FieldCondition, type FieldError, type FieldRule, type FieldType, type FieldTypeBase, type FieldTypeDefinition, type FieldTypeValidateContext, type FieldValidate, type FieldValidateContext, type FieldValue, type FieldsInput, type FieldsValue, type FilterOptions, type FilterOptionsArgs, type FindArgs, type FindOptions, type FolderLevel, type FolderPermissions, ForbiddenError, type GlobalAccess, type GlobalConfig, type GlobalDocument, type GlobalHooks, type GlobalInput, type GlobalSlug, type GroupField, type ID, INTERNAL_COLLECTIONS, type ImageSize, type IncrementOptions, type InferCollection, type InferGlobal, type JobConfig, type JsonField, type Label, type LayoutNode, type LivePreview, type LoadConfigOptions, type LocalStorageOptions, type LocalizationConfig, type Logger, type LoginArgs, MAX_DEPTH, MEDIA, MEDIA_FOLDERS, MIME_GROUPS, MIN_PASSWORD_LENGTH, MIN_SECRET_LENGTH, type MediaDocument, MediaFolders, type MediaSize, type MembersConfig, type MembersSignup, type MigrationInfo, type NavGroup, NotFoundError, type NumberField, type OnRequest, type OnRequestArgs, type Operation, type PaginatedDocs, type PasswordEmail, type PasswordEmailArgs, type PasswordEmailFn, type PasswordLinkOptions, PayloadTooLargeError, type Plugin, type PluginInfo, type PluginTypes, type PreviewTarget, type PreviewURL, QueryError, ROLE_OPERATIONS, type RawDocument, type ReadOptions, type RelationshipField, type RequestContext, type ResolvedConfig, type RestHandler, type RestHandlerOptions, type RichTextDocument, type RichTextField, type Role, type RoleOperation, type RolePermissions, Roles, type RoutesConfig, SESSION_COOKIE, SSO_COOKIE, type ScheduledJob, SchemaError, type SchemaMode, type SearchHit, type SelectField, type SelectOption, type Session, type SidebarPanel, type SignupArgs, type SignupResult, type SlugField, type SlugOf, type SsoOutcome, type SsoProviderRef, type StorageAdapter, type StoredFile, type TextField, type TextareaField, TooManyRequestsError, type TypedPlugin, UnauthorizedError, type UpdateInput, type UpdateOptions, type UploadConfig, type UploadField, type UploadFromURLConfig, type UserIdentity, VERSION, ValidationError, type Version, type VersionSummary, type VersionsConfig, WEBHOOK_EVENTS, type WebhookConfig, type WebhookEvent, type WebhookPayload, type Where, type WhereOperators, anyone, applyDefaults, applyPlugins, checkFormToken, configSignature, consoleEmail, consoleLogger, copyDatabase, createApiHandler, createEasyCMS, createRestHandler, createRootEndpointHandler, defineConfig, defineFieldType, definePlugin, expandMimeTypes, fillMissing, findConfigFile, formToken, generateSlugs, generateTypes, hasRows, hashPassword, honeypotName, imageDimensions, importConfig, isAdmin, isHasMany, isLoggedIn, isSignedIn, isSystemAdmin, keyAllows, loadConfig, localStorage, mergeForUpdate, mimeAllowed, mimeAllowedBy, parseId, populate, rateKeys, readCookie, resolveAdminModule, resolveConfig, rowFields, sharedEasyCMS, silentLogger, singularize, slugify, sniffMimeType, uniqueWithinOf, validateConfig, validateFields, verifyPassword, verifyTurnstile, writeBackupFile };