@easy-cms/core 1.8.0 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-CB2FT4WA.js → chunk-HAHGAHFD.js} +69 -7
- package/dist/{config-zh7mTozB.d.ts → config-BZgVbC3f.d.ts} +47 -2
- package/dist/{handler-CVBEpaJ6.d.ts → handler-j6s6J723.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-uSB31Kh0.d.ts → plugin-DlSta1rd.d.ts} +1 -1
- package/dist/plugin.d.ts +2 -2
- package/package.json +1 -1
|
@@ -3874,7 +3874,7 @@ var VersionStore = class {
|
|
|
3874
3874
|
};
|
|
3875
3875
|
|
|
3876
3876
|
// src/local-api.ts
|
|
3877
|
-
import { createHmac as createHmac6, randomBytes as randomBytes6, randomUUID as randomUUID3, timingSafeEqual as timingSafeEqual5 } from "crypto";
|
|
3877
|
+
import { createHash as createHash4, createHmac as createHmac6, randomBytes as randomBytes6, randomUUID as randomUUID3, timingSafeEqual as timingSafeEqual5 } from "crypto";
|
|
3878
3878
|
|
|
3879
3879
|
// src/auth/common-passwords.ts
|
|
3880
3880
|
var LIST = `
|
|
@@ -4426,7 +4426,7 @@ function read(response, maxBytes, deadline) {
|
|
|
4426
4426
|
var keys = (list) => new Set(list.split(/\s+/).filter(Boolean));
|
|
4427
4427
|
var CONFIG = keys(`secret db serverURL cors cronSecret timeZone webhooks events jobs localization routes admin
|
|
4428
4428
|
upload auth collections globals endpoints cliCommands onRequest fieldTypes apiKeys email backups
|
|
4429
|
-
audit logs countCacheSeconds plugins`);
|
|
4429
|
+
audit logs countCacheSeconds maxPage plugins`);
|
|
4430
4430
|
var ADMIN = keys("path locale brand siteURL nav commands modules pages dashboard switcher");
|
|
4431
4431
|
var AUTH = keys(`roles rbac tokenExpiration maxLoginAttempts lockWindow trustedOrigins
|
|
4432
4432
|
resetPasswordExpiration inviteExpiration providers providerSignUp password setupCode members emails`);
|
|
@@ -4889,6 +4889,7 @@ function validateConfig(config) {
|
|
|
4889
4889
|
validateAudit(config, add);
|
|
4890
4890
|
validateLogs(config, add);
|
|
4891
4891
|
validateCountCache(config, add);
|
|
4892
|
+
validateMaxPage(config, add);
|
|
4892
4893
|
validateAuth(config, add);
|
|
4893
4894
|
validateCors(config.cors, add);
|
|
4894
4895
|
validateLocalization(config, add);
|
|
@@ -5511,6 +5512,11 @@ function validateUpload(config, add) {
|
|
|
5511
5512
|
var FOLDER_KEY = /^[a-z0-9][a-z0-9_-]{0,59}$/;
|
|
5512
5513
|
var MIME_PATTERN = /^([\w.+-]+\/(\*|[\w.+-]+)|documents|office|archives)$/i;
|
|
5513
5514
|
var HOST_PATTERN = /^(\*|(\*\.)?[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*)$/i;
|
|
5515
|
+
function validateMaxPage(config, add) {
|
|
5516
|
+
const max = config.maxPage;
|
|
5517
|
+
if (max !== void 0 && !(Number.isInteger(max) && max >= 1))
|
|
5518
|
+
add("maxPage", "must be a whole number, 1 or more");
|
|
5519
|
+
}
|
|
5514
5520
|
function validateCountCache(config, add) {
|
|
5515
5521
|
const seconds = config.countCacheSeconds;
|
|
5516
5522
|
if (seconds !== void 0 && !(typeof seconds === "number" && Number.isFinite(seconds) && seconds >= 0))
|
|
@@ -6540,6 +6546,26 @@ var EasyCMS = class {
|
|
|
6540
6546
|
locale === ALL_LOCALES ? this.config.localization?.defaultLocale ?? locale : locale,
|
|
6541
6547
|
this.config.localization?.locales ?? []
|
|
6542
6548
|
);
|
|
6549
|
+
if (options.cursor !== void 0) {
|
|
6550
|
+
if (options.page !== void 0) throw new QueryError("Use either cursor or page, not both");
|
|
6551
|
+
if (limit === 0) throw new QueryError("A cursor needs a limit above 0");
|
|
6552
|
+
if (!this.db.findAfter) throw new QueryError("This database adapter has no cursor pagination");
|
|
6553
|
+
const query = cursorQuery(collection2, options.where, requested, locale, draft);
|
|
6554
|
+
const after = readCursor(options.cursor, query);
|
|
6555
|
+
const result2 = await this.db.findAfter({ collection: collection2, where, sort, limit, after });
|
|
6556
|
+
const found2 = draft ? await this.withDrafts(config, result2.docs) : result2.docs;
|
|
6557
|
+
const docs2 = await this.output(config, found2, guard, { ...options, draft });
|
|
6558
|
+
return {
|
|
6559
|
+
docs: docs2,
|
|
6560
|
+
limit,
|
|
6561
|
+
nextCursor: result2.hasNextPage && result2.next ? writeCursor(result2.next, query) : null,
|
|
6562
|
+
hasNextPage: result2.hasNextPage,
|
|
6563
|
+
hasPrevPage: after !== null,
|
|
6564
|
+
totalDocs: null,
|
|
6565
|
+
totalPages: null,
|
|
6566
|
+
page: null
|
|
6567
|
+
};
|
|
6568
|
+
}
|
|
6543
6569
|
const args = { collection: collection2, where, sort, limit, page };
|
|
6544
6570
|
const count = options.count !== false || limit === 0;
|
|
6545
6571
|
const result = count ? await this.db.find(args) : this.db.findPage ? await this.db.findPage(args) : { ...await this.db.find(args), totalDocs: null, totalPages: null };
|
|
@@ -9038,6 +9064,28 @@ function durationSeconds(value) {
|
|
|
9038
9064
|
if (seconds > MAX_LINK) throw new QueryError("expiresIn can be at most 7 days");
|
|
9039
9065
|
return Math.floor(seconds);
|
|
9040
9066
|
}
|
|
9067
|
+
function cursorQuery(collection2, where, sort, locale, draft) {
|
|
9068
|
+
const key = JSON.stringify([collection2, where ?? null, sort, locale ?? null, draft]);
|
|
9069
|
+
return createHash4("sha256").update(key).digest("base64url").slice(0, 16);
|
|
9070
|
+
}
|
|
9071
|
+
function writeCursor(keys2, query) {
|
|
9072
|
+
return Buffer.from(JSON.stringify({ k: keys2, q: query })).toString("base64url");
|
|
9073
|
+
}
|
|
9074
|
+
function readCursor(cursor, query) {
|
|
9075
|
+
if (cursor === "") return null;
|
|
9076
|
+
let parsed;
|
|
9077
|
+
try {
|
|
9078
|
+
parsed = JSON.parse(Buffer.from(cursor, "base64url").toString("utf8"));
|
|
9079
|
+
} catch {
|
|
9080
|
+
throw new QueryError("cursor is not a cursor from this API");
|
|
9081
|
+
}
|
|
9082
|
+
const { k, q } = parsed ?? {};
|
|
9083
|
+
if (!Array.isArray(k) || typeof q !== "string")
|
|
9084
|
+
throw new QueryError("cursor is not a cursor from this API");
|
|
9085
|
+
if (q !== query)
|
|
9086
|
+
throw new QueryError("cursor was made for another query: keep where, sort and locale the same");
|
|
9087
|
+
return k;
|
|
9088
|
+
}
|
|
9041
9089
|
|
|
9042
9090
|
// src/rest/admin-jobs.ts
|
|
9043
9091
|
var has = (config, slug2) => config.collections.some((c) => c.slug === slug2);
|
|
@@ -9769,7 +9817,7 @@ function rank(role, config) {
|
|
|
9769
9817
|
}
|
|
9770
9818
|
|
|
9771
9819
|
// src/rest/admin-modules.ts
|
|
9772
|
-
import { createHash as
|
|
9820
|
+
import { createHash as createHash5 } from "crypto";
|
|
9773
9821
|
import { readFile as readFile3 } from "fs/promises";
|
|
9774
9822
|
import { createRequire } from "module";
|
|
9775
9823
|
import { join as join3 } from "path";
|
|
@@ -9810,11 +9858,11 @@ async function readAdminModule(cms, index) {
|
|
|
9810
9858
|
if (!file) return void 0;
|
|
9811
9859
|
const body = await readFile3(file, "utf8").catch(() => void 0);
|
|
9812
9860
|
if (body === void 0) return void 0;
|
|
9813
|
-
return { body, etag: `"${
|
|
9861
|
+
return { body, etag: `"${createHash5("sha1").update(body).digest("base64url")}"` };
|
|
9814
9862
|
}
|
|
9815
9863
|
|
|
9816
9864
|
// src/version.ts
|
|
9817
|
-
var VERSION = true ? "1.
|
|
9865
|
+
var VERSION = true ? "1.9.0" : "0.0.0-dev";
|
|
9818
9866
|
|
|
9819
9867
|
// src/rest/handler.ts
|
|
9820
9868
|
import { randomUUID as randomUUID4 } from "crypto";
|
|
@@ -10703,6 +10751,11 @@ function parseListQuery(url) {
|
|
|
10703
10751
|
if (sort) query.sort = sort;
|
|
10704
10752
|
const depth = integer("depth", params.depth, 0, 3);
|
|
10705
10753
|
if (depth !== void 0) query.depth = depth;
|
|
10754
|
+
if (params.cursor !== void 0) {
|
|
10755
|
+
if (typeof params.cursor !== "string") throw new QueryError("cursor must be a string");
|
|
10756
|
+
if (params.page !== void 0) throw new QueryError("Use either cursor or page, not both");
|
|
10757
|
+
query.cursor = params.cursor;
|
|
10758
|
+
}
|
|
10706
10759
|
if (params.count !== void 0 && params.count !== "true") {
|
|
10707
10760
|
if (params.count !== "false") throw new QueryError("count must be true or false");
|
|
10708
10761
|
query.count = false;
|
|
@@ -11524,10 +11577,19 @@ async function route(cms, ctx, method, path, options) {
|
|
|
11524
11577
|
}
|
|
11525
11578
|
if (second === void 0) {
|
|
11526
11579
|
if (method === "GET") {
|
|
11527
|
-
const query = parseListQuery(ctx.url);
|
|
11580
|
+
const { page, ...query } = parseListQuery(ctx.url);
|
|
11528
11581
|
const filter = await pickerFilter(cms, ctx.url, collection2, ctx.user, ctx.context);
|
|
11529
11582
|
if (filter) query.where = query.where ? { and: [query.where, filter] } : filter;
|
|
11530
|
-
|
|
11583
|
+
const { maxPage } = cms.config;
|
|
11584
|
+
if (maxPage !== void 0 && ctx.via !== "cookie" && page > maxPage)
|
|
11585
|
+
throw new QueryError(`page can be at most ${maxPage}: use cursor to go further`);
|
|
11586
|
+
const options2 = { ...access, ...query, draft };
|
|
11587
|
+
return {
|
|
11588
|
+
body: await cms.find(
|
|
11589
|
+
collection2,
|
|
11590
|
+
query.cursor === void 0 ? { ...options2, page } : options2
|
|
11591
|
+
)
|
|
11592
|
+
};
|
|
11531
11593
|
}
|
|
11532
11594
|
if (method === "POST") {
|
|
11533
11595
|
const body = await readJson(ctx.request);
|
|
@@ -136,6 +136,21 @@ interface PaginatedDocs<T> {
|
|
|
136
136
|
hasNextPage: boolean;
|
|
137
137
|
hasPrevPage: boolean;
|
|
138
138
|
}
|
|
139
|
+
/**
|
|
140
|
+
* A page read with a `cursor`: the documents after the cursor, and `nextCursor` for the page after
|
|
141
|
+
* them (`null` at the end). No page numbers or totals.
|
|
142
|
+
*/
|
|
143
|
+
interface CursorDocs<T> {
|
|
144
|
+
docs: T[];
|
|
145
|
+
limit: number;
|
|
146
|
+
nextCursor: string | null;
|
|
147
|
+
hasNextPage: boolean;
|
|
148
|
+
/** Whether the cursor started after the first document. */
|
|
149
|
+
hasPrevPage: boolean;
|
|
150
|
+
totalDocs: null;
|
|
151
|
+
totalPages: null;
|
|
152
|
+
page: null;
|
|
153
|
+
}
|
|
139
154
|
/** A page read with `count: false`: no totals, which saves counting every matching document. */
|
|
140
155
|
interface UncountedDocs<T> extends Omit<PaginatedDocs<T>, 'totalDocs' | 'totalPages'> {
|
|
141
156
|
totalDocs: null;
|
|
@@ -166,6 +181,17 @@ interface FindArgs {
|
|
|
166
181
|
readonly limit: number;
|
|
167
182
|
readonly page: number;
|
|
168
183
|
}
|
|
184
|
+
/** `Database.findAfter`: a find with no page, from after a row's keys. */
|
|
185
|
+
interface FindAfterArgs extends Omit<FindArgs, 'page'> {
|
|
186
|
+
/** The keys `findAfter` returned for the last row of the page before; `null` for the first page. */
|
|
187
|
+
readonly after: readonly unknown[] | null;
|
|
188
|
+
}
|
|
189
|
+
interface KeysetPage {
|
|
190
|
+
docs: RawDocument[];
|
|
191
|
+
hasNextPage: boolean;
|
|
192
|
+
/** The keys of the last row (its sort values, then its id), to continue after; `null` when empty. */
|
|
193
|
+
next: unknown[] | null;
|
|
194
|
+
}
|
|
169
195
|
interface MigrationInfo {
|
|
170
196
|
readonly name: string;
|
|
171
197
|
readonly applied: boolean;
|
|
@@ -183,6 +209,11 @@ interface Database {
|
|
|
183
209
|
* from one row more. Optional: without it, `find` runs and its totals are dropped.
|
|
184
210
|
*/
|
|
185
211
|
findPage?(args: FindArgs): Promise<UncountedDocs<RawDocument>>;
|
|
212
|
+
/**
|
|
213
|
+
* Keyset pagination, for `find` with a `cursor`: the rows after `after` in the sort's order (with
|
|
214
|
+
* `id` last). Optional: without it, cursors are refused.
|
|
215
|
+
*/
|
|
216
|
+
findAfter?(args: FindAfterArgs): Promise<KeysetPage>;
|
|
186
217
|
findById(args: {
|
|
187
218
|
collection: string;
|
|
188
219
|
id: ID;
|
|
@@ -1685,6 +1716,11 @@ interface FindOptions extends ReadOptions {
|
|
|
1685
1716
|
* `hasNextPage` still says whether there is more. Default `true`.
|
|
1686
1717
|
*/
|
|
1687
1718
|
readonly count?: boolean;
|
|
1719
|
+
/**
|
|
1720
|
+
* Cursor pagination instead of `page`: `''` for the first page, then the `nextCursor` of the
|
|
1721
|
+
* page before. Fast on deep pages of large collections; no page numbers or totals.
|
|
1722
|
+
*/
|
|
1723
|
+
readonly cursor?: string;
|
|
1688
1724
|
}
|
|
1689
1725
|
interface CreateEasyCMSOptions {
|
|
1690
1726
|
/** Project root. Default `process.cwd()`. */
|
|
@@ -1746,6 +1782,10 @@ declare class EasyCMS<C extends Config = Config> {
|
|
|
1746
1782
|
user: AuthUser | null;
|
|
1747
1783
|
context: RequestContext;
|
|
1748
1784
|
}>;
|
|
1785
|
+
find<S extends Slug<C>, L extends string | undefined = undefined>(collection: S, options: FindOptions & {
|
|
1786
|
+
readonly locale?: L;
|
|
1787
|
+
readonly cursor: string;
|
|
1788
|
+
}): Promise<CursorDocs<Doc<C, S, L>>>;
|
|
1749
1789
|
find<S extends Slug<C>, L extends string | undefined = undefined>(collection: S, options: FindOptions & {
|
|
1750
1790
|
readonly locale?: L;
|
|
1751
1791
|
readonly count: false;
|
|
@@ -3334,6 +3374,11 @@ interface Config {
|
|
|
3334
3374
|
* Default 5.
|
|
3335
3375
|
*/
|
|
3336
3376
|
readonly countCacheSeconds?: number;
|
|
3377
|
+
/**
|
|
3378
|
+
* The deepest `page` the REST API serves to API clients (not to the signed-in admin); deeper
|
|
3379
|
+
* requests get `400`, pointing to `cursor`. Deep pages are read row by row. Default: no limit.
|
|
3380
|
+
*/
|
|
3381
|
+
readonly maxPage?: number;
|
|
3337
3382
|
readonly plugins?: readonly Plugin[];
|
|
3338
3383
|
}
|
|
3339
3384
|
/** The config after plugins ran, validation passed and defaults were applied. */
|
|
@@ -3365,5 +3410,5 @@ interface ResolvedConfig extends Omit<Config, 'cors' | 'localization' | 'routes'
|
|
|
3365
3410
|
*/
|
|
3366
3411
|
declare function defineConfig<const TConfig extends Config>(config: TConfig): TConfig;
|
|
3367
3412
|
|
|
3368
|
-
export { ADAPTER_API_VERSION as A, AuditLog as J, Auth as M, ADMIN_ICONS as a, FIELD_TYPES as
|
|
3369
|
-
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 _,
|
|
3413
|
+
export { ADAPTER_API_VERSION as A, AuditLog as J, Auth as M, ADMIN_ICONS as a, FIELD_TYPES as aD, ForbiddenError as a_, ConfigError as ac, EasyCMS as av, EasyCMSError as aw, PayloadTooLargeError as bC, QueryError as bI, ROLE_OPERATIONS as bJ, Roles as bU, SchemaError as bX, NotFoundError as bs, PLUGIN_API_VERSION as bx, logFormat as c$, SingleSignOn as c3, defineConfig as cA, defineFieldType as cB, definePlugin as cC, diskStorage as cD, hasRows as cE, isAdmin as cF, isHasMany as cG, isSignedIn as cH, isStaff as cI, isSystemAdmin as cJ, jsonLogger as cK, mimeAllowedBy as cL, rowFields as cM, silentLogger as cN, uniqueWithinOf as cO, API_KEYS as cP, API_KEY_GLOBAL_OPERATIONS as cQ, API_KEY_OPERATIONS as cR, DEFAULT_MAX_VERSIONS as cS, DEFAULT_PASSWORD_EMAILS as cT, FIELD_TYPE_BASES as cU, FOLDER_LEVELS as cV, MediaFolders as cW, SSO_COOKIE as cX, codeOfStatus as cY, isJsonLogger as cZ, keyAllows as c_, TooManyRequestsError as cc, UnauthorizedError as ce, ValidationError as cm, WEBHOOK_EVENTS as cq, anyone as cw, consoleEmail as cx, consoleLogger as cy, createEasyCMS as cz };
|
|
3414
|
+
export type { BuiltinMediaCollection as $, ApiKeyOperation as B, ApiKeyPermissions as C, ArrayField as D, EmailSetting as E, AuditChange as F, AuditConfig as G, AuditEntry as H, ID as I, AuditPage as K, AuditVerification as L, AuthConfig as N, AuthProvider as O, PaginatedDocs as P, AuthProviderProfile as Q, AuthProviderRequest as R, AuthUser as S, BackupsConfig as T, BeforeChangeHook as U, BeforeDeleteHook as V, BeforeValidateHook as W, Block as X, BlocksField as Y, BooleanField as Z, BuiltinApiKeysCollection as _, GlobalAccess as a$, BuiltinMediaFoldersCollection as a0, BuiltinUsersCollection as a1, BundleHints as a2, CliCommand as a3, CollectionAccess as a4, CollectionAdmin as a5, CollectionConfig as a6, CollectionDocument as a7, CollectionHooks as a8, CollectionListAdmin as a9, Endpoint as aA, EndpointRequest as aB, ErrorCode as aC, Field as aE, FieldAccess as aF, FieldAccessFn as aG, FieldAdmin as aH, FieldError as aI, FieldRule as aJ, FieldType as aK, FieldTypeBase as aL, FieldTypeDefinition as aM, FieldTypeValidateContext as aN, FieldValidate as aO, FieldValidateContext as aP, FieldValue as aQ, FieldsInput as aR, FieldsValue as aS, FilterOptions as aT, FilterOptionsArgs as aU, FindAfterArgs as aV, FindArgs as aW, FindOptions as aX, FolderLevel as aY, FolderPermissions as aZ, CollectionSlug as aa, Config as ab, ConfigIssue as ad, ContainerAdmin as ae, CreateEasyCMSOptions as af, CreateInput as ag, CreateMigrationResult as ah, CursorDocs as ai, CustomField as aj, CustomFieldTypes as ak, DashboardWidget as al, Database as am, DatabaseAdapter as an, DatabaseInitArgs as ao, DatabaseTransfer as ap, DateField as aq, DepthOptions as ar, DirectUpload as as, DiskStorageOptions as at, DocumentOf as au, EmailAdapter as ax, EmailField as ay, EmailMessage as az, Access as b, Session as b$, GlobalConfig as b0, GlobalDocument as b1, GlobalHooks as b2, GlobalInput as b3, GlobalSlug as b4, GroupField as b5, ImageSize as b6, IncrementOptions as b7, InferCollection as b8, InferGlobal as b9, PasswordEmailFn as bA, PasswordLinkOptions as bB, Plugin as bD, PluginInfo as bE, PluginTypes as bF, PreviewTarget as bG, PreviewURL as bH, RawDocument as bK, ReadOptions as bL, RelationshipField as bM, RequestContext as bN, ResolvedConfig as bO, RichTextDocument as bP, RichTextField as bQ, Role as bR, RoleOperation as bS, RolePermissions as bT, RoutesConfig as bV, ScheduledPublish as bW, SchemaMode as bY, SelectField as bZ, SelectOption as b_, JobConfig as ba, JsonField as bb, KeysetPage as bc, Label as bd, LayoutNode as be, LivePreview as bf, LocaleOf as bg, LocalizationConfig as bh, LogDetails as bi, Logger as bj, LoginArgs as bk, LogsConfig as bl, MediaDocument as bm, MediaSize as bn, MembersConfig as bo, MembersSignup as bp, MigrationInfo as bq, NavGroup as br, NumberField as bt, OnRequest as bu, OnRequestArgs as bv, Operation as bw, PasswordEmail as by, PasswordEmailArgs as bz, AccessArgs as c, SidebarPanel as c0, SignupArgs as c1, SignupResult as c2, SlugField as c4, SlugOf as c5, SsoOutcome as c6, SsoProviderRef as c7, StorageAdapter as c8, StoredFile as c9, TextField as ca, TextareaField as cb, TypedPlugin as cd, UncountedDocs as cf, UpdateInput as cg, UpdateOptions as ch, UploadConfig as ci, UploadField as cj, UploadFromURLConfig as ck, UserIdentity as cl, Version as cn, VersionSummary as co, VersionsConfig as cp, WebhookConfig as cr, WebhookEvent as cs, WebhookPayload as ct, Where as cu, WhereOperators as cv, AccessOptions as d, AdminBrand as e, AdminCommand as f, AdminComponent as g, AdminConfig as h, AdminFieldArgs as i, AdminIcon as j, AdminLocale as k, AdminPage as l, AdminRole as m, AdminRoleChange as n, AdminRoleField as o, AdminRoleTarget as p, AdminRoleView as q, AdminRoles as r, AdminSso as s, AdminSwitcher as t, AdminViewAccess as u, AfterChangeHook as v, AfterDeleteHook as w, AfterReadHook as x, ApiKeyContext as y, ApiKeyGlobalOperation as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { I as ID, ab as Config,
|
|
1
|
+
import { I as ID, ab as Config, av as EasyCMS, bh as LocalizationConfig, aE as Field, aI as FieldError, aT as FilterOptions, af as CreateEasyCMSOptions, bO as ResolvedConfig } from './config-BZgVbC3f.js';
|
|
2
2
|
|
|
3
3
|
/** Decrypts a file from `encryptBackup`; throws for another key or a changed file. */
|
|
4
4
|
declare function decryptBackup(data: Uint8Array, encryptionKey: string): Uint8Array;
|
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
|
|
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-BZgVbC3f.js';
|
|
2
|
+
export { A as ADAPTER_API_VERSION, a as ADMIN_ICONS, b as Access, c as AccessArgs, d as AccessOptions, e as AdminBrand, f as AdminCommand, g as AdminComponent, h as AdminConfig, i as AdminFieldArgs, j as AdminIcon, k as AdminLocale, l as AdminPage, m as AdminRole, n as AdminRoleChange, o as AdminRoleField, p as AdminRoleTarget, q as AdminRoleView, r as AdminRoles, s as AdminSso, t as AdminSwitcher, u as AdminViewAccess, v as AfterChangeHook, w as AfterDeleteHook, x as AfterReadHook, y as ApiKeyContext, z as ApiKeyGlobalOperation, B as ApiKeyOperation, C as ApiKeyPermissions, D as ArrayField, F as AuditChange, G as AuditConfig, H as AuditEntry, J as AuditLog, K as AuditPage, L as AuditVerification, M as Auth, N as AuthConfig, O as AuthProvider, Q as AuthProviderProfile, R as AuthProviderRequest, S as AuthUser, T as BackupsConfig, U as BeforeChangeHook, V as BeforeDeleteHook, W as BeforeValidateHook, X as Block, Y as BlocksField, Z as BooleanField, _ as BuiltinApiKeysCollection, $ as BuiltinMediaCollection, a0 as BuiltinMediaFoldersCollection, a1 as BuiltinUsersCollection, a2 as BundleHints, a3 as CliCommand, a4 as CollectionAccess, a5 as CollectionAdmin, a6 as CollectionConfig, a7 as CollectionDocument, a8 as CollectionHooks, a9 as CollectionListAdmin, aa as CollectionSlug, ab as Config, ac as ConfigError, ad as ConfigIssue, ae as ContainerAdmin, af as CreateEasyCMSOptions, ag as CreateInput, ah as CreateMigrationResult, ai as CursorDocs, aj as CustomField, ak as CustomFieldTypes, al as DashboardWidget, am as Database, an as DatabaseAdapter, ao as DatabaseInitArgs, ap as DatabaseTransfer, aq as DateField, ar as DepthOptions, as as DirectUpload, at as DiskStorageOptions, au as DocumentOf, av as EasyCMS, aw as EasyCMSError, ax as EmailAdapter, ay as EmailField, az as EmailMessage, aA as Endpoint, aB as EndpointRequest, aC as ErrorCode, aD as FIELD_TYPES, aE as Field, aF as FieldAccess, aG as FieldAccessFn, aH as FieldAdmin, aI as FieldError, aJ as FieldRule, aK as FieldType, aL as FieldTypeBase, aM as FieldTypeDefinition, aN as FieldTypeValidateContext, aO as FieldValidate, aP as FieldValidateContext, aQ as FieldValue, aR as FieldsInput, aS as FieldsValue, aT as FilterOptions, aU as FilterOptionsArgs, aV as FindAfterArgs, aW as FindArgs, aX as FindOptions, aY as FolderLevel, aZ as FolderPermissions, a_ as ForbiddenError, a$ as GlobalAccess, b0 as GlobalConfig, b1 as GlobalDocument, b2 as GlobalHooks, b3 as GlobalInput, b4 as GlobalSlug, b5 as GroupField, b6 as ImageSize, b7 as IncrementOptions, b8 as InferCollection, b9 as InferGlobal, ba as JobConfig, bb as JsonField, bc as KeysetPage, bd as Label, be as LayoutNode, bf as LivePreview, bg as LocaleOf, bh as LocalizationConfig, bi as LogDetails, bj as Logger, bk as LoginArgs, bl as LogsConfig, bm as MediaDocument, bn as MediaSize, bo as MembersConfig, bp as MembersSignup, bq as MigrationInfo, br as NavGroup, bs as NotFoundError, bt as NumberField, bu as OnRequest, bv as OnRequestArgs, bw as Operation, bx as PLUGIN_API_VERSION, by as PasswordEmail, bz as PasswordEmailArgs, bA as PasswordEmailFn, bB as PasswordLinkOptions, bC as PayloadTooLargeError, bD as Plugin, bE as PluginInfo, bF as PluginTypes, bG as PreviewTarget, bH as PreviewURL, bI as QueryError, bJ as ROLE_OPERATIONS, bK as RawDocument, bL as ReadOptions, bM as RelationshipField, bN as RequestContext, bO as ResolvedConfig, bP as RichTextDocument, bQ as RichTextField, bR as Role, bS as RoleOperation, bT as RolePermissions, bU as Roles, bV as RoutesConfig, bW as ScheduledPublish, bX as SchemaError, bY as SchemaMode, bZ as SelectField, b_ as SelectOption, b$ as Session, c0 as SidebarPanel, c1 as SignupArgs, c2 as SignupResult, c3 as SingleSignOn, c4 as SlugField, c5 as SlugOf, c6 as SsoOutcome, c7 as SsoProviderRef, c8 as StorageAdapter, c9 as StoredFile, ca as TextField, cb as TextareaField, cc as TooManyRequestsError, cd as TypedPlugin, ce as UnauthorizedError, cf as UncountedDocs, cg as UpdateInput, ch as UpdateOptions, ci as UploadConfig, cj as UploadField, ck as UploadFromURLConfig, cl as UserIdentity, cm as ValidationError, cn as Version, co as VersionSummary, cp as VersionsConfig, cq as WEBHOOK_EVENTS, cr as WebhookConfig, cs as WebhookEvent, ct as WebhookPayload, cu as Where, cv as WhereOperators, cw as anyone, cx as consoleEmail, cy as consoleLogger, cz as createEasyCMS, cA as defineConfig, cB as defineFieldType, cC as definePlugin, cD as diskStorage, cE as hasRows, cF as isAdmin, cG as isHasMany, cH as isSignedIn, cI as isStaff, cJ as isSystemAdmin, cK as jsonLogger, cL as mimeAllowedBy, cM as rowFields, cN as silentLogger, cO as uniqueWithinOf } from './config-BZgVbC3f.js';
|
|
3
|
+
export { A as ADMIN_API_VERSION, a as AdminCollection, b as AdminComponentRef, c as AdminElementProps, d as AdminField, e as AdminGlobal, f as AdminLayoutNode, g as AdminNavGroup, h as AdminNavItem, i as AdminNavNode, j as AdminPageRef, k as AdminPageRoute, l as AdminSchema, m as AdminWidgetRef, S as SetFieldDetail, w as warnDeprecated } from './plugin-DlSta1rd.js';
|
|
4
|
+
export { A as AdminBackup, a as AdminBackups, b as ApiHandlerOptions, B as BackupState, L as LoadConfigOptions, R as RestHandler, c as RestHandlerOptions, d as createApiHandler, e as createRestHandler, l as loadConfig, r as resolveConfig, s as sharedEasyCMS, f as slugify } from './handler-j6s6J723.js';
|
|
5
5
|
export { FieldCondition, matchesCondition } from './conditions.js';
|
|
6
6
|
|
|
7
7
|
type DeliveryKind = 'webhook' | 'email';
|
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 mergeForUpdate, y as parseId, z as platformClientIp, E as readCookie, F as validateFields, G as writeBackupFile } from './handler-
|
|
2
|
+
export { cP as API_KEYS, cQ as API_KEY_GLOBAL_OPERATIONS, cR as API_KEY_OPERATIONS, cS as DEFAULT_MAX_VERSIONS, cT as DEFAULT_PASSWORD_EMAILS, cU as FIELD_TYPE_BASES, cV as FOLDER_LEVELS, cW as MediaFolders, cX as SSO_COOKIE, cY as codeOfStatus, cE as hasRows, cG as isHasMany, cZ as isJsonLogger, c_ as keyAllows, c$ as logFormat, cL as mimeAllowedBy, cM as rowFields, cO as uniqueWithinOf } from './config-BZgVbC3f.js';
|
|
3
|
+
export { C as CONFIG_FILE_NAMES, g as CSRF_COOKIE, h as CSRF_HEADER, D as DEFAULT_ADMIN_PATH, i as DEFAULT_API_PATH, j as DEFAULT_MAX_FILE_SIZE, k as DEFAULT_TOKEN_EXPIRATION, m as applyDefaults, n as applyPlugins, o as createRootEndpointHandler, p as decryptBackup, q as fillMissing, t as findConfigFile, u as forwardedClientIp, v as generateSlugs, w as importConfig, x as mergeForUpdate, y as parseId, z as platformClientIp, E as readCookie, F as validateFields, G as writeBackupFile } from './handler-j6s6J723.js';
|
|
4
4
|
export { conditionIssues } from './conditions.js';
|
|
5
5
|
|
|
6
6
|
/** The session cookie the REST API sets at login. */
|
package/dist/internal.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { bd as Label, aE as Field, I as ID, k as AdminLocale, t as AdminSwitcher, c7 as SsoProviderRef } from './config-BZgVbC3f.js';
|
|
2
2
|
import { FieldCondition } from './conditions.js';
|
|
3
3
|
|
|
4
4
|
/** A Web Component from an admin module, with its `props` (plain JSON). */
|
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,
|
|
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, al as DashboardWidget, aw as EasyCMSError, aA as Endpoint, aB as EndpointRequest, aC as ErrorCode, aE as Field, aF as FieldAccess, aI as FieldError, aL as FieldTypeBase, aM as FieldTypeDefinition, aN as FieldTypeValidateContext, a_ as ForbiddenError, b0 as GlobalConfig, I as ID, ba as JobConfig, bd as Label, br as NavGroup, bs as NotFoundError, bu as OnRequest, bv as OnRequestArgs, bx as PLUGIN_API_VERSION, bC as PayloadTooLargeError, bD as Plugin, bE as PluginInfo, bF as PluginTypes, bI as QueryError, bN as RequestContext, cc as TooManyRequestsError, cd as TypedPlugin, ce as UnauthorizedError, cm as ValidationError, cu as Where, cB as defineFieldType, cC as definePlugin } from './config-BZgVbC3f.js';
|
|
2
|
+
export { A as ADMIN_API_VERSION, c as AdminElementProps, k as AdminPageRoute, S as SetFieldDetail, w as warnDeprecated } from './plugin-DlSta1rd.js';
|
|
3
3
|
import './conditions.js';
|