@easy-cms/core 1.14.0 → 1.15.1

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.
@@ -166,6 +166,25 @@ function zipType(data) {
166
166
  if (contains(data, "ppt/presentation.xml")) return OFFICE[2];
167
167
  return "application/zip";
168
168
  }
169
+ function isSvg(text) {
170
+ let rest = text;
171
+ if (rest.slice(0, 5).toLowerCase() === "<?xml") {
172
+ const end = rest.indexOf(">");
173
+ if (end < 0) return false;
174
+ rest = rest.slice(end + 1).trimStart();
175
+ }
176
+ while (rest.startsWith("<!--")) {
177
+ const end = rest.indexOf("-->", 4);
178
+ if (end < 0) return false;
179
+ rest = rest.slice(end + 3).trimStart();
180
+ }
181
+ if (/^<!DOCTYPE svg/i.test(rest)) {
182
+ const end = rest.indexOf(">");
183
+ if (end < 0) return false;
184
+ rest = rest.slice(end + 1).trimStart();
185
+ }
186
+ return /^<svg[\s>]/i.test(rest);
187
+ }
169
188
  function sniffMimeType(data, name = "") {
170
189
  if (startsWith(data, [137, 80, 78, 71, 13, 10, 26, 10])) return "image/png";
171
190
  if (startsWith(data, [255, 216, 255])) return "image/jpeg";
@@ -195,8 +214,7 @@ function sniffMimeType(data, name = "") {
195
214
  return void 0;
196
215
  }
197
216
  const trimmed = text.replace(/^/, "").trimStart();
198
- if (/^(<\?xml[^>]*>\s*)?(<!--[\s\S]*?-->\s*)*(<!DOCTYPE svg[^>]*>\s*)?<svg[\s>]/i.test(trimmed))
199
- return "image/svg+xml";
217
+ if (isSvg(trimmed)) return "image/svg+xml";
200
218
  return /\.csv$/i.test(name) ? "text/csv" : "text/plain";
201
219
  }
202
220
  function mimeAllowed(type, allowed) {
@@ -119,7 +119,8 @@ declare function logFormat(logs: LogsConfig | undefined): 'pretty' | 'json';
119
119
  declare const isJsonLogger: (logger: Logger) => boolean;
120
120
  /**
121
121
  * One JSON object per line: `time`, `level`, `name`, `message`, the request's `requestId` (or
122
- * the job run's `runId`), `error` with its stack, and any other details.
122
+ * the job run's `runId`), with `telemetry` the active span's `traceId` and `spanId`, `error`
123
+ * with its stack, and any other details.
123
124
  */
124
125
  declare function jsonLogger(write?: (line: string, level: 'info' | 'warn' | 'error') => void): Logger;
125
126
 
@@ -2107,6 +2108,8 @@ declare class EasyCMS<C extends Config = Config> {
2107
2108
  }[]>;
2108
2109
  /** Published documents of a collection in a locale, a page at a time, for the search index. */
2109
2110
  private publishedPages;
2111
+ /** A Local API call in a span (`easy-cms <operation> <collection>`) with `telemetry`. */
2112
+ private traced;
2110
2113
  destroy(): Promise<void>;
2111
2114
  private schedulerTimer;
2112
2115
  private running;
@@ -2147,6 +2150,8 @@ declare class EasyCMS<C extends Config = Config> {
2147
2150
  * many instances run jobs.
2148
2151
  */
2149
2152
  private runConfigJobs;
2153
+ /** Background work waiting and failed, for `telemetry`'s queue gauges. */
2154
+ private countQueues;
2150
2155
  private recordJobRun;
2151
2156
  /**
2152
2157
  * Sends an event of the app or a plugin (`events` in the config, e.g. `order.paid`) to the
@@ -2732,6 +2737,14 @@ interface CollectionSearch {
2732
2737
  */
2733
2738
  declare function memorySearch(): SearchAdapter;
2734
2739
 
2740
+ /** `telemetry` in the config: OpenTelemetry traces and metrics, both on with `true`. */
2741
+ interface TelemetryConfig {
2742
+ /** Spans for API requests, Local API calls, database calls and background jobs. Default true. */
2743
+ readonly traces?: boolean;
2744
+ /** Request and database durations, job runs and queue sizes. Default true. */
2745
+ readonly metrics?: boolean;
2746
+ }
2747
+
2735
2748
  declare const WEBHOOK_EVENTS: readonly ["create", "update", "delete", "publish", "unpublish", "draft"];
2736
2749
  /**
2737
2750
  * `create`, `update`, `delete`: the stored document changed. `publish` / `unpublish`: its status
@@ -3616,6 +3629,13 @@ interface Config {
3616
3629
  * (with `index: 'trigram'` on Postgres) still finds text.
3617
3630
  */
3618
3631
  readonly search?: SearchAdapter;
3632
+ /**
3633
+ * OpenTelemetry traces and metrics through `@opentelemetry/api` (install it, and set up the SDK
3634
+ * in your app): spans for API requests, Local API calls, database calls and jobs, and metrics
3635
+ * for request and database durations, job runs and queue sizes. `true` turns both on. Spans
3636
+ * carry names of collections, routes and operations, never query values or documents.
3637
+ */
3638
+ readonly telemetry?: boolean | TelemetryConfig;
3619
3639
  readonly plugins?: readonly Plugin[];
3620
3640
  }
3621
3641
  /** The config after plugins ran, validation passed and defaults were applied. */
@@ -3647,5 +3667,5 @@ interface ResolvedConfig extends Omit<Config, 'cors' | 'localization' | 'routes'
3647
3667
  */
3648
3668
  declare function defineConfig<const TConfig extends Config>(config: TConfig): TConfig;
3649
3669
 
3650
- export { ADAPTER_API_VERSION as A, AuditLog as J, Auth as M, ADMIN_ICONS as a, ForbiddenError as a$, FIELD_TYPES as aE, ConfigError as ad, EasyCMS as aw, EasyCMSError as ax, PayloadTooLargeError as bE, QueryError as bK, ROLE_OPERATIONS as bL, Roles as bW, SchemaError as bZ, NotFoundError as bt, PLUGIN_API_VERSION as bz, API_KEY_OPERATIONS as c$, anyone as cF, consoleEmail as cG, consoleLogger as cH, createEasyCMS as cI, defineConfig as cJ, defineFieldType as cK, definePlugin as cL, diskStorage as cM, hasRows as cN, isAdmin as cO, isHasMany as cP, isSignedIn as cQ, isStaff as cR, isSystemAdmin as cS, jsonLogger as cT, memorySearch as cU, mimeAllowedBy as cV, rowFields as cW, silentLogger as cX, uniqueWithinOf as cY, API_KEYS as cZ, API_KEY_GLOBAL_OPERATIONS as c_, SingleSignOn as cc, TooManyRequestsError as cl, UnauthorizedError as cn, ValidationError as cv, WEBHOOK_EVENTS as cz, DEFAULT_MAX_VERSIONS as d0, DEFAULT_PASSWORD_EMAILS as d1, FIELD_TYPE_BASES as d2, FOLDER_LEVELS as d3, MediaFolders as d4, SSO_COOKIE as d5, codeOfStatus as d6, isJsonLogger as d7, keyAllows as d8, logFormat as d9 };
3651
- 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 _, 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, EmailMessage as aA, Endpoint as aB, EndpointRequest as aC, ErrorCode as aD, Field as aF, FieldAccess as aG, FieldAccessFn as aH, FieldAdmin as aI, FieldError as aJ, FieldRule as aK, FieldType as aL, FieldTypeBase as aM, FieldTypeDefinition as aN, FieldTypeValidateContext as aO, FieldValidate as aP, FieldValidateContext as aQ, FieldValue as aR, FieldsInput as aS, FieldsValue as aT, FilterOptions as aU, FilterOptionsArgs as aV, FindAfterArgs as aW, FindArgs as aX, FindOptions as aY, FolderLevel as aZ, FolderPermissions as a_, CollectionSearch as aa, CollectionSlug as ab, Config as ac, ConfigIssue as ae, ContainerAdmin as af, CreateEasyCMSOptions as ag, CreateInput as ah, CreateMigrationResult as ai, CursorDocs as aj, CustomField as ak, CustomFieldTypes as al, DashboardWidget as am, Database as an, DatabaseAdapter as ao, DatabaseInitArgs as ap, DatabaseTransfer as aq, DateField as ar, DepthOptions as as, DirectUpload as at, DiskStorageOptions as au, DocumentOf as av, EmailAdapter as ay, EmailField as az, Access as b, SearchAdapter as b$, GlobalAccess as b0, GlobalConfig as b1, GlobalDocument as b2, GlobalHooks as b3, GlobalInput as b4, GlobalSlug as b5, GroupField as b6, ImageSize as b7, IncrementOptions as b8, InferCollection as b9, PasswordEmail as bA, PasswordEmailArgs as bB, PasswordEmailFn as bC, PasswordLinkOptions as bD, Plugin as bF, PluginInfo as bG, PluginTypes as bH, PreviewTarget as bI, PreviewURL as bJ, RawDocument as bM, ReadOptions as bN, RelationshipField as bO, RequestContext as bP, ResolvedConfig as bQ, RichTextDocument as bR, RichTextField as bS, Role as bT, RoleOperation as bU, RolePermissions as bV, RoutesConfig as bX, ScheduledPublish as bY, SchemaMode as b_, InferGlobal as ba, JobConfig as bb, JsonField as bc, KeysetPage as bd, Label as be, LayoutNode as bf, LivePreview as bg, LocaleOf as bh, LocalizationConfig as bi, LogDetails as bj, Logger as bk, LoginArgs as bl, LogsConfig as bm, MediaDocument as bn, MediaSize as bo, MembersConfig as bp, MembersSignup as bq, MigrationInfo as br, NavGroup as bs, NumberField as bu, OnRequest as bv, OnRequestArgs as bw, Operation as bx, OutboxRow as by, AccessArgs as c, SearchEntry as c0, SearchHits as c1, SearchOptions as c2, SearchQuery as c3, SearchResults as c4, SearchSetting as c5, SelectField as c6, SelectOption as c7, Session as c8, SidebarPanel as c9, WebhookConfig as cA, WebhookEvent as cB, WebhookPayload as cC, Where as cD, WhereOperators as cE, SignupArgs as ca, SignupResult as cb, SlugField as cd, SlugOf as ce, SsoOutcome as cf, SsoProviderRef as cg, StorageAdapter as ch, StoredFile as ci, TextField as cj, TextareaField as ck, TypedPlugin as cm, UncountedDocs as co, UpdateInput as cp, UpdateOptions as cq, UploadConfig as cr, UploadField as cs, UploadFromURLConfig as ct, UserIdentity as cu, Version as cw, VersionSummary as cx, VersionsConfig as cy, 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 };
3670
+ export { ADAPTER_API_VERSION as A, AuditLog as J, Auth as M, ADMIN_ICONS as a, ForbiddenError as a$, FIELD_TYPES as aE, ConfigError as ad, EasyCMS as aw, EasyCMSError as ax, PayloadTooLargeError as bE, QueryError as bK, ROLE_OPERATIONS as bL, Roles as bW, SchemaError as bZ, NotFoundError as bt, PLUGIN_API_VERSION as bz, API_KEY_GLOBAL_OPERATIONS as c$, WEBHOOK_EVENTS as cA, anyone as cG, consoleEmail as cH, consoleLogger as cI, createEasyCMS as cJ, defineConfig as cK, defineFieldType as cL, definePlugin as cM, diskStorage as cN, hasRows as cO, isAdmin as cP, isHasMany as cQ, isSignedIn as cR, isStaff as cS, isSystemAdmin as cT, jsonLogger as cU, memorySearch as cV, mimeAllowedBy as cW, rowFields as cX, silentLogger as cY, uniqueWithinOf as cZ, API_KEYS as c_, SingleSignOn as cc, TooManyRequestsError as cm, UnauthorizedError as co, ValidationError as cw, API_KEY_OPERATIONS as d0, DEFAULT_MAX_VERSIONS as d1, DEFAULT_PASSWORD_EMAILS as d2, FIELD_TYPE_BASES as d3, FOLDER_LEVELS as d4, MediaFolders as d5, SSO_COOKIE as d6, codeOfStatus as d7, isJsonLogger as d8, keyAllows as d9, logFormat as da };
3671
+ 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 _, 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, EmailMessage as aA, Endpoint as aB, EndpointRequest as aC, ErrorCode as aD, Field as aF, FieldAccess as aG, FieldAccessFn as aH, FieldAdmin as aI, FieldError as aJ, FieldRule as aK, FieldType as aL, FieldTypeBase as aM, FieldTypeDefinition as aN, FieldTypeValidateContext as aO, FieldValidate as aP, FieldValidateContext as aQ, FieldValue as aR, FieldsInput as aS, FieldsValue as aT, FilterOptions as aU, FilterOptionsArgs as aV, FindAfterArgs as aW, FindArgs as aX, FindOptions as aY, FolderLevel as aZ, FolderPermissions as a_, CollectionSearch as aa, CollectionSlug as ab, Config as ac, ConfigIssue as ae, ContainerAdmin as af, CreateEasyCMSOptions as ag, CreateInput as ah, CreateMigrationResult as ai, CursorDocs as aj, CustomField as ak, CustomFieldTypes as al, DashboardWidget as am, Database as an, DatabaseAdapter as ao, DatabaseInitArgs as ap, DatabaseTransfer as aq, DateField as ar, DepthOptions as as, DirectUpload as at, DiskStorageOptions as au, DocumentOf as av, EmailAdapter as ay, EmailField as az, Access as b, SearchAdapter as b$, GlobalAccess as b0, GlobalConfig as b1, GlobalDocument as b2, GlobalHooks as b3, GlobalInput as b4, GlobalSlug as b5, GroupField as b6, ImageSize as b7, IncrementOptions as b8, InferCollection as b9, PasswordEmail as bA, PasswordEmailArgs as bB, PasswordEmailFn as bC, PasswordLinkOptions as bD, Plugin as bF, PluginInfo as bG, PluginTypes as bH, PreviewTarget as bI, PreviewURL as bJ, RawDocument as bM, ReadOptions as bN, RelationshipField as bO, RequestContext as bP, ResolvedConfig as bQ, RichTextDocument as bR, RichTextField as bS, Role as bT, RoleOperation as bU, RolePermissions as bV, RoutesConfig as bX, ScheduledPublish as bY, SchemaMode as b_, InferGlobal as ba, JobConfig as bb, JsonField as bc, KeysetPage as bd, Label as be, LayoutNode as bf, LivePreview as bg, LocaleOf as bh, LocalizationConfig as bi, LogDetails as bj, Logger as bk, LoginArgs as bl, LogsConfig as bm, MediaDocument as bn, MediaSize as bo, MembersConfig as bp, MembersSignup as bq, MigrationInfo as br, NavGroup as bs, NumberField as bu, OnRequest as bv, OnRequestArgs as bw, Operation as bx, OutboxRow as by, AccessArgs as c, SearchEntry as c0, SearchHits as c1, SearchOptions as c2, SearchQuery as c3, SearchResults as c4, SearchSetting as c5, SelectField as c6, SelectOption as c7, Session as c8, SidebarPanel as c9, WebhookConfig as cB, WebhookEvent as cC, WebhookPayload as cD, Where as cE, WhereOperators as cF, SignupArgs as ca, SignupResult as cb, SlugField as cd, SlugOf as ce, SsoOutcome as cf, SsoProviderRef as cg, StorageAdapter as ch, StoredFile as ci, TelemetryConfig as cj, TextField as ck, TextareaField as cl, TypedPlugin as cn, UncountedDocs as cp, UpdateInput as cq, UpdateOptions as cr, UploadConfig as cs, UploadField as ct, UploadFromURLConfig as cu, UserIdentity as cv, Version as cx, VersionSummary as cy, VersionsConfig as cz, 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, ac as Config, aw as EasyCMS, bi as LocalizationConfig, aF as Field, aJ as FieldError, aU as FilterOptions, ag as CreateEasyCMSOptions, bQ as ResolvedConfig } from './config-B-bT0hIn.js';
1
+ import { I as ID, ac as Config, aw as EasyCMS, bi as LocalizationConfig, aF as Field, aJ as FieldError, aU as FilterOptions, ag as CreateEasyCMSOptions, bQ as ResolvedConfig } from './config-BLxN8qcy.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;
@@ -45,6 +45,11 @@ declare function writeBackupFile<C extends Config>(cms: EasyCMS<C>, file: string
45
45
  type Localization = Required<LocalizationConfig>;
46
46
 
47
47
  type Data = Record<string, unknown>;
48
+ /**
49
+ * `name@host.tld`: no whitespace, one `@`, and a dot inside the part after it. String operations,
50
+ * not a regex: `/^[^\s@]+@[^\s@]+\.[^\s@]+$/` takes time quadratic in the length.
51
+ */
52
+ declare function isEmail(value: string): boolean;
48
53
  /**
49
54
  * Turns text into a URL slug. Keeps letters and digits of any script,
50
55
  * so Thai titles stay readable: "สวัสดี World!" → "สวัสดี-world".
@@ -193,5 +198,5 @@ declare function createRootEndpointHandler<C extends Config>(instance: EasyCMS<C
193
198
  /** A cookie of the request; the `__Host-` one (set over HTTPS) first. */
194
199
  declare function readCookie(request: Request, name: string): string | undefined;
195
200
 
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 };
201
+ export { CONFIG_FILE_NAMES as C, DEFAULT_ADMIN_PATH as D, platformClientIp as E, readCookie as F, validateFields as G, writeBackupFile as H, 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, isEmail as x, mergeForUpdate as y, parseId as z };
197
202
  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-B-bT0hIn.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 CollectionSearch, ab as CollectionSlug, ac as Config, ad as ConfigError, ae as ConfigIssue, af as ContainerAdmin, ag as CreateEasyCMSOptions, ah as CreateInput, ai as CreateMigrationResult, aj as CursorDocs, ak as CustomField, al as CustomFieldTypes, am as DashboardWidget, an as Database, ao as DatabaseAdapter, ap as DatabaseInitArgs, aq as DatabaseTransfer, ar as DateField, as as DepthOptions, at as DirectUpload, au as DiskStorageOptions, av as DocumentOf, aw as EasyCMS, ax as EasyCMSError, ay as EmailAdapter, az as EmailField, aA as EmailMessage, aB as Endpoint, aC as EndpointRequest, aD as ErrorCode, aE as FIELD_TYPES, aF as Field, aG as FieldAccess, aH as FieldAccessFn, aI as FieldAdmin, aJ as FieldError, aK as FieldRule, aL as FieldType, aM as FieldTypeBase, aN as FieldTypeDefinition, aO as FieldTypeValidateContext, aP as FieldValidate, aQ as FieldValidateContext, aR as FieldValue, aS as FieldsInput, aT as FieldsValue, aU as FilterOptions, aV as FilterOptionsArgs, aW as FindAfterArgs, aX as FindArgs, aY as FindOptions, aZ as FolderLevel, a_ as FolderPermissions, a$ as ForbiddenError, b0 as GlobalAccess, b1 as GlobalConfig, b2 as GlobalDocument, b3 as GlobalHooks, b4 as GlobalInput, b5 as GlobalSlug, b6 as GroupField, b7 as ImageSize, b8 as IncrementOptions, b9 as InferCollection, ba as InferGlobal, bb as JobConfig, bc as JsonField, bd as KeysetPage, be as Label, bf as LayoutNode, bg as LivePreview, bh as LocaleOf, bi as LocalizationConfig, bj as LogDetails, bk as Logger, bl as LoginArgs, bm as LogsConfig, bn as MediaDocument, bo as MediaSize, bp as MembersConfig, bq as MembersSignup, br as MigrationInfo, bs as NavGroup, bt as NotFoundError, bu as NumberField, bv as OnRequest, bw as OnRequestArgs, bx as Operation, by as OutboxRow, bz as PLUGIN_API_VERSION, bA as PasswordEmail, bB as PasswordEmailArgs, bC as PasswordEmailFn, bD as PasswordLinkOptions, bE as PayloadTooLargeError, bF as Plugin, bG as PluginInfo, bH as PluginTypes, bI as PreviewTarget, bJ as PreviewURL, bK as QueryError, bL as ROLE_OPERATIONS, bM as RawDocument, bN as ReadOptions, bO as RelationshipField, bP as RequestContext, bQ as ResolvedConfig, bR as RichTextDocument, bS as RichTextField, bT as Role, bU as RoleOperation, bV as RolePermissions, bW as Roles, bX as RoutesConfig, bY as ScheduledPublish, bZ as SchemaError, b_ as SchemaMode, b$ as SearchAdapter, c0 as SearchEntry, c1 as SearchHits, c2 as SearchOptions, c3 as SearchQuery, c4 as SearchResults, c5 as SearchSetting, c6 as SelectField, c7 as SelectOption, c8 as Session, c9 as SidebarPanel, ca as SignupArgs, cb as SignupResult, cc as SingleSignOn, cd as SlugField, ce as SlugOf, cf as SsoOutcome, cg as SsoProviderRef, ch as StorageAdapter, ci as StoredFile, cj as TextField, ck as TextareaField, cl as TooManyRequestsError, cm as TypedPlugin, cn as UnauthorizedError, co as UncountedDocs, cp as UpdateInput, cq as UpdateOptions, cr as UploadConfig, cs as UploadField, ct as UploadFromURLConfig, cu as UserIdentity, cv as ValidationError, cw as Version, cx as VersionSummary, cy as VersionsConfig, cz as WEBHOOK_EVENTS, cA as WebhookConfig, cB as WebhookEvent, cC as WebhookPayload, cD as Where, cE as WhereOperators, cF as anyone, cG as consoleEmail, cH as consoleLogger, cI as createEasyCMS, cJ as defineConfig, cK as defineFieldType, cL as definePlugin, cM as diskStorage, cN as hasRows, cO as isAdmin, cP as isHasMany, cQ as isSignedIn, cR as isStaff, cS as isSystemAdmin, cT as jsonLogger, cU as memorySearch, cV as mimeAllowedBy, cW as rowFields, cX as silentLogger, cY as uniqueWithinOf } from './config-B-bT0hIn.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-CI6r3SK1.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-COsNEVx0.js';
1
+ import { P as PaginatedDocs, I as ID, E as EmailSetting } from './config-BLxN8qcy.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 CollectionSearch, ab as CollectionSlug, ac as Config, ad as ConfigError, ae as ConfigIssue, af as ContainerAdmin, ag as CreateEasyCMSOptions, ah as CreateInput, ai as CreateMigrationResult, aj as CursorDocs, ak as CustomField, al as CustomFieldTypes, am as DashboardWidget, an as Database, ao as DatabaseAdapter, ap as DatabaseInitArgs, aq as DatabaseTransfer, ar as DateField, as as DepthOptions, at as DirectUpload, au as DiskStorageOptions, av as DocumentOf, aw as EasyCMS, ax as EasyCMSError, ay as EmailAdapter, az as EmailField, aA as EmailMessage, aB as Endpoint, aC as EndpointRequest, aD as ErrorCode, aE as FIELD_TYPES, aF as Field, aG as FieldAccess, aH as FieldAccessFn, aI as FieldAdmin, aJ as FieldError, aK as FieldRule, aL as FieldType, aM as FieldTypeBase, aN as FieldTypeDefinition, aO as FieldTypeValidateContext, aP as FieldValidate, aQ as FieldValidateContext, aR as FieldValue, aS as FieldsInput, aT as FieldsValue, aU as FilterOptions, aV as FilterOptionsArgs, aW as FindAfterArgs, aX as FindArgs, aY as FindOptions, aZ as FolderLevel, a_ as FolderPermissions, a$ as ForbiddenError, b0 as GlobalAccess, b1 as GlobalConfig, b2 as GlobalDocument, b3 as GlobalHooks, b4 as GlobalInput, b5 as GlobalSlug, b6 as GroupField, b7 as ImageSize, b8 as IncrementOptions, b9 as InferCollection, ba as InferGlobal, bb as JobConfig, bc as JsonField, bd as KeysetPage, be as Label, bf as LayoutNode, bg as LivePreview, bh as LocaleOf, bi as LocalizationConfig, bj as LogDetails, bk as Logger, bl as LoginArgs, bm as LogsConfig, bn as MediaDocument, bo as MediaSize, bp as MembersConfig, bq as MembersSignup, br as MigrationInfo, bs as NavGroup, bt as NotFoundError, bu as NumberField, bv as OnRequest, bw as OnRequestArgs, bx as Operation, by as OutboxRow, bz as PLUGIN_API_VERSION, bA as PasswordEmail, bB as PasswordEmailArgs, bC as PasswordEmailFn, bD as PasswordLinkOptions, bE as PayloadTooLargeError, bF as Plugin, bG as PluginInfo, bH as PluginTypes, bI as PreviewTarget, bJ as PreviewURL, bK as QueryError, bL as ROLE_OPERATIONS, bM as RawDocument, bN as ReadOptions, bO as RelationshipField, bP as RequestContext, bQ as ResolvedConfig, bR as RichTextDocument, bS as RichTextField, bT as Role, bU as RoleOperation, bV as RolePermissions, bW as Roles, bX as RoutesConfig, bY as ScheduledPublish, bZ as SchemaError, b_ as SchemaMode, b$ as SearchAdapter, c0 as SearchEntry, c1 as SearchHits, c2 as SearchOptions, c3 as SearchQuery, c4 as SearchResults, c5 as SearchSetting, c6 as SelectField, c7 as SelectOption, c8 as Session, c9 as SidebarPanel, ca as SignupArgs, cb as SignupResult, cc as SingleSignOn, cd as SlugField, ce as SlugOf, cf as SsoOutcome, cg as SsoProviderRef, ch as StorageAdapter, ci as StoredFile, cj as TelemetryConfig, ck as TextField, cl as TextareaField, cm as TooManyRequestsError, cn as TypedPlugin, co as UnauthorizedError, cp as UncountedDocs, cq as UpdateInput, cr as UpdateOptions, cs as UploadConfig, ct as UploadField, cu as UploadFromURLConfig, cv as UserIdentity, cw as ValidationError, cx as Version, cy as VersionSummary, cz as VersionsConfig, cA as WEBHOOK_EVENTS, cB as WebhookConfig, cC as WebhookEvent, cD as WebhookPayload, cE as Where, cF as WhereOperators, cG as anyone, cH as consoleEmail, cI as consoleLogger, cJ as createEasyCMS, cK as defineConfig, cL as defineFieldType, cM as definePlugin, cN as diskStorage, cO as hasRows, cP as isAdmin, cQ as isHasMany, cR as isSignedIn, cS as isStaff, cT as isSystemAdmin, cU as jsonLogger, cV as memorySearch, cW as mimeAllowedBy, cX as rowFields, cY as silentLogger, cZ as uniqueWithinOf } from './config-BLxN8qcy.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-JIb70PKm.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-Ccc-CwBq.js';
5
5
  export { FieldCondition, matchesCondition } from './conditions.js';
6
6
 
7
7
  type DeliveryKind = 'webhook' | 'email';
@@ -232,6 +232,8 @@ interface AdminStatus {
232
232
  email: string | null;
233
233
  /** The search adapter's name, `custom` when it has none, or `null` without `search`. */
234
234
  search: string | null;
235
+ /** `telemetry` is on: OpenTelemetry traces or metrics. */
236
+ telemetry: boolean;
235
237
  /** The config's plugins, with their name and version when they give them. */
236
238
  plugins: {
237
239
  name?: string;
package/dist/index.js CHANGED
@@ -26,7 +26,7 @@ import {
26
26
  sharedEasyCMS,
27
27
  silentLogger,
28
28
  slugify
29
- } from "./chunk-Q7MVE3BT.js";
29
+ } from "./chunk-Q3QLUBFK.js";
30
30
  import {
31
31
  matchesCondition
32
32
  } from "./chunk-U266LV4M.js";
@@ -51,7 +51,7 @@ import {
51
51
  defineFieldType,
52
52
  definePlugin,
53
53
  warnDeprecated
54
- } from "./chunk-RTKWMVAC.js";
54
+ } from "./chunk-SKGKGKUN.js";
55
55
  export {
56
56
  ADAPTER_API_VERSION,
57
57
  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 { cZ as API_KEYS, c_ as API_KEY_GLOBAL_OPERATIONS, c$ as API_KEY_OPERATIONS, d0 as DEFAULT_MAX_VERSIONS, d1 as DEFAULT_PASSWORD_EMAILS, d2 as FIELD_TYPE_BASES, d3 as FOLDER_LEVELS, d4 as MediaFolders, d5 as SSO_COOKIE, d6 as codeOfStatus, cN as hasRows, cP as isHasMany, d7 as isJsonLogger, d8 as keyAllows, d9 as logFormat, cV as mimeAllowedBy, cW as rowFields, cY as uniqueWithinOf } from './config-B-bT0hIn.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-COsNEVx0.js';
2
+ export { c_ as API_KEYS, c$ as API_KEY_GLOBAL_OPERATIONS, d0 as API_KEY_OPERATIONS, d1 as DEFAULT_MAX_VERSIONS, d2 as DEFAULT_PASSWORD_EMAILS, d3 as FIELD_TYPE_BASES, d4 as FOLDER_LEVELS, d5 as MediaFolders, d6 as SSO_COOKIE, d7 as codeOfStatus, cO as hasRows, cQ as isHasMany, d8 as isJsonLogger, d9 as keyAllows, da as logFormat, cW as mimeAllowedBy, cX as rowFields, cZ as uniqueWithinOf } from './config-BLxN8qcy.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-Ccc-CwBq.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
@@ -41,6 +41,7 @@ import {
41
41
  healthResponse,
42
42
  honeypotName,
43
43
  importConfig,
44
+ isEmail,
44
45
  isJsonLogger,
45
46
  keyAllows,
46
47
  logFormat,
@@ -56,7 +57,7 @@ import {
56
57
  verifyPassword,
57
58
  verifyTurnstile,
58
59
  writeBackupFile
59
- } from "./chunk-Q7MVE3BT.js";
60
+ } from "./chunk-Q3QLUBFK.js";
60
61
  import {
61
62
  conditionIssues
62
63
  } from "./chunk-U266LV4M.js";
@@ -74,7 +75,7 @@ import {
74
75
  rowFields,
75
76
  sniffMimeType,
76
77
  uniqueWithinOf
77
- } from "./chunk-RTKWMVAC.js";
78
+ } from "./chunk-SKGKGKUN.js";
78
79
 
79
80
  // src/typegen.ts
80
81
  var pascal = (name) => name.split(/[^A-Za-z0-9]+/).filter(Boolean).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join("");
@@ -293,6 +294,7 @@ export {
293
294
  honeypotName,
294
295
  imageDimensions,
295
296
  importConfig,
297
+ isEmail,
296
298
  isHasMany,
297
299
  isJsonLogger,
298
300
  keyAllows,
@@ -1,4 +1,4 @@
1
- import { be as Label, aF as Field, I as ID, k as AdminLocale, t as AdminSwitcher, cg as SsoProviderRef } from './config-B-bT0hIn.js';
1
+ import { be as Label, aF as Field, I as ID, k as AdminLocale, t as AdminSwitcher, cg as SsoProviderRef } from './config-BLxN8qcy.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 { a as ADMIN_ICONS, g as AdminComponent, j as AdminIcon, S as AuthUser, a3 as CliCommand, a4 as CollectionAccess, a6 as CollectionConfig, ac as Config, ad as ConfigError, am as DashboardWidget, ax as EasyCMSError, aB as Endpoint, aC as EndpointRequest, aD as ErrorCode, aF as Field, aG as FieldAccess, aJ as FieldError, aM as FieldTypeBase, aN as FieldTypeDefinition, aO as FieldTypeValidateContext, a$ as ForbiddenError, b1 as GlobalConfig, I as ID, bb as JobConfig, be as Label, bs as NavGroup, bt as NotFoundError, bv as OnRequest, bw as OnRequestArgs, bz as PLUGIN_API_VERSION, bE as PayloadTooLargeError, bF as Plugin, bG as PluginInfo, bH as PluginTypes, bK as QueryError, bP as RequestContext, cl as TooManyRequestsError, cm as TypedPlugin, cn as UnauthorizedError, cv as ValidationError, cD as Where, cK as defineFieldType, cL as definePlugin } from './config-B-bT0hIn.js';
2
- export { A as ADMIN_API_VERSION, c as AdminElementProps, k as AdminPageRoute, S as SetFieldDetail, w as warnDeprecated } from './plugin-CI6r3SK1.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, ac as Config, ad as ConfigError, am as DashboardWidget, ax as EasyCMSError, aB as Endpoint, aC as EndpointRequest, aD as ErrorCode, aF as Field, aG as FieldAccess, aJ as FieldError, aM as FieldTypeBase, aN as FieldTypeDefinition, aO as FieldTypeValidateContext, a$ as ForbiddenError, b1 as GlobalConfig, I as ID, bb as JobConfig, be as Label, bs as NavGroup, bt as NotFoundError, bv as OnRequest, bw as OnRequestArgs, bz as PLUGIN_API_VERSION, bE as PayloadTooLargeError, bF as Plugin, bG as PluginInfo, bH as PluginTypes, bK as QueryError, bP as RequestContext, cm as TooManyRequestsError, cn as TypedPlugin, co as UnauthorizedError, cw as ValidationError, cE as Where, cL as defineFieldType, cM as definePlugin } from './config-BLxN8qcy.js';
2
+ export { A as ADMIN_API_VERSION, c as AdminElementProps, k as AdminPageRoute, S as SetFieldDetail, w as warnDeprecated } from './plugin-JIb70PKm.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-RTKWMVAC.js";
19
+ } from "./chunk-SKGKGKUN.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.14.0",
3
+ "version": "1.15.1",
4
4
  "description": "Embedded, code-first headless CMS for Nuxt and Next.js",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -54,14 +54,19 @@
54
54
  "react"
55
55
  ],
56
56
  "peerDependencies": {
57
- "sharp": ">=0.33.0"
57
+ "sharp": ">=0.33.0",
58
+ "@opentelemetry/api": ">=1.9.0 <2"
58
59
  },
59
60
  "peerDependenciesMeta": {
60
61
  "sharp": {
61
62
  "optional": true
63
+ },
64
+ "@opentelemetry/api": {
65
+ "optional": true
62
66
  }
63
67
  },
64
68
  "devDependencies": {
69
+ "@opentelemetry/api": "~1.9.1",
65
70
  "sharp": "^0.35.5"
66
71
  },
67
72
  "scripts": {