@mainsoft/agent-cms 0.10.2 → 0.11.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/CHANGELOG.md +16 -0
- package/README.md +91 -2
- package/TODO.md +6 -6
- package/UPGRADE-0.11.md +43 -0
- package/dist/agent.d.cts +1 -1
- package/dist/agent.d.ts +1 -1
- package/dist/agent.js +7 -7
- package/dist/bin.js +236 -23
- package/dist/{chunk-IU2SMWAM.js → chunk-42PW3HQ3.js} +15 -1
- package/dist/{chunk-6PB4ZCHH.js → chunk-CIMW73L3.js} +58 -1
- package/dist/{chunk-7Y6TU2UA.js → chunk-HY4ED7LT.js} +2 -2
- package/dist/{chunk-DSJETZT4.js → chunk-I3DF6DMI.js} +15 -10
- package/dist/{chunk-KAO3Z3CF.js → chunk-I5UHTAAW.js} +3 -1
- package/dist/{chunk-7SCYDG2G.js → chunk-J25IKU7C.js} +164 -28
- package/dist/{chunk-BFVBHIHV.js → chunk-J5DW3RFQ.js} +4 -1
- package/dist/{chunk-7WJIIJCI.js → chunk-LELPCGDX.js} +8 -5
- package/dist/{chunk-5ODZ2ZJF.js → chunk-NO6S7KOL.js} +1 -1
- package/dist/{chunk-5FMVVBDR.js → chunk-OLHLSSTD.js} +3 -3
- package/dist/{chunk-3OPKTBEI.js → chunk-SV3ZA6XP.js} +1 -1
- package/dist/{chunk-PEQY4N73.js → chunk-TKKTEGHL.js} +1 -0
- package/dist/{chunk-PGV2QPIL.js → chunk-WWG7XDIZ.js} +2 -0
- package/dist/cli.cjs +236 -23
- package/dist/cli.d.cts +2 -2
- package/dist/cli.d.ts +2 -2
- package/dist/cli.js +18 -16
- package/dist/client.cjs +4 -1
- package/dist/client.d.cts +14 -2
- package/dist/client.d.ts +14 -2
- package/dist/client.js +1 -1
- package/dist/{cms-pqJyowu1.d.ts → cms-A9tmLmTP.d.ts} +100 -5
- package/dist/{cms-C_vkAxYV.d.cts → cms-CaB81PPX.d.cts} +100 -5
- package/dist/config.d.cts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/{drizzle-repo-DWLD0rWe.d.ts → drizzle-repo-BXV-hFkE.d.ts} +1 -1
- package/dist/{drizzle-repo-CviH3EX7.d.cts → drizzle-repo-CblPVYnK.d.cts} +1 -1
- package/dist/errors.cjs +4 -0
- package/dist/errors.d.cts +3 -1
- package/dist/errors.d.ts +3 -1
- package/dist/errors.js +2 -2
- package/dist/frontmatter.d.cts +1 -1
- package/dist/frontmatter.d.ts +1 -1
- package/dist/http.cjs +17 -7
- package/dist/http.d.cts +2 -2
- package/dist/http.d.ts +2 -2
- package/dist/http.js +16 -15
- package/dist/image-sharp.cjs +104 -0
- package/dist/image-sharp.d.cts +47 -0
- package/dist/image-sharp.d.ts +47 -0
- package/dist/image-sharp.js +70 -0
- package/dist/index.cjs +244 -27
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +21 -21
- package/dist/mcp.cjs +9 -4
- package/dist/mcp.d.cts +1 -1
- package/dist/mcp.d.ts +1 -1
- package/dist/mcp.js +11 -11
- package/dist/messages/en.cjs +2 -0
- package/dist/messages/en.js +1 -1
- package/dist/messages/ko.cjs +2 -0
- package/dist/messages/ko.js +2 -0
- package/dist/registry/cms-doc-editor.json +6 -1
- package/dist/registry/cms-lib.json +2 -2
- package/dist/registry/cms-media-picker.json +2 -2
- package/dist/registry/cms-media.json +1 -1
- package/dist/registry/registry.json +4 -0
- package/dist/storage-vercel-blob.cjs +199 -0
- package/dist/storage-vercel-blob.d.cts +98 -0
- package/dist/storage-vercel-blob.d.ts +98 -0
- package/dist/storage-vercel-blob.js +165 -0
- package/dist/storage.cjs +63 -3
- package/dist/storage.d.cts +27 -2
- package/dist/storage.d.ts +27 -2
- package/dist/storage.js +9 -3
- package/dist/tables.cjs +15 -1
- package/dist/tables.d.cts +160 -7
- package/dist/tables.d.ts +160 -7
- package/dist/tables.js +2 -2
- package/dist/tools.cjs +8 -3
- package/dist/tools.d.cts +1 -1
- package/dist/tools.d.ts +1 -1
- package/dist/tools.js +9 -9
- package/dist/types.cjs +5 -0
- package/dist/types.d.cts +6 -1
- package/dist/types.d.ts +6 -1
- package/dist/types.js +3 -3
- package/package.json +36 -2
package/dist/client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { i as AssetView, h as AssetUsage, H as PatchOp, k as BulkAction, l as BulkResult, D as DocDiff, A as AgentChange, Q as PreviewTtl, J as PreviewLink, ai as CommentThread, aj as TrashRef, ak as TrashItem, al as ReleaseView, e as AssetListOptions, Z as UploadRequest, Y as UploadInstructions } from './cms-A9tmLmTP.js';
|
|
2
|
+
export { am as BlockedItem, an as ScheduledRun } from './cms-A9tmLmTP.js';
|
|
3
3
|
import { ErrorParams, Diagnostic } from './errors.js';
|
|
4
4
|
import { Block, TocItem } from './markdown.js';
|
|
5
5
|
import { CmsRelease, DocSummary, DocCounts, CmsDoc, AutosaveState, VersionSummary, CmsVersion, CmsComment, Presence, SavedFilter, CmsKey, KeyScope, AuditEntry } from './types.js';
|
|
@@ -141,6 +141,8 @@ interface MediaStoreInfo {
|
|
|
141
141
|
/** File types the store takes (MIME types, `image/*` groups, `.ext`). */
|
|
142
142
|
accept: readonly string[];
|
|
143
143
|
maxFileSize: number;
|
|
144
|
+
/** `false`: the store takes a file in one request, so a failed upload starts again instead of carrying on. */
|
|
145
|
+
parts?: boolean;
|
|
144
146
|
can: {
|
|
145
147
|
write: boolean;
|
|
146
148
|
delete: boolean;
|
|
@@ -150,6 +152,10 @@ interface MediaStoreInfo {
|
|
|
150
152
|
interface MediaInfo {
|
|
151
153
|
stores: MediaStoreInfo[];
|
|
152
154
|
partSize: number;
|
|
155
|
+
/** Photos lose their camera data (location, time, device) in the browser before they are sent. */
|
|
156
|
+
stripMetadata?: boolean;
|
|
157
|
+
/** Names of the image sizes the server makes (`?size=`). */
|
|
158
|
+
sizes?: string[];
|
|
153
159
|
}
|
|
154
160
|
interface FolderTree {
|
|
155
161
|
store: string;
|
|
@@ -420,6 +426,10 @@ declare function createRestClient(opts: RestClientOptions): {
|
|
|
420
426
|
updateAsset: (id: string, patch: {
|
|
421
427
|
alt?: string;
|
|
422
428
|
tags?: string[];
|
|
429
|
+
focal?: {
|
|
430
|
+
x: number;
|
|
431
|
+
y: number;
|
|
432
|
+
} | null;
|
|
423
433
|
}) => Promise<AssetView>;
|
|
424
434
|
moveAsset: (id: string, to: {
|
|
425
435
|
folder?: string | null;
|
|
@@ -510,9 +520,11 @@ declare function createRestClient(opts: RestClientOptions): {
|
|
|
510
520
|
fileUrl: (a: {
|
|
511
521
|
id: string;
|
|
512
522
|
name: string;
|
|
523
|
+
rev?: number;
|
|
513
524
|
}, o?: {
|
|
514
525
|
thumb?: boolean;
|
|
515
526
|
download?: boolean;
|
|
527
|
+
size?: string;
|
|
516
528
|
}) => string;
|
|
517
529
|
audit: (q?: {
|
|
518
530
|
cursor?: string | null;
|
package/dist/client.js
CHANGED
|
@@ -45,9 +45,12 @@ interface AuditQuery {
|
|
|
45
45
|
outcome?: AuditEntry["outcome"];
|
|
46
46
|
actorKind?: AuditEntry["actorKind"];
|
|
47
47
|
}
|
|
48
|
-
type NewAsset = Omit<CmsAsset, "createdAt" | "updatedAt" | "deletedAt" | "deletedBy"> & {
|
|
48
|
+
type NewAsset = Omit<CmsAsset, "createdAt" | "updatedAt" | "deletedAt" | "deletedBy" | "focalX" | "focalY" | "rev"> & {
|
|
49
49
|
createdAt?: string;
|
|
50
50
|
updatedAt?: string;
|
|
51
|
+
focalX?: number | null;
|
|
52
|
+
focalY?: number | null;
|
|
53
|
+
rev?: number;
|
|
51
54
|
};
|
|
52
55
|
type VersionPatch = Partial<Pick<CmsVersion, "label" | "pinned" | "approvedBy" | "approvedAt">>;
|
|
53
56
|
type NewComment = Omit<CmsComment, "id" | "resolvedAt" | "resolvedBy">;
|
|
@@ -338,6 +341,45 @@ interface ScanFile {
|
|
|
338
341
|
url: string | null;
|
|
339
342
|
bytes?: Uint8Array;
|
|
340
343
|
}
|
|
344
|
+
type ImageFormat = "webp" | "avif" | "jpeg" | "png";
|
|
345
|
+
/** One named size of an image. With both sides and `fit: "cover"` the picture is cropped around its focal point. */
|
|
346
|
+
interface ImagePreset {
|
|
347
|
+
width?: number;
|
|
348
|
+
height?: number;
|
|
349
|
+
/** `inside` (default): fits within the box, never enlarged. `cover`: fills the box exactly, cropping what sticks out. */
|
|
350
|
+
fit?: "inside" | "cover";
|
|
351
|
+
format?: ImageFormat;
|
|
352
|
+
/** 1..100. Default: the library's own for the format. */
|
|
353
|
+
quality?: number;
|
|
354
|
+
}
|
|
355
|
+
interface ImageJob {
|
|
356
|
+
width: number | null;
|
|
357
|
+
height: number | null;
|
|
358
|
+
fit: "inside" | "cover";
|
|
359
|
+
format: ImageFormat;
|
|
360
|
+
quality: number | null;
|
|
361
|
+
focal: {
|
|
362
|
+
x: number;
|
|
363
|
+
y: number;
|
|
364
|
+
} | null;
|
|
365
|
+
}
|
|
366
|
+
/** What makes resized copies (`sharpTransforms()` from `./image-sharp`, or your own). */
|
|
367
|
+
interface ImageTransforms {
|
|
368
|
+
presets: Record<string, ImagePreset>;
|
|
369
|
+
/** The format of sizes that do not name one. */
|
|
370
|
+
format: ImageFormat;
|
|
371
|
+
make(bytes: Uint8Array, job: ImageJob): Promise<{
|
|
372
|
+
bytes: Uint8Array;
|
|
373
|
+
width: number;
|
|
374
|
+
height: number;
|
|
375
|
+
}>;
|
|
376
|
+
/** Originals above this many bytes are served as they are. Default 40MB. */
|
|
377
|
+
maxInputBytes?: number;
|
|
378
|
+
/** Copies made at the same time. Default 4. */
|
|
379
|
+
concurrency?: number;
|
|
380
|
+
/** A request waits this long for a copy, then gets the original. Default 10000. */
|
|
381
|
+
timeoutMs?: number;
|
|
382
|
+
}
|
|
341
383
|
interface MediaOptions {
|
|
342
384
|
/** The first one is the default store. */
|
|
343
385
|
stores: Record<string, MediaStoreConfig>;
|
|
@@ -351,6 +393,19 @@ interface MediaOptions {
|
|
|
351
393
|
width: number;
|
|
352
394
|
asset: AssetInfo;
|
|
353
395
|
}) => string;
|
|
396
|
+
/**
|
|
397
|
+
* Named image sizes made on the server: `sharpTransforms({ presets })`
|
|
398
|
+
* from `@mainsoft/agent-cms/image-sharp`. A size is made the first time
|
|
399
|
+
* `/files/<id>/<name>?size=<name>` is asked for and kept in the store.
|
|
400
|
+
*/
|
|
401
|
+
transforms?: ImageTransforms;
|
|
402
|
+
/**
|
|
403
|
+
* Remove what cameras write into JPEG photos (location, time, device)
|
|
404
|
+
* before they are stored. The admin does it in the browser, so the data
|
|
405
|
+
* never leaves the person's computer; imports are cleaned on the server.
|
|
406
|
+
* Default false.
|
|
407
|
+
*/
|
|
408
|
+
stripMetadata?: boolean;
|
|
354
409
|
/** How long a link to a private file works, in seconds. Default 300. */
|
|
355
410
|
linkTtlSeconds?: number;
|
|
356
411
|
/** Largest file an agent may import by URL, in bytes. Default 50MB. */
|
|
@@ -400,6 +455,11 @@ interface AssetInfo {
|
|
|
400
455
|
alt: string;
|
|
401
456
|
url: string;
|
|
402
457
|
visibility: "public" | "private";
|
|
458
|
+
/** The point to keep in view when cropping (`object-position: ${x * 100}% ${y * 100}%`), or null. */
|
|
459
|
+
focal: {
|
|
460
|
+
x: number;
|
|
461
|
+
y: number;
|
|
462
|
+
} | null;
|
|
403
463
|
}
|
|
404
464
|
interface AssetUsage {
|
|
405
465
|
collection: string;
|
|
@@ -432,6 +492,8 @@ interface UploadRequest {
|
|
|
432
492
|
collection: string;
|
|
433
493
|
path: string;
|
|
434
494
|
} | null;
|
|
495
|
+
/** New content for this file: same id, same address, same type. Folder, store, alt and tags are the file's own. */
|
|
496
|
+
replace?: string | null;
|
|
435
497
|
}
|
|
436
498
|
interface AssetListOptions {
|
|
437
499
|
store?: string | null;
|
|
@@ -496,6 +558,7 @@ declare function createAssets(ctx: AssetsContext): {
|
|
|
496
558
|
}[];
|
|
497
559
|
describe: (actor: Actor) => {
|
|
498
560
|
stores: {
|
|
561
|
+
parts: boolean;
|
|
499
562
|
can: {
|
|
500
563
|
write: boolean;
|
|
501
564
|
delete: boolean;
|
|
@@ -508,6 +571,8 @@ declare function createAssets(ctx: AssetsContext): {
|
|
|
508
571
|
visibility: "public" | "private";
|
|
509
572
|
}[];
|
|
510
573
|
partSize: number;
|
|
574
|
+
stripMetadata: boolean;
|
|
575
|
+
sizes: string[];
|
|
511
576
|
} | null;
|
|
512
577
|
can: (actor: Actor, store: string, what: "read" | "write" | "delete") => boolean;
|
|
513
578
|
requestUpload: (actor: Actor, input: UploadRequest) => Promise<{
|
|
@@ -537,6 +602,13 @@ declare function createAssets(ctx: AssetsContext): {
|
|
|
537
602
|
height?: number | null;
|
|
538
603
|
duration?: number | null;
|
|
539
604
|
}) => Promise<AssetView>;
|
|
605
|
+
replace: (actor: Actor, id: string, input: {
|
|
606
|
+
bytes: Uint8Array;
|
|
607
|
+
mime?: string | null;
|
|
608
|
+
width?: number | null;
|
|
609
|
+
height?: number | null;
|
|
610
|
+
duration?: number | null;
|
|
611
|
+
}) => Promise<AssetView>;
|
|
540
612
|
import: (actor: Actor, input: {
|
|
541
613
|
url: string;
|
|
542
614
|
name?: string | null;
|
|
@@ -578,6 +650,10 @@ declare function createAssets(ctx: AssetsContext): {
|
|
|
578
650
|
update: (actor: Actor, id: string, patch: {
|
|
579
651
|
alt?: string;
|
|
580
652
|
tags?: string[];
|
|
653
|
+
focal?: {
|
|
654
|
+
x: number;
|
|
655
|
+
y: number;
|
|
656
|
+
} | null;
|
|
581
657
|
}) => Promise<AssetView>;
|
|
582
658
|
move: (actor: Actor, id: string, to: {
|
|
583
659
|
folder?: string | null;
|
|
@@ -593,6 +669,7 @@ declare function createAssets(ctx: AssetsContext): {
|
|
|
593
669
|
open: (actor: Actor, id: string, o?: {
|
|
594
670
|
thumb?: boolean;
|
|
595
671
|
download?: boolean;
|
|
672
|
+
size?: string | null;
|
|
596
673
|
}) => Promise<{
|
|
597
674
|
url: string;
|
|
598
675
|
visibility: "public" | "private";
|
|
@@ -689,7 +766,8 @@ declare function createAssets(ctx: AssetsContext): {
|
|
|
689
766
|
idsIn: (cfg: AnyCollection, c: Pick<DocContent, "body" | "fields">) => Set<string>;
|
|
690
767
|
assetsFor: (doc: Pick<CmsDoc, "collection" | "body" | "fields">) => Promise<Record<string, AssetInfo>>;
|
|
691
768
|
imageUrl: (asset: AssetInfo, o: {
|
|
692
|
-
width
|
|
769
|
+
width?: number;
|
|
770
|
+
size?: string;
|
|
693
771
|
}) => string;
|
|
694
772
|
};
|
|
695
773
|
type CmsAssets = ReturnType<typeof createAssets>;
|
|
@@ -1286,6 +1364,7 @@ declare function createCmsCore(opts: CreateCmsOptions): {
|
|
|
1286
1364
|
}[];
|
|
1287
1365
|
describe: (actor: Actor) => {
|
|
1288
1366
|
stores: {
|
|
1367
|
+
parts: boolean;
|
|
1289
1368
|
can: {
|
|
1290
1369
|
write: boolean;
|
|
1291
1370
|
delete: boolean;
|
|
@@ -1298,6 +1377,8 @@ declare function createCmsCore(opts: CreateCmsOptions): {
|
|
|
1298
1377
|
visibility: "public" | "private";
|
|
1299
1378
|
}[];
|
|
1300
1379
|
partSize: number;
|
|
1380
|
+
stripMetadata: boolean;
|
|
1381
|
+
sizes: string[];
|
|
1301
1382
|
} | null;
|
|
1302
1383
|
can: (actor: Actor, store: string, what: "read" | "write" | "delete") => boolean;
|
|
1303
1384
|
requestUpload: (actor: Actor, input: UploadRequest) => Promise<{
|
|
@@ -1327,6 +1408,13 @@ declare function createCmsCore(opts: CreateCmsOptions): {
|
|
|
1327
1408
|
height?: number | null;
|
|
1328
1409
|
duration?: number | null;
|
|
1329
1410
|
}) => Promise<AssetView>;
|
|
1411
|
+
replace: (actor: Actor, id: string, input: {
|
|
1412
|
+
bytes: Uint8Array;
|
|
1413
|
+
mime?: string | null;
|
|
1414
|
+
width?: number | null;
|
|
1415
|
+
height?: number | null;
|
|
1416
|
+
duration?: number | null;
|
|
1417
|
+
}) => Promise<AssetView>;
|
|
1330
1418
|
import: (actor: Actor, input: {
|
|
1331
1419
|
url: string;
|
|
1332
1420
|
name?: string | null;
|
|
@@ -1368,6 +1456,10 @@ declare function createCmsCore(opts: CreateCmsOptions): {
|
|
|
1368
1456
|
update: (actor: Actor, id: string, patch: {
|
|
1369
1457
|
alt?: string;
|
|
1370
1458
|
tags?: string[];
|
|
1459
|
+
focal?: {
|
|
1460
|
+
x: number;
|
|
1461
|
+
y: number;
|
|
1462
|
+
} | null;
|
|
1371
1463
|
}) => Promise<AssetView>;
|
|
1372
1464
|
move: (actor: Actor, id: string, to: {
|
|
1373
1465
|
folder?: string | null;
|
|
@@ -1383,6 +1475,7 @@ declare function createCmsCore(opts: CreateCmsOptions): {
|
|
|
1383
1475
|
open: (actor: Actor, id: string, o?: {
|
|
1384
1476
|
thumb?: boolean;
|
|
1385
1477
|
download?: boolean;
|
|
1478
|
+
size?: string | null;
|
|
1386
1479
|
}) => Promise<{
|
|
1387
1480
|
url: string;
|
|
1388
1481
|
visibility: "public" | "private";
|
|
@@ -1479,14 +1572,16 @@ declare function createCmsCore(opts: CreateCmsOptions): {
|
|
|
1479
1572
|
idsIn: (cfg: AnyCollection, c: Pick<DocContent, "body" | "fields">) => Set<string>;
|
|
1480
1573
|
assetsFor: (doc: Pick<CmsDoc, "collection" | "body" | "fields">) => Promise<Record<string, AssetInfo>>;
|
|
1481
1574
|
imageUrl: (asset: AssetInfo, o: {
|
|
1482
|
-
width
|
|
1575
|
+
width?: number;
|
|
1576
|
+
size?: string;
|
|
1483
1577
|
}) => string;
|
|
1484
1578
|
};
|
|
1485
1579
|
/** The files a document uses, by id: address, size, alt text. For rendering. */
|
|
1486
1580
|
assetsFor: (doc: Pick<CmsDoc, "collection" | "body" | "fields">) => Promise<Record<string, AssetInfo>>;
|
|
1487
1581
|
/** An image's address at a width, through `media.imageUrl` when set. */
|
|
1488
1582
|
imageUrl: (asset: AssetInfo, o: {
|
|
1489
|
-
width
|
|
1583
|
+
width?: number;
|
|
1584
|
+
size?: string;
|
|
1490
1585
|
}) => string;
|
|
1491
1586
|
message: (e: unknown) => string;
|
|
1492
1587
|
messages: Partial<Messages> | undefined;
|
|
@@ -1534,4 +1629,4 @@ type CmsLike = {
|
|
|
1534
1629
|
declare const coreOf: (c: CmsLike) => CmsCore;
|
|
1535
1630
|
declare function createCms<const C extends readonly AnyCollection[]>(opts: CreateCmsOptions<C>): Cms<C>;
|
|
1536
1631
|
|
|
1537
|
-
export {
|
|
1632
|
+
export { applyPatch as $, type AgentChange as A, BULK_ACTIONS as B, type CmsLike as C, type DocDiff as D, type NewDoc as E, type FieldsOf as F, type NewVersion as G, type PatchOp as H, type ImagePreset as I, type PreviewLink as J, type KeyRow as K, LIMITS as L, type MediaOptions as M, type NewAsset as N, type PreviewRead as O, PREVIEW_TTLS as P, type PreviewTtl as Q, type ScanFile as R, SLUG_RE as S, type SearchOptions as T, type SearchResult as U, type SectionRange as V, type StoredVersion as W, type TypedDoc as X, type UploadInstructions as Y, type UploadRequest as Z, type WriteOptions as _, type ImageFormat as a, assetFields as a0, assetId as a1, coreOf as a2, createCms as a3, createCmsCore as a4, dayIn as a5, defineCollection as a6, humanSize as a7, mergePatch as a8, normalizeQuery as a9, sectionRanges as aa, type FindOptions as ab, type DocFilter as ac, type VersionPatch as ad, type NewComment as ae, type NewRelease as af, type ReleasePatch as ag, type NewFilter as ah, type CommentThread as ai, type TrashRef as aj, type TrashItem as ak, type ReleaseView as al, type BlockedItem as am, type ScheduledRun as an, type ImageTransforms as b, type AnyCollection as c, type AssetInfo as d, type AssetListOptions as e, type AssetPatch as f, type AssetQuery as g, type AssetUsage as h, type AssetView as i, type AuditQuery as j, type BulkAction as k, type BulkResult as l, type ChangeInfo as m, type Cms as n, type CmsAssets as o, type CmsCore as p, type CmsRepo as q, type CollectionName as r, type CreateCmsOptions as s, type DocInput as t, type DocPatch as u, type FieldsPatch as v, type ListOptions as w, type MediaStoreConfig as x, MemoryRepo as y, type NewAudit as z };
|
|
@@ -45,9 +45,12 @@ interface AuditQuery {
|
|
|
45
45
|
outcome?: AuditEntry["outcome"];
|
|
46
46
|
actorKind?: AuditEntry["actorKind"];
|
|
47
47
|
}
|
|
48
|
-
type NewAsset = Omit<CmsAsset, "createdAt" | "updatedAt" | "deletedAt" | "deletedBy"> & {
|
|
48
|
+
type NewAsset = Omit<CmsAsset, "createdAt" | "updatedAt" | "deletedAt" | "deletedBy" | "focalX" | "focalY" | "rev"> & {
|
|
49
49
|
createdAt?: string;
|
|
50
50
|
updatedAt?: string;
|
|
51
|
+
focalX?: number | null;
|
|
52
|
+
focalY?: number | null;
|
|
53
|
+
rev?: number;
|
|
51
54
|
};
|
|
52
55
|
type VersionPatch = Partial<Pick<CmsVersion, "label" | "pinned" | "approvedBy" | "approvedAt">>;
|
|
53
56
|
type NewComment = Omit<CmsComment, "id" | "resolvedAt" | "resolvedBy">;
|
|
@@ -338,6 +341,45 @@ interface ScanFile {
|
|
|
338
341
|
url: string | null;
|
|
339
342
|
bytes?: Uint8Array;
|
|
340
343
|
}
|
|
344
|
+
type ImageFormat = "webp" | "avif" | "jpeg" | "png";
|
|
345
|
+
/** One named size of an image. With both sides and `fit: "cover"` the picture is cropped around its focal point. */
|
|
346
|
+
interface ImagePreset {
|
|
347
|
+
width?: number;
|
|
348
|
+
height?: number;
|
|
349
|
+
/** `inside` (default): fits within the box, never enlarged. `cover`: fills the box exactly, cropping what sticks out. */
|
|
350
|
+
fit?: "inside" | "cover";
|
|
351
|
+
format?: ImageFormat;
|
|
352
|
+
/** 1..100. Default: the library's own for the format. */
|
|
353
|
+
quality?: number;
|
|
354
|
+
}
|
|
355
|
+
interface ImageJob {
|
|
356
|
+
width: number | null;
|
|
357
|
+
height: number | null;
|
|
358
|
+
fit: "inside" | "cover";
|
|
359
|
+
format: ImageFormat;
|
|
360
|
+
quality: number | null;
|
|
361
|
+
focal: {
|
|
362
|
+
x: number;
|
|
363
|
+
y: number;
|
|
364
|
+
} | null;
|
|
365
|
+
}
|
|
366
|
+
/** What makes resized copies (`sharpTransforms()` from `./image-sharp`, or your own). */
|
|
367
|
+
interface ImageTransforms {
|
|
368
|
+
presets: Record<string, ImagePreset>;
|
|
369
|
+
/** The format of sizes that do not name one. */
|
|
370
|
+
format: ImageFormat;
|
|
371
|
+
make(bytes: Uint8Array, job: ImageJob): Promise<{
|
|
372
|
+
bytes: Uint8Array;
|
|
373
|
+
width: number;
|
|
374
|
+
height: number;
|
|
375
|
+
}>;
|
|
376
|
+
/** Originals above this many bytes are served as they are. Default 40MB. */
|
|
377
|
+
maxInputBytes?: number;
|
|
378
|
+
/** Copies made at the same time. Default 4. */
|
|
379
|
+
concurrency?: number;
|
|
380
|
+
/** A request waits this long for a copy, then gets the original. Default 10000. */
|
|
381
|
+
timeoutMs?: number;
|
|
382
|
+
}
|
|
341
383
|
interface MediaOptions {
|
|
342
384
|
/** The first one is the default store. */
|
|
343
385
|
stores: Record<string, MediaStoreConfig>;
|
|
@@ -351,6 +393,19 @@ interface MediaOptions {
|
|
|
351
393
|
width: number;
|
|
352
394
|
asset: AssetInfo;
|
|
353
395
|
}) => string;
|
|
396
|
+
/**
|
|
397
|
+
* Named image sizes made on the server: `sharpTransforms({ presets })`
|
|
398
|
+
* from `@mainsoft/agent-cms/image-sharp`. A size is made the first time
|
|
399
|
+
* `/files/<id>/<name>?size=<name>` is asked for and kept in the store.
|
|
400
|
+
*/
|
|
401
|
+
transforms?: ImageTransforms;
|
|
402
|
+
/**
|
|
403
|
+
* Remove what cameras write into JPEG photos (location, time, device)
|
|
404
|
+
* before they are stored. The admin does it in the browser, so the data
|
|
405
|
+
* never leaves the person's computer; imports are cleaned on the server.
|
|
406
|
+
* Default false.
|
|
407
|
+
*/
|
|
408
|
+
stripMetadata?: boolean;
|
|
354
409
|
/** How long a link to a private file works, in seconds. Default 300. */
|
|
355
410
|
linkTtlSeconds?: number;
|
|
356
411
|
/** Largest file an agent may import by URL, in bytes. Default 50MB. */
|
|
@@ -400,6 +455,11 @@ interface AssetInfo {
|
|
|
400
455
|
alt: string;
|
|
401
456
|
url: string;
|
|
402
457
|
visibility: "public" | "private";
|
|
458
|
+
/** The point to keep in view when cropping (`object-position: ${x * 100}% ${y * 100}%`), or null. */
|
|
459
|
+
focal: {
|
|
460
|
+
x: number;
|
|
461
|
+
y: number;
|
|
462
|
+
} | null;
|
|
403
463
|
}
|
|
404
464
|
interface AssetUsage {
|
|
405
465
|
collection: string;
|
|
@@ -432,6 +492,8 @@ interface UploadRequest {
|
|
|
432
492
|
collection: string;
|
|
433
493
|
path: string;
|
|
434
494
|
} | null;
|
|
495
|
+
/** New content for this file: same id, same address, same type. Folder, store, alt and tags are the file's own. */
|
|
496
|
+
replace?: string | null;
|
|
435
497
|
}
|
|
436
498
|
interface AssetListOptions {
|
|
437
499
|
store?: string | null;
|
|
@@ -496,6 +558,7 @@ declare function createAssets(ctx: AssetsContext): {
|
|
|
496
558
|
}[];
|
|
497
559
|
describe: (actor: Actor) => {
|
|
498
560
|
stores: {
|
|
561
|
+
parts: boolean;
|
|
499
562
|
can: {
|
|
500
563
|
write: boolean;
|
|
501
564
|
delete: boolean;
|
|
@@ -508,6 +571,8 @@ declare function createAssets(ctx: AssetsContext): {
|
|
|
508
571
|
visibility: "public" | "private";
|
|
509
572
|
}[];
|
|
510
573
|
partSize: number;
|
|
574
|
+
stripMetadata: boolean;
|
|
575
|
+
sizes: string[];
|
|
511
576
|
} | null;
|
|
512
577
|
can: (actor: Actor, store: string, what: "read" | "write" | "delete") => boolean;
|
|
513
578
|
requestUpload: (actor: Actor, input: UploadRequest) => Promise<{
|
|
@@ -537,6 +602,13 @@ declare function createAssets(ctx: AssetsContext): {
|
|
|
537
602
|
height?: number | null;
|
|
538
603
|
duration?: number | null;
|
|
539
604
|
}) => Promise<AssetView>;
|
|
605
|
+
replace: (actor: Actor, id: string, input: {
|
|
606
|
+
bytes: Uint8Array;
|
|
607
|
+
mime?: string | null;
|
|
608
|
+
width?: number | null;
|
|
609
|
+
height?: number | null;
|
|
610
|
+
duration?: number | null;
|
|
611
|
+
}) => Promise<AssetView>;
|
|
540
612
|
import: (actor: Actor, input: {
|
|
541
613
|
url: string;
|
|
542
614
|
name?: string | null;
|
|
@@ -578,6 +650,10 @@ declare function createAssets(ctx: AssetsContext): {
|
|
|
578
650
|
update: (actor: Actor, id: string, patch: {
|
|
579
651
|
alt?: string;
|
|
580
652
|
tags?: string[];
|
|
653
|
+
focal?: {
|
|
654
|
+
x: number;
|
|
655
|
+
y: number;
|
|
656
|
+
} | null;
|
|
581
657
|
}) => Promise<AssetView>;
|
|
582
658
|
move: (actor: Actor, id: string, to: {
|
|
583
659
|
folder?: string | null;
|
|
@@ -593,6 +669,7 @@ declare function createAssets(ctx: AssetsContext): {
|
|
|
593
669
|
open: (actor: Actor, id: string, o?: {
|
|
594
670
|
thumb?: boolean;
|
|
595
671
|
download?: boolean;
|
|
672
|
+
size?: string | null;
|
|
596
673
|
}) => Promise<{
|
|
597
674
|
url: string;
|
|
598
675
|
visibility: "public" | "private";
|
|
@@ -689,7 +766,8 @@ declare function createAssets(ctx: AssetsContext): {
|
|
|
689
766
|
idsIn: (cfg: AnyCollection, c: Pick<DocContent, "body" | "fields">) => Set<string>;
|
|
690
767
|
assetsFor: (doc: Pick<CmsDoc, "collection" | "body" | "fields">) => Promise<Record<string, AssetInfo>>;
|
|
691
768
|
imageUrl: (asset: AssetInfo, o: {
|
|
692
|
-
width
|
|
769
|
+
width?: number;
|
|
770
|
+
size?: string;
|
|
693
771
|
}) => string;
|
|
694
772
|
};
|
|
695
773
|
type CmsAssets = ReturnType<typeof createAssets>;
|
|
@@ -1286,6 +1364,7 @@ declare function createCmsCore(opts: CreateCmsOptions): {
|
|
|
1286
1364
|
}[];
|
|
1287
1365
|
describe: (actor: Actor) => {
|
|
1288
1366
|
stores: {
|
|
1367
|
+
parts: boolean;
|
|
1289
1368
|
can: {
|
|
1290
1369
|
write: boolean;
|
|
1291
1370
|
delete: boolean;
|
|
@@ -1298,6 +1377,8 @@ declare function createCmsCore(opts: CreateCmsOptions): {
|
|
|
1298
1377
|
visibility: "public" | "private";
|
|
1299
1378
|
}[];
|
|
1300
1379
|
partSize: number;
|
|
1380
|
+
stripMetadata: boolean;
|
|
1381
|
+
sizes: string[];
|
|
1301
1382
|
} | null;
|
|
1302
1383
|
can: (actor: Actor, store: string, what: "read" | "write" | "delete") => boolean;
|
|
1303
1384
|
requestUpload: (actor: Actor, input: UploadRequest) => Promise<{
|
|
@@ -1327,6 +1408,13 @@ declare function createCmsCore(opts: CreateCmsOptions): {
|
|
|
1327
1408
|
height?: number | null;
|
|
1328
1409
|
duration?: number | null;
|
|
1329
1410
|
}) => Promise<AssetView>;
|
|
1411
|
+
replace: (actor: Actor, id: string, input: {
|
|
1412
|
+
bytes: Uint8Array;
|
|
1413
|
+
mime?: string | null;
|
|
1414
|
+
width?: number | null;
|
|
1415
|
+
height?: number | null;
|
|
1416
|
+
duration?: number | null;
|
|
1417
|
+
}) => Promise<AssetView>;
|
|
1330
1418
|
import: (actor: Actor, input: {
|
|
1331
1419
|
url: string;
|
|
1332
1420
|
name?: string | null;
|
|
@@ -1368,6 +1456,10 @@ declare function createCmsCore(opts: CreateCmsOptions): {
|
|
|
1368
1456
|
update: (actor: Actor, id: string, patch: {
|
|
1369
1457
|
alt?: string;
|
|
1370
1458
|
tags?: string[];
|
|
1459
|
+
focal?: {
|
|
1460
|
+
x: number;
|
|
1461
|
+
y: number;
|
|
1462
|
+
} | null;
|
|
1371
1463
|
}) => Promise<AssetView>;
|
|
1372
1464
|
move: (actor: Actor, id: string, to: {
|
|
1373
1465
|
folder?: string | null;
|
|
@@ -1383,6 +1475,7 @@ declare function createCmsCore(opts: CreateCmsOptions): {
|
|
|
1383
1475
|
open: (actor: Actor, id: string, o?: {
|
|
1384
1476
|
thumb?: boolean;
|
|
1385
1477
|
download?: boolean;
|
|
1478
|
+
size?: string | null;
|
|
1386
1479
|
}) => Promise<{
|
|
1387
1480
|
url: string;
|
|
1388
1481
|
visibility: "public" | "private";
|
|
@@ -1479,14 +1572,16 @@ declare function createCmsCore(opts: CreateCmsOptions): {
|
|
|
1479
1572
|
idsIn: (cfg: AnyCollection, c: Pick<DocContent, "body" | "fields">) => Set<string>;
|
|
1480
1573
|
assetsFor: (doc: Pick<CmsDoc, "collection" | "body" | "fields">) => Promise<Record<string, AssetInfo>>;
|
|
1481
1574
|
imageUrl: (asset: AssetInfo, o: {
|
|
1482
|
-
width
|
|
1575
|
+
width?: number;
|
|
1576
|
+
size?: string;
|
|
1483
1577
|
}) => string;
|
|
1484
1578
|
};
|
|
1485
1579
|
/** The files a document uses, by id: address, size, alt text. For rendering. */
|
|
1486
1580
|
assetsFor: (doc: Pick<CmsDoc, "collection" | "body" | "fields">) => Promise<Record<string, AssetInfo>>;
|
|
1487
1581
|
/** An image's address at a width, through `media.imageUrl` when set. */
|
|
1488
1582
|
imageUrl: (asset: AssetInfo, o: {
|
|
1489
|
-
width
|
|
1583
|
+
width?: number;
|
|
1584
|
+
size?: string;
|
|
1490
1585
|
}) => string;
|
|
1491
1586
|
message: (e: unknown) => string;
|
|
1492
1587
|
messages: Partial<Messages> | undefined;
|
|
@@ -1534,4 +1629,4 @@ type CmsLike = {
|
|
|
1534
1629
|
declare const coreOf: (c: CmsLike) => CmsCore;
|
|
1535
1630
|
declare function createCms<const C extends readonly AnyCollection[]>(opts: CreateCmsOptions<C>): Cms<C>;
|
|
1536
1631
|
|
|
1537
|
-
export {
|
|
1632
|
+
export { applyPatch as $, type AgentChange as A, BULK_ACTIONS as B, type CmsLike as C, type DocDiff as D, type NewDoc as E, type FieldsOf as F, type NewVersion as G, type PatchOp as H, type ImagePreset as I, type PreviewLink as J, type KeyRow as K, LIMITS as L, type MediaOptions as M, type NewAsset as N, type PreviewRead as O, PREVIEW_TTLS as P, type PreviewTtl as Q, type ScanFile as R, SLUG_RE as S, type SearchOptions as T, type SearchResult as U, type SectionRange as V, type StoredVersion as W, type TypedDoc as X, type UploadInstructions as Y, type UploadRequest as Z, type WriteOptions as _, type ImageFormat as a, assetFields as a0, assetId as a1, coreOf as a2, createCms as a3, createCmsCore as a4, dayIn as a5, defineCollection as a6, humanSize as a7, mergePatch as a8, normalizeQuery as a9, sectionRanges as aa, type FindOptions as ab, type DocFilter as ac, type VersionPatch as ad, type NewComment as ae, type NewRelease as af, type ReleasePatch as ag, type NewFilter as ah, type CommentThread as ai, type TrashRef as aj, type TrashItem as ak, type ReleaseView as al, type BlockedItem as am, type ScheduledRun as an, type ImageTransforms as b, type AnyCollection as c, type AssetInfo as d, type AssetListOptions as e, type AssetPatch as f, type AssetQuery as g, type AssetUsage as h, type AssetView as i, type AuditQuery as j, type BulkAction as k, type BulkResult as l, type ChangeInfo as m, type Cms as n, type CmsAssets as o, type CmsCore as p, type CmsRepo as q, type CollectionName as r, type CreateCmsOptions as s, type DocInput as t, type DocPatch as u, type FieldsPatch as v, type ListOptions as w, type MediaStoreConfig as x, MemoryRepo as y, type NewAudit as z };
|
package/dist/config.d.cts
CHANGED
package/dist/config.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PgDatabase } from 'drizzle-orm/pg-core';
|
|
2
|
-
import {
|
|
2
|
+
import { q as CmsRepo, ab as FindOptions, ac as DocFilter, E as NewDoc, u as DocPatch, G as NewVersion, W as StoredVersion, ad as VersionPatch, K as KeyRow, z as NewAudit, j as AuditQuery, N as NewAsset, g as AssetQuery, f as AssetPatch, ae as NewComment, af as NewRelease, ag as ReleasePatch, ah as NewFilter } from './cms-A9tmLmTP.js';
|
|
3
3
|
import { CmsTables } from './tables.js';
|
|
4
4
|
import { CmsDoc, ReviewMark, KeyScope, AuditEntry, CmsAsset, AssetKind, AssetRef, CmsComment, CmsRelease, SavedFilter, Presence } from './types.js';
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PgDatabase } from 'drizzle-orm/pg-core';
|
|
2
|
-
import {
|
|
2
|
+
import { q as CmsRepo, ab as FindOptions, ac as DocFilter, E as NewDoc, u as DocPatch, G as NewVersion, W as StoredVersion, ad as VersionPatch, K as KeyRow, z as NewAudit, j as AuditQuery, N as NewAsset, g as AssetQuery, f as AssetPatch, ae as NewComment, af as NewRelease, ag as ReleasePatch, ah as NewFilter } from './cms-CaB81PPX.cjs';
|
|
3
3
|
import { CmsTables } from './tables.cjs';
|
|
4
4
|
import { CmsDoc, ReviewMark, KeyScope, AuditEntry, CmsAsset, AssetKind, AssetRef, CmsComment, CmsRelease, SavedFilter, Presence } from './types.cjs';
|
|
5
5
|
|
package/dist/errors.cjs
CHANGED
|
@@ -85,6 +85,8 @@ var en = {
|
|
|
85
85
|
import_blocked: "That address cannot be fetched",
|
|
86
86
|
import_failed: "Could not fetch the file ({reason})",
|
|
87
87
|
asset_rejected: "This file did not pass the check",
|
|
88
|
+
asset_replace_type: "A file can only be replaced by one of the same type ({mime})",
|
|
89
|
+
unknown_image_size: "There is no image size named \u201C{size}\u201D",
|
|
88
90
|
asset_missing: "The file {id} does not exist",
|
|
89
91
|
asset_wrong_kind: "The file {id} is not a kind this field takes",
|
|
90
92
|
asset_alt_missing: "The image on line {line} has no alt text",
|
|
@@ -175,6 +177,8 @@ var ERROR_CODES = {
|
|
|
175
177
|
import_blocked: "invalid",
|
|
176
178
|
import_failed: "invalid",
|
|
177
179
|
asset_rejected: "invalid",
|
|
180
|
+
asset_replace_type: "invalid",
|
|
181
|
+
unknown_image_size: "not_found",
|
|
178
182
|
asset_missing: "invalid",
|
|
179
183
|
asset_wrong_kind: "invalid",
|
|
180
184
|
asset_alt_missing: "invalid",
|
package/dist/errors.d.cts
CHANGED
|
@@ -60,6 +60,8 @@ declare const ERROR_CODES: {
|
|
|
60
60
|
readonly import_blocked: "invalid";
|
|
61
61
|
readonly import_failed: "invalid";
|
|
62
62
|
readonly asset_rejected: "invalid";
|
|
63
|
+
readonly asset_replace_type: "invalid";
|
|
64
|
+
readonly unknown_image_size: "not_found";
|
|
63
65
|
readonly asset_missing: "invalid";
|
|
64
66
|
readonly asset_wrong_kind: "invalid";
|
|
65
67
|
readonly asset_alt_missing: "invalid";
|
|
@@ -134,7 +136,7 @@ declare class CmsError extends Error {
|
|
|
134
136
|
toJSON(): {
|
|
135
137
|
current?: {} | null | undefined;
|
|
136
138
|
diagnostics?: Diagnostic[] | undefined;
|
|
137
|
-
error: "not_found" | "unknown_collection" | "forbidden" | "unauthorized" | "invalid" | "internal" | "version_not_found" | "key_not_found" | "route_not_found" | "asset_not_found" | "unknown_store" | "invalid_key" | "key_expired" | "preview_invalid" | "preview_expired" | "forbidden_read" | "forbidden_write" | "forbidden_publish" | "forbidden_keys" | "forbidden_audit" | "forbidden_media" | "key_too_wide" | "cross_site" | "invalid_slug" | "invalid_title" | "summary_too_long" | "body_too_long" | "invalid_keywords" | "forbidden_char" | "invalid_category" | "invalid_field" | "unknown_link" | "slug_locked" | "not_published" | "invalid_key_name" | "scopes_required" | "invalid_expiry" | "invalid_anchor" | "invalid_version" | "invalid_request" | "invalid_json" | "body_too_large" | "preview_disabled" | "media_disabled" | "asset_type_not_allowed" | "asset_type_mismatch" | "asset_too_large" | "invalid_folder" | "upload_incomplete" | "import_blocked" | "import_failed" | "asset_rejected" | "asset_missing" | "asset_wrong_kind" | "asset_alt_missing" | "asset_alt_empty" | "asset_private_in_public" | "no_public_url" | "schema_outdated" | "conflict_version" | "slug_taken" | "asset_in_use" | "folder_not_empty" | "slug_in_trash" | "in_other_release" | "comment_not_found" | "release_not_found" | "filter_not_found" | "trash_not_found" | "review_required" | "review_self" | "review_people_only" | "forbidden_trash" | "forbidden_filter" | "comments_off" | "review_not_requested" | "not_scheduled" | "release_closed" | "release_empty" | "release_blocked" | "schedule_invalid" | "comment_invalid" | "name_invalid" | "too_many_files" | "precondition_required";
|
|
139
|
+
error: "not_found" | "unknown_collection" | "forbidden" | "unauthorized" | "invalid" | "internal" | "version_not_found" | "key_not_found" | "route_not_found" | "asset_not_found" | "unknown_store" | "invalid_key" | "key_expired" | "preview_invalid" | "preview_expired" | "forbidden_read" | "forbidden_write" | "forbidden_publish" | "forbidden_keys" | "forbidden_audit" | "forbidden_media" | "key_too_wide" | "cross_site" | "invalid_slug" | "invalid_title" | "summary_too_long" | "body_too_long" | "invalid_keywords" | "forbidden_char" | "invalid_category" | "invalid_field" | "unknown_link" | "slug_locked" | "not_published" | "invalid_key_name" | "scopes_required" | "invalid_expiry" | "invalid_anchor" | "invalid_version" | "invalid_request" | "invalid_json" | "body_too_large" | "preview_disabled" | "media_disabled" | "asset_type_not_allowed" | "asset_type_mismatch" | "asset_too_large" | "invalid_folder" | "upload_incomplete" | "import_blocked" | "import_failed" | "asset_rejected" | "asset_replace_type" | "unknown_image_size" | "asset_missing" | "asset_wrong_kind" | "asset_alt_missing" | "asset_alt_empty" | "asset_private_in_public" | "no_public_url" | "schema_outdated" | "conflict_version" | "slug_taken" | "asset_in_use" | "folder_not_empty" | "slug_in_trash" | "in_other_release" | "comment_not_found" | "release_not_found" | "filter_not_found" | "trash_not_found" | "review_required" | "review_self" | "review_people_only" | "forbidden_trash" | "forbidden_filter" | "comments_off" | "review_not_requested" | "not_scheduled" | "release_closed" | "release_empty" | "release_blocked" | "schedule_invalid" | "comment_invalid" | "name_invalid" | "too_many_files" | "precondition_required";
|
|
138
140
|
kind: "not_found" | "unknown_collection" | "forbidden" | "unauthorized" | "invalid" | "conflict" | "precondition" | "internal";
|
|
139
141
|
message: string;
|
|
140
142
|
params: ErrorParams;
|
package/dist/errors.d.ts
CHANGED
|
@@ -60,6 +60,8 @@ declare const ERROR_CODES: {
|
|
|
60
60
|
readonly import_blocked: "invalid";
|
|
61
61
|
readonly import_failed: "invalid";
|
|
62
62
|
readonly asset_rejected: "invalid";
|
|
63
|
+
readonly asset_replace_type: "invalid";
|
|
64
|
+
readonly unknown_image_size: "not_found";
|
|
63
65
|
readonly asset_missing: "invalid";
|
|
64
66
|
readonly asset_wrong_kind: "invalid";
|
|
65
67
|
readonly asset_alt_missing: "invalid";
|
|
@@ -134,7 +136,7 @@ declare class CmsError extends Error {
|
|
|
134
136
|
toJSON(): {
|
|
135
137
|
current?: {} | null | undefined;
|
|
136
138
|
diagnostics?: Diagnostic[] | undefined;
|
|
137
|
-
error: "not_found" | "unknown_collection" | "forbidden" | "unauthorized" | "invalid" | "internal" | "version_not_found" | "key_not_found" | "route_not_found" | "asset_not_found" | "unknown_store" | "invalid_key" | "key_expired" | "preview_invalid" | "preview_expired" | "forbidden_read" | "forbidden_write" | "forbidden_publish" | "forbidden_keys" | "forbidden_audit" | "forbidden_media" | "key_too_wide" | "cross_site" | "invalid_slug" | "invalid_title" | "summary_too_long" | "body_too_long" | "invalid_keywords" | "forbidden_char" | "invalid_category" | "invalid_field" | "unknown_link" | "slug_locked" | "not_published" | "invalid_key_name" | "scopes_required" | "invalid_expiry" | "invalid_anchor" | "invalid_version" | "invalid_request" | "invalid_json" | "body_too_large" | "preview_disabled" | "media_disabled" | "asset_type_not_allowed" | "asset_type_mismatch" | "asset_too_large" | "invalid_folder" | "upload_incomplete" | "import_blocked" | "import_failed" | "asset_rejected" | "asset_missing" | "asset_wrong_kind" | "asset_alt_missing" | "asset_alt_empty" | "asset_private_in_public" | "no_public_url" | "schema_outdated" | "conflict_version" | "slug_taken" | "asset_in_use" | "folder_not_empty" | "slug_in_trash" | "in_other_release" | "comment_not_found" | "release_not_found" | "filter_not_found" | "trash_not_found" | "review_required" | "review_self" | "review_people_only" | "forbidden_trash" | "forbidden_filter" | "comments_off" | "review_not_requested" | "not_scheduled" | "release_closed" | "release_empty" | "release_blocked" | "schedule_invalid" | "comment_invalid" | "name_invalid" | "too_many_files" | "precondition_required";
|
|
139
|
+
error: "not_found" | "unknown_collection" | "forbidden" | "unauthorized" | "invalid" | "internal" | "version_not_found" | "key_not_found" | "route_not_found" | "asset_not_found" | "unknown_store" | "invalid_key" | "key_expired" | "preview_invalid" | "preview_expired" | "forbidden_read" | "forbidden_write" | "forbidden_publish" | "forbidden_keys" | "forbidden_audit" | "forbidden_media" | "key_too_wide" | "cross_site" | "invalid_slug" | "invalid_title" | "summary_too_long" | "body_too_long" | "invalid_keywords" | "forbidden_char" | "invalid_category" | "invalid_field" | "unknown_link" | "slug_locked" | "not_published" | "invalid_key_name" | "scopes_required" | "invalid_expiry" | "invalid_anchor" | "invalid_version" | "invalid_request" | "invalid_json" | "body_too_large" | "preview_disabled" | "media_disabled" | "asset_type_not_allowed" | "asset_type_mismatch" | "asset_too_large" | "invalid_folder" | "upload_incomplete" | "import_blocked" | "import_failed" | "asset_rejected" | "asset_replace_type" | "unknown_image_size" | "asset_missing" | "asset_wrong_kind" | "asset_alt_missing" | "asset_alt_empty" | "asset_private_in_public" | "no_public_url" | "schema_outdated" | "conflict_version" | "slug_taken" | "asset_in_use" | "folder_not_empty" | "slug_in_trash" | "in_other_release" | "comment_not_found" | "release_not_found" | "filter_not_found" | "trash_not_found" | "review_required" | "review_self" | "review_people_only" | "forbidden_trash" | "forbidden_filter" | "comments_off" | "review_not_requested" | "not_scheduled" | "release_closed" | "release_empty" | "release_blocked" | "schedule_invalid" | "comment_invalid" | "name_invalid" | "too_many_files" | "precondition_required";
|
|
138
140
|
kind: "not_found" | "unknown_collection" | "forbidden" | "unauthorized" | "invalid" | "conflict" | "precondition" | "internal";
|
|
139
141
|
message: string;
|
|
140
142
|
params: ErrorParams;
|
package/dist/errors.js
CHANGED