@easy-cms/core 1.4.3 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-VWIYMZVS.js → chunk-GBEWSAZF.js} +139 -25
- package/dist/{config-CB8mhU2a.d.ts → config-CzW6kBeb.d.ts} +31 -4
- package/dist/{handler-bybEUkpd.d.ts → handler-BsBQ-2qf.d.ts} +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +3 -1
- package/dist/internal.d.ts +3 -3
- package/dist/internal.js +5 -1
- package/dist/{plugin-CJCqvyo_.d.ts → plugin-BmKxHxuu.d.ts} +1 -1
- package/dist/plugin.d.ts +2 -2
- package/package.json +1 -1
|
@@ -2678,7 +2678,7 @@ var Mailer = class {
|
|
|
2678
2678
|
error: null
|
|
2679
2679
|
});
|
|
2680
2680
|
} catch (error) {
|
|
2681
|
-
this.logger.error(`Could not save email: ${error.message}
|
|
2681
|
+
this.logger.error(`Could not save email: ${error.message}`, { error });
|
|
2682
2682
|
}
|
|
2683
2683
|
this.track(this.deliver(message2, body, id));
|
|
2684
2684
|
}
|
|
@@ -2726,7 +2726,9 @@ var Mailer = class {
|
|
|
2726
2726
|
return this.attempt(JSON.parse(message2));
|
|
2727
2727
|
}
|
|
2728
2728
|
track(delivery) {
|
|
2729
|
-
const tracked = delivery.catch(
|
|
2729
|
+
const tracked = delivery.catch(
|
|
2730
|
+
(error) => this.logger.error(`Email queue failed: ${error.message}`, { error })
|
|
2731
|
+
).finally(() => this.pending.delete(tracked));
|
|
2730
2732
|
this.pending.add(tracked);
|
|
2731
2733
|
}
|
|
2732
2734
|
async deliver(message2, body, id) {
|
|
@@ -3112,7 +3114,7 @@ async function startBackup(cms, trigger, author) {
|
|
|
3112
3114
|
}
|
|
3113
3115
|
});
|
|
3114
3116
|
void runBackup(cms, row).catch(
|
|
3115
|
-
(error) => cms.logger.error(`Backup failed: ${error.message}
|
|
3117
|
+
(error) => cms.logger.error(`Backup failed: ${error.message}`, { error })
|
|
3116
3118
|
);
|
|
3117
3119
|
return toAdmin(row);
|
|
3118
3120
|
}
|
|
@@ -3221,7 +3223,7 @@ async function runDueBackups(cms, now = /* @__PURE__ */ new Date()) {
|
|
|
3221
3223
|
if (!due) return;
|
|
3222
3224
|
if (await inProgress(cms, now.getTime())) return;
|
|
3223
3225
|
await startBackup(cms, "scheduled").catch(
|
|
3224
|
-
(error) => cms.logger.error(`Scheduled backup could not start: ${error.message}
|
|
3226
|
+
(error) => cms.logger.error(`Scheduled backup could not start: ${error.message}`, { error })
|
|
3225
3227
|
);
|
|
3226
3228
|
}
|
|
3227
3229
|
async function backupAttention(cms, now = Date.now()) {
|
|
@@ -3290,12 +3292,58 @@ async function deleteBackup(cms, id) {
|
|
|
3290
3292
|
var consoleLogger = {
|
|
3291
3293
|
info: (message2) => console.info(`[easy-cms] ${message2}`),
|
|
3292
3294
|
warn: (message2) => console.warn(`[easy-cms] ${message2}`),
|
|
3293
|
-
error: (message2) =>
|
|
3295
|
+
error: (message2, details) => {
|
|
3296
|
+
const stack = details?.error instanceof Error ? details.error.stack : void 0;
|
|
3297
|
+
console.error(`[easy-cms] ${message2}${stack ? `
|
|
3298
|
+
${stack}` : ""}`);
|
|
3299
|
+
}
|
|
3294
3300
|
};
|
|
3295
3301
|
var silentLogger = { info() {
|
|
3296
3302
|
}, warn() {
|
|
3297
3303
|
}, error() {
|
|
3298
3304
|
} };
|
|
3305
|
+
function logFormat(logs) {
|
|
3306
|
+
const env = process.env.EASY_CMS_LOG_FORMAT;
|
|
3307
|
+
if (env === "json" || env === "pretty") return env;
|
|
3308
|
+
return logs?.format ?? "pretty";
|
|
3309
|
+
}
|
|
3310
|
+
var jsonLoggers = /* @__PURE__ */ new WeakSet();
|
|
3311
|
+
var isJsonLogger = (logger) => jsonLoggers.has(logger);
|
|
3312
|
+
function errorFields(error) {
|
|
3313
|
+
if (error instanceof Error)
|
|
3314
|
+
return { name: error.name, message: error.message, stack: error.stack };
|
|
3315
|
+
return { message: String(error) };
|
|
3316
|
+
}
|
|
3317
|
+
function jsonLogger(write = (line, level) => (level === "info" ? process.stdout : process.stderr).write(`${line}
|
|
3318
|
+
`)) {
|
|
3319
|
+
const log = (level) => (message2, details) => {
|
|
3320
|
+
const store2 = auditContext.getStore();
|
|
3321
|
+
const { error, ...rest } = details ?? {};
|
|
3322
|
+
const entry = {
|
|
3323
|
+
time: (/* @__PURE__ */ new Date()).toISOString(),
|
|
3324
|
+
level,
|
|
3325
|
+
name: "easy-cms",
|
|
3326
|
+
message: message2,
|
|
3327
|
+
...store2?.requestId ? { requestId: store2.requestId } : {},
|
|
3328
|
+
...store2?.runId ? { runId: store2.runId } : {},
|
|
3329
|
+
...rest,
|
|
3330
|
+
...error === void 0 ? {} : { error: errorFields(error) }
|
|
3331
|
+
};
|
|
3332
|
+
let line;
|
|
3333
|
+
try {
|
|
3334
|
+
line = JSON.stringify(entry);
|
|
3335
|
+
} catch {
|
|
3336
|
+
line = JSON.stringify({
|
|
3337
|
+
...entry,
|
|
3338
|
+
...Object.fromEntries(Object.keys(rest).map((k) => [k, "[unserializable]"]))
|
|
3339
|
+
});
|
|
3340
|
+
}
|
|
3341
|
+
write(line, level);
|
|
3342
|
+
};
|
|
3343
|
+
const logger = { info: log("info"), warn: log("warn"), error: log("error") };
|
|
3344
|
+
jsonLoggers.add(logger);
|
|
3345
|
+
return logger;
|
|
3346
|
+
}
|
|
3299
3347
|
|
|
3300
3348
|
// src/media-folders.ts
|
|
3301
3349
|
var FOLDER_LEVELS = ["view", "edit", "manage"];
|
|
@@ -3790,7 +3838,7 @@ var VersionStore = class {
|
|
|
3790
3838
|
};
|
|
3791
3839
|
|
|
3792
3840
|
// src/local-api.ts
|
|
3793
|
-
import { createHmac as createHmac6, randomBytes as randomBytes6, timingSafeEqual as timingSafeEqual5 } from "crypto";
|
|
3841
|
+
import { createHmac as createHmac6, randomBytes as randomBytes6, randomUUID as randomUUID3, timingSafeEqual as timingSafeEqual5 } from "crypto";
|
|
3794
3842
|
|
|
3795
3843
|
// src/auth/common-passwords.ts
|
|
3796
3844
|
var LIST = `
|
|
@@ -4342,7 +4390,7 @@ function read(response, maxBytes, deadline) {
|
|
|
4342
4390
|
var keys = (list) => new Set(list.split(/\s+/).filter(Boolean));
|
|
4343
4391
|
var CONFIG = keys(`secret db serverURL cors cronSecret timeZone webhooks events jobs localization routes admin
|
|
4344
4392
|
upload auth collections globals endpoints cliCommands onRequest fieldTypes apiKeys email backups
|
|
4345
|
-
audit plugins`);
|
|
4393
|
+
audit logs plugins`);
|
|
4346
4394
|
var ADMIN = keys("path locale brand siteURL nav commands modules pages dashboard switcher");
|
|
4347
4395
|
var AUTH = keys(`roles rbac tokenExpiration maxLoginAttempts lockWindow trustedOrigins
|
|
4348
4396
|
resetPasswordExpiration inviteExpiration providers providerSignUp password setupCode members emails`);
|
|
@@ -4350,6 +4398,7 @@ var MEMBERS = keys("roles signUp pages emails");
|
|
|
4350
4398
|
var UPLOAD = keys("dir maxFileSize mimeTypes storage imageSizes fromURL folders privateStorage");
|
|
4351
4399
|
var BACKUPS = keys("frequency at keep dir storage sqlite encryptionKey");
|
|
4352
4400
|
var AUDIT = keys("keepDays values failedLogins scope");
|
|
4401
|
+
var LOGS = keys("format requests");
|
|
4353
4402
|
var COLLECTION = keys(`slug labels fields useAsTitle drafts versions schedule preview access hooks
|
|
4354
4403
|
admin`);
|
|
4355
4404
|
var GLOBAL = keys("slug label fields drafts versions schedule preview access hooks scope admin");
|
|
@@ -4472,6 +4521,7 @@ function checkConfigKeys(config, add) {
|
|
|
4472
4521
|
check2(c.upload, "upload", "upload", UPLOAD, add);
|
|
4473
4522
|
check2(c.backups, "backups", "backups", BACKUPS, add);
|
|
4474
4523
|
if (isObject(c.audit)) check2(c.audit, "audit", "audit", AUDIT, add);
|
|
4524
|
+
check2(c.logs, "logs", "logs", LOGS, add);
|
|
4475
4525
|
for (const [kind, list] of [
|
|
4476
4526
|
["collections", c.collections],
|
|
4477
4527
|
["globals", c.globals]
|
|
@@ -4661,7 +4711,9 @@ var Webhooks = class {
|
|
|
4661
4711
|
return this.attempt(hook, delivery.event, delivery.body, delivery.delivery);
|
|
4662
4712
|
}
|
|
4663
4713
|
track(delivery) {
|
|
4664
|
-
const tracked = delivery.catch(
|
|
4714
|
+
const tracked = delivery.catch(
|
|
4715
|
+
(error) => this.logger.error(`Webhook queue failed: ${error.message}`, { error })
|
|
4716
|
+
).finally(() => this.pending.delete(tracked));
|
|
4665
4717
|
this.pending.add(tracked);
|
|
4666
4718
|
}
|
|
4667
4719
|
async deliver(hook, payload) {
|
|
@@ -4686,7 +4738,7 @@ var Webhooks = class {
|
|
|
4686
4738
|
try {
|
|
4687
4739
|
queued = await saved;
|
|
4688
4740
|
} catch (error) {
|
|
4689
|
-
this.logger.error(`Could not save webhook delivery: ${error.message}
|
|
4741
|
+
this.logger.error(`Could not save webhook delivery: ${error.message}`, { error });
|
|
4690
4742
|
}
|
|
4691
4743
|
for (let attempt = 0; ; attempt++) {
|
|
4692
4744
|
const result = await this.attempt(hook, event, body, delivery);
|
|
@@ -4797,6 +4849,7 @@ function validateConfig(config) {
|
|
|
4797
4849
|
validateUpload(config, add);
|
|
4798
4850
|
validateBackups(config, add, (issue) => issues.push(issue));
|
|
4799
4851
|
validateAudit(config, add);
|
|
4852
|
+
validateLogs(config, add);
|
|
4800
4853
|
validateAuth(config, add);
|
|
4801
4854
|
validateCors(config.cors, add);
|
|
4802
4855
|
validateLocalization(config, add);
|
|
@@ -5419,6 +5472,19 @@ function validateUpload(config, add) {
|
|
|
5419
5472
|
var FOLDER_KEY = /^[a-z0-9][a-z0-9_-]{0,59}$/;
|
|
5420
5473
|
var MIME_PATTERN = /^([\w.+-]+\/(\*|[\w.+-]+)|documents|office|archives)$/i;
|
|
5421
5474
|
var HOST_PATTERN = /^(\*|(\*\.)?[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*)$/i;
|
|
5475
|
+
function validateLogs(config, add) {
|
|
5476
|
+
const logs = config.logs;
|
|
5477
|
+
if (logs === void 0) return;
|
|
5478
|
+
if (typeof logs !== "object" || logs === null) {
|
|
5479
|
+
add("logs", "must be an object", "e.g. logs: { format: 'json' }");
|
|
5480
|
+
return;
|
|
5481
|
+
}
|
|
5482
|
+
const { format, requests } = logs;
|
|
5483
|
+
if (format !== void 0 && format !== "pretty" && format !== "json")
|
|
5484
|
+
add("logs.format", "must be 'pretty' or 'json'");
|
|
5485
|
+
if (requests !== void 0 && typeof requests !== "boolean")
|
|
5486
|
+
add("logs.requests", "must be true or false");
|
|
5487
|
+
}
|
|
5422
5488
|
function validateAudit(config, add) {
|
|
5423
5489
|
const audit = config.audit;
|
|
5424
5490
|
if (audit !== void 0 && typeof audit !== "boolean") {
|
|
@@ -6287,7 +6353,7 @@ function resolveAudit(audit) {
|
|
|
6287
6353
|
// src/local-api.ts
|
|
6288
6354
|
async function createEasyCMS(config, options = {}) {
|
|
6289
6355
|
const resolved3 = await resolveConfig(config);
|
|
6290
|
-
const logger = options.logger ?? consoleLogger;
|
|
6356
|
+
const logger = options.logger ?? (logFormat(resolved3.logs) === "json" ? jsonLogger() : consoleLogger);
|
|
6291
6357
|
for (const warning of resolved3.warnings)
|
|
6292
6358
|
logger.warn(
|
|
6293
6359
|
`Config: ${warning.path} ${warning.message}${warning.hint ? ` (${warning.hint})` : ""}`
|
|
@@ -7142,7 +7208,9 @@ var EasyCMS = class {
|
|
|
7142
7208
|
try {
|
|
7143
7209
|
return config.preview({ doc, locale }) ?? null;
|
|
7144
7210
|
} catch (error) {
|
|
7145
|
-
this.logger.error(`preview URL of "${config.slug}" failed: ${error.message}
|
|
7211
|
+
this.logger.error(`preview URL of "${config.slug}" failed: ${error.message}`, {
|
|
7212
|
+
error
|
|
7213
|
+
});
|
|
7146
7214
|
return null;
|
|
7147
7215
|
}
|
|
7148
7216
|
}
|
|
@@ -7628,7 +7696,7 @@ var EasyCMS = class {
|
|
|
7628
7696
|
if (this.schedulerTimer) return;
|
|
7629
7697
|
this.schedulerTimer = setInterval(() => {
|
|
7630
7698
|
void this.runJobs().catch(
|
|
7631
|
-
(error) => this.logger.error(`Scheduled jobs failed: ${error.message}
|
|
7699
|
+
(error) => this.logger.error(`Scheduled jobs failed: ${error.message}`, { error })
|
|
7632
7700
|
);
|
|
7633
7701
|
}, interval);
|
|
7634
7702
|
this.schedulerTimer.unref?.();
|
|
@@ -7644,13 +7712,20 @@ var EasyCMS = class {
|
|
|
7644
7712
|
return run;
|
|
7645
7713
|
}
|
|
7646
7714
|
runJobsNow(now) {
|
|
7647
|
-
|
|
7715
|
+
const requestId = auditContext.getStore()?.requestId;
|
|
7716
|
+
const run = {
|
|
7717
|
+
via: "scheduler",
|
|
7718
|
+
user: null,
|
|
7719
|
+
runId: randomUUID3(),
|
|
7720
|
+
...requestId ? { requestId } : {}
|
|
7721
|
+
};
|
|
7722
|
+
return auditContext.run(run, async () => {
|
|
7648
7723
|
const scheduled = await this.runScheduled(now);
|
|
7649
7724
|
await this.pruneFailedDeliveries(now);
|
|
7650
7725
|
await runDueBackups(this, now).catch(
|
|
7651
|
-
(error) => this.logger.error(`Backups: ${error.message}
|
|
7726
|
+
(error) => this.logger.error(`Backups: ${error.message}`, { error })
|
|
7652
7727
|
);
|
|
7653
|
-
await this.audit.upkeep(now).catch((error) => this.logger.error(`Audit log: ${error.message}
|
|
7728
|
+
await this.audit.upkeep(now).catch((error) => this.logger.error(`Audit log: ${error.message}`, { error }));
|
|
7654
7729
|
const result = {
|
|
7655
7730
|
scheduled,
|
|
7656
7731
|
webhooks: await this.retryWebhooks(now),
|
|
@@ -7658,7 +7733,7 @@ var EasyCMS = class {
|
|
|
7658
7733
|
jobs: await this.runConfigJobs(now)
|
|
7659
7734
|
};
|
|
7660
7735
|
const ranAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7661
|
-
await this.db.updateGlobal({ slug: JOBS_RAN, data: { at: ranAt, updatedAt: ranAt } }).catch((error) => this.logger.error(`Jobs: ${error.message}
|
|
7736
|
+
await this.db.updateGlobal({ slug: JOBS_RAN, data: { at: ranAt, updatedAt: ranAt } }).catch((error) => this.logger.error(`Jobs: ${error.message}`, { error }));
|
|
7662
7737
|
return result;
|
|
7663
7738
|
});
|
|
7664
7739
|
}
|
|
@@ -7730,10 +7805,10 @@ var EasyCMS = class {
|
|
|
7730
7805
|
} catch (caught) {
|
|
7731
7806
|
failed++;
|
|
7732
7807
|
error = (caught.message || String(caught)).slice(0, 500);
|
|
7733
|
-
this.logger.error(`Job ${job.name} failed: ${error}
|
|
7808
|
+
this.logger.error(`Job ${job.name} failed: ${error}`, { error: caught, job: job.name });
|
|
7734
7809
|
}
|
|
7735
7810
|
await this.recordJobRun(job.name, stamp, error, Date.now() - started).catch(
|
|
7736
|
-
(caught) => this.logger.error(`Job ${job.name}: ${caught.message}
|
|
7811
|
+
(caught) => this.logger.error(`Job ${job.name}: ${caught.message}`, { error: caught })
|
|
7737
7812
|
);
|
|
7738
7813
|
}
|
|
7739
7814
|
return { ran, failed };
|
|
@@ -7898,7 +7973,9 @@ var EasyCMS = class {
|
|
|
7898
7973
|
} catch (error) {
|
|
7899
7974
|
failed++;
|
|
7900
7975
|
const message2 = error.message;
|
|
7901
|
-
this.logger.error(`Scheduled ${action} of ${parent} ${row.doc} failed: ${message2}
|
|
7976
|
+
this.logger.error(`Scheduled ${action} of ${parent} ${row.doc} failed: ${message2}`, {
|
|
7977
|
+
error
|
|
7978
|
+
});
|
|
7902
7979
|
await this.db.update({
|
|
7903
7980
|
collection: SCHEDULED_JOBS,
|
|
7904
7981
|
id: row.id,
|
|
@@ -9688,7 +9765,10 @@ async function readAdminModule(cms, index) {
|
|
|
9688
9765
|
}
|
|
9689
9766
|
|
|
9690
9767
|
// src/version.ts
|
|
9691
|
-
var VERSION = true ? "1.
|
|
9768
|
+
var VERSION = true ? "1.6.0" : "0.0.0-dev";
|
|
9769
|
+
|
|
9770
|
+
// src/rest/handler.ts
|
|
9771
|
+
import { randomUUID as randomUUID4 } from "crypto";
|
|
9692
9772
|
|
|
9693
9773
|
// src/rest/admin-deliveries.ts
|
|
9694
9774
|
var PER_PAGE = 50;
|
|
@@ -10635,7 +10715,38 @@ function withCors(cms, handle) {
|
|
|
10635
10715
|
return withHeaders(await handle(request), cors);
|
|
10636
10716
|
};
|
|
10637
10717
|
}
|
|
10718
|
+
var REQUEST_ID = /^[\w.-]{1,128}$/;
|
|
10638
10719
|
async function respond(cms, request, url, path, root, options, production) {
|
|
10720
|
+
const started = performance.now();
|
|
10721
|
+
const incoming = request.headers.get("x-request-id");
|
|
10722
|
+
const requestId = incoming && REQUEST_ID.test(incoming) ? incoming : randomUUID4();
|
|
10723
|
+
const requestLog = { userId: void 0 };
|
|
10724
|
+
const response = await auditContext.run(
|
|
10725
|
+
{ requestId },
|
|
10726
|
+
() => respondNow(cms, request, url, path, root, options, production, requestId, requestLog)
|
|
10727
|
+
);
|
|
10728
|
+
let tagged;
|
|
10729
|
+
try {
|
|
10730
|
+
response.headers.set("x-request-id", requestId);
|
|
10731
|
+
tagged = response;
|
|
10732
|
+
} catch {
|
|
10733
|
+
tagged = withHeaders(response, new Headers({ "x-request-id": requestId }));
|
|
10734
|
+
}
|
|
10735
|
+
if (cms.config.logs?.requests !== false && isJsonLogger(cms.logger)) {
|
|
10736
|
+
auditContext.run(
|
|
10737
|
+
{ requestId },
|
|
10738
|
+
() => cms.logger.info(`${request.method} ${url.pathname} ${tagged.status}`, {
|
|
10739
|
+
method: request.method,
|
|
10740
|
+
path: url.pathname,
|
|
10741
|
+
status: tagged.status,
|
|
10742
|
+
durationMs: Math.round(performance.now() - started),
|
|
10743
|
+
...requestLog.userId === void 0 ? {} : { userId: requestLog.userId }
|
|
10744
|
+
})
|
|
10745
|
+
);
|
|
10746
|
+
}
|
|
10747
|
+
return tagged;
|
|
10748
|
+
}
|
|
10749
|
+
async function respondNow(cms, request, url, path, root, options, production, requestId, requestLog) {
|
|
10639
10750
|
const headers = new Headers({
|
|
10640
10751
|
"content-type": "application/json; charset=utf-8",
|
|
10641
10752
|
"cache-control": "no-store",
|
|
@@ -10650,6 +10761,7 @@ async function respond(cms, request, url, path, root, options, production) {
|
|
|
10650
10761
|
if (!signedIn && via === "bearer" && token?.startsWith("ecms_"))
|
|
10651
10762
|
throw new UnauthorizedError("Invalid or expired API key");
|
|
10652
10763
|
const { user, context } = await cms.applyOnRequest(request.headers, url, signedIn);
|
|
10764
|
+
requestLog.userId = user?.id;
|
|
10653
10765
|
const ctx = {
|
|
10654
10766
|
request,
|
|
10655
10767
|
url,
|
|
@@ -10666,7 +10778,8 @@ async function respond(cms, request, url, path, root, options, production) {
|
|
|
10666
10778
|
user,
|
|
10667
10779
|
context,
|
|
10668
10780
|
ip: options.getClientIp?.(request),
|
|
10669
|
-
userAgent: request.headers.get("user-agent")
|
|
10781
|
+
userAgent: request.headers.get("user-agent"),
|
|
10782
|
+
requestId
|
|
10670
10783
|
};
|
|
10671
10784
|
const result = await auditContext.run(
|
|
10672
10785
|
audit,
|
|
@@ -11851,7 +11964,7 @@ function errorResponse(cms, error, headers, production) {
|
|
|
11851
11964
|
if (error instanceof TooManyRequestsError && error.retryAfter !== void 0)
|
|
11852
11965
|
headers.set("retry-after", String(error.retryAfter));
|
|
11853
11966
|
if (error.status >= 500) {
|
|
11854
|
-
cms.logger.error(`REST request failed: ${error.
|
|
11967
|
+
cms.logger.error(`REST request failed: ${error.message}`, { error });
|
|
11855
11968
|
if (production)
|
|
11856
11969
|
return new Response(
|
|
11857
11970
|
JSON.stringify({ errors: [{ message: "Internal Server Error", code }] }),
|
|
@@ -11861,9 +11974,7 @@ function errorResponse(cms, error, headers, production) {
|
|
|
11861
11974
|
return new Response(JSON.stringify({ errors }), { status: error.status, headers });
|
|
11862
11975
|
}
|
|
11863
11976
|
const message2 = error instanceof Error ? error.message : String(error);
|
|
11864
|
-
cms.logger.error(
|
|
11865
|
-
`REST request failed: ${error instanceof Error ? error.stack ?? message2 : message2}`
|
|
11866
|
-
);
|
|
11977
|
+
cms.logger.error(`REST request failed: ${message2}`, { error });
|
|
11867
11978
|
const body = {
|
|
11868
11979
|
errors: [
|
|
11869
11980
|
{ message: production ? "Internal Server Error" : message2, code: "INTERNAL_SERVER_ERROR" }
|
|
@@ -12006,6 +12117,9 @@ export {
|
|
|
12006
12117
|
writeBackupFile,
|
|
12007
12118
|
consoleLogger,
|
|
12008
12119
|
silentLogger,
|
|
12120
|
+
logFormat,
|
|
12121
|
+
isJsonLogger,
|
|
12122
|
+
jsonLogger,
|
|
12009
12123
|
FOLDER_LEVELS,
|
|
12010
12124
|
MediaFolders,
|
|
12011
12125
|
DEFAULT_DEPTH,
|
|
@@ -93,13 +93,35 @@ declare const isSignedIn: Access;
|
|
|
93
93
|
*/
|
|
94
94
|
declare const isAdmin: Access;
|
|
95
95
|
|
|
96
|
+
/** More about a log line: `error` for what failed (its stack goes to the log). */
|
|
97
|
+
interface LogDetails {
|
|
98
|
+
readonly error?: unknown;
|
|
99
|
+
readonly [key: string]: unknown;
|
|
100
|
+
}
|
|
96
101
|
interface Logger {
|
|
97
|
-
info(message: string): void;
|
|
98
|
-
warn(message: string): void;
|
|
99
|
-
error(message: string): void;
|
|
102
|
+
info(message: string, details?: LogDetails): void;
|
|
103
|
+
warn(message: string, details?: LogDetails): void;
|
|
104
|
+
error(message: string, details?: LogDetails): void;
|
|
100
105
|
}
|
|
106
|
+
/** Readable lines for development; an error's stack follows its line. */
|
|
101
107
|
declare const consoleLogger: Logger;
|
|
102
108
|
declare const silentLogger: Logger;
|
|
109
|
+
/** Log line formats: `pretty` for people, `json` (one object per line) for log pipelines. */
|
|
110
|
+
interface LogsConfig {
|
|
111
|
+
/** Default `pretty`. The `EASY_CMS_LOG_FORMAT` environment variable wins over this. */
|
|
112
|
+
readonly format?: 'pretty' | 'json';
|
|
113
|
+
/** In `json`, a line for every API request (method, path, status, duration). Default true. */
|
|
114
|
+
readonly requests?: boolean;
|
|
115
|
+
}
|
|
116
|
+
/** The format in use: `EASY_CMS_LOG_FORMAT`, then the config, then `pretty`. */
|
|
117
|
+
declare function logFormat(logs: LogsConfig | undefined): 'pretty' | 'json';
|
|
118
|
+
/** Whether a logger writes JSON: it then also gets a line per API request (`logs.requests`). */
|
|
119
|
+
declare const isJsonLogger: (logger: Logger) => boolean;
|
|
120
|
+
/**
|
|
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.
|
|
123
|
+
*/
|
|
124
|
+
declare function jsonLogger(write?: (line: string, level: 'info' | 'warn' | 'error') => void): Logger;
|
|
103
125
|
|
|
104
126
|
/** A document as stored: relationships and uploads are ids, never populated. */
|
|
105
127
|
type RawDocument = Record<string, unknown> & {
|
|
@@ -3281,6 +3303,11 @@ interface Config {
|
|
|
3281
3303
|
* actions, kept for `keep` days. `true` for the defaults.
|
|
3282
3304
|
*/
|
|
3283
3305
|
readonly audit?: boolean | AuditConfig;
|
|
3306
|
+
/**
|
|
3307
|
+
* How Easy CMS writes its logs: `{ format: 'json' }` for one JSON object per line, with the
|
|
3308
|
+
* request id. Ignored when `createEasyCMS` is given a `logger`.
|
|
3309
|
+
*/
|
|
3310
|
+
readonly logs?: LogsConfig;
|
|
3284
3311
|
readonly plugins?: readonly Plugin[];
|
|
3285
3312
|
}
|
|
3286
3313
|
/** The config after plugins ran, validation passed and defaults were applied. */
|
|
@@ -3312,4 +3339,4 @@ interface ResolvedConfig extends Omit<Config, 'cors' | 'localization' | 'routes'
|
|
|
3312
3339
|
*/
|
|
3313
3340
|
declare function defineConfig<const TConfig extends Config>(config: TConfig): TConfig;
|
|
3314
3341
|
|
|
3315
|
-
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
|
|
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 };
|
|
@@ -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,
|
|
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';
|
|
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, E as EmailSetting } from './config-
|
|
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
|
|
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-
|
|
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-
|
|
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';
|
|
5
5
|
export { FieldCondition, matchesCondition } from './conditions.js';
|
|
6
6
|
|
|
7
7
|
type DeliveryKind = 'webhook' | 'email';
|
package/dist/index.js
CHANGED
|
@@ -18,12 +18,13 @@ import {
|
|
|
18
18
|
isSignedIn,
|
|
19
19
|
isStaff,
|
|
20
20
|
isSystemAdmin,
|
|
21
|
+
jsonLogger,
|
|
21
22
|
loadConfig,
|
|
22
23
|
resolveConfig,
|
|
23
24
|
sharedEasyCMS,
|
|
24
25
|
silentLogger,
|
|
25
26
|
slugify
|
|
26
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-GBEWSAZF.js";
|
|
27
28
|
import {
|
|
28
29
|
matchesCondition
|
|
29
30
|
} from "./chunk-U266LV4M.js";
|
|
@@ -86,6 +87,7 @@ export {
|
|
|
86
87
|
isSignedIn,
|
|
87
88
|
isStaff,
|
|
88
89
|
isSystemAdmin,
|
|
90
|
+
jsonLogger,
|
|
89
91
|
loadConfig,
|
|
90
92
|
matchesCondition,
|
|
91
93
|
resolveConfig,
|
package/dist/internal.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ab as Config, al as Database,
|
|
2
|
-
export {
|
|
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-
|
|
1
|
+
import { ab as Config, al as Database, 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';
|
|
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
|
@@ -40,7 +40,9 @@ import {
|
|
|
40
40
|
hashPassword,
|
|
41
41
|
honeypotName,
|
|
42
42
|
importConfig,
|
|
43
|
+
isJsonLogger,
|
|
43
44
|
keyAllows,
|
|
45
|
+
logFormat,
|
|
44
46
|
mergeForUpdate,
|
|
45
47
|
parseId,
|
|
46
48
|
platformClientIp,
|
|
@@ -53,7 +55,7 @@ import {
|
|
|
53
55
|
verifyPassword,
|
|
54
56
|
verifyTurnstile,
|
|
55
57
|
writeBackupFile
|
|
56
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-GBEWSAZF.js";
|
|
57
59
|
import {
|
|
58
60
|
conditionIssues
|
|
59
61
|
} from "./chunk-U266LV4M.js";
|
|
@@ -290,7 +292,9 @@ export {
|
|
|
290
292
|
imageDimensions,
|
|
291
293
|
importConfig,
|
|
292
294
|
isHasMany,
|
|
295
|
+
isJsonLogger,
|
|
293
296
|
keyAllows,
|
|
297
|
+
logFormat,
|
|
294
298
|
mergeForUpdate,
|
|
295
299
|
mimeAllowed,
|
|
296
300
|
mimeAllowedBy,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ba as Label, aD as Field, I as ID, k as AdminLocale, t as AdminSwitcher,
|
|
1
|
+
import { ba as Label, aD as Field, I as ID, k as AdminLocale, t as AdminSwitcher, c4 as SsoProviderRef } from './config-CzW6kBeb.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, 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,
|
|
2
|
-
export { A as ADMIN_API_VERSION, c as AdminElementProps, k as AdminPageRoute, S as SetFieldDetail, w as warnDeprecated } from './plugin-
|
|
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';
|
|
3
3
|
import './conditions.js';
|