@easy-cms/core 1.7.1 → 1.9.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.
@@ -3874,7 +3874,7 @@ var VersionStore = class {
3874
3874
  };
3875
3875
 
3876
3876
  // src/local-api.ts
3877
- import { createHmac as createHmac6, randomBytes as randomBytes6, randomUUID as randomUUID3, timingSafeEqual as timingSafeEqual5 } from "crypto";
3877
+ import { createHash as createHash4, createHmac as createHmac6, randomBytes as randomBytes6, randomUUID as randomUUID3, timingSafeEqual as timingSafeEqual5 } from "crypto";
3878
3878
 
3879
3879
  // src/auth/common-passwords.ts
3880
3880
  var LIST = `
@@ -4426,7 +4426,7 @@ function read(response, maxBytes, deadline) {
4426
4426
  var keys = (list) => new Set(list.split(/\s+/).filter(Boolean));
4427
4427
  var CONFIG = keys(`secret db serverURL cors cronSecret timeZone webhooks events jobs localization routes admin
4428
4428
  upload auth collections globals endpoints cliCommands onRequest fieldTypes apiKeys email backups
4429
- audit logs plugins`);
4429
+ audit logs countCacheSeconds maxPage plugins`);
4430
4430
  var ADMIN = keys("path locale brand siteURL nav commands modules pages dashboard switcher");
4431
4431
  var AUTH = keys(`roles rbac tokenExpiration maxLoginAttempts lockWindow trustedOrigins
4432
4432
  resetPasswordExpiration inviteExpiration providers providerSignUp password setupCode members emails`);
@@ -4888,6 +4888,8 @@ function validateConfig(config) {
4888
4888
  validateBackups(config, add, (issue) => issues.push(issue));
4889
4889
  validateAudit(config, add);
4890
4890
  validateLogs(config, add);
4891
+ validateCountCache(config, add);
4892
+ validateMaxPage(config, add);
4891
4893
  validateAuth(config, add);
4892
4894
  validateCors(config.cors, add);
4893
4895
  validateLocalization(config, add);
@@ -5510,6 +5512,16 @@ function validateUpload(config, add) {
5510
5512
  var FOLDER_KEY = /^[a-z0-9][a-z0-9_-]{0,59}$/;
5511
5513
  var MIME_PATTERN = /^([\w.+-]+\/(\*|[\w.+-]+)|documents|office|archives)$/i;
5512
5514
  var HOST_PATTERN = /^(\*|(\*\.)?[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*)$/i;
5515
+ function validateMaxPage(config, add) {
5516
+ const max = config.maxPage;
5517
+ if (max !== void 0 && !(Number.isInteger(max) && max >= 1))
5518
+ add("maxPage", "must be a whole number, 1 or more");
5519
+ }
5520
+ function validateCountCache(config, add) {
5521
+ const seconds = config.countCacheSeconds;
5522
+ if (seconds !== void 0 && !(typeof seconds === "number" && Number.isFinite(seconds) && seconds >= 0))
5523
+ add("countCacheSeconds", "must be a number of seconds, 0 or more");
5524
+ }
5513
5525
  function validateLogs(config, add) {
5514
5526
  const logs = config.logs;
5515
5527
  if (logs === void 0) return;
@@ -6534,7 +6546,29 @@ var EasyCMS = class {
6534
6546
  locale === ALL_LOCALES ? this.config.localization?.defaultLocale ?? locale : locale,
6535
6547
  this.config.localization?.locales ?? []
6536
6548
  );
6537
- const result = await this.db.find({ collection: collection2, where, sort, limit, page });
6549
+ if (options.cursor !== void 0) {
6550
+ if (options.page !== void 0) throw new QueryError("Use either cursor or page, not both");
6551
+ if (limit === 0) throw new QueryError("A cursor needs a limit above 0");
6552
+ if (!this.db.findAfter) throw new QueryError("This database adapter has no cursor pagination");
6553
+ const query = cursorQuery(collection2, options.where, requested, locale, draft);
6554
+ const after = readCursor(options.cursor, query);
6555
+ const result2 = await this.db.findAfter({ collection: collection2, where, sort, limit, after });
6556
+ const found2 = draft ? await this.withDrafts(config, result2.docs) : result2.docs;
6557
+ const docs2 = await this.output(config, found2, guard, { ...options, draft });
6558
+ return {
6559
+ docs: docs2,
6560
+ limit,
6561
+ nextCursor: result2.hasNextPage && result2.next ? writeCursor(result2.next, query) : null,
6562
+ hasNextPage: result2.hasNextPage,
6563
+ hasPrevPage: after !== null,
6564
+ totalDocs: null,
6565
+ totalPages: null,
6566
+ page: null
6567
+ };
6568
+ }
6569
+ const args = { collection: collection2, where, sort, limit, page };
6570
+ const count = options.count !== false || limit === 0;
6571
+ const result = count ? await this.db.find(args) : this.db.findPage ? await this.db.findPage(args) : { ...await this.db.find(args), totalDocs: null, totalPages: null };
6538
6572
  const found = draft ? await this.withDrafts(config, result.docs) : result.docs;
6539
6573
  const docs = await this.output(config, found, guard, { ...options, draft });
6540
6574
  return { ...result, docs };
@@ -9030,6 +9064,28 @@ function durationSeconds(value) {
9030
9064
  if (seconds > MAX_LINK) throw new QueryError("expiresIn can be at most 7 days");
9031
9065
  return Math.floor(seconds);
9032
9066
  }
9067
+ function cursorQuery(collection2, where, sort, locale, draft) {
9068
+ const key = JSON.stringify([collection2, where ?? null, sort, locale ?? null, draft]);
9069
+ return createHash4("sha256").update(key).digest("base64url").slice(0, 16);
9070
+ }
9071
+ function writeCursor(keys2, query) {
9072
+ return Buffer.from(JSON.stringify({ k: keys2, q: query })).toString("base64url");
9073
+ }
9074
+ function readCursor(cursor, query) {
9075
+ if (cursor === "") return null;
9076
+ let parsed;
9077
+ try {
9078
+ parsed = JSON.parse(Buffer.from(cursor, "base64url").toString("utf8"));
9079
+ } catch {
9080
+ throw new QueryError("cursor is not a cursor from this API");
9081
+ }
9082
+ const { k, q } = parsed ?? {};
9083
+ if (!Array.isArray(k) || typeof q !== "string")
9084
+ throw new QueryError("cursor is not a cursor from this API");
9085
+ if (q !== query)
9086
+ throw new QueryError("cursor was made for another query: keep where, sort and locale the same");
9087
+ return k;
9088
+ }
9033
9089
 
9034
9090
  // src/rest/admin-jobs.ts
9035
9091
  var has = (config, slug2) => config.collections.some((c) => c.slug === slug2);
@@ -9761,7 +9817,7 @@ function rank(role, config) {
9761
9817
  }
9762
9818
 
9763
9819
  // src/rest/admin-modules.ts
9764
- import { createHash as createHash4 } from "crypto";
9820
+ import { createHash as createHash5 } from "crypto";
9765
9821
  import { readFile as readFile3 } from "fs/promises";
9766
9822
  import { createRequire } from "module";
9767
9823
  import { join as join3 } from "path";
@@ -9802,11 +9858,11 @@ async function readAdminModule(cms, index) {
9802
9858
  if (!file) return void 0;
9803
9859
  const body = await readFile3(file, "utf8").catch(() => void 0);
9804
9860
  if (body === void 0) return void 0;
9805
- return { body, etag: `"${createHash4("sha1").update(body).digest("base64url")}"` };
9861
+ return { body, etag: `"${createHash5("sha1").update(body).digest("base64url")}"` };
9806
9862
  }
9807
9863
 
9808
9864
  // src/version.ts
9809
- var VERSION = true ? "1.7.1" : "0.0.0-dev";
9865
+ var VERSION = true ? "1.9.0" : "0.0.0-dev";
9810
9866
 
9811
9867
  // src/rest/handler.ts
9812
9868
  import { randomUUID as randomUUID4 } from "crypto";
@@ -10695,6 +10751,15 @@ function parseListQuery(url) {
10695
10751
  if (sort) query.sort = sort;
10696
10752
  const depth = integer("depth", params.depth, 0, 3);
10697
10753
  if (depth !== void 0) query.depth = depth;
10754
+ if (params.cursor !== void 0) {
10755
+ if (typeof params.cursor !== "string") throw new QueryError("cursor must be a string");
10756
+ if (params.page !== void 0) throw new QueryError("Use either cursor or page, not both");
10757
+ query.cursor = params.cursor;
10758
+ }
10759
+ if (params.count !== void 0 && params.count !== "true") {
10760
+ if (params.count !== "false") throw new QueryError("count must be true or false");
10761
+ query.count = false;
10762
+ }
10698
10763
  return query;
10699
10764
  }
10700
10765
  function parseDepth(url) {
@@ -11512,10 +11577,19 @@ async function route(cms, ctx, method, path, options) {
11512
11577
  }
11513
11578
  if (second === void 0) {
11514
11579
  if (method === "GET") {
11515
- const query = parseListQuery(ctx.url);
11580
+ const { page, ...query } = parseListQuery(ctx.url);
11516
11581
  const filter = await pickerFilter(cms, ctx.url, collection2, ctx.user, ctx.context);
11517
11582
  if (filter) query.where = query.where ? { and: [query.where, filter] } : filter;
11518
- return { body: await cms.find(collection2, { ...access, ...query, draft }) };
11583
+ const { maxPage } = cms.config;
11584
+ if (maxPage !== void 0 && ctx.via !== "cookie" && page > maxPage)
11585
+ throw new QueryError(`page can be at most ${maxPage}: use cursor to go further`);
11586
+ const options2 = { ...access, ...query, draft };
11587
+ return {
11588
+ body: await cms.find(
11589
+ collection2,
11590
+ query.cursor === void 0 ? { ...options2, page } : options2
11591
+ )
11592
+ };
11519
11593
  }
11520
11594
  if (method === "POST") {
11521
11595
  const body = await readJson(ctx.request);
@@ -30,4 +30,5 @@ declare function matchesCondition(condition: FieldCondition, data: Data): boolea
30
30
  /** Problems with a condition, for the config's checks; `[]` when it's fine. */
31
31
  declare function conditionIssues(condition: unknown, siblings: readonly string[]): string[];
32
32
 
33
- export { type FieldCondition, conditionIssues, matchesCondition };
33
+ export { conditionIssues, matchesCondition };
34
+ export type { FieldCondition };
@@ -136,6 +136,26 @@ interface PaginatedDocs<T> {
136
136
  hasNextPage: boolean;
137
137
  hasPrevPage: boolean;
138
138
  }
139
+ /**
140
+ * A page read with a `cursor`: the documents after the cursor, and `nextCursor` for the page after
141
+ * them (`null` at the end). No page numbers or totals.
142
+ */
143
+ interface CursorDocs<T> {
144
+ docs: T[];
145
+ limit: number;
146
+ nextCursor: string | null;
147
+ hasNextPage: boolean;
148
+ /** Whether the cursor started after the first document. */
149
+ hasPrevPage: boolean;
150
+ totalDocs: null;
151
+ totalPages: null;
152
+ page: null;
153
+ }
154
+ /** A page read with `count: false`: no totals, which saves counting every matching document. */
155
+ interface UncountedDocs<T> extends Omit<PaginatedDocs<T>, 'totalDocs' | 'totalPages'> {
156
+ totalDocs: null;
157
+ totalPages: null;
158
+ }
139
159
  /**
140
160
  * How the adapter treats the database schema on startup.
141
161
  * - `push`: apply schema changes directly (development).
@@ -161,6 +181,17 @@ interface FindArgs {
161
181
  readonly limit: number;
162
182
  readonly page: number;
163
183
  }
184
+ /** `Database.findAfter`: a find with no page, from after a row's keys. */
185
+ interface FindAfterArgs extends Omit<FindArgs, 'page'> {
186
+ /** The keys `findAfter` returned for the last row of the page before; `null` for the first page. */
187
+ readonly after: readonly unknown[] | null;
188
+ }
189
+ interface KeysetPage {
190
+ docs: RawDocument[];
191
+ hasNextPage: boolean;
192
+ /** The keys of the last row (its sort values, then its id), to continue after; `null` when empty. */
193
+ next: unknown[] | null;
194
+ }
164
195
  interface MigrationInfo {
165
196
  readonly name: string;
166
197
  readonly applied: boolean;
@@ -173,6 +204,16 @@ interface CreateMigrationResult {
173
204
  /** A connected database bound to one config. Returned by `DatabaseAdapter.init`. */
174
205
  interface Database {
175
206
  find(args: FindArgs): Promise<PaginatedDocs<RawDocument>>;
207
+ /**
208
+ * A page without counting the matching documents (`find` with `count: false`): `hasNextPage`
209
+ * from one row more. Optional: without it, `find` runs and its totals are dropped.
210
+ */
211
+ findPage?(args: FindArgs): Promise<UncountedDocs<RawDocument>>;
212
+ /**
213
+ * Keyset pagination, for `find` with a `cursor`: the rows after `after` in the sort's order (with
214
+ * `id` last). Optional: without it, cursors are refused.
215
+ */
216
+ findAfter?(args: FindAfterArgs): Promise<KeysetPage>;
176
217
  findById(args: {
177
218
  collection: string;
178
219
  id: ID;
@@ -1670,6 +1711,16 @@ interface FindOptions extends ReadOptions {
1670
1711
  readonly limit?: number;
1671
1712
  /** 1-based. Default 1. */
1672
1713
  readonly page?: number;
1714
+ /**
1715
+ * `false` skips counting the matching documents: `totalDocs` and `totalPages` are `null`, and
1716
+ * `hasNextPage` still says whether there is more. Default `true`.
1717
+ */
1718
+ readonly count?: boolean;
1719
+ /**
1720
+ * Cursor pagination instead of `page`: `''` for the first page, then the `nextCursor` of the
1721
+ * page before. Fast on deep pages of large collections; no page numbers or totals.
1722
+ */
1723
+ readonly cursor?: string;
1673
1724
  }
1674
1725
  interface CreateEasyCMSOptions {
1675
1726
  /** Project root. Default `process.cwd()`. */
@@ -1731,6 +1782,14 @@ declare class EasyCMS<C extends Config = Config> {
1731
1782
  user: AuthUser | null;
1732
1783
  context: RequestContext;
1733
1784
  }>;
1785
+ find<S extends Slug<C>, L extends string | undefined = undefined>(collection: S, options: FindOptions & {
1786
+ readonly locale?: L;
1787
+ readonly cursor: string;
1788
+ }): Promise<CursorDocs<Doc<C, S, L>>>;
1789
+ find<S extends Slug<C>, L extends string | undefined = undefined>(collection: S, options: FindOptions & {
1790
+ readonly locale?: L;
1791
+ readonly count: false;
1792
+ }): Promise<UncountedDocs<Doc<C, S, L>>>;
1734
1793
  find<S extends Slug<C>, L extends string | undefined = undefined>(collection: S, options?: FindOptions & {
1735
1794
  readonly locale?: L;
1736
1795
  }): Promise<PaginatedDocs<Doc<C, S, L>>>;
@@ -3308,6 +3367,18 @@ interface Config {
3308
3367
  * request id. Ignored when `createEasyCMS` is given a `logger`.
3309
3368
  */
3310
3369
  readonly logs?: LogsConfig;
3370
+ /**
3371
+ * How long, in seconds, the total of a paginated list (`totalDocs`, `totalPages`) is reused for
3372
+ * the same query. Counting reads every matching document, and many people open the same lists.
3373
+ * The documents themselves are always current; a total can be this old. `0` counts every time.
3374
+ * Default 5.
3375
+ */
3376
+ readonly countCacheSeconds?: number;
3377
+ /**
3378
+ * The deepest `page` the REST API serves to API clients (not to the signed-in admin); deeper
3379
+ * requests get `400`, pointing to `cursor`. Deep pages are read row by row. Default: no limit.
3380
+ */
3381
+ readonly maxPage?: number;
3311
3382
  readonly plugins?: readonly Plugin[];
3312
3383
  }
3313
3384
  /** The config after plugins ran, validation passed and defaults were applied. */
@@ -3339,4 +3410,5 @@ interface ResolvedConfig extends Omit<Config, 'cors' | 'localization' | 'routes'
3339
3410
  */
3340
3411
  declare function defineConfig<const TConfig extends Config>(config: TConfig): TConfig;
3341
3412
 
3342
- export { type BuiltinMediaCollection as $, ADAPTER_API_VERSION as A, type ApiKeyOperation as B, type ApiKeyPermissions as C, type ArrayField as D, type EmailSetting as E, type AuditChange as F, type AuditConfig as G, type AuditEntry as H, type ID as I, AuditLog as J, type AuditPage as K, type AuditVerification as L, Auth as M, type AuthConfig as N, type AuthProvider as O, type PaginatedDocs as P, type AuthProviderProfile as Q, type AuthProviderRequest as R, type AuthUser as S, type BackupsConfig as T, type BeforeChangeHook as U, type BeforeDeleteHook as V, type BeforeValidateHook as W, type Block as X, type BlocksField as Y, type BooleanField as Z, type BuiltinApiKeysCollection as _, ADMIN_ICONS as a, type GlobalDocument as a$, type BuiltinMediaFoldersCollection as a0, type BuiltinUsersCollection as a1, type BundleHints as a2, type CliCommand as a3, type CollectionAccess as a4, type CollectionAdmin as a5, type CollectionConfig as a6, type CollectionDocument as a7, type CollectionHooks as a8, type CollectionListAdmin as a9, type EndpointRequest as aA, type ErrorCode as aB, FIELD_TYPES as aC, type Field as aD, type FieldAccess as aE, type FieldAccessFn as aF, type FieldAdmin as aG, type FieldError as aH, type FieldRule as aI, type FieldType as aJ, type FieldTypeBase as aK, type FieldTypeDefinition as aL, type FieldTypeValidateContext as aM, type FieldValidate as aN, type FieldValidateContext as aO, type FieldValue as aP, type FieldsInput as aQ, type FieldsValue as aR, type FilterOptions as aS, type FilterOptionsArgs as aT, type FindArgs as aU, type FindOptions as aV, type FolderLevel as aW, type FolderPermissions as aX, ForbiddenError as aY, type GlobalAccess as aZ, type GlobalConfig as a_, type CollectionSlug as aa, type Config as ab, ConfigError as ac, type ConfigIssue as ad, type ContainerAdmin as ae, type CreateEasyCMSOptions as af, type CreateInput as ag, type CreateMigrationResult as ah, type CustomField as ai, type CustomFieldTypes as aj, type DashboardWidget as ak, type Database as al, type DatabaseAdapter as am, type DatabaseInitArgs as an, type DatabaseTransfer as ao, type DateField as ap, type DepthOptions as aq, type DirectUpload as ar, type DiskStorageOptions as as, type DocumentOf as at, EasyCMS as au, EasyCMSError as av, type EmailAdapter as aw, type EmailField as ax, type EmailMessage as ay, type Endpoint as az, type Access as b, type SignupResult as b$, type GlobalHooks as b0, type GlobalInput as b1, type GlobalSlug as b2, type GroupField as b3, type ImageSize as b4, type IncrementOptions as b5, type InferCollection as b6, type InferGlobal as b7, type JobConfig as b8, type JsonField as b9, type Plugin as bA, type PluginInfo as bB, type PluginTypes as bC, type PreviewTarget as bD, type PreviewURL as bE, QueryError as bF, ROLE_OPERATIONS as bG, type RawDocument as bH, type ReadOptions as bI, type RelationshipField as bJ, type RequestContext as bK, type ResolvedConfig as bL, type RichTextDocument as bM, type RichTextField as bN, type Role as bO, type RoleOperation as bP, type RolePermissions as bQ, Roles as bR, type RoutesConfig as bS, type ScheduledPublish as bT, SchemaError as bU, type SchemaMode as bV, type SelectField as bW, type SelectOption as bX, type Session as bY, type SidebarPanel as bZ, type SignupArgs as b_, type Label as ba, type LayoutNode as bb, type LivePreview as bc, type LocaleOf as bd, type LocalizationConfig as be, type LogDetails as bf, type Logger as bg, type LoginArgs as bh, type LogsConfig as bi, type MediaDocument as bj, type MediaSize as bk, type MembersConfig as bl, type MembersSignup as bm, type MigrationInfo as bn, type NavGroup as bo, NotFoundError as bp, type NumberField as bq, type OnRequest as br, type OnRequestArgs as bs, type Operation as bt, PLUGIN_API_VERSION as bu, type PasswordEmail as bv, type PasswordEmailArgs as bw, type PasswordEmailFn as bx, type PasswordLinkOptions as by, PayloadTooLargeError as bz, type AccessArgs as c, SingleSignOn as c0, type SlugField as c1, type SlugOf as c2, type SsoOutcome as c3, type SsoProviderRef as c4, type StorageAdapter as c5, type StoredFile as c6, type TextField as c7, type TextareaField as c8, TooManyRequestsError as c9, hasRows as cA, isAdmin as cB, isHasMany as cC, isSignedIn as cD, isStaff as cE, isSystemAdmin as cF, jsonLogger as cG, mimeAllowedBy as cH, rowFields as cI, silentLogger as cJ, uniqueWithinOf as cK, API_KEYS as cL, API_KEY_GLOBAL_OPERATIONS as cM, API_KEY_OPERATIONS as cN, DEFAULT_MAX_VERSIONS as cO, DEFAULT_PASSWORD_EMAILS as cP, FIELD_TYPE_BASES as cQ, FOLDER_LEVELS as cR, MediaFolders as cS, SSO_COOKIE as cT, codeOfStatus as cU, isJsonLogger as cV, keyAllows as cW, logFormat as cX, type TypedPlugin as ca, UnauthorizedError as cb, type UpdateInput as cc, type UpdateOptions as cd, type UploadConfig as ce, type UploadField as cf, type UploadFromURLConfig as cg, type UserIdentity as ch, ValidationError as ci, type Version as cj, type VersionSummary as ck, type VersionsConfig as cl, WEBHOOK_EVENTS as cm, type WebhookConfig as cn, type WebhookEvent as co, type WebhookPayload as cp, type Where as cq, type WhereOperators as cr, anyone as cs, consoleEmail as ct, consoleLogger as cu, createEasyCMS as cv, defineConfig as cw, defineFieldType as cx, definePlugin as cy, diskStorage as cz, type AccessOptions as d, type AdminBrand as e, type AdminCommand as f, type AdminComponent as g, type AdminConfig as h, type AdminFieldArgs as i, type AdminIcon as j, type AdminLocale as k, type AdminPage as l, type AdminRole as m, type AdminRoleChange as n, type AdminRoleField as o, type AdminRoleTarget as p, type AdminRoleView as q, type AdminRoles as r, type AdminSso as s, type AdminSwitcher as t, type AdminViewAccess as u, type AfterChangeHook as v, type AfterDeleteHook as w, type AfterReadHook as x, type ApiKeyContext as y, type ApiKeyGlobalOperation as z };
3413
+ export { ADAPTER_API_VERSION as A, AuditLog as J, Auth as M, ADMIN_ICONS as a, FIELD_TYPES as aD, ForbiddenError as a_, ConfigError as ac, EasyCMS as av, EasyCMSError as aw, PayloadTooLargeError as bC, QueryError as bI, ROLE_OPERATIONS as bJ, Roles as bU, SchemaError as bX, NotFoundError as bs, PLUGIN_API_VERSION as bx, logFormat as c$, SingleSignOn as c3, defineConfig as cA, defineFieldType as cB, definePlugin as cC, diskStorage as cD, hasRows as cE, isAdmin as cF, isHasMany as cG, isSignedIn as cH, isStaff as cI, isSystemAdmin as cJ, jsonLogger as cK, mimeAllowedBy as cL, rowFields as cM, silentLogger as cN, uniqueWithinOf as cO, API_KEYS as cP, API_KEY_GLOBAL_OPERATIONS as cQ, API_KEY_OPERATIONS as cR, DEFAULT_MAX_VERSIONS as cS, DEFAULT_PASSWORD_EMAILS as cT, FIELD_TYPE_BASES as cU, FOLDER_LEVELS as cV, MediaFolders as cW, SSO_COOKIE as cX, codeOfStatus as cY, isJsonLogger as cZ, keyAllows as c_, TooManyRequestsError as cc, UnauthorizedError as ce, ValidationError as cm, WEBHOOK_EVENTS as cq, anyone as cw, consoleEmail as cx, consoleLogger as cy, createEasyCMS as cz };
3414
+ export type { BuiltinMediaCollection as $, ApiKeyOperation as B, ApiKeyPermissions as C, ArrayField as D, EmailSetting as E, AuditChange as F, AuditConfig as G, AuditEntry as H, ID as I, AuditPage as K, AuditVerification as L, AuthConfig as N, AuthProvider as O, PaginatedDocs as P, AuthProviderProfile as Q, AuthProviderRequest as R, AuthUser as S, BackupsConfig as T, BeforeChangeHook as U, BeforeDeleteHook as V, BeforeValidateHook as W, Block as X, BlocksField as Y, BooleanField as Z, BuiltinApiKeysCollection as _, GlobalAccess as a$, BuiltinMediaFoldersCollection as a0, BuiltinUsersCollection as a1, BundleHints as a2, CliCommand as a3, CollectionAccess as a4, CollectionAdmin as a5, CollectionConfig as a6, CollectionDocument as a7, CollectionHooks as a8, CollectionListAdmin as a9, Endpoint as aA, EndpointRequest as aB, ErrorCode as aC, Field as aE, FieldAccess as aF, FieldAccessFn as aG, FieldAdmin as aH, FieldError as aI, FieldRule as aJ, FieldType as aK, FieldTypeBase as aL, FieldTypeDefinition as aM, FieldTypeValidateContext as aN, FieldValidate as aO, FieldValidateContext as aP, FieldValue as aQ, FieldsInput as aR, FieldsValue as aS, FilterOptions as aT, FilterOptionsArgs as aU, FindAfterArgs as aV, FindArgs as aW, FindOptions as aX, FolderLevel as aY, FolderPermissions as aZ, CollectionSlug as aa, Config as ab, ConfigIssue as ad, ContainerAdmin as ae, CreateEasyCMSOptions as af, CreateInput as ag, CreateMigrationResult as ah, CursorDocs as ai, CustomField as aj, CustomFieldTypes as ak, DashboardWidget as al, Database as am, DatabaseAdapter as an, DatabaseInitArgs as ao, DatabaseTransfer as ap, DateField as aq, DepthOptions as ar, DirectUpload as as, DiskStorageOptions as at, DocumentOf as au, EmailAdapter as ax, EmailField as ay, EmailMessage as az, Access as b, Session as b$, GlobalConfig as b0, GlobalDocument as b1, GlobalHooks as b2, GlobalInput as b3, GlobalSlug as b4, GroupField as b5, ImageSize as b6, IncrementOptions as b7, InferCollection as b8, InferGlobal as b9, PasswordEmailFn as bA, PasswordLinkOptions as bB, Plugin as bD, PluginInfo as bE, PluginTypes as bF, PreviewTarget as bG, PreviewURL as bH, RawDocument as bK, ReadOptions as bL, RelationshipField as bM, RequestContext as bN, ResolvedConfig as bO, RichTextDocument as bP, RichTextField as bQ, Role as bR, RoleOperation as bS, RolePermissions as bT, RoutesConfig as bV, ScheduledPublish as bW, SchemaMode as bY, SelectField as bZ, SelectOption as b_, JobConfig as ba, JsonField as bb, KeysetPage as bc, Label as bd, LayoutNode as be, LivePreview as bf, LocaleOf as bg, LocalizationConfig as bh, LogDetails as bi, Logger as bj, LoginArgs as bk, LogsConfig as bl, MediaDocument as bm, MediaSize as bn, MembersConfig as bo, MembersSignup as bp, MigrationInfo as bq, NavGroup as br, NumberField as bt, OnRequest as bu, OnRequestArgs as bv, Operation as bw, PasswordEmail as by, PasswordEmailArgs as bz, AccessArgs as c, SidebarPanel as c0, SignupArgs as c1, SignupResult as c2, SlugField as c4, SlugOf as c5, SsoOutcome as c6, SsoProviderRef as c7, StorageAdapter as c8, StoredFile as c9, TextField as ca, TextareaField as cb, TypedPlugin as cd, UncountedDocs as cf, UpdateInput as cg, UpdateOptions as ch, UploadConfig as ci, UploadField as cj, UploadFromURLConfig as ck, UserIdentity as cl, Version as cn, VersionSummary as co, VersionsConfig as cp, WebhookConfig as cr, WebhookEvent as cs, WebhookPayload as ct, Where as cu, WhereOperators as cv, AccessOptions as d, AdminBrand as e, AdminCommand as f, AdminComponent as g, AdminConfig as h, AdminFieldArgs as i, AdminIcon as j, AdminLocale as k, AdminPage as l, AdminRole as m, AdminRoleChange as n, AdminRoleField as o, AdminRoleTarget as p, AdminRoleView as q, AdminRoles as r, AdminSso as s, AdminSwitcher as t, AdminViewAccess as u, AfterChangeHook as v, AfterDeleteHook as w, AfterReadHook as x, ApiKeyContext as y, ApiKeyGlobalOperation as z };
@@ -1,4 +1,4 @@
1
- import { I as ID, ab as Config, au as EasyCMS, be as LocalizationConfig, aD as Field, aH as FieldError, aS as FilterOptions, af as CreateEasyCMSOptions, bL as ResolvedConfig } from './config-CzW6kBeb.js';
1
+ import { I as ID, ab as Config, av as EasyCMS, bh as LocalizationConfig, aE as Field, aI as FieldError, aT as FilterOptions, af as CreateEasyCMSOptions, bO as ResolvedConfig } from './config-BZgVbC3f.js';
2
2
 
3
3
  /** Decrypts a file from `encryptBackup`; throws for another key or a changed file. */
4
4
  declare function decryptBackup(data: Uint8Array, encryptionKey: string): Uint8Array;
@@ -193,4 +193,5 @@ declare function createRootEndpointHandler<C extends Config>(instance: EasyCMS<C
193
193
  /** A cookie of the request; the `__Host-` one (set over HTTPS) first. */
194
194
  declare function readCookie(request: Request, name: string): string | undefined;
195
195
 
196
- export { type AdminBackup as A, type BackupState as B, CONFIG_FILE_NAMES as C, DEFAULT_ADMIN_PATH as D, readCookie as E, validateFields as F, writeBackupFile as G, type LoadConfigOptions as L, type RestHandler as R, type AdminBackups as a, type ApiHandlerOptions as b, type RestHandlerOptions as c, createApiHandler as d, createRestHandler as e, slugify as f, CSRF_COOKIE as g, CSRF_HEADER as h, DEFAULT_API_PATH as i, DEFAULT_MAX_FILE_SIZE as j, DEFAULT_TOKEN_EXPIRATION as k, loadConfig as l, applyDefaults as m, applyPlugins as n, createRootEndpointHandler as o, decryptBackup as p, fillMissing as q, resolveConfig as r, sharedEasyCMS as s, findConfigFile as t, forwardedClientIp as u, generateSlugs as v, importConfig as w, mergeForUpdate as x, parseId as y, platformClientIp as z };
196
+ export { CONFIG_FILE_NAMES as C, DEFAULT_ADMIN_PATH as D, readCookie as E, validateFields as F, writeBackupFile as G, createApiHandler as d, createRestHandler as e, slugify as f, CSRF_COOKIE as g, CSRF_HEADER as h, DEFAULT_API_PATH as i, DEFAULT_MAX_FILE_SIZE as j, DEFAULT_TOKEN_EXPIRATION as k, loadConfig as l, applyDefaults as m, applyPlugins as n, createRootEndpointHandler as o, decryptBackup as p, fillMissing as q, resolveConfig as r, sharedEasyCMS as s, findConfigFile as t, forwardedClientIp as u, generateSlugs as v, importConfig as w, mergeForUpdate as x, parseId as y, platformClientIp as z };
197
+ export type { AdminBackup as A, BackupState as B, LoadConfigOptions as L, RestHandler as R, AdminBackups as a, ApiHandlerOptions as b, RestHandlerOptions as c };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { P as PaginatedDocs, I as ID, E as EmailSetting } from './config-CzW6kBeb.js';
2
- export { A as ADAPTER_API_VERSION, a as ADMIN_ICONS, b as Access, c as AccessArgs, d as AccessOptions, e as AdminBrand, f as AdminCommand, g as AdminComponent, h as AdminConfig, i as AdminFieldArgs, j as AdminIcon, k as AdminLocale, l as AdminPage, m as AdminRole, n as AdminRoleChange, o as AdminRoleField, p as AdminRoleTarget, q as AdminRoleView, r as AdminRoles, s as AdminSso, t as AdminSwitcher, u as AdminViewAccess, v as AfterChangeHook, w as AfterDeleteHook, x as AfterReadHook, y as ApiKeyContext, z as ApiKeyGlobalOperation, B as ApiKeyOperation, C as ApiKeyPermissions, D as ArrayField, F as AuditChange, G as AuditConfig, H as AuditEntry, J as AuditLog, K as AuditPage, L as AuditVerification, M as Auth, N as AuthConfig, O as AuthProvider, Q as AuthProviderProfile, R as AuthProviderRequest, S as AuthUser, T as BackupsConfig, U as BeforeChangeHook, V as BeforeDeleteHook, W as BeforeValidateHook, X as Block, Y as BlocksField, Z as BooleanField, _ as BuiltinApiKeysCollection, $ as BuiltinMediaCollection, a0 as BuiltinMediaFoldersCollection, a1 as BuiltinUsersCollection, a2 as BundleHints, a3 as CliCommand, a4 as CollectionAccess, a5 as CollectionAdmin, a6 as CollectionConfig, a7 as CollectionDocument, a8 as CollectionHooks, a9 as CollectionListAdmin, aa as CollectionSlug, ab as Config, ac as ConfigError, ad as ConfigIssue, ae as ContainerAdmin, af as CreateEasyCMSOptions, ag as CreateInput, ah as CreateMigrationResult, ai as CustomField, aj as CustomFieldTypes, ak as DashboardWidget, al as Database, am as DatabaseAdapter, an as DatabaseInitArgs, ao as DatabaseTransfer, ap as DateField, aq as DepthOptions, ar as DirectUpload, as as DiskStorageOptions, at as DocumentOf, au as EasyCMS, av as EasyCMSError, aw as EmailAdapter, ax as EmailField, ay as EmailMessage, az as Endpoint, aA as EndpointRequest, aB as ErrorCode, aC as FIELD_TYPES, aD as Field, aE as FieldAccess, aF as FieldAccessFn, aG as FieldAdmin, aH as FieldError, aI as FieldRule, aJ as FieldType, aK as FieldTypeBase, aL as FieldTypeDefinition, aM as FieldTypeValidateContext, aN as FieldValidate, aO as FieldValidateContext, aP as FieldValue, aQ as FieldsInput, aR as FieldsValue, aS as FilterOptions, aT as FilterOptionsArgs, aU as FindArgs, aV as FindOptions, aW as FolderLevel, aX as FolderPermissions, aY as ForbiddenError, aZ as GlobalAccess, a_ as GlobalConfig, a$ as GlobalDocument, b0 as GlobalHooks, b1 as GlobalInput, b2 as GlobalSlug, b3 as GroupField, b4 as ImageSize, b5 as IncrementOptions, b6 as InferCollection, b7 as InferGlobal, b8 as JobConfig, b9 as JsonField, ba as Label, bb as LayoutNode, bc as LivePreview, bd as LocaleOf, be as LocalizationConfig, bf as LogDetails, bg as Logger, bh as LoginArgs, bi as LogsConfig, bj as MediaDocument, bk as MediaSize, bl as MembersConfig, bm as MembersSignup, bn as MigrationInfo, bo as NavGroup, bp as NotFoundError, bq as NumberField, br as OnRequest, bs as OnRequestArgs, bt as Operation, bu as PLUGIN_API_VERSION, bv as PasswordEmail, bw as PasswordEmailArgs, bx as PasswordEmailFn, by as PasswordLinkOptions, bz as PayloadTooLargeError, bA as Plugin, bB as PluginInfo, bC as PluginTypes, bD as PreviewTarget, bE as PreviewURL, bF as QueryError, bG as ROLE_OPERATIONS, bH as RawDocument, bI as ReadOptions, bJ as RelationshipField, bK as RequestContext, bL as ResolvedConfig, bM as RichTextDocument, bN as RichTextField, bO as Role, bP as RoleOperation, bQ as RolePermissions, bR as Roles, bS as RoutesConfig, bT as ScheduledPublish, bU as SchemaError, bV as SchemaMode, bW as SelectField, bX as SelectOption, bY as Session, bZ as SidebarPanel, b_ as SignupArgs, b$ as SignupResult, c0 as SingleSignOn, c1 as SlugField, c2 as SlugOf, c3 as SsoOutcome, c4 as SsoProviderRef, c5 as StorageAdapter, c6 as StoredFile, c7 as TextField, c8 as TextareaField, c9 as TooManyRequestsError, ca as TypedPlugin, cb as UnauthorizedError, cc as UpdateInput, cd as UpdateOptions, ce as UploadConfig, cf as UploadField, cg as UploadFromURLConfig, ch as UserIdentity, ci as ValidationError, cj as Version, ck as VersionSummary, cl as VersionsConfig, cm as WEBHOOK_EVENTS, cn as WebhookConfig, co as WebhookEvent, cp as WebhookPayload, cq as Where, cr as WhereOperators, cs as anyone, ct as consoleEmail, cu as consoleLogger, cv as createEasyCMS, cw as defineConfig, cx as defineFieldType, cy as definePlugin, cz as diskStorage, cA as hasRows, cB as isAdmin, cC as isHasMany, cD as isSignedIn, cE as isStaff, cF as isSystemAdmin, cG as jsonLogger, cH as mimeAllowedBy, cI as rowFields, cJ as silentLogger, cK as uniqueWithinOf } from './config-CzW6kBeb.js';
3
- export { A as ADMIN_API_VERSION, a as AdminCollection, b as AdminComponentRef, c as AdminElementProps, d as AdminField, e as AdminGlobal, f as AdminLayoutNode, g as AdminNavGroup, h as AdminNavItem, i as AdminNavNode, j as AdminPageRef, k as AdminPageRoute, l as AdminSchema, m as AdminWidgetRef, S as SetFieldDetail, w as warnDeprecated } from './plugin-BmKxHxuu.js';
4
- export { A as AdminBackup, a as AdminBackups, b as ApiHandlerOptions, B as BackupState, L as LoadConfigOptions, R as RestHandler, c as RestHandlerOptions, d as createApiHandler, e as createRestHandler, l as loadConfig, r as resolveConfig, s as sharedEasyCMS, f as slugify } from './handler-BsBQ-2qf.js';
1
+ import { P as PaginatedDocs, I as ID, E as EmailSetting } from './config-BZgVbC3f.js';
2
+ export { A as ADAPTER_API_VERSION, a as ADMIN_ICONS, b as Access, c as AccessArgs, d as AccessOptions, e as AdminBrand, f as AdminCommand, g as AdminComponent, h as AdminConfig, i as AdminFieldArgs, j as AdminIcon, k as AdminLocale, l as AdminPage, m as AdminRole, n as AdminRoleChange, o as AdminRoleField, p as AdminRoleTarget, q as AdminRoleView, r as AdminRoles, s as AdminSso, t as AdminSwitcher, u as AdminViewAccess, v as AfterChangeHook, w as AfterDeleteHook, x as AfterReadHook, y as ApiKeyContext, z as ApiKeyGlobalOperation, B as ApiKeyOperation, C as ApiKeyPermissions, D as ArrayField, F as AuditChange, G as AuditConfig, H as AuditEntry, J as AuditLog, K as AuditPage, L as AuditVerification, M as Auth, N as AuthConfig, O as AuthProvider, Q as AuthProviderProfile, R as AuthProviderRequest, S as AuthUser, T as BackupsConfig, U as BeforeChangeHook, V as BeforeDeleteHook, W as BeforeValidateHook, X as Block, Y as BlocksField, Z as BooleanField, _ as BuiltinApiKeysCollection, $ as BuiltinMediaCollection, a0 as BuiltinMediaFoldersCollection, a1 as BuiltinUsersCollection, a2 as BundleHints, a3 as CliCommand, a4 as CollectionAccess, a5 as CollectionAdmin, a6 as CollectionConfig, a7 as CollectionDocument, a8 as CollectionHooks, a9 as CollectionListAdmin, aa as CollectionSlug, ab as Config, ac as ConfigError, ad as ConfigIssue, ae as ContainerAdmin, af as CreateEasyCMSOptions, ag as CreateInput, ah as CreateMigrationResult, ai as CursorDocs, aj as CustomField, ak as CustomFieldTypes, al as DashboardWidget, am as Database, an as DatabaseAdapter, ao as DatabaseInitArgs, ap as DatabaseTransfer, aq as DateField, ar as DepthOptions, as as DirectUpload, at as DiskStorageOptions, au as DocumentOf, av as EasyCMS, aw as EasyCMSError, ax as EmailAdapter, ay as EmailField, az as EmailMessage, aA as Endpoint, aB as EndpointRequest, aC as ErrorCode, aD as FIELD_TYPES, aE as Field, aF as FieldAccess, aG as FieldAccessFn, aH as FieldAdmin, aI as FieldError, aJ as FieldRule, aK as FieldType, aL as FieldTypeBase, aM as FieldTypeDefinition, aN as FieldTypeValidateContext, aO as FieldValidate, aP as FieldValidateContext, aQ as FieldValue, aR as FieldsInput, aS as FieldsValue, aT as FilterOptions, aU as FilterOptionsArgs, aV as FindAfterArgs, aW as FindArgs, aX as FindOptions, aY as FolderLevel, aZ as FolderPermissions, a_ as ForbiddenError, a$ as GlobalAccess, b0 as GlobalConfig, b1 as GlobalDocument, b2 as GlobalHooks, b3 as GlobalInput, b4 as GlobalSlug, b5 as GroupField, b6 as ImageSize, b7 as IncrementOptions, b8 as InferCollection, b9 as InferGlobal, ba as JobConfig, bb as JsonField, bc as KeysetPage, bd as Label, be as LayoutNode, bf as LivePreview, bg as LocaleOf, bh as LocalizationConfig, bi as LogDetails, bj as Logger, bk as LoginArgs, bl as LogsConfig, bm as MediaDocument, bn as MediaSize, bo as MembersConfig, bp as MembersSignup, bq as MigrationInfo, br as NavGroup, bs as NotFoundError, bt as NumberField, bu as OnRequest, bv as OnRequestArgs, bw as Operation, bx as PLUGIN_API_VERSION, by as PasswordEmail, bz as PasswordEmailArgs, bA as PasswordEmailFn, bB as PasswordLinkOptions, bC as PayloadTooLargeError, bD as Plugin, bE as PluginInfo, bF as PluginTypes, bG as PreviewTarget, bH as PreviewURL, bI as QueryError, bJ as ROLE_OPERATIONS, bK as RawDocument, bL as ReadOptions, bM as RelationshipField, bN as RequestContext, bO as ResolvedConfig, bP as RichTextDocument, bQ as RichTextField, bR as Role, bS as RoleOperation, bT as RolePermissions, bU as Roles, bV as RoutesConfig, bW as ScheduledPublish, bX as SchemaError, bY as SchemaMode, bZ as SelectField, b_ as SelectOption, b$ as Session, c0 as SidebarPanel, c1 as SignupArgs, c2 as SignupResult, c3 as SingleSignOn, c4 as SlugField, c5 as SlugOf, c6 as SsoOutcome, c7 as SsoProviderRef, c8 as StorageAdapter, c9 as StoredFile, ca as TextField, cb as TextareaField, cc as TooManyRequestsError, cd as TypedPlugin, ce as UnauthorizedError, cf as UncountedDocs, cg as UpdateInput, ch as UpdateOptions, ci as UploadConfig, cj as UploadField, ck as UploadFromURLConfig, cl as UserIdentity, cm as ValidationError, cn as Version, co as VersionSummary, cp as VersionsConfig, cq as WEBHOOK_EVENTS, cr as WebhookConfig, cs as WebhookEvent, ct as WebhookPayload, cu as Where, cv as WhereOperators, cw as anyone, cx as consoleEmail, cy as consoleLogger, cz as createEasyCMS, cA as defineConfig, cB as defineFieldType, cC as definePlugin, cD as diskStorage, cE as hasRows, cF as isAdmin, cG as isHasMany, cH as isSignedIn, cI as isStaff, cJ as isSystemAdmin, cK as jsonLogger, cL as mimeAllowedBy, cM as rowFields, cN as silentLogger, cO as uniqueWithinOf } from './config-BZgVbC3f.js';
3
+ export { A as ADMIN_API_VERSION, a as AdminCollection, b as AdminComponentRef, c as AdminElementProps, d as AdminField, e as AdminGlobal, f as AdminLayoutNode, g as AdminNavGroup, h as AdminNavItem, i as AdminNavNode, j as AdminPageRef, k as AdminPageRoute, l as AdminSchema, m as AdminWidgetRef, S as SetFieldDetail, w as warnDeprecated } from './plugin-DlSta1rd.js';
4
+ export { A as AdminBackup, a as AdminBackups, b as ApiHandlerOptions, B as BackupState, L as LoadConfigOptions, R as RestHandler, c as RestHandlerOptions, d as createApiHandler, e as createRestHandler, l as loadConfig, r as resolveConfig, s as sharedEasyCMS, f as slugify } from './handler-j6s6J723.js';
5
5
  export { FieldCondition, matchesCondition } from './conditions.js';
6
6
 
7
7
  type DeliveryKind = 'webhook' | 'email';
@@ -221,4 +221,5 @@ interface AdminStatus {
221
221
  /** The version of `@easy-cms/core`, set when the package is built. */
222
222
  declare const VERSION: string;
223
223
 
224
- export { type AdminAttention, type AdminDeliveries, type AdminDelivery, type AdminEmail, type AdminEmailDelivery, type AdminJob, type AdminJobs, type AdminScheduledJob, type AdminStatus, type AdminWebhookDelivery, type BuiltInJob, type DeliveryKind, type DeliveryState, type EmailCheck, EmailSetting, ID, PaginatedDocs, type SearchHit, VERSION };
224
+ export { EmailSetting, ID, PaginatedDocs, VERSION };
225
+ export type { AdminAttention, AdminDeliveries, AdminDelivery, AdminEmail, AdminEmailDelivery, AdminJob, AdminJobs, AdminScheduledJob, AdminStatus, AdminWebhookDelivery, BuiltInJob, DeliveryKind, DeliveryState, EmailCheck, SearchHit };
package/dist/index.js CHANGED
@@ -24,7 +24,7 @@ import {
24
24
  sharedEasyCMS,
25
25
  silentLogger,
26
26
  slugify
27
- } from "./chunk-ERXCJ3V6.js";
27
+ } from "./chunk-HAHGAHFD.js";
28
28
  import {
29
29
  matchesCondition
30
30
  } from "./chunk-U266LV4M.js";
@@ -1,6 +1,6 @@
1
- import { ab as Config, al as Database, au as EasyCMS, bo as NavGroup, a6 as CollectionConfig, I as ID, bH as RawDocument, aD as Field, bL as ResolvedConfig, ad as ConfigIssue } from './config-CzW6kBeb.js';
2
- export { cL as API_KEYS, cM as API_KEY_GLOBAL_OPERATIONS, cN as API_KEY_OPERATIONS, cO as DEFAULT_MAX_VERSIONS, cP as DEFAULT_PASSWORD_EMAILS, cQ as FIELD_TYPE_BASES, cR as FOLDER_LEVELS, cS as MediaFolders, cT as SSO_COOKIE, cU as codeOfStatus, cA as hasRows, cC as isHasMany, cV as isJsonLogger, cW as keyAllows, cX as logFormat, cH as mimeAllowedBy, cI as rowFields, cK as uniqueWithinOf } from './config-CzW6kBeb.js';
3
- export { C as CONFIG_FILE_NAMES, g as CSRF_COOKIE, h as CSRF_HEADER, D as DEFAULT_ADMIN_PATH, i as DEFAULT_API_PATH, j as DEFAULT_MAX_FILE_SIZE, k as DEFAULT_TOKEN_EXPIRATION, m as applyDefaults, n as applyPlugins, o as createRootEndpointHandler, p as decryptBackup, q as fillMissing, t as findConfigFile, u as forwardedClientIp, v as generateSlugs, w as importConfig, x as mergeForUpdate, y as parseId, z as platformClientIp, E as readCookie, F as validateFields, G as writeBackupFile } from './handler-BsBQ-2qf.js';
1
+ import { Config, Database, EasyCMS, NavGroup, CollectionConfig, ID, RawDocument, Field, ResolvedConfig, ConfigIssue } from './index.js';
2
+ export { cP as API_KEYS, cQ as API_KEY_GLOBAL_OPERATIONS, cR as API_KEY_OPERATIONS, cS as DEFAULT_MAX_VERSIONS, cT as DEFAULT_PASSWORD_EMAILS, cU as FIELD_TYPE_BASES, cV as FOLDER_LEVELS, cW as MediaFolders, cX as SSO_COOKIE, cY as codeOfStatus, cE as hasRows, cG as isHasMany, cZ as isJsonLogger, c_ as keyAllows, c$ as logFormat, cL as mimeAllowedBy, cM as rowFields, cO as uniqueWithinOf } from './config-BZgVbC3f.js';
3
+ export { C as CONFIG_FILE_NAMES, g as CSRF_COOKIE, h as CSRF_HEADER, D as DEFAULT_ADMIN_PATH, i as DEFAULT_API_PATH, j as DEFAULT_MAX_FILE_SIZE, k as DEFAULT_TOKEN_EXPIRATION, m as applyDefaults, n as applyPlugins, o as createRootEndpointHandler, p as decryptBackup, q as fillMissing, t as findConfigFile, u as forwardedClientIp, v as generateSlugs, w as importConfig, x as mergeForUpdate, y as parseId, z as platformClientIp, E as readCookie, F as validateFields, G as writeBackupFile } from './handler-j6s6J723.js';
4
4
  export { conditionIssues } from './conditions.js';
5
5
 
6
6
  /** The session cookie the REST API sets at login. */
@@ -141,4 +141,5 @@ declare const BUILTIN_COLLECTIONS: readonly ["users", "media"];
141
141
  /** Checks a config and returns every problem found. An empty array means it is valid. */
142
142
  declare function validateConfig(config: Config): ConfigIssue[];
143
143
 
144
- export { BUILTIN_COLLECTIONS, BUILTIN_NAV, type CopyProgress, type CopyResult, DEFAULT_DEPTH, EXTENSIONS, type HealthCheck, INTERNAL_COLLECTIONS, MAX_DEPTH, MEDIA, MEDIA_FOLDERS, MIME_GROUPS, MIN_PASSWORD_LENGTH, MIN_SECRET_LENGTH, SESSION_COOKIE, checkFormToken, checkRenamedOptions, configSignature, copyDatabase, expandMimeTypes, formToken, generateTypes, hashPassword, healthResponse, honeypotName, imageDimensions, mimeAllowed, populate, rateKeys, resolveAdminModule, singularize, sniffMimeType, validateConfig, verifyPassword, verifyTurnstile };
144
+ export { BUILTIN_COLLECTIONS, BUILTIN_NAV, DEFAULT_DEPTH, EXTENSIONS, INTERNAL_COLLECTIONS, MAX_DEPTH, MEDIA, MEDIA_FOLDERS, MIME_GROUPS, MIN_PASSWORD_LENGTH, MIN_SECRET_LENGTH, SESSION_COOKIE, checkFormToken, checkRenamedOptions, configSignature, copyDatabase, expandMimeTypes, formToken, generateTypes, hashPassword, healthResponse, honeypotName, imageDimensions, mimeAllowed, populate, rateKeys, resolveAdminModule, singularize, sniffMimeType, validateConfig, verifyPassword, verifyTurnstile };
145
+ export type { CopyProgress, CopyResult, HealthCheck };
package/dist/internal.js CHANGED
@@ -56,7 +56,7 @@ import {
56
56
  verifyPassword,
57
57
  verifyTurnstile,
58
58
  writeBackupFile
59
- } from "./chunk-ERXCJ3V6.js";
59
+ } from "./chunk-HAHGAHFD.js";
60
60
  import {
61
61
  conditionIssues
62
62
  } from "./chunk-U266LV4M.js";
@@ -37,4 +37,5 @@ declare function isLivePreview(): boolean;
37
37
  */
38
38
  declare function subscribeLivePreview<T = Record<string, unknown>>(onChange: (doc: T, message: LivePreviewMessage<T>) => void, options?: LivePreviewOptions): () => void;
39
39
 
40
- export { type LivePreviewMessage, type LivePreviewOptions, PREVIEW_PARAM, READY_MESSAGE, getPreviewToken, isLivePreview, subscribeLivePreview };
40
+ export { PREVIEW_PARAM, READY_MESSAGE, getPreviewToken, isLivePreview, subscribeLivePreview };
41
+ export type { LivePreviewMessage, LivePreviewOptions };
@@ -1,4 +1,4 @@
1
- import { ba as Label, aD as Field, I as ID, k as AdminLocale, t as AdminSwitcher, c4 as SsoProviderRef } from './config-CzW6kBeb.js';
1
+ import { bd as Label, aE as Field, I as ID, k as AdminLocale, t as AdminSwitcher, c7 as SsoProviderRef } from './config-BZgVbC3f.js';
2
2
  import { FieldCondition } from './conditions.js';
3
3
 
4
4
  /** A Web Component from an admin module, with its `props` (plain JSON). */
@@ -339,4 +339,5 @@ interface SetFieldDetail {
339
339
  */
340
340
  declare function warnDeprecated(code: string, message: string): void;
341
341
 
342
- export { ADMIN_API_VERSION as A, type SetFieldDetail as S, type AdminCollection as a, type AdminComponentRef as b, type AdminElementProps as c, type AdminField as d, type AdminGlobal as e, type AdminLayoutNode as f, type AdminNavGroup as g, type AdminNavItem as h, type AdminNavNode as i, type AdminPageRef as j, type AdminPageRoute as k, type AdminSchema as l, type AdminWidgetRef as m, warnDeprecated as w };
342
+ export { ADMIN_API_VERSION as A, warnDeprecated as w };
343
+ export type { SetFieldDetail as S, AdminCollection as a, AdminComponentRef as b, AdminElementProps as c, AdminField as d, AdminGlobal as e, AdminLayoutNode as f, AdminNavGroup as g, AdminNavItem as h, AdminNavNode as i, AdminPageRef as j, AdminPageRoute as k, AdminSchema as l, AdminWidgetRef as m };
package/dist/plugin.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export { a as ADMIN_ICONS, g as AdminComponent, j as AdminIcon, S as AuthUser, a3 as CliCommand, a4 as CollectionAccess, a6 as CollectionConfig, ab as Config, ac as ConfigError, ak as DashboardWidget, av as EasyCMSError, az as Endpoint, aA as EndpointRequest, aB as ErrorCode, aD as Field, aE as FieldAccess, aH as FieldError, aK as FieldTypeBase, aL as FieldTypeDefinition, aM as FieldTypeValidateContext, aY as ForbiddenError, a_ as GlobalConfig, I as ID, b8 as JobConfig, ba as Label, bo as NavGroup, bp as NotFoundError, br as OnRequest, bs as OnRequestArgs, bu as PLUGIN_API_VERSION, bz as PayloadTooLargeError, bA as Plugin, bB as PluginInfo, bC as PluginTypes, bF as QueryError, bK as RequestContext, c9 as TooManyRequestsError, ca as TypedPlugin, cb as UnauthorizedError, ci as ValidationError, cq as Where, cx as defineFieldType, cy as definePlugin } from './config-CzW6kBeb.js';
2
- export { A as ADMIN_API_VERSION, c as AdminElementProps, k as AdminPageRoute, S as SetFieldDetail, w as warnDeprecated } from './plugin-BmKxHxuu.js';
1
+ export { a as ADMIN_ICONS, g as AdminComponent, j as AdminIcon, S as AuthUser, a3 as CliCommand, a4 as CollectionAccess, a6 as CollectionConfig, ab as Config, ac as ConfigError, al as DashboardWidget, aw as EasyCMSError, aA as Endpoint, aB as EndpointRequest, aC as ErrorCode, aE as Field, aF as FieldAccess, aI as FieldError, aL as FieldTypeBase, aM as FieldTypeDefinition, aN as FieldTypeValidateContext, a_ as ForbiddenError, b0 as GlobalConfig, I as ID, ba as JobConfig, bd as Label, br as NavGroup, bs as NotFoundError, bu as OnRequest, bv as OnRequestArgs, bx as PLUGIN_API_VERSION, bC as PayloadTooLargeError, bD as Plugin, bE as PluginInfo, bF as PluginTypes, bI as QueryError, bN as RequestContext, cc as TooManyRequestsError, cd as TypedPlugin, ce as UnauthorizedError, cm as ValidationError, cu as Where, cB as defineFieldType, cC as definePlugin } from './config-BZgVbC3f.js';
2
+ export { A as ADMIN_API_VERSION, c as AdminElementProps, k as AdminPageRoute, S as SetFieldDetail, w as warnDeprecated } from './plugin-DlSta1rd.js';
3
3
  import './conditions.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easy-cms/core",
3
- "version": "1.7.1",
3
+ "version": "1.9.0",
4
4
  "description": "Embedded, code-first headless CMS for Nuxt and Next.js",
5
5
  "license": "MIT",
6
6
  "type": "module",