@vardum/shared 0.3.0 → 0.4.1

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/README.md CHANGED
@@ -1,18 +1,41 @@
1
1
  # @vardum/shared
2
2
 
3
- Wire types and the accepted-format tables shared by the Vardum API, dashboard,
3
+ Wire types and accepted-format tables shared by the Vardum API, dashboard,
4
4
  CLI and MCP server. Published because `@vardum/cli` and `@vardum/mcp` depend on
5
5
  it at runtime; it carries no dependencies of its own.
6
6
 
7
- This README describes shared **0.3.0**. It adds the exported `mediaStem` and `mediaOutputPath`
8
- helpers used by the CLI and API for consistent media names and output suffixes.
9
- The published client baseline uses shared **0.2.0**; see
10
- [release compatibility](https://github.com/f-tuma/vardum/blob/main/docs/npm-release.md#compatibility)
11
- for the corresponding CLI/MCP versions and unreleased candidates.
7
+ This README describes [shared **0.4.1**](https://www.npmjs.com/package/@vardum/shared/v/0.4.1),
8
+ used by CLI **0.8.1** and MCP **0.4.1**. This patch makes the package documentation
9
+ self-contained; it does not change the wire types or client snapshot schema.
12
10
 
13
- CLI 0.7.0 and MCP 0.3.0 retain `workspace:^` dependencies in source; the release
14
- archives require `@vardum/shared: ^0.3.0`, which npm resolves transitively.
11
+ Shared 0.4.0 adds the guarded-editor wire contract: `VardEditorDefinition`
12
+ requires the opaque `revision` and each manual item's literal nullable
13
+ `pinnedVersionId`; `VardEditorItemInput` requires an existing mapping `id` or
14
+ `null`, plus an explicit nullable `versionId`. Keep saved pins separate from
15
+ resolved delivery versions. It retains `mediaStem`, `mediaOutputPath`, format
16
+ tables. This client batch keeps CLI schema 2 snapshots; the wire manifest remains
17
+ schema 1. It does not introduce schema 3.
18
+
19
+ CLI 0.8.1 and MCP 0.4.1 retain `workspace:^` dependencies in source; their release
20
+ archives require `@vardum/shared: ^0.4.1`, which npm resolves transitively.
21
+
22
+ For a direct consumer, pin **shared 0.4.1**:
23
+
24
+ ```sh
25
+ npm install --save-exact @vardum/shared@0.4.1
26
+ ```
15
27
 
16
28
  ```ts
17
- import { mimeForFilename, supportedMimeTypes, type VardManifest } from "@vardum/shared";
29
+ import { mimeForFilename, supportedMimeTypes, type VardEditorDefinition } from "@vardum/shared";
18
30
  ```
31
+
32
+ Types alone do not enable backend features. Editable Vard reads and mutations
33
+ require a server advertising `vardEditRevision: 1` at `GET /api/capabilities`
34
+ and implementing the guarded `/editor` endpoints. Folder-upload mutation requires
35
+ `folderUploadResume: 1`; importing uploaded files into a Vard also requires
36
+ `folderVardImport: 1`. The upload backend needs migrations through
37
+ `0015_upload_request_checksum.sql` and ready-version checksum metadata.
38
+
39
+ Private delivery still needs a workspace read key. Keep API keys out of source
40
+ control and client-side applications; this package contains no authentication,
41
+ credential storage or server upgrades.
package/dist/wire.d.ts CHANGED
@@ -17,6 +17,8 @@ export type VardItem = {
17
17
  outputPath: string;
18
18
  writable: boolean;
19
19
  pinned: boolean;
20
+ /** Literal saved pin, supplied by the guarded editor even when the version is unavailable. */
21
+ pinnedVersionId?: string | null;
20
22
  transformation: Transformation | null;
21
23
  versionId: string | null;
22
24
  sourceChecksum: string | null;
@@ -44,6 +46,24 @@ export type VardFolderRule = {
44
46
  /** Editable configuration: items are manual mappings only, never expanded outputs. */
45
47
  export type VardDefinition = VardManifest & {
46
48
  folderRules: VardFolderRule[];
49
+ /** Opaque state-equivalence token supplied by guarded editor endpoints. */
50
+ revision?: string;
51
+ };
52
+ /** The dedicated editor always supplies its revision and literal pin IDs. */
53
+ export type VardEditorDefinition = VardDefinition & {
54
+ revision: string;
55
+ items: (VardItem & {
56
+ pinnedVersionId: string | null;
57
+ })[];
58
+ };
59
+ export type VardEditorItemInput = {
60
+ /** Existing manual mapping ID, or null to allocate a new mapping. */
61
+ id: string | null;
62
+ assetId: string;
63
+ versionId: string | null;
64
+ outputPath: string;
65
+ transformation: Transformation | null;
66
+ writable: boolean;
47
67
  };
48
68
  export type SyncAsset = {
49
69
  id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vardum/shared",
3
- "version": "0.3.0",
3
+ "version": "0.4.1",
4
4
  "description": "Shared Vardum wire types and accepted-format tables",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -25,7 +25,7 @@
25
25
  "url": "git+https://github.com/f-tuma/vardum.git",
26
26
  "directory": "packages/shared"
27
27
  },
28
- "homepage": "https://github.com/f-tuma/vardum/tree/main/packages/shared#readme",
28
+ "homepage": "https://vardum.com",
29
29
  "bugs": {
30
30
  "url": "https://github.com/f-tuma/vardum/issues"
31
31
  },