@easy-cms/core 1.21.0 → 1.23.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-S7Q2NGAL.js → chunk-7S2HXNF5.js} +85 -8
- package/dist/{config-Daj_EbDR.d.ts → config-BQ53ulBF.d.ts} +22 -3
- package/dist/{handler-5PPSC9o4.d.ts → handler-B4GC_p5n.d.ts} +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1 -1
- package/dist/internal.d.ts +2 -2
- package/dist/internal.js +1 -1
- package/dist/{plugin-DRe5S9Wi.d.ts → plugin-I5C-9kXl.d.ts} +10 -2
- package/dist/plugin.d.ts +2 -2
- package/package.json +1 -1
|
@@ -4973,7 +4973,7 @@ var GLOBAL = keys(
|
|
|
4973
4973
|
);
|
|
4974
4974
|
var CONTAINER_ADMIN = keys("icon order sidebar layout group");
|
|
4975
4975
|
var COLLECTION_ADMIN = keys(
|
|
4976
|
-
"icon order sidebar layout group editIn badge count empty list ownerField confirmDelete"
|
|
4976
|
+
"icon order sidebar layout group editIn badge count empty list calendar ownerField confirmDelete"
|
|
4977
4977
|
);
|
|
4978
4978
|
var FIELD_ADMIN = keys(
|
|
4979
4979
|
"description width condition component after cell column allowCreate initialValue position filter"
|
|
@@ -5109,6 +5109,8 @@ function checkConfigKeys(config, add) {
|
|
|
5109
5109
|
collection2 ? COLLECTION_ADMIN : CONTAINER_ADMIN,
|
|
5110
5110
|
add
|
|
5111
5111
|
);
|
|
5112
|
+
if (collection2 && isObject(item.admin) && isObject(item.admin.calendar))
|
|
5113
|
+
check2(item.admin.calendar, `${at}.admin.calendar`, "calendar", keys("start end color"), add);
|
|
5112
5114
|
if (isObject(item.versions))
|
|
5113
5115
|
check2(item.versions, `${at}.versions`, "versions", keys("keep"), add);
|
|
5114
5116
|
checkFields(item.fields, `${at}.fields`, add);
|
|
@@ -5140,6 +5142,7 @@ var BUILTIN_NAV = [
|
|
|
5140
5142
|
}
|
|
5141
5143
|
];
|
|
5142
5144
|
var MEDIA_ORDER = 10;
|
|
5145
|
+
var CALENDAR_ORDER = 5;
|
|
5143
5146
|
var LABEL_ORDER = 500;
|
|
5144
5147
|
var NAV_ID = /^[a-z][a-z0-9-]*$/;
|
|
5145
5148
|
function mergeGroups(lists, parent = "") {
|
|
@@ -6756,6 +6759,9 @@ function validateContainer(container, path, collectionSlugs, add, { collection:
|
|
|
6756
6759
|
validateCollectionAdmin(admin, `${path}.admin`, add);
|
|
6757
6760
|
const list = admin.list;
|
|
6758
6761
|
if (list !== void 0) validateList(list, container, `${path}.admin.list`, add);
|
|
6762
|
+
const calendar = admin.calendar;
|
|
6763
|
+
if (collection2 && calendar !== void 0)
|
|
6764
|
+
validateCalendar(calendar, container, `${path}.admin.calendar`, add);
|
|
6759
6765
|
const owner = admin.ownerField;
|
|
6760
6766
|
if (owner !== void 0) {
|
|
6761
6767
|
const field = container.fields.find((f) => f.name === owner);
|
|
@@ -6828,6 +6834,35 @@ function validateFields2(fields, path, reserved, collectionSlugs, add) {
|
|
|
6828
6834
|
validateField(field, fieldPath, byName, collectionSlugs, add);
|
|
6829
6835
|
}
|
|
6830
6836
|
}
|
|
6837
|
+
function validateCalendar(calendar, container, path, add) {
|
|
6838
|
+
if (typeof calendar !== "object" || calendar === null) {
|
|
6839
|
+
add(path, "must be an object", "e.g. calendar: { start: 'startsAt', end: 'endsAt' }");
|
|
6840
|
+
return;
|
|
6841
|
+
}
|
|
6842
|
+
const { start, end, color } = calendar;
|
|
6843
|
+
const fieldNamed = (name) => typeof name === "string" ? container.fields.find((f) => f.name === name) : void 0;
|
|
6844
|
+
for (const [key, value, required] of [
|
|
6845
|
+
["start", start, true],
|
|
6846
|
+
["end", end, false]
|
|
6847
|
+
]) {
|
|
6848
|
+
if (value === void 0 && !required) continue;
|
|
6849
|
+
if (fieldNamed(value)?.type !== "date")
|
|
6850
|
+
add(
|
|
6851
|
+
`${path}.${key}`,
|
|
6852
|
+
"must name a top-level date field",
|
|
6853
|
+
`e.g. { name: '${key}sAt', type: 'date' }`
|
|
6854
|
+
);
|
|
6855
|
+
}
|
|
6856
|
+
if (start !== void 0 && start === end) add(`${path}.end`, "must differ from start");
|
|
6857
|
+
if (color === void 0) return;
|
|
6858
|
+
const field = fieldNamed(color);
|
|
6859
|
+
if (field?.type !== "select" && field?.type !== "relationship" || "hasMany" in field && field.hasMany)
|
|
6860
|
+
add(
|
|
6861
|
+
`${path}.color`,
|
|
6862
|
+
"must name a top-level select or relationship field (not hasMany)",
|
|
6863
|
+
"e.g. color: 'category'"
|
|
6864
|
+
);
|
|
6865
|
+
}
|
|
6831
6866
|
function validateList(list, container, path, add) {
|
|
6832
6867
|
if (typeof list !== "object" || list === null) {
|
|
6833
6868
|
add(path, "must be an object", "e.g. list: { tree: 'parent' }");
|
|
@@ -7422,7 +7457,7 @@ function cacheableResponse(request, body, status, headers, times, tags) {
|
|
|
7422
7457
|
}
|
|
7423
7458
|
|
|
7424
7459
|
// src/version.ts
|
|
7425
|
-
var VERSION = true ? "1.
|
|
7460
|
+
var VERSION = true ? "1.23.0" : "0.0.0-dev";
|
|
7426
7461
|
|
|
7427
7462
|
// src/telemetry.ts
|
|
7428
7463
|
var DB_CALLS = /* @__PURE__ */ new Set([
|
|
@@ -9619,15 +9654,28 @@ var EasyCMS = class {
|
|
|
9619
9654
|
}
|
|
9620
9655
|
/**
|
|
9621
9656
|
* The next pending jobs across all collections and globals, soonest first; with access
|
|
9622
|
-
* enforced, only those the user may update.
|
|
9657
|
+
* enforced, only those the user may update. `from` and `to` (ISO) keep those due in that
|
|
9658
|
+
* range, e.g. for a calendar; `collection` (and `docs`, its ids) those of a list page.
|
|
9623
9659
|
*/
|
|
9624
9660
|
async upcomingSchedules(options = {}) {
|
|
9625
9661
|
if (!this.config.collections.some((c) => c.slug === SCHEDULED_JOBS)) return [];
|
|
9626
9662
|
const guard = guardOf(options);
|
|
9627
9663
|
const limit = options.limit ?? 10;
|
|
9664
|
+
const due = {
|
|
9665
|
+
...options.from !== void 0 ? { gte: options.from } : {},
|
|
9666
|
+
...options.to !== void 0 ? { lt: options.to } : {}
|
|
9667
|
+
};
|
|
9628
9668
|
const rows = await this.db.find({
|
|
9629
9669
|
collection: SCHEDULED_JOBS,
|
|
9630
|
-
where: {
|
|
9670
|
+
where: {
|
|
9671
|
+
and: [
|
|
9672
|
+
{ state: { equals: "pending" } },
|
|
9673
|
+
...Object.keys(due).length ? [{ runAt: due }] : [],
|
|
9674
|
+
...options.collection !== void 0 ? [{ parent: { equals: options.collection } }] : [],
|
|
9675
|
+
// Jobs keep the document's id as a number (`doc`).
|
|
9676
|
+
...options.docs !== void 0 ? [{ doc: { in: options.docs.map(Number) } }] : []
|
|
9677
|
+
]
|
|
9678
|
+
},
|
|
9631
9679
|
sort: ["runAt"],
|
|
9632
9680
|
limit: limit * 5,
|
|
9633
9681
|
page: 1
|
|
@@ -10672,6 +10720,9 @@ var has = (config, slug2) => config.collections.some((c) => c.slug === slug2);
|
|
|
10672
10720
|
function hasJobsPage(config) {
|
|
10673
10721
|
return config.jobs.length > 0 || has(config, SCHEDULED_JOBS) || has(config, OUTBOX);
|
|
10674
10722
|
}
|
|
10723
|
+
function hasCalendarPage(config) {
|
|
10724
|
+
return config.collections.some((c) => c.admin?.calendar !== void 0 || c.schedule === true);
|
|
10725
|
+
}
|
|
10675
10726
|
var text2 = (value) => typeof value === "string" && value !== "" ? value : null;
|
|
10676
10727
|
async function adminJobs(cms, user) {
|
|
10677
10728
|
const { config } = cms;
|
|
@@ -10946,7 +10997,8 @@ var Roles = class {
|
|
|
10946
10997
|
if ((id === "deliveries" || id === "jobs") && user.scoped === true) return false;
|
|
10947
10998
|
if (id === "audit" && user.role === "admin" && user.scoped === true && this.config.audit !== false && typeof this.config.audit.scope === "function")
|
|
10948
10999
|
return true;
|
|
10949
|
-
if (!this.enabled)
|
|
11000
|
+
if (!this.enabled)
|
|
11001
|
+
return id === "calendar" || id.startsWith("page:") || id.startsWith("widget:");
|
|
10950
11002
|
return (await this.permissionsOf(user.role)).admin?.includes(id) ?? false;
|
|
10951
11003
|
}
|
|
10952
11004
|
/**
|
|
@@ -11230,6 +11282,7 @@ var Roles = class {
|
|
|
11230
11282
|
(c) => c.slug === WEBHOOK_DELIVERIES || c.slug === EMAIL_DELIVERIES
|
|
11231
11283
|
) ? [{ id: "deliveries" }] : [],
|
|
11232
11284
|
...hasJobsPage(this.config) ? [{ id: "jobs" }] : [],
|
|
11285
|
+
...hasCalendarPage(this.config) ? [{ id: "calendar" }] : [],
|
|
11233
11286
|
...this.config.admin.pages.map((page) => ({ id: viewId.page(page.path), label: page.label })),
|
|
11234
11287
|
...this.config.admin.dashboard.map((widget) => ({
|
|
11235
11288
|
id: viewId.widget(widget.id ?? tagOf(widget.component)),
|
|
@@ -11845,6 +11898,7 @@ async function collection(cms, config, user, localized, roles, context) {
|
|
|
11845
11898
|
if (config.admin?.empty) result.empty = JSON.parse(JSON.stringify(config.admin.empty));
|
|
11846
11899
|
if (config.admin?.list?.tree) result.tree = config.admin.list.tree;
|
|
11847
11900
|
if (config.admin?.list?.sort) result.defaultSort = config.admin.list.sort;
|
|
11901
|
+
if (config.admin?.calendar) result.calendar = { ...config.admin.calendar };
|
|
11848
11902
|
if (config.admin?.confirmDelete) result.confirmDelete = { ...config.admin.confirmDelete };
|
|
11849
11903
|
const owner = cms.roles.ownerOf(config.slug);
|
|
11850
11904
|
if (owner && fields.some((f) => f.name === owner)) result.owner = owner;
|
|
@@ -11893,7 +11947,8 @@ async function adminSchema(cms, user, origin, context = {}) {
|
|
|
11893
11947
|
email: admin,
|
|
11894
11948
|
roles: admin && cms.roles.enabled,
|
|
11895
11949
|
sso: admin && cms.auth.sso.enabled,
|
|
11896
|
-
audit: cms.audit.enabled && await cms.roles.canView(user, "audit")
|
|
11950
|
+
audit: cms.audit.enabled && await cms.roles.canView(user, "audit"),
|
|
11951
|
+
calendar: hasCalendarPage(cms.config) && await cms.roles.canView(user, "calendar")
|
|
11897
11952
|
};
|
|
11898
11953
|
const roles = await cms.roles.options();
|
|
11899
11954
|
const adminCollections = await Promise.all(
|
|
@@ -12104,6 +12159,7 @@ function buildNav(cms, collections, globals, pageRefs, views) {
|
|
|
12104
12159
|
if (own.length)
|
|
12105
12160
|
root.push({ order: LABEL_ORDER + i++, node: { kind: "group", id, label, items: own } });
|
|
12106
12161
|
}
|
|
12162
|
+
if (views.calendar) root.push({ order: CALENDAR_ORDER, node: { kind: "view", view: "calendar" } });
|
|
12107
12163
|
if (media) root.push({ order: MEDIA_ORDER, node: { kind: "collection", slug: MEDIA } });
|
|
12108
12164
|
return root.sort((a, b) => a.order - b.order).map((r) => r.node);
|
|
12109
12165
|
}
|
|
@@ -12398,6 +12454,7 @@ function parseDepth(url) {
|
|
|
12398
12454
|
}
|
|
12399
12455
|
|
|
12400
12456
|
// src/rest/handler.ts
|
|
12457
|
+
var SCHEDULED_RANGE_LIMIT = 500;
|
|
12401
12458
|
var CSRF_COOKIE = "ecms-csrf";
|
|
12402
12459
|
var CSRF_HEADER = "x-csrf-token";
|
|
12403
12460
|
var MAX_BODY_BYTES = 1024 * 1024;
|
|
@@ -13125,14 +13182,34 @@ async function route(cms, ctx, method, path, options) {
|
|
|
13125
13182
|
if (!await cms.roles.canView(ctx.user, "status")) throw new ForbiddenError();
|
|
13126
13183
|
return { body: await adminStatus(cms) };
|
|
13127
13184
|
}
|
|
13128
|
-
if (second === "scheduled" && third === void 0)
|
|
13185
|
+
if (second === "scheduled" && third === void 0) {
|
|
13186
|
+
const moment = (name) => {
|
|
13187
|
+
const value = ctx.url.searchParams.get(name);
|
|
13188
|
+
if (value === null) return void 0;
|
|
13189
|
+
if (Number.isNaN(Date.parse(value)))
|
|
13190
|
+
throw new HttpError(`${name} must be an ISO date and time`, 400);
|
|
13191
|
+
return new Date(value).toISOString();
|
|
13192
|
+
};
|
|
13193
|
+
const from = moment("from");
|
|
13194
|
+
const to = moment("to");
|
|
13195
|
+
const collection4 = ctx.url.searchParams.get("collection") ?? void 0;
|
|
13196
|
+
const docs = ctx.url.searchParams.get("docs")?.split(",").filter(Boolean);
|
|
13197
|
+
if (docs && docs.length > SCHEDULED_RANGE_LIMIT)
|
|
13198
|
+
throw new HttpError(`docs: at most ${SCHEDULED_RANGE_LIMIT}`, 400);
|
|
13199
|
+
const ranged = from !== void 0 || to !== void 0 || collection4 !== void 0;
|
|
13129
13200
|
return {
|
|
13130
13201
|
body: await cms.upcomingSchedules({
|
|
13131
13202
|
user: ctx.user,
|
|
13132
13203
|
context: ctx.context,
|
|
13133
|
-
overrideAccess: false
|
|
13204
|
+
overrideAccess: false,
|
|
13205
|
+
...from !== void 0 ? { from } : {},
|
|
13206
|
+
...to !== void 0 ? { to } : {},
|
|
13207
|
+
...collection4 !== void 0 ? { collection: collection4 } : {},
|
|
13208
|
+
...docs !== void 0 ? { docs } : {},
|
|
13209
|
+
...ranged ? { limit: SCHEDULED_RANGE_LIMIT } : {}
|
|
13134
13210
|
})
|
|
13135
13211
|
};
|
|
13212
|
+
}
|
|
13136
13213
|
const [, , collection3, id2, extra] = segments;
|
|
13137
13214
|
if (second === "access" && collection3 && id2 && extra === void 0) {
|
|
13138
13215
|
if (INTERNAL_COLLECTIONS.has(collection3) || !cms.config.collections.some((c) => c.slug === collection3)) {
|
|
@@ -2242,10 +2242,15 @@ declare class EasyCMS<C extends Config = Config> {
|
|
|
2242
2242
|
private addJob;
|
|
2243
2243
|
/**
|
|
2244
2244
|
* The next pending jobs across all collections and globals, soonest first; with access
|
|
2245
|
-
* enforced, only those the user may update.
|
|
2245
|
+
* enforced, only those the user may update. `from` and `to` (ISO) keep those due in that
|
|
2246
|
+
* range, e.g. for a calendar; `collection` (and `docs`, its ids) those of a list page.
|
|
2246
2247
|
*/
|
|
2247
2248
|
upcomingSchedules(options?: AccessOptions & {
|
|
2248
2249
|
limit?: number;
|
|
2250
|
+
from?: string;
|
|
2251
|
+
to?: string;
|
|
2252
|
+
collection?: string;
|
|
2253
|
+
docs?: readonly ID[];
|
|
2249
2254
|
}): Promise<(ScheduledPublish & {
|
|
2250
2255
|
collection?: string;
|
|
2251
2256
|
global?: string;
|
|
@@ -3002,6 +3007,8 @@ interface CollectionAdmin extends ContainerAdmin {
|
|
|
3002
3007
|
};
|
|
3003
3008
|
};
|
|
3004
3009
|
readonly list?: CollectionListAdmin;
|
|
3010
|
+
/** A Calendar mode beside the list, placing documents by date. See `CollectionCalendarAdmin`. */
|
|
3011
|
+
readonly calendar?: CollectionCalendarAdmin;
|
|
3005
3012
|
/**
|
|
3006
3013
|
* With `auth.rbac`: the relationship field to `users` that names a document's owner, e.g.
|
|
3007
3014
|
* `author`, for roles given "own documents only". Default: who created it (`createdBy`).
|
|
@@ -3018,6 +3025,18 @@ interface CollectionAdmin extends ContainerAdmin {
|
|
|
3018
3025
|
readonly impact?: string;
|
|
3019
3026
|
};
|
|
3020
3027
|
}
|
|
3028
|
+
/**
|
|
3029
|
+
* Where a document sits in the list's Calendar mode: top-level date fields, and optionally a field
|
|
3030
|
+
* that colours it. E.g. `{ start: 'startsAt', end: 'endsAt', color: 'category' }`.
|
|
3031
|
+
*/
|
|
3032
|
+
interface CollectionCalendarAdmin {
|
|
3033
|
+
/** A top-level date field: when it starts. */
|
|
3034
|
+
readonly start: string;
|
|
3035
|
+
/** A top-level date field: when it ends. Without it, a document takes one hour (or the day). */
|
|
3036
|
+
readonly end?: string;
|
|
3037
|
+
/** A top-level select or relationship field (not hasMany): one colour per value. */
|
|
3038
|
+
readonly color?: string;
|
|
3039
|
+
}
|
|
3021
3040
|
interface CollectionListAdmin {
|
|
3022
3041
|
/**
|
|
3023
3042
|
* Show the list as a tree: the name of a relationship field to this same collection (e.g.
|
|
@@ -3770,5 +3789,5 @@ interface ResolvedConfig extends Omit<Config, 'cors' | 'localization' | 'routes'
|
|
|
3770
3789
|
*/
|
|
3771
3790
|
declare function defineConfig<const TConfig extends Config>(config: TConfig): TConfig;
|
|
3772
3791
|
|
|
3773
|
-
export { ADAPTER_API_VERSION as A, EasyCMS as E, AuditLog as S, Auth as V, EasyCMSError as
|
|
3774
|
-
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,
|
|
3792
|
+
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, uniqueWithinOf as c$, WEBHOOK_EVENTS as cD, anyone as cI, consoleEmail as cJ, consoleLogger as cK, createEasyCMS as cL, defineConfig as cM, defineFieldType as cN, definePlugin as cO, diskStorage as cP, hasRows as cQ, isAdmin as cR, isHasMany as cS, isSignedIn as cT, isStaff as cU, isSystemAdmin as cV, jsonLogger as cW, memorySearch as cX, mimeAllowedBy as cY, rowFields as cZ, silentLogger as c_, SingleSignOn as ce, TRIGRAM_LIKE_MIN as cl, TooManyRequestsError as cp, UnauthorizedError as cr, ValidationError as cz, API_KEYS as d0, API_KEY_GLOBAL_OPERATIONS as d1, API_KEY_OPERATIONS as d2, DEFAULT_MAX_VERSIONS as d3, DEFAULT_PASSWORD_EMAILS as d4, FIELD_TYPE_BASES as d5, FOLDER_LEVELS as d6, MediaFolders as d7, SSO_COOKIE as d8, codeOfStatus as da, isJsonLogger as db, keyAllows as dc, logFormat as dd, secretsOf as de, ADMIN_ICONS as e };
|
|
3793
|
+
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 cA, VersionSummary as cB, VersionsConfig as cC, WebhookConfig as cE, WebhookEvent as cF, Where as cG, WhereOperators as cH, 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, UncountedDocs as cs, UpdateInput as ct, UpdateOptions as cu, UploadConfig as cv, UploadField as cw, UploadFromURLConfig as cx, UserIdentity as cy, EmailSetting as d, Secrets as d9, 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 };
|
|
@@ -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-
|
|
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-BQ53ulBF.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-
|
|
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
|
|
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, d as EmailSetting, W as WebhookPayload } from './config-BQ53ulBF.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 UnauthorizedError, cs as UncountedDocs, ct as UpdateInput, cu as UpdateOptions, cv as UploadConfig, cw as UploadField, cx as UploadFromURLConfig, cy as UserIdentity, cz as ValidationError, cA as Version, cB as VersionSummary, cC as VersionsConfig, cD as WEBHOOK_EVENTS, cE as WebhookConfig, cF as WebhookEvent, cG as Where, cH as WhereOperators, cI as anyone, cJ as consoleEmail, cK as consoleLogger, cL as createEasyCMS, cM as defineConfig, cN as defineFieldType, cO as definePlugin, cP as diskStorage, cQ as hasRows, cR as isAdmin, cS as isHasMany, cT as isSignedIn, cU as isStaff, cV as isSystemAdmin, cW as jsonLogger, cX as memorySearch, cY as mimeAllowedBy, cZ as rowFields, c_ as silentLogger, c$ as uniqueWithinOf } from './config-BQ53ulBF.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-I5C-9kXl.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-B4GC_p5n.js';
|
|
5
5
|
export { FieldCondition, matchesCondition } from './conditions.js';
|
|
6
6
|
|
|
7
7
|
type DeliveryKind = 'webhook' | 'email';
|
package/dist/index.js
CHANGED
package/dist/internal.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Config, Database, EasyCMS, NavGroup, CollectionConfig, ID, RawDocument, Field, ResolvedConfig, ConfigIssue } from './index.js';
|
|
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 isEmail, y as mergeForUpdate, z as parseId, E as platformClientIp, F as readCookie, G as validateFields, H as writeBackupFile } from './handler-
|
|
2
|
+
export { d0 as API_KEYS, d1 as API_KEY_GLOBAL_OPERATIONS, d2 as API_KEY_OPERATIONS, d3 as DEFAULT_MAX_VERSIONS, d4 as DEFAULT_PASSWORD_EMAILS, d5 as FIELD_TYPE_BASES, d6 as FOLDER_LEVELS, d7 as MediaFolders, d8 as SSO_COOKIE, d9 as Secrets, cl as TRIGRAM_LIKE_MIN, da as codeOfStatus, cQ as hasRows, cS as isHasMany, db as isJsonLogger, dc as keyAllows, dd as logFormat, cY as mimeAllowedBy, cZ as rowFields, de as secretsOf, c$ as uniqueWithinOf } from './config-BQ53ulBF.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-B4GC_p5n.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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { bi as Label, F as Field, I as ID, o as AdminLocale, x as AdminSwitcher, ci as SsoProviderRef } from './config-BQ53ulBF.js';
|
|
2
2
|
import { FieldCondition } from './conditions.js';
|
|
3
3
|
|
|
4
4
|
/** A Web Component from an admin module, with its `props` (plain JSON). */
|
|
@@ -39,7 +39,7 @@ type AdminNavItem = {
|
|
|
39
39
|
path: string;
|
|
40
40
|
} | {
|
|
41
41
|
kind: 'view';
|
|
42
|
-
view: 'roles' | 'sso' | 'backups' | 'email' | 'deliveries' | 'jobs' | 'audit';
|
|
42
|
+
view: 'roles' | 'sso' | 'backups' | 'email' | 'deliveries' | 'jobs' | 'audit' | 'calendar';
|
|
43
43
|
};
|
|
44
44
|
/** A group of the admin menu (`admin.nav`), with what this user may open in it. */
|
|
45
45
|
interface AdminNavGroup {
|
|
@@ -159,6 +159,12 @@ interface AdminCollection {
|
|
|
159
159
|
tree?: string;
|
|
160
160
|
/** The list's default order (`admin.list.sort`). */
|
|
161
161
|
defaultSort?: string;
|
|
162
|
+
/** The list's Calendar mode (`admin.calendar`): the fields placing and colouring documents. */
|
|
163
|
+
calendar?: {
|
|
164
|
+
start: string;
|
|
165
|
+
end?: string;
|
|
166
|
+
color?: string;
|
|
167
|
+
};
|
|
162
168
|
permissions: {
|
|
163
169
|
read: boolean;
|
|
164
170
|
create: boolean;
|
|
@@ -270,6 +276,8 @@ interface AdminSchema {
|
|
|
270
276
|
roles: boolean;
|
|
271
277
|
sso: boolean;
|
|
272
278
|
audit: boolean;
|
|
279
|
+
/** The Calendar page (#272): documents with `admin.calendar` and scheduled publishing. */
|
|
280
|
+
calendar: boolean;
|
|
273
281
|
};
|
|
274
282
|
/** Roles from the admin are on (`auth.rbac`): documents have owners. */
|
|
275
283
|
rbac: boolean;
|
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,
|
|
2
|
-
export { A as ADMIN_API_VERSION, c as AdminElementProps, k as AdminPageRoute, S as SetFieldDetail, w as warnDeprecated } from './plugin-
|
|
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, cr as UnauthorizedError, cz as ValidationError, cG as Where, cN as defineFieldType, cO as definePlugin } from './config-BQ53ulBF.js';
|
|
2
|
+
export { A as ADMIN_API_VERSION, c as AdminElementProps, k as AdminPageRoute, S as SetFieldDetail, w as warnDeprecated } from './plugin-I5C-9kXl.js';
|
|
3
3
|
import './conditions.js';
|