@easy-cms/core 1.26.0 → 1.28.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.
@@ -19,11 +19,13 @@ import {
19
19
  UnauthorizedError,
20
20
  ValidationError,
21
21
  applyFieldTypes,
22
+ errorText,
22
23
  expandMimeTypes,
23
24
  fieldTypeModules,
24
25
  hasRows,
25
26
  imageDimensions,
26
27
  isHasMany,
28
+ isPassingError,
27
29
  isPrivateKey,
28
30
  mimeAllowed,
29
31
  mimeAllowedBy,
@@ -36,7 +38,7 @@ import {
36
38
  warnDeprecated,
37
39
  withCharset,
38
40
  withPrivacy
39
- } from "./chunk-J6E6QMDG.js";
41
+ } from "./chunk-SYUQX2G6.js";
40
42
 
41
43
  // src/access.ts
42
44
  var isSystemAdmin = (user) => user?.role === "admin" && !user.apiKey && user.scoped !== true;
@@ -7930,7 +7932,7 @@ function cacheableResponse(request, body, status, headers, times, tags) {
7930
7932
  }
7931
7933
 
7932
7934
  // src/version.ts
7933
- var VERSION = true ? "1.26.0" : "0.0.0-dev";
7935
+ var VERSION = true ? "1.28.0" : "0.0.0-dev";
7934
7936
 
7935
7937
  // src/telemetry.ts
7936
7938
  var DB_CALLS = /* @__PURE__ */ new Set([
@@ -10013,7 +10015,7 @@ var EasyCMS = class {
10013
10015
  if (!claimed) continue;
10014
10016
  const parent = String(row.parent);
10015
10017
  const action = row.action;
10016
- try {
10018
+ const run = async () => {
10017
10019
  if (parent.startsWith("global:")) {
10018
10020
  const { slug: slug2, scope } = splitGlobalKey(parent.slice("global:".length));
10019
10021
  if (action === "publish")
@@ -10030,6 +10032,21 @@ var EasyCMS = class {
10030
10032
  "unpublish"
10031
10033
  );
10032
10034
  }
10035
+ };
10036
+ try {
10037
+ for (let attempt = 0; ; attempt++) {
10038
+ try {
10039
+ await run();
10040
+ break;
10041
+ } catch (error) {
10042
+ const wait = SCHEDULED_RETRY_DELAYS[attempt];
10043
+ if (wait === void 0 || !isPassingError(error)) throw error;
10044
+ this.logger.warn(
10045
+ `Scheduled ${action} of ${parent} ${row.doc}: ${errorText(error)}; trying again`
10046
+ );
10047
+ await new Promise((resolve3) => setTimeout(resolve3, wait));
10048
+ }
10049
+ }
10033
10050
  await this.db.update({
10034
10051
  collection: SCHEDULED_JOBS,
10035
10052
  id: row.id,
@@ -10038,7 +10055,7 @@ var EasyCMS = class {
10038
10055
  ran++;
10039
10056
  } catch (error) {
10040
10057
  failed++;
10041
- const message2 = error.message;
10058
+ const message2 = errorText(error);
10042
10059
  this.logger.error(`Scheduled ${action} of ${parent} ${row.doc} failed: ${message2}`, {
10043
10060
  error
10044
10061
  });
@@ -10048,7 +10065,7 @@ var EasyCMS = class {
10048
10065
  data: {
10049
10066
  ...row,
10050
10067
  state: "failed",
10051
- error: message2.slice(0, 500),
10068
+ error: message2,
10052
10069
  updatedAt: (/* @__PURE__ */ new Date()).toISOString()
10053
10070
  }
10054
10071
  });
@@ -10056,6 +10073,22 @@ var EasyCMS = class {
10056
10073
  }
10057
10074
  return { ran, failed };
10058
10075
  }
10076
+ /**
10077
+ * Puts a failed scheduled publish or unpublish back in the queue and runs what is due (#333).
10078
+ * Returns `false` when the job isn't a failed one.
10079
+ */
10080
+ async retryScheduled(id) {
10081
+ const row = await this.db.findById({ collection: SCHEDULED_JOBS, id });
10082
+ if (!row || row.state !== "failed") return false;
10083
+ const claimed = await this.claim(
10084
+ SCHEDULED_JOBS,
10085
+ row,
10086
+ { state: "pending", error: null, updatedAt: (/* @__PURE__ */ new Date()).toISOString() },
10087
+ { state: { equals: "failed" } }
10088
+ );
10089
+ if (claimed) await this.runScheduled();
10090
+ return claimed;
10091
+ }
10059
10092
  /** Schedules a publish or unpublish, replacing a pending job with the same action. */
10060
10093
  async schedule(collection2, id, job, options = {}) {
10061
10094
  const { parsed } = await this.scheduleTarget(collection2, id, options);
@@ -11191,6 +11224,7 @@ function jobSchedule(job, row) {
11191
11224
  var JOBS_RAN = "easy-cms:jobs-ran";
11192
11225
  var LEGACY_JOB_RUNS = "easy-cms:jobs";
11193
11226
  var JOB_LEASE = 10 * 6e4;
11227
+ var SCHEDULED_RETRY_DELAYS = [1e3, 3e3];
11194
11228
  function durationSeconds(value) {
11195
11229
  const match = typeof value === "string" ? /^(\d+)\s*([smhd])$/.exec(value.trim()) : null;
11196
11230
  const seconds = typeof value === "number" ? value : match ? Number(match[1]) * { s: 1, m: 60, h: 3600, d: 86400 }[match[2]] : Number.NaN;
@@ -11328,6 +11362,15 @@ async function retryOutbox(cms, user, id) {
11328
11362
  if (!await cms.retryOutbox(row.id))
11329
11363
  throw new EasyCMSError("Only failed entries can be retried", 409);
11330
11364
  }
11365
+ async function retryScheduled(cms, user, id) {
11366
+ if (!isSystemAdmin(user)) throw new ForbiddenError();
11367
+ if (!has(cms.config, SCHEDULED_JOBS)) throw new NotFoundError(SCHEDULED_JOBS, id);
11368
+ const parsed = parseId(id);
11369
+ const row = parsed === void 0 ? null : await cms.db.findById({ collection: SCHEDULED_JOBS, id: parsed });
11370
+ if (!row) throw new NotFoundError(SCHEDULED_JOBS, id);
11371
+ if (!await cms.retryScheduled(row.id))
11372
+ throw new EasyCMSError("Only failed jobs can be retried", 409);
11373
+ }
11331
11374
  var TIME_OF_DAY2 = /^([01]\d|2[0-3]):[0-5]\d$/;
11332
11375
  async function updateJob(cms, user, name, body) {
11333
11376
  if (!isSystemAdmin(user)) throw new ForbiddenError();
@@ -13654,6 +13697,13 @@ async function route(cms, ctx, method, path, options) {
13654
13697
  await cms.audit.record({ action: "jobs.outbox.retry", target: "jobs", detail: { id: id2 } });
13655
13698
  return { body: await adminJobs(cms, ctx.user) };
13656
13699
  }
13700
+ if (third === "scheduled" && segments.length === 4) {
13701
+ if (method !== "POST") throw methodNotAllowed(ctx, "POST");
13702
+ const id2 = segments[3];
13703
+ await retryScheduled(cms, ctx.user, id2);
13704
+ await cms.audit.record({ action: "jobs.scheduled.retry", target: "jobs", detail: { id: id2 } });
13705
+ return { body: await adminJobs(cms, ctx.user) };
13706
+ }
13657
13707
  if (third !== void 0 && segments.length === 3) {
13658
13708
  if (method !== "PATCH") throw methodNotAllowed(ctx, "PATCH");
13659
13709
  const { action, detail } = await updateJob(
@@ -103,6 +103,32 @@ var PayloadTooLargeError = class extends EasyCMSError {
103
103
  this.name = "PayloadTooLargeError";
104
104
  }
105
105
  };
106
+ function errorText(error, max = 500) {
107
+ const parts = [];
108
+ let current = error;
109
+ for (let depth = 0; current && depth < 5; depth++) {
110
+ const message = current instanceof Error ? current.message : typeof current === "string" ? current : "";
111
+ const code = current.code;
112
+ const text2 = [message, typeof code === "string" && !message.includes(code) ? code : ""].filter(Boolean).join(" ");
113
+ if (text2 && !parts.some((p) => p.includes(text2))) parts.push(text2);
114
+ current = current.cause;
115
+ }
116
+ const text = parts.join(" \u2014 ") || String(error);
117
+ return text.length > max ? `${text.slice(0, max - 1)}\u2026` : text;
118
+ }
119
+ var PASSING = /ECONNRESET|ECONNREFUSED|ETIMEDOUT|EPIPE|EAI_AGAIN|ENOTFOUND|fetch failed|socket hang up|network|timed? ?out|SQLITE_BUSY|database is locked|too many (clients|connections)|connection (terminated|closed|reset|refused)|server closed|stream (expired|not found)|\b50[234]\b/i;
120
+ function isPassingError(error) {
121
+ if (error instanceof EasyCMSError) return false;
122
+ let current = error;
123
+ for (let depth = 0; current && depth < 5; depth++) {
124
+ const message = current instanceof Error ? current.message : String(current);
125
+ const code = current.code;
126
+ const checked = message.startsWith("Failed query") ? "" : message;
127
+ if (PASSING.test(checked) || typeof code === "string" && PASSING.test(code)) return true;
128
+ current = current.cause;
129
+ }
130
+ return false;
131
+ }
106
132
 
107
133
  // src/media.ts
108
134
  var EXTENSIONS = {
@@ -548,6 +574,8 @@ export {
548
574
  ForbiddenError,
549
575
  TooManyRequestsError,
550
576
  PayloadTooLargeError,
577
+ errorText,
578
+ isPassingError,
551
579
  EXTENSIONS,
552
580
  MIME_GROUPS,
553
581
  expandMimeTypes,
@@ -0,0 +1,131 @@
1
+ import { Config, CollectionSlug, CollectionDocument, Where, CursorDocs, UncountedDocs, PaginatedDocs, ID, GlobalSlug, GlobalDocument } from './index.js';
2
+ import './conditions.js';
3
+
4
+ type Doc = Record<string, unknown>;
5
+ /**
6
+ * What the client reads: `typeof config` (a type-only import of `easy-cms.config.ts`), or the
7
+ * types `easy-cms generate:types` writes, as `{ collections: Collections; globals: Globals }`.
8
+ */
9
+ type ClientSchema = Config | {
10
+ readonly collections?: object;
11
+ readonly globals?: object;
12
+ };
13
+ type Collections<C> = C extends Config ? {
14
+ [S in CollectionSlug<C>]: CollectionDocument<C, S>;
15
+ } : C extends {
16
+ readonly collections: infer X extends object;
17
+ } ? X : Record<string, Doc>;
18
+ type Globals<C> = C extends Config ? {
19
+ [S in GlobalSlug<C> & string]: GlobalDocument<C, S>;
20
+ } : C extends {
21
+ readonly globals: infer X extends object;
22
+ } ? X : Record<string, Doc>;
23
+ /**
24
+ * Options passed on to `fetch`, such as `next: { revalidate: 60, tags: ['posts'] }` on Next.js or
25
+ * `cf: { cacheTtl: 60 }` on Cloudflare.
26
+ */
27
+ type FetchOptions = RequestInit & Record<string, unknown>;
28
+ interface ClientOptions {
29
+ /** The REST API's URL, e.g. `https://cms.example.com/api/cms`. */
30
+ readonly url: string;
31
+ /**
32
+ * An API key, or a user's token, sent as `Authorization: Bearer`. Without one the client reads
33
+ * what anonymous visitors can. Keep it on the server: don't ship it to browsers.
34
+ */
35
+ readonly token?: string;
36
+ /** Default: the global `fetch`. */
37
+ readonly fetch?: typeof fetch;
38
+ /** Passed to every request; a call's own `fetch` options are merged over it. */
39
+ readonly fetchOptions?: FetchOptions;
40
+ }
41
+ interface ReadQuery {
42
+ /** Populate relationships this many levels deep (0–3). */
43
+ readonly depth?: number;
44
+ /** A content locale, or `'all'`. */
45
+ readonly locale?: string;
46
+ /** `false`: leave missing translations empty instead of using the default locale. */
47
+ readonly fallbackLocale?: boolean;
48
+ /** Options for this request's `fetch`. */
49
+ readonly fetch?: FetchOptions;
50
+ }
51
+ interface FindQuery extends ReadQuery {
52
+ readonly where?: Where;
53
+ /** Field path, `-` prefix for descending. */
54
+ readonly sort?: string | readonly string[];
55
+ /** 1–100. Default 10. */
56
+ readonly limit?: number;
57
+ readonly page?: number;
58
+ /** The `nextCursor` of the page before: cursor pagination, without page numbers. */
59
+ readonly cursor?: string;
60
+ /** `false`: no totals, which saves counting every matching document. */
61
+ readonly count?: boolean;
62
+ /** Latest drafts instead of published versions. Needs a `token`. */
63
+ readonly draft?: boolean;
64
+ }
65
+ interface FindByIdQuery extends ReadQuery {
66
+ /** Latest draft instead of the published version. Needs a `token`. */
67
+ readonly draft?: boolean;
68
+ /** A preview token (the page's `easy-cms-preview` parameter): reads the draft without a login. */
69
+ readonly preview?: string | null;
70
+ }
71
+ type FindGlobalQuery = FindByIdQuery;
72
+ interface SearchQuery extends ReadQuery {
73
+ /** Only these collections. */
74
+ readonly collections?: readonly string[];
75
+ readonly limit?: number;
76
+ readonly page?: number;
77
+ }
78
+ /** A page of `find`: numbered, uncounted (`count: false`) or by cursor. */
79
+ type FindResult<T, Q> = Q extends {
80
+ readonly cursor: string;
81
+ } ? CursorDocs<T> : Q extends {
82
+ readonly count: false;
83
+ } ? UncountedDocs<T> : PaginatedDocs<T>;
84
+ interface SearchResult {
85
+ readonly hits: readonly {
86
+ readonly collection: string;
87
+ readonly doc: Doc;
88
+ }[];
89
+ readonly total: number;
90
+ readonly page: number;
91
+ readonly limit: number;
92
+ readonly hasNextPage: boolean;
93
+ }
94
+ /** A request the API refused: `status` is the HTTP status, `errors` what the API said. */
95
+ declare class EasyCMSClientError extends Error {
96
+ readonly status: number;
97
+ readonly errors: readonly {
98
+ readonly message: string;
99
+ readonly code?: string;
100
+ }[];
101
+ constructor(message: string, status: number, errors: readonly {
102
+ message: string;
103
+ code?: string;
104
+ }[]);
105
+ }
106
+ interface EasyCMSClient<C extends ClientSchema> {
107
+ /** Documents of a collection: `GET /:collection`. */
108
+ find<S extends keyof Collections<C> & string, const Q extends FindQuery = Record<never, never>>(collection: S, query?: Q): Promise<FindResult<Collections<C>[S], Q>>;
109
+ /** One document, or `null` when there is none (or it can't be read): `GET /:collection/:id`. */
110
+ findById<S extends keyof Collections<C> & string>(collection: S, id: ID, query?: FindByIdQuery): Promise<Collections<C>[S] | null>;
111
+ /** A global: `GET /globals/:slug`. */
112
+ findGlobal<S extends keyof Globals<C> & string>(global: S, query?: FindGlobalQuery): Promise<Globals<C>[S]>;
113
+ /** Full-text search with the config's `search` adapter: `GET /search`. */
114
+ search(q: string, query?: SearchQuery): Promise<SearchResult>;
115
+ }
116
+ /**
117
+ * A client that reads content over the REST API, for code that can't run Easy CMS itself (edge
118
+ * runtimes, other servers, browsers):
119
+ *
120
+ * ```ts
121
+ * import { createClient } from '@easy-cms/core/client'
122
+ * import type config from './easy-cms.config'
123
+ *
124
+ * const cms = createClient<typeof config>({ url: 'https://cms.example.com/api/cms' })
125
+ * const { docs } = await cms.find('posts', { where: { status: { equals: 'published' } } })
126
+ * ```
127
+ */
128
+ declare function createClient<C extends ClientSchema = Record<never, never>>(options: ClientOptions): EasyCMSClient<C>;
129
+
130
+ export { EasyCMSClientError, createClient };
131
+ export type { ClientOptions, ClientSchema, EasyCMSClient, FetchOptions, FindByIdQuery, FindGlobalQuery, FindQuery, FindResult, SearchQuery, SearchResult };
package/dist/client.js ADDED
@@ -0,0 +1,93 @@
1
+ // src/client.ts
2
+ var EasyCMSClientError = class extends Error {
3
+ status;
4
+ errors;
5
+ constructor(message, status, errors) {
6
+ super(message);
7
+ this.name = "EasyCMSClientError";
8
+ this.status = status;
9
+ this.errors = errors;
10
+ }
11
+ };
12
+ function createClient(options) {
13
+ let base = options.url;
14
+ while (base.endsWith("/")) base = base.slice(0, -1);
15
+ const doFetch = options.fetch ?? ((input, init) => fetch(input, init));
16
+ async function get(path, params, init) {
17
+ const search = new URLSearchParams();
18
+ for (const [key, value] of Object.entries(params))
19
+ if (value !== void 0 && value !== null) search.set(key, String(value));
20
+ const qs = search.toString();
21
+ const headers = new Headers(options.fetchOptions?.headers);
22
+ new Headers(init?.headers).forEach((value, key) => {
23
+ headers.set(key, value);
24
+ });
25
+ headers.set("accept", "application/json");
26
+ if (options.token) headers.set("authorization", `Bearer ${options.token}`);
27
+ const res = await doFetch(`${base}/${path}${qs ? `?${qs}` : ""}`, {
28
+ ...options.fetchOptions,
29
+ ...init,
30
+ method: "GET",
31
+ headers
32
+ });
33
+ const body = await res.json().catch(() => null);
34
+ if (!res.ok) {
35
+ const errors = body?.errors ?? [{ message: res.statusText || `HTTP ${res.status}` }];
36
+ throw new EasyCMSClientError(errors.map((e) => e.message).join("; "), res.status, errors);
37
+ }
38
+ return body;
39
+ }
40
+ const read = (q) => ({
41
+ depth: q.depth,
42
+ locale: q.locale,
43
+ fallbackLocale: q.fallbackLocale === false ? "false" : void 0
44
+ });
45
+ const one = (q) => ({
46
+ ...read(q),
47
+ ...q.preview ? { preview: q.preview } : { draft: q.draft ? "true" : void 0 }
48
+ });
49
+ return {
50
+ find: (collection, query = {}) => get(
51
+ encodeURIComponent(collection),
52
+ {
53
+ ...read(query),
54
+ where: query.where ? JSON.stringify(query.where) : void 0,
55
+ sort: typeof query.sort === "string" ? query.sort : query.sort?.join(","),
56
+ limit: query.limit,
57
+ page: query.page,
58
+ cursor: query.cursor,
59
+ count: query.count === false ? "false" : void 0,
60
+ draft: query.draft ? "true" : void 0
61
+ },
62
+ query.fetch
63
+ ),
64
+ findById: async (collection, id, query = {}) => {
65
+ try {
66
+ return await get(
67
+ `${encodeURIComponent(collection)}/${encodeURIComponent(String(id))}`,
68
+ one(query),
69
+ query.fetch
70
+ );
71
+ } catch (error) {
72
+ if (error instanceof EasyCMSClientError && error.status === 404) return null;
73
+ throw error;
74
+ }
75
+ },
76
+ findGlobal: (global, query = {}) => get(`globals/${encodeURIComponent(global)}`, one(query), query.fetch),
77
+ search: (q, query = {}) => get(
78
+ "search",
79
+ {
80
+ ...read(query),
81
+ q,
82
+ collections: query.collections?.join(","),
83
+ limit: query.limit,
84
+ page: query.page
85
+ },
86
+ query.fetch
87
+ )
88
+ };
89
+ }
90
+ export {
91
+ EasyCMSClientError,
92
+ createClient
93
+ };
@@ -2250,6 +2250,11 @@ declare class EasyCMS<C extends Config = Config> {
2250
2250
  ran: number;
2251
2251
  failed: number;
2252
2252
  }>;
2253
+ /**
2254
+ * Puts a failed scheduled publish or unpublish back in the queue and runs what is due (#333).
2255
+ * Returns `false` when the job isn't a failed one.
2256
+ */
2257
+ retryScheduled(id: ID): Promise<boolean>;
2253
2258
  /** Schedules a publish or unpublish, replacing a pending job with the same action. */
2254
2259
  schedule<S extends Slug<C>>(collection: S, id: ID, job: {
2255
2260
  action: 'publish' | 'unpublish';
@@ -3816,5 +3821,5 @@ interface ResolvedConfig extends Omit<Config, 'cors' | 'localization' | 'routes'
3816
3821
  */
3817
3822
  declare function defineConfig<const TConfig extends Config>(config: TConfig): TConfig;
3818
3823
 
3819
- export { ADAPTER_API_VERSION as A, EasyCMS as E, AuditLog as S, Auth as V, EasyCMSError as aE, FIELD_TYPES as aL, ConfigError as am, SchemaError as b$, ForbiddenError as b3, PLUGIN_API_VERSION as bC, PayloadTooLargeError as bH, QueryError as bN, ROLE_OPERATIONS as bO, Roles as bY, NotFoundError as bw, silentLogger as c$, ValidationError as cA, WEBHOOK_EVENTS as cE, anyone as cJ, consoleEmail as cK, consoleLogger as cL, createEasyCMS as cM, defineConfig as cN, defineFieldType as cO, definePlugin as cP, diskStorage as cQ, hasRows as cR, isAdmin as cS, isHasMany as cT, isSignedIn as cU, isStaff as cV, isSystemAdmin as cW, jsonLogger as cX, memorySearch as cY, mimeAllowedBy as cZ, rowFields as c_, SingleSignOn as ce, TRIGRAM_LIKE_MIN as cl, TooManyRequestsError as cp, UnauthorizedError as cs, uniqueWithinOf as d0, API_KEYS as d1, API_KEY_GLOBAL_OPERATIONS as d2, API_KEY_OPERATIONS as d3, DEFAULT_MAX_VERSIONS as d4, DEFAULT_PASSWORD_EMAILS as d5, FIELD_TYPE_BASES as d6, FOLDER_LEVELS as d7, MediaFolders as d8, SSO_COOKIE as d9, codeOfStatus as db, isJsonLogger as dc, keyAllows as dd, logFormat as de, secretsOf as df, ADMIN_ICONS as e };
3820
- export type { AuthUser as $, AfterDeleteHook as B, Config as C, AfterReadHook as D, Field as F, ApiKeyContext as G, ApiKeyGlobalOperation as H, ID as I, ApiKeyOperation as J, ApiKeyPermissions as K, LocalizationConfig as L, ArrayField as M, AuditChange as N, AuditConfig as O, PaginatedDocs as P, AuditEntry as Q, ResolvedConfig as R, AuditPage as T, AuditVerification as U, WebhookPayload as W, AuthConfig as X, AuthProvider as Y, AuthProviderProfile as Z, AuthProviderRequest as _, FieldError as a, FindArgs as a$, BackupsConfig as a0, BeforeChangeHook as a1, BeforeDeleteHook as a2, BeforeValidateHook as a3, Block as a4, BlocksField as a5, BooleanField as a6, BuiltinApiKeysCollection as a7, BuiltinMediaCollection as a8, BuiltinMediaFoldersCollection as a9, DepthOptions as aA, DirectUpload as aB, DiskStorageOptions as aC, DocumentOf as aD, EmailAdapter as aF, EmailField as aG, EmailMessage as aH, Endpoint as aI, EndpointRequest as aJ, ErrorCode as aK, FieldAccess as aM, FieldAccessFn as aN, FieldAdmin as aO, FieldRule as aP, FieldType as aQ, FieldTypeBase as aR, FieldTypeDefinition as aS, FieldTypeValidateContext as aT, FieldValidate as aU, FieldValidateContext as aV, FieldValue as aW, FieldsInput as aX, FieldsValue as aY, FilterOptionsArgs as aZ, FindAfterArgs as a_, BuiltinUsersCollection as aa, BundleHints as ab, CliCommand as ac, CollectionAccess as ad, CollectionAdmin as ae, CollectionCalendarAdmin as af, CollectionConfig as ag, CollectionDocument as ah, CollectionHooks as ai, CollectionListAdmin as aj, CollectionSearch as ak, CollectionSlug as al, ConfigIssue as an, ContainerAdmin as ao, CreateInput as ap, CreateMigrationResult as aq, CursorDocs as ar, CustomField as as, CustomFieldTypes as at, DashboardWidget as au, Database as av, DatabaseAdapter as aw, DatabaseInitArgs as ax, DatabaseTransfer as ay, DateField as az, FilterOptions as b, FindOptions as b0, FolderLevel as b1, FolderPermissions as b2, GlobalAccess as b4, GlobalConfig as b5, GlobalDocument as b6, GlobalHooks as b7, GlobalInput as b8, GlobalSlug as b9, Operation as bA, OutboxRow as bB, PasswordEmail as bD, PasswordEmailArgs as bE, PasswordEmailFn as bF, PasswordLinkOptions as bG, Plugin as bI, PluginInfo as bJ, PluginTypes as bK, PreviewTarget as bL, PreviewURL as bM, RawDocument as bP, ReadOptions as bQ, RelationshipField as bR, RequestContext as bS, RichTextDocument as bT, RichTextField as bU, Role as bV, RoleOperation as bW, RolePermissions as bX, RoutesConfig as bZ, ScheduledPublish as b_, GroupField as ba, ImageSize as bb, IncrementOptions as bc, InferCollection as bd, InferGlobal as be, JobConfig as bf, JsonField as bg, KeysetPage as bh, Label as bi, LayoutNode as bj, LivePreview as bk, LocaleOf as bl, LogDetails as bm, Logger as bn, LoginArgs as bo, LogsConfig as bp, MediaDocument as bq, MediaSize as br, MembersConfig as bs, MembersSignup as bt, MigrationInfo as bu, NavGroup as bv, NumberField as bx, OnRequest as by, OnRequestArgs as bz, CreateEasyCMSOptions as c, SchemaMode as c0, SearchAdapter as c1, SearchEntry as c2, SearchHits as c3, SearchOptions as c4, SearchQuery as c5, SearchResults as c6, SearchSetting as c7, SelectField as c8, SelectOption as c9, Version as cB, VersionSummary as cC, VersionsConfig as cD, WebhookConfig as cF, WebhookEvent as cG, Where as cH, WhereOperators as cI, Session as ca, SidebarPanel as cb, SignupArgs as cc, SignupResult as cd, SlugField as cf, SlugOf as cg, SsoOutcome as ch, SsoProviderRef as ci, StorageAdapter as cj, StoredFile as ck, TelemetryConfig as cm, TextField as cn, TextareaField as co, TypedPlugin as cq, UiField as cr, UncountedDocs as ct, UpdateInput as cu, UpdateOptions as cv, UploadConfig as cw, UploadField as cx, UploadFromURLConfig as cy, UserIdentity as cz, EmailSetting as d, Secrets as da, Access as f, AccessArgs as g, AccessOptions as h, AdminBrand as i, AdminCommand as j, AdminComponent as k, AdminConfig as l, AdminFieldArgs as m, AdminIcon as n, AdminLocale as o, AdminPage as p, AdminRole as q, AdminRoleChange as r, AdminRoleField as s, AdminRoleTarget as t, AdminRoleView as u, AdminRoles as v, AdminSso as w, AdminSwitcher as x, AdminViewAccess as y, AfterChangeHook as z };
3824
+ export { ADAPTER_API_VERSION as A, EasyCMS as E, AuditLog as _, Auth as a1, EasyCMSError as aI, FIELD_TYPES as aP, ConfigError as ar, ForbiddenError as b7, PLUGIN_API_VERSION as bE, PayloadTooLargeError as bJ, QueryError as bP, ROLE_OPERATIONS as bQ, Roles as b_, NotFoundError as by, silentLogger as c$, SchemaError as c1, ValidationError as cB, WEBHOOK_EVENTS as cF, anyone as cJ, consoleEmail as cK, consoleLogger as cL, createEasyCMS as cM, defineConfig as cN, defineFieldType as cO, definePlugin as cP, diskStorage as cQ, hasRows as cR, isAdmin as cS, isHasMany as cT, isSignedIn as cU, isStaff as cV, isSystemAdmin as cW, jsonLogger as cX, memorySearch as cY, mimeAllowedBy as cZ, rowFields as c_, SingleSignOn as cg, TRIGRAM_LIKE_MIN as cn, TooManyRequestsError as cr, UnauthorizedError as cu, uniqueWithinOf as d0, API_KEYS as d1, API_KEY_GLOBAL_OPERATIONS as d2, API_KEY_OPERATIONS as d3, DEFAULT_MAX_VERSIONS as d4, DEFAULT_PASSWORD_EMAILS as d5, FIELD_TYPE_BASES as d6, FOLDER_LEVELS as d7, MediaFolders as d8, SSO_COOKIE as d9, codeOfStatus as db, isJsonLogger as dc, keyAllows as dd, logFormat as de, secretsOf as df, ADMIN_ICONS as j };
3825
+ export type { AuditPage as $, AdminRoles as B, Config as C, AdminSso as D, Field as F, GlobalSlug as G, AdminSwitcher as H, ID as I, AdminViewAccess as J, AfterChangeHook as K, LocalizationConfig as L, AfterDeleteHook as M, AfterReadHook as N, ApiKeyContext as O, PaginatedDocs as P, ApiKeyGlobalOperation as Q, ResolvedConfig as R, ApiKeyOperation as S, ApiKeyPermissions as T, UncountedDocs as U, ArrayField as V, Where as W, AuditChange as X, AuditConfig as Y, AuditEntry as Z, CollectionSlug as a, FieldsInput as a$, AuditVerification as a0, AuthConfig as a2, AuthProvider as a3, AuthProviderProfile as a4, AuthProviderRequest as a5, AuthUser as a6, BackupsConfig as a7, BeforeChangeHook as a8, BeforeDeleteHook as a9, DatabaseAdapter as aA, DatabaseInitArgs as aB, DatabaseTransfer as aC, DateField as aD, DepthOptions as aE, DirectUpload as aF, DiskStorageOptions as aG, DocumentOf as aH, EmailAdapter as aJ, EmailField as aK, EmailMessage as aL, Endpoint as aM, EndpointRequest as aN, ErrorCode as aO, FieldAccess as aQ, FieldAccessFn as aR, FieldAdmin as aS, FieldRule as aT, FieldType as aU, FieldTypeBase as aV, FieldTypeDefinition as aW, FieldTypeValidateContext as aX, FieldValidate as aY, FieldValidateContext as aZ, FieldValue as a_, BeforeValidateHook as aa, Block as ab, BlocksField as ac, BooleanField as ad, BuiltinApiKeysCollection as ae, BuiltinMediaCollection as af, BuiltinMediaFoldersCollection as ag, BuiltinUsersCollection as ah, BundleHints as ai, CliCommand as aj, CollectionAccess as ak, CollectionAdmin as al, CollectionCalendarAdmin as am, CollectionConfig as an, CollectionHooks as ao, CollectionListAdmin as ap, CollectionSearch as aq, ConfigIssue as as, ContainerAdmin as at, CreateInput as au, CreateMigrationResult as av, CustomField as aw, CustomFieldTypes as ax, DashboardWidget as ay, Database as az, CollectionDocument as b, RoutesConfig as b$, FieldsValue as b0, FilterOptionsArgs as b1, FindAfterArgs as b2, FindArgs as b3, FindOptions as b4, FolderLevel as b5, FolderPermissions as b6, GlobalAccess as b8, GlobalConfig as b9, OnRequest as bA, OnRequestArgs as bB, Operation as bC, OutboxRow as bD, PasswordEmail as bF, PasswordEmailArgs as bG, PasswordEmailFn as bH, PasswordLinkOptions as bI, Plugin as bK, PluginInfo as bL, PluginTypes as bM, PreviewTarget as bN, PreviewURL as bO, RawDocument as bR, ReadOptions as bS, RelationshipField as bT, RequestContext as bU, RichTextDocument as bV, RichTextField as bW, Role as bX, RoleOperation as bY, RolePermissions as bZ, GlobalHooks as ba, GlobalInput as bb, GroupField as bc, ImageSize as bd, IncrementOptions as be, InferCollection as bf, InferGlobal as bg, JobConfig as bh, JsonField as bi, KeysetPage as bj, Label as bk, LayoutNode as bl, LivePreview as bm, LocaleOf as bn, LogDetails as bo, Logger as bp, LoginArgs as bq, LogsConfig as br, MediaDocument as bs, MediaSize as bt, MembersConfig as bu, MembersSignup as bv, MigrationInfo as bw, NavGroup as bx, NumberField as bz, CursorDocs as c, ScheduledPublish as c0, SchemaMode as c2, SearchAdapter as c3, SearchEntry as c4, SearchHits as c5, SearchOptions as c6, SearchQuery as c7, SearchResults as c8, SearchSetting as c9, UserIdentity as cA, Version as cC, VersionSummary as cD, VersionsConfig as cE, WebhookConfig as cG, WebhookEvent as cH, WhereOperators as cI, SelectField as ca, SelectOption as cb, Session as cc, SidebarPanel as cd, SignupArgs as ce, SignupResult as cf, SlugField as ch, SlugOf as ci, SsoOutcome as cj, SsoProviderRef as ck, StorageAdapter as cl, StoredFile as cm, TelemetryConfig as co, TextField as cp, TextareaField as cq, TypedPlugin as cs, UiField as ct, UpdateInput as cv, UpdateOptions as cw, UploadConfig as cx, UploadField as cy, UploadFromURLConfig as cz, GlobalDocument as d, Secrets as da, FieldError as e, FilterOptions as f, CreateEasyCMSOptions as g, EmailSetting as h, WebhookPayload as i, Access as k, AccessArgs as l, AccessOptions as m, AdminBrand as n, AdminCommand as o, AdminComponent as p, AdminConfig as q, AdminFieldArgs as r, AdminIcon as s, AdminLocale as t, AdminPage as u, AdminRole as v, AdminRoleChange as w, AdminRoleField as x, AdminRoleTarget as y, AdminRoleView as z };
@@ -1,4 +1,4 @@
1
- import { I as ID, C as Config, E as EasyCMS, L as LocalizationConfig, F as Field, a as FieldError, b as FilterOptions, c as CreateEasyCMSOptions, R as ResolvedConfig } from './config-BpKdXA32.js';
1
+ import { I as ID, C as Config, E as EasyCMS, L as LocalizationConfig, F as Field, e as FieldError, f as FilterOptions, g as CreateEasyCMSOptions, R as ResolvedConfig } from './config-BLNPAco2.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;
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { P as PaginatedDocs, I as ID, d as EmailSetting, W as WebhookPayload } from './config-BpKdXA32.js';
2
- export { A as ADAPTER_API_VERSION, e as ADMIN_ICONS, f as Access, g as AccessArgs, h as AccessOptions, i as AdminBrand, j as AdminCommand, k as AdminComponent, l as AdminConfig, m as AdminFieldArgs, n as AdminIcon, o as AdminLocale, p as AdminPage, q as AdminRole, r as AdminRoleChange, s as AdminRoleField, t as AdminRoleTarget, u as AdminRoleView, v as AdminRoles, w as AdminSso, x as AdminSwitcher, y as AdminViewAccess, z as AfterChangeHook, B as AfterDeleteHook, D as AfterReadHook, G as ApiKeyContext, H as ApiKeyGlobalOperation, J as ApiKeyOperation, K as ApiKeyPermissions, M as ArrayField, N as AuditChange, O as AuditConfig, Q as AuditEntry, S as AuditLog, T as AuditPage, U as AuditVerification, V as Auth, X as AuthConfig, Y as AuthProvider, Z as AuthProviderProfile, _ as AuthProviderRequest, $ as AuthUser, a0 as BackupsConfig, a1 as BeforeChangeHook, a2 as BeforeDeleteHook, a3 as BeforeValidateHook, a4 as Block, a5 as BlocksField, a6 as BooleanField, a7 as BuiltinApiKeysCollection, a8 as BuiltinMediaCollection, a9 as BuiltinMediaFoldersCollection, aa as BuiltinUsersCollection, ab as BundleHints, ac as CliCommand, ad as CollectionAccess, ae as CollectionAdmin, af as CollectionCalendarAdmin, ag as CollectionConfig, ah as CollectionDocument, ai as CollectionHooks, aj as CollectionListAdmin, ak as CollectionSearch, al as CollectionSlug, C as Config, am as ConfigError, an as ConfigIssue, ao as ContainerAdmin, c as CreateEasyCMSOptions, ap as CreateInput, aq as CreateMigrationResult, ar as CursorDocs, as as CustomField, at as CustomFieldTypes, au as DashboardWidget, av as Database, aw as DatabaseAdapter, ax as DatabaseInitArgs, ay as DatabaseTransfer, az as DateField, aA as DepthOptions, aB as DirectUpload, aC as DiskStorageOptions, aD as DocumentOf, E as EasyCMS, aE as EasyCMSError, aF as EmailAdapter, aG as EmailField, aH as EmailMessage, aI as Endpoint, aJ as EndpointRequest, aK as ErrorCode, aL as FIELD_TYPES, F as Field, aM as FieldAccess, aN as FieldAccessFn, aO as FieldAdmin, a as FieldError, aP as FieldRule, aQ as FieldType, aR as FieldTypeBase, aS as FieldTypeDefinition, aT as FieldTypeValidateContext, aU as FieldValidate, aV as FieldValidateContext, aW as FieldValue, aX as FieldsInput, aY as FieldsValue, b as FilterOptions, aZ as FilterOptionsArgs, a_ as FindAfterArgs, a$ as FindArgs, b0 as FindOptions, b1 as FolderLevel, b2 as FolderPermissions, b3 as ForbiddenError, b4 as GlobalAccess, b5 as GlobalConfig, b6 as GlobalDocument, b7 as GlobalHooks, b8 as GlobalInput, b9 as GlobalSlug, ba as GroupField, bb as ImageSize, bc as IncrementOptions, bd as InferCollection, be as InferGlobal, bf as JobConfig, bg as JsonField, bh as KeysetPage, bi as Label, bj as LayoutNode, bk as LivePreview, bl as LocaleOf, L as LocalizationConfig, bm as LogDetails, bn as Logger, bo as LoginArgs, bp as LogsConfig, bq as MediaDocument, br as MediaSize, bs as MembersConfig, bt as MembersSignup, bu as MigrationInfo, bv as NavGroup, bw as NotFoundError, bx as NumberField, by as OnRequest, bz as OnRequestArgs, bA as Operation, bB as OutboxRow, bC as PLUGIN_API_VERSION, bD as PasswordEmail, bE as PasswordEmailArgs, bF as PasswordEmailFn, bG as PasswordLinkOptions, bH as PayloadTooLargeError, bI as Plugin, bJ as PluginInfo, bK as PluginTypes, bL as PreviewTarget, bM as PreviewURL, bN as QueryError, bO as ROLE_OPERATIONS, bP as RawDocument, bQ as ReadOptions, bR as RelationshipField, bS as RequestContext, R as ResolvedConfig, bT as RichTextDocument, bU as RichTextField, bV as Role, bW as RoleOperation, bX as RolePermissions, bY as Roles, bZ as RoutesConfig, b_ as ScheduledPublish, b$ as SchemaError, c0 as SchemaMode, c1 as SearchAdapter, c2 as SearchEntry, c3 as SearchHits, c4 as SearchOptions, c5 as SearchQuery, c6 as SearchResults, c7 as SearchSetting, c8 as SelectField, c9 as SelectOption, ca as Session, cb as SidebarPanel, cc as SignupArgs, cd as SignupResult, ce as SingleSignOn, cf as SlugField, cg as SlugOf, ch as SsoOutcome, ci as SsoProviderRef, cj as StorageAdapter, ck as StoredFile, cl as TRIGRAM_LIKE_MIN, cm as TelemetryConfig, cn as TextField, co as TextareaField, cp as TooManyRequestsError, cq as TypedPlugin, cr as UiField, cs as UnauthorizedError, ct as UncountedDocs, cu as UpdateInput, cv as UpdateOptions, cw as UploadConfig, cx as UploadField, cy as UploadFromURLConfig, cz as UserIdentity, cA as ValidationError, cB as Version, cC as VersionSummary, cD as VersionsConfig, cE as WEBHOOK_EVENTS, cF as WebhookConfig, cG as WebhookEvent, cH as Where, cI as WhereOperators, cJ as anyone, cK as consoleEmail, cL as consoleLogger, cM as createEasyCMS, cN as defineConfig, cO as defineFieldType, cP as definePlugin, cQ as diskStorage, cR as hasRows, cS as isAdmin, cT as isHasMany, cU as isSignedIn, cV as isStaff, cW as isSystemAdmin, cX as jsonLogger, cY as memorySearch, cZ as mimeAllowedBy, c_ as rowFields, c$ as silentLogger, d0 as uniqueWithinOf } from './config-BpKdXA32.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-AYwNCGrB.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-BokoUN1I.js';
1
+ import { P as PaginatedDocs, I as ID, h as EmailSetting, i as WebhookPayload } from './config-BLNPAco2.js';
2
+ export { A as ADAPTER_API_VERSION, j as ADMIN_ICONS, k as Access, l as AccessArgs, m as AccessOptions, n as AdminBrand, o as AdminCommand, p as AdminComponent, q as AdminConfig, r as AdminFieldArgs, s as AdminIcon, t as AdminLocale, u as AdminPage, v as AdminRole, w as AdminRoleChange, x as AdminRoleField, y as AdminRoleTarget, z as AdminRoleView, B as AdminRoles, D as AdminSso, H as AdminSwitcher, J as AdminViewAccess, K as AfterChangeHook, M as AfterDeleteHook, N as AfterReadHook, O as ApiKeyContext, Q as ApiKeyGlobalOperation, S as ApiKeyOperation, T as ApiKeyPermissions, V as ArrayField, X as AuditChange, Y as AuditConfig, Z as AuditEntry, _ as AuditLog, $ as AuditPage, a0 as AuditVerification, a1 as Auth, a2 as AuthConfig, a3 as AuthProvider, a4 as AuthProviderProfile, a5 as AuthProviderRequest, a6 as AuthUser, a7 as BackupsConfig, a8 as BeforeChangeHook, a9 as BeforeDeleteHook, aa as BeforeValidateHook, ab as Block, ac as BlocksField, ad as BooleanField, ae as BuiltinApiKeysCollection, af as BuiltinMediaCollection, ag as BuiltinMediaFoldersCollection, ah as BuiltinUsersCollection, ai as BundleHints, aj as CliCommand, ak as CollectionAccess, al as CollectionAdmin, am as CollectionCalendarAdmin, an as CollectionConfig, b as CollectionDocument, ao as CollectionHooks, ap as CollectionListAdmin, aq as CollectionSearch, a as CollectionSlug, C as Config, ar as ConfigError, as as ConfigIssue, at as ContainerAdmin, g as CreateEasyCMSOptions, au as CreateInput, av as CreateMigrationResult, c as CursorDocs, aw as CustomField, ax as CustomFieldTypes, ay as DashboardWidget, az as Database, aA as DatabaseAdapter, aB as DatabaseInitArgs, aC as DatabaseTransfer, aD as DateField, aE as DepthOptions, aF as DirectUpload, aG as DiskStorageOptions, aH as DocumentOf, E as EasyCMS, aI as EasyCMSError, aJ as EmailAdapter, aK as EmailField, aL as EmailMessage, aM as Endpoint, aN as EndpointRequest, aO as ErrorCode, aP as FIELD_TYPES, F as Field, aQ as FieldAccess, aR as FieldAccessFn, aS as FieldAdmin, e as FieldError, aT as FieldRule, aU as FieldType, aV as FieldTypeBase, aW as FieldTypeDefinition, aX as FieldTypeValidateContext, aY as FieldValidate, aZ as FieldValidateContext, a_ as FieldValue, a$ as FieldsInput, b0 as FieldsValue, f as FilterOptions, b1 as FilterOptionsArgs, b2 as FindAfterArgs, b3 as FindArgs, b4 as FindOptions, b5 as FolderLevel, b6 as FolderPermissions, b7 as ForbiddenError, b8 as GlobalAccess, b9 as GlobalConfig, d as GlobalDocument, ba as GlobalHooks, bb as GlobalInput, G as GlobalSlug, bc as GroupField, bd as ImageSize, be as IncrementOptions, bf as InferCollection, bg as InferGlobal, bh as JobConfig, bi as JsonField, bj as KeysetPage, bk as Label, bl as LayoutNode, bm as LivePreview, bn as LocaleOf, L as LocalizationConfig, bo as LogDetails, bp as Logger, bq as LoginArgs, br as LogsConfig, bs as MediaDocument, bt as MediaSize, bu as MembersConfig, bv as MembersSignup, bw as MigrationInfo, bx as NavGroup, by as NotFoundError, bz as NumberField, bA as OnRequest, bB as OnRequestArgs, bC as Operation, bD as OutboxRow, bE as PLUGIN_API_VERSION, bF as PasswordEmail, bG as PasswordEmailArgs, bH as PasswordEmailFn, bI as PasswordLinkOptions, bJ as PayloadTooLargeError, bK as Plugin, bL as PluginInfo, bM as PluginTypes, bN as PreviewTarget, bO as PreviewURL, bP as QueryError, bQ as ROLE_OPERATIONS, bR as RawDocument, bS as ReadOptions, bT as RelationshipField, bU as RequestContext, R as ResolvedConfig, bV as RichTextDocument, bW as RichTextField, bX as Role, bY as RoleOperation, bZ as RolePermissions, b_ as Roles, b$ as RoutesConfig, c0 as ScheduledPublish, c1 as SchemaError, c2 as SchemaMode, c3 as SearchAdapter, c4 as SearchEntry, c5 as SearchHits, c6 as SearchOptions, c7 as SearchQuery, c8 as SearchResults, c9 as SearchSetting, ca as SelectField, cb as SelectOption, cc as Session, cd as SidebarPanel, ce as SignupArgs, cf as SignupResult, cg as SingleSignOn, ch as SlugField, ci as SlugOf, cj as SsoOutcome, ck as SsoProviderRef, cl as StorageAdapter, cm as StoredFile, cn as TRIGRAM_LIKE_MIN, co as TelemetryConfig, cp as TextField, cq as TextareaField, cr as TooManyRequestsError, cs as TypedPlugin, ct as UiField, cu as UnauthorizedError, U as UncountedDocs, cv as UpdateInput, cw as UpdateOptions, cx as UploadConfig, cy as UploadField, cz as UploadFromURLConfig, cA as UserIdentity, cB as ValidationError, cC as Version, cD as VersionSummary, cE as VersionsConfig, cF as WEBHOOK_EVENTS, cG as WebhookConfig, cH as WebhookEvent, W as Where, cI as WhereOperators, cJ as anyone, cK as consoleEmail, cL as consoleLogger, cM as createEasyCMS, cN as defineConfig, cO as defineFieldType, cP as definePlugin, cQ as diskStorage, cR as hasRows, cS as isAdmin, cT as isHasMany, cU as isSignedIn, cV as isStaff, cW as isSystemAdmin, cX as jsonLogger, cY as memorySearch, cZ as mimeAllowedBy, c_ as rowFields, c$ as silentLogger, d0 as uniqueWithinOf } from './config-BLNPAco2.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-B7pTgG5F.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-d7cT0k4l.js';
5
5
  export { FieldCondition, matchesCondition } from './conditions.js';
6
6
 
7
7
  type DeliveryKind = 'webhook' | 'email';
package/dist/index.js CHANGED
@@ -28,7 +28,7 @@ import {
28
28
  silentLogger,
29
29
  slugify,
30
30
  verifyWebhook
31
- } from "./chunk-5L544S33.js";
31
+ } from "./chunk-QRHRDJN5.js";
32
32
  import {
33
33
  matchesCondition
34
34
  } from "./chunk-U266LV4M.js";
@@ -53,7 +53,7 @@ import {
53
53
  defineFieldType,
54
54
  definePlugin,
55
55
  warnDeprecated
56
- } from "./chunk-J6E6QMDG.js";
56
+ } from "./chunk-SYUQX2G6.js";
57
57
  export {
58
58
  ADAPTER_API_VERSION,
59
59
  ADMIN_API_VERSION,
@@ -1,6 +1,6 @@
1
1
  import { Config, Database, EasyCMS, NavGroup, CollectionConfig, ID, RawDocument, Field, ResolvedConfig, ConfigIssue } from './index.js';
2
- export { d1 as API_KEYS, d2 as API_KEY_GLOBAL_OPERATIONS, d3 as API_KEY_OPERATIONS, d4 as DEFAULT_MAX_VERSIONS, d5 as DEFAULT_PASSWORD_EMAILS, d6 as FIELD_TYPE_BASES, d7 as FOLDER_LEVELS, d8 as MediaFolders, d9 as SSO_COOKIE, da as Secrets, cl as TRIGRAM_LIKE_MIN, db as codeOfStatus, cR as hasRows, cT as isHasMany, dc as isJsonLogger, dd as keyAllows, de as logFormat, cZ as mimeAllowedBy, c_ as rowFields, df as secretsOf, d0 as uniqueWithinOf } from './config-BpKdXA32.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 isEmail, y as mergeForUpdate, z as parseId, E as platformClientIp, F as readCookie, G as validateFields, H as writeBackupFile } from './handler-BokoUN1I.js';
2
+ export { d1 as API_KEYS, d2 as API_KEY_GLOBAL_OPERATIONS, d3 as API_KEY_OPERATIONS, d4 as DEFAULT_MAX_VERSIONS, d5 as DEFAULT_PASSWORD_EMAILS, d6 as FIELD_TYPE_BASES, d7 as FOLDER_LEVELS, d8 as MediaFolders, d9 as SSO_COOKIE, da as Secrets, cn as TRIGRAM_LIKE_MIN, db as codeOfStatus, cR as hasRows, cT as isHasMany, dc as isJsonLogger, dd as keyAllows, de as logFormat, cZ as mimeAllowedBy, c_ as rowFields, df as secretsOf, d0 as uniqueWithinOf } from './config-BLNPAco2.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 isEmail, y as mergeForUpdate, z as parseId, E as platformClientIp, F as readCookie, G as validateFields, H as writeBackupFile } from './handler-d7cT0k4l.js';
4
4
  export { conditionIssues } from './conditions.js';
5
5
 
6
6
  /** The session cookie the REST API sets at login. */
package/dist/internal.js CHANGED
@@ -58,7 +58,7 @@ import {
58
58
  verifyPassword,
59
59
  verifyTurnstile,
60
60
  writeBackupFile
61
- } from "./chunk-5L544S33.js";
61
+ } from "./chunk-QRHRDJN5.js";
62
62
  import {
63
63
  conditionIssues
64
64
  } from "./chunk-U266LV4M.js";
@@ -77,7 +77,7 @@ import {
77
77
  rowFields,
78
78
  sniffMimeType,
79
79
  uniqueWithinOf
80
- } from "./chunk-J6E6QMDG.js";
80
+ } from "./chunk-SYUQX2G6.js";
81
81
 
82
82
  // src/typegen.ts
83
83
  var pascal = (name) => name.split(/[^A-Za-z0-9]+/).filter(Boolean).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join("");
@@ -1,4 +1,4 @@
1
- import { bi as Label, F as Field, I as ID, o as AdminLocale, x as AdminSwitcher, ci as SsoProviderRef } from './config-BpKdXA32.js';
1
+ import { bk as Label, F as Field, I as ID, t as AdminLocale, H as AdminSwitcher, ck as SsoProviderRef } from './config-BLNPAco2.js';
2
2
  import { FieldCondition } from './conditions.js';
3
3
 
4
4
  /** A Web Component from an admin module, with its `props` (plain JSON). */
package/dist/plugin.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export { e as ADMIN_ICONS, k as AdminComponent, n as AdminIcon, $ as AuthUser, ac as CliCommand, ad as CollectionAccess, ag as CollectionConfig, C as Config, am as ConfigError, au as DashboardWidget, aE as EasyCMSError, aI as Endpoint, aJ as EndpointRequest, aK as ErrorCode, F as Field, aM as FieldAccess, a as FieldError, aR as FieldTypeBase, aS as FieldTypeDefinition, aT as FieldTypeValidateContext, b3 as ForbiddenError, b5 as GlobalConfig, I as ID, bf as JobConfig, bi as Label, bv as NavGroup, bw as NotFoundError, by as OnRequest, bz as OnRequestArgs, bC as PLUGIN_API_VERSION, bH as PayloadTooLargeError, bI as Plugin, bJ as PluginInfo, bK as PluginTypes, bN as QueryError, bS as RequestContext, cp as TooManyRequestsError, cq as TypedPlugin, cs as UnauthorizedError, cA as ValidationError, cH as Where, cO as defineFieldType, cP as definePlugin } from './config-BpKdXA32.js';
2
- export { A as ADMIN_API_VERSION, c as AdminElementProps, k as AdminPageRoute, S as SetFieldDetail, w as warnDeprecated } from './plugin-AYwNCGrB.js';
1
+ export { j as ADMIN_ICONS, p as AdminComponent, s as AdminIcon, a6 as AuthUser, aj as CliCommand, ak as CollectionAccess, an as CollectionConfig, C as Config, ar as ConfigError, ay as DashboardWidget, aI as EasyCMSError, aM as Endpoint, aN as EndpointRequest, aO as ErrorCode, F as Field, aQ as FieldAccess, e as FieldError, aV as FieldTypeBase, aW as FieldTypeDefinition, aX as FieldTypeValidateContext, b7 as ForbiddenError, b9 as GlobalConfig, I as ID, bh as JobConfig, bk as Label, bx as NavGroup, by as NotFoundError, bA as OnRequest, bB as OnRequestArgs, bE as PLUGIN_API_VERSION, bJ as PayloadTooLargeError, bK as Plugin, bL as PluginInfo, bM as PluginTypes, bP as QueryError, bU as RequestContext, cr as TooManyRequestsError, cs as TypedPlugin, cu as UnauthorizedError, cB as ValidationError, W as Where, cO as defineFieldType, cP as definePlugin } from './config-BLNPAco2.js';
2
+ export { A as ADMIN_API_VERSION, c as AdminElementProps, k as AdminPageRoute, S as SetFieldDetail, w as warnDeprecated } from './plugin-B7pTgG5F.js';
3
3
  import './conditions.js';
package/dist/plugin.js CHANGED
@@ -16,7 +16,7 @@ import {
16
16
  defineFieldType,
17
17
  definePlugin,
18
18
  warnDeprecated
19
- } from "./chunk-J6E6QMDG.js";
19
+ } from "./chunk-SYUQX2G6.js";
20
20
  export {
21
21
  ADMIN_API_VERSION,
22
22
  ADMIN_ICONS,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easy-cms/core",
3
- "version": "1.26.0",
3
+ "version": "1.28.0",
4
4
  "description": "Embedded, code-first headless CMS for Nuxt and Next.js",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -22,6 +22,10 @@
22
22
  "types": "./dist/plugin.d.ts",
23
23
  "default": "./dist/plugin.js"
24
24
  },
25
+ "./client": {
26
+ "types": "./dist/client.d.ts",
27
+ "default": "./dist/client.js"
28
+ },
25
29
  "./internal": {
26
30
  "types": "./dist/internal.d.ts",
27
31
  "default": "./dist/internal.js"