@murumets-ee/content 0.1.1 → 0.1.2
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/package.json +11 -17
- package/dist/blocks/index.cjs +0 -1
- package/dist/blocks/index.d.cts +0 -187
- package/dist/blocks/index.d.ts +0 -187
- package/dist/client.cjs +0 -1
- package/dist/client.d.cts +0 -215
- package/dist/client.d.ts +0 -215
- package/dist/index.cjs +0 -1
- package/dist/index.d.cts +0 -142
- package/dist/index.d.ts +0 -142
- package/dist/lock-service.cjs +0 -1
- package/dist/lock-service.d.cts +0 -61
- package/dist/lock-service.d.ts +0 -61
- package/dist/plugin.cjs +0 -1
- package/dist/plugin.d.cts +0 -33
- package/dist/plugin.d.ts +0 -33
- package/dist/query-client.cjs +0 -1
- package/dist/query-client.d.cts +0 -67
- package/dist/query-client.d.ts +0 -67
- package/dist/types-BYeiE1ie.d.cts +0 -99
- package/dist/types-BYeiE1ie.d.ts +0 -99
- package/dist/types-Cr0ifLn_.d.cts +0 -41
- package/dist/types-Cr0ifLn_.d.ts +0 -41
package/dist/types-BYeiE1ie.d.ts
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { FieldConfig, InferEntityDTO } from '@murumets-ee/entity';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Content package types
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* A block definition — describes a reusable content block's data shape.
|
|
9
|
-
*
|
|
10
|
-
* @typeParam F - The literal field map, inferred from the call site.
|
|
11
|
-
*/
|
|
12
|
-
interface BlockDefinition<F extends Record<string, FieldConfig> = Record<string, FieldConfig>> {
|
|
13
|
-
slug: string;
|
|
14
|
-
label: string;
|
|
15
|
-
fields: F;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Infer the data shape of a single block definition.
|
|
19
|
-
* Produces `{ _block: 'hero'; _id: string; heading: string; ... }`
|
|
20
|
-
*/
|
|
21
|
-
type InferBlockData<B extends BlockDefinition> = B extends BlockDefinition<infer F> ? {
|
|
22
|
-
_block: B['slug'];
|
|
23
|
-
_id: string;
|
|
24
|
-
} & Omit<InferEntityDTO<F>, 'id'> : never;
|
|
25
|
-
/**
|
|
26
|
-
* Infer a discriminated union from a tuple of block definitions.
|
|
27
|
-
*
|
|
28
|
-
* @example
|
|
29
|
-
* type Layout = InferBlocksUnion<typeof [HeroBlock, RichTextBlock]>
|
|
30
|
-
* // = { _block: 'hero'; ... } | { _block: 'richtext'; ... }
|
|
31
|
-
*/
|
|
32
|
-
type InferBlocksUnion<T extends readonly BlockDefinition[]> = {
|
|
33
|
-
[K in keyof T]: T[K] extends BlockDefinition ? InferBlockData<T[K]> : never;
|
|
34
|
-
}[number];
|
|
35
|
-
interface LocaleConfig {
|
|
36
|
-
code: string;
|
|
37
|
-
label: string;
|
|
38
|
-
}
|
|
39
|
-
interface ContentConfig {
|
|
40
|
-
locales: LocaleConfig[];
|
|
41
|
-
defaultLocale: string;
|
|
42
|
-
}
|
|
43
|
-
interface VersionableOptions {
|
|
44
|
-
/** Maximum versions kept per document. Default: 50 */
|
|
45
|
-
maxPerDoc?: number;
|
|
46
|
-
/** Enable autosave (single mutable autosave version). Default: false */
|
|
47
|
-
autosave?: boolean;
|
|
48
|
-
}
|
|
49
|
-
interface VersionEntry {
|
|
50
|
-
id: string;
|
|
51
|
-
entityId: string;
|
|
52
|
-
version: number;
|
|
53
|
-
locale: string;
|
|
54
|
-
data: Record<string, unknown>;
|
|
55
|
-
delta: Record<string, unknown> | null;
|
|
56
|
-
status: string | null;
|
|
57
|
-
createdBy: string | null;
|
|
58
|
-
createdByName: string | null;
|
|
59
|
-
createdAt: Date | string;
|
|
60
|
-
isAutosave: boolean;
|
|
61
|
-
}
|
|
62
|
-
interface TranslationFieldStatus {
|
|
63
|
-
complete: boolean;
|
|
64
|
-
total: number;
|
|
65
|
-
translated: number;
|
|
66
|
-
missing: string[];
|
|
67
|
-
}
|
|
68
|
-
interface TranslationStatus {
|
|
69
|
-
[locale: string]: TranslationFieldStatus;
|
|
70
|
-
}
|
|
71
|
-
interface TranslationReport {
|
|
72
|
-
total: number;
|
|
73
|
-
complete: number;
|
|
74
|
-
partial: number;
|
|
75
|
-
missing: number;
|
|
76
|
-
}
|
|
77
|
-
interface LocalePublishStatus {
|
|
78
|
-
locale: string;
|
|
79
|
-
status: 'draft' | 'published';
|
|
80
|
-
publishedAt: Date | string | null;
|
|
81
|
-
}
|
|
82
|
-
interface DraftEntry {
|
|
83
|
-
id: string;
|
|
84
|
-
entityId: string;
|
|
85
|
-
locale: string;
|
|
86
|
-
data: Record<string, unknown>;
|
|
87
|
-
createdBy: string;
|
|
88
|
-
createdByName: string | null;
|
|
89
|
-
createdAt: Date | string;
|
|
90
|
-
updatedAt: Date | string;
|
|
91
|
-
}
|
|
92
|
-
interface LockInfo {
|
|
93
|
-
lockedBy: string;
|
|
94
|
-
lockedByName: string | null;
|
|
95
|
-
lockedAt: Date | string;
|
|
96
|
-
expiresAt: Date | string;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
export type { BlockDefinition as B, ContentConfig as C, DraftEntry as D, InferBlockData as I, LocalePublishStatus as L, TranslationStatus as T, VersionEntry as V, TranslationReport as a, VersionableOptions as b, InferBlocksUnion as c, LocaleConfig as d, LockInfo as e, TranslationFieldStatus as f };
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Diff result types for version comparison.
|
|
3
|
-
*/
|
|
4
|
-
/** A segment within a word-level text diff. */
|
|
5
|
-
interface DiffSegment {
|
|
6
|
-
type: 'equal' | 'add' | 'remove';
|
|
7
|
-
value: string;
|
|
8
|
-
}
|
|
9
|
-
/** Diff result for a single scalar field. */
|
|
10
|
-
interface FieldDiff {
|
|
11
|
-
field: string;
|
|
12
|
-
type: 'text' | 'number' | 'boolean' | 'date' | 'select' | 'media' | 'richtext' | 'json' | 'blocks' | 'unknown';
|
|
13
|
-
from: unknown;
|
|
14
|
-
to: unknown;
|
|
15
|
-
/** Word-level diff segments (present for text/richtext/slug fields). */
|
|
16
|
-
segments?: DiffSegment[];
|
|
17
|
-
/** Block-level structural diff (present for blocks fields). */
|
|
18
|
-
blockDiffs?: BlockDiffEntry[];
|
|
19
|
-
}
|
|
20
|
-
/** Status of a single block within a structural diff. */
|
|
21
|
-
type BlockDiffStatus = 'added' | 'removed' | 'moved' | 'changed' | 'unchanged';
|
|
22
|
-
/** Diff result for a single block within a blocks field. */
|
|
23
|
-
interface BlockDiffEntry {
|
|
24
|
-
blockId: string;
|
|
25
|
-
blockType: string;
|
|
26
|
-
status: BlockDiffStatus;
|
|
27
|
-
fromIndex?: number;
|
|
28
|
-
toIndex?: number;
|
|
29
|
-
/** Per-prop diffs for changed blocks. */
|
|
30
|
-
propDiffs?: PropDiff[];
|
|
31
|
-
}
|
|
32
|
-
/** Diff for a single prop within a changed block. */
|
|
33
|
-
interface PropDiff {
|
|
34
|
-
field: string;
|
|
35
|
-
from: unknown;
|
|
36
|
-
to: unknown;
|
|
37
|
-
/** Word-level segments for string props. */
|
|
38
|
-
segments?: DiffSegment[];
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export type { BlockDiffEntry as B, DiffSegment as D, FieldDiff as F, PropDiff as P, BlockDiffStatus as a };
|
package/dist/types-Cr0ifLn_.d.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Diff result types for version comparison.
|
|
3
|
-
*/
|
|
4
|
-
/** A segment within a word-level text diff. */
|
|
5
|
-
interface DiffSegment {
|
|
6
|
-
type: 'equal' | 'add' | 'remove';
|
|
7
|
-
value: string;
|
|
8
|
-
}
|
|
9
|
-
/** Diff result for a single scalar field. */
|
|
10
|
-
interface FieldDiff {
|
|
11
|
-
field: string;
|
|
12
|
-
type: 'text' | 'number' | 'boolean' | 'date' | 'select' | 'media' | 'richtext' | 'json' | 'blocks' | 'unknown';
|
|
13
|
-
from: unknown;
|
|
14
|
-
to: unknown;
|
|
15
|
-
/** Word-level diff segments (present for text/richtext/slug fields). */
|
|
16
|
-
segments?: DiffSegment[];
|
|
17
|
-
/** Block-level structural diff (present for blocks fields). */
|
|
18
|
-
blockDiffs?: BlockDiffEntry[];
|
|
19
|
-
}
|
|
20
|
-
/** Status of a single block within a structural diff. */
|
|
21
|
-
type BlockDiffStatus = 'added' | 'removed' | 'moved' | 'changed' | 'unchanged';
|
|
22
|
-
/** Diff result for a single block within a blocks field. */
|
|
23
|
-
interface BlockDiffEntry {
|
|
24
|
-
blockId: string;
|
|
25
|
-
blockType: string;
|
|
26
|
-
status: BlockDiffStatus;
|
|
27
|
-
fromIndex?: number;
|
|
28
|
-
toIndex?: number;
|
|
29
|
-
/** Per-prop diffs for changed blocks. */
|
|
30
|
-
propDiffs?: PropDiff[];
|
|
31
|
-
}
|
|
32
|
-
/** Diff for a single prop within a changed block. */
|
|
33
|
-
interface PropDiff {
|
|
34
|
-
field: string;
|
|
35
|
-
from: unknown;
|
|
36
|
-
to: unknown;
|
|
37
|
-
/** Word-level segments for string props. */
|
|
38
|
-
segments?: DiffSegment[];
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export type { BlockDiffEntry as B, DiffSegment as D, FieldDiff as F, PropDiff as P, BlockDiffStatus as a };
|