@kumwe/studio-testkit 0.1.0-alpha.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.
Files changed (101) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +39 -0
  3. package/conformance/rich-text/blocks.structural.json +57 -0
  4. package/conformance/rich-text/document.multi-block.json +74 -0
  5. package/conformance/rich-text/embed.hard-break.json +24 -0
  6. package/conformance/rich-text/marks.nested.json +29 -0
  7. package/conformance/rich-text/offsets.astral.json +24 -0
  8. package/conformance/rich-text/paragraph.plain.json +20 -0
  9. package/conformance/rich-text/spans.adjacent.json +27 -0
  10. package/dist/host-testbed.d.ts +40 -0
  11. package/dist/host-testbed.d.ts.map +1 -0
  12. package/dist/host-testbed.js +390 -0
  13. package/dist/host-testbed.js.map +1 -0
  14. package/dist/index.d.ts +29 -0
  15. package/dist/index.d.ts.map +1 -0
  16. package/dist/index.js +139 -0
  17. package/dist/index.js.map +1 -0
  18. package/fixtures/block.grid.example.json +76 -0
  19. package/fixtures/block.price.example.json +69 -0
  20. package/fixtures/blueprint.product.example.json +92 -0
  21. package/fixtures/command.move-node.example.json +18 -0
  22. package/fixtures/content-model.product.example.json +141 -0
  23. package/fixtures/entry.product.example.json +55 -0
  24. package/fixtures/host-capabilities.example.json +36 -0
  25. package/fixtures/host-error.conflict.example.json +23 -0
  26. package/fixtures/media-asset.example.json +29 -0
  27. package/fixtures/media-asset.processing.example.json +15 -0
  28. package/fixtures/media-reference.example.json +26 -0
  29. package/fixtures/media-upload-session.transferring.example.json +22 -0
  30. package/fixtures/pattern.example.json +49 -0
  31. package/fixtures/plugin.example.json +49 -0
  32. package/fixtures/preview.render.example.json +14 -0
  33. package/fixtures/provenance.example.json +38 -0
  34. package/fixtures/rich-text.example.json +48 -0
  35. package/fixtures/studio-config.example.json +139 -0
  36. package/fixtures/theme.example.json +123 -0
  37. package/fixtures/unresolved-contribution.example.json +23 -0
  38. package/invalid/blueprint.control-character-member.json +59 -0
  39. package/invalid/blueprint.forbidden-property-member.json +61 -0
  40. package/invalid/blueprint.invalid-node-id.json +57 -0
  41. package/invalid/blueprint.invalid-slot-name.json +59 -0
  42. package/invalid/blueprint.published-empty-roots.json +45 -0
  43. package/invalid/blueprint.unknown-member.json +58 -0
  44. package/invalid/command-vector.unknown-error-code.json +103 -0
  45. package/invalid/command.empty-batch.json +17 -0
  46. package/invalid/command.forbidden-id-map-member.json +20 -0
  47. package/invalid/command.negative-position.json +20 -0
  48. package/invalid/command.nested-batch.json +24 -0
  49. package/invalid/command.pattern-in-batch.json +40 -0
  50. package/invalid/command.reset-inherited-property-in-batch.json +24 -0
  51. package/invalid/command.unknown-member.json +23 -0
  52. package/invalid/command.wrong-contract-version.json +22 -0
  53. package/invalid/content-model.published-empty.json +22 -0
  54. package/invalid/entry.forbidden-value-member.json +23 -0
  55. package/invalid/entry.invalid-locale.json +59 -0
  56. package/invalid/host-capabilities.invalid-protocol-version.json +40 -0
  57. package/invalid/media-reference.missing-accessibility.json +25 -0
  58. package/invalid/media-upload-session.complete-without-asset.json +20 -0
  59. package/invalid/preview-message.invalid-digest.json +18 -0
  60. package/invalid/rich-text.embedded-html.json +13 -0
  61. package/invalid/rich-text.unknown-mark.json +19 -0
  62. package/invalid/theme.unknown-member.json +128 -0
  63. package/package.json +48 -0
  64. package/vectors/command/apply-pattern.colliding-id.error.json +97 -0
  65. package/vectors/command/apply-pattern.incomplete-id-map.error.json +111 -0
  66. package/vectors/command/apply-pattern.two-roots.json +259 -0
  67. package/vectors/command/batch.atomic-failure.error.json +100 -0
  68. package/vectors/command/batch.insert-and-configure.json +197 -0
  69. package/vectors/command/duplicate-node.existing-id.error.json +88 -0
  70. package/vectors/command/duplicate-node.explicit-destination.json +183 -0
  71. package/vectors/command/duplicate-node.incomplete-id-map.error.json +91 -0
  72. package/vectors/command/duplicate-node.subtree.json +201 -0
  73. package/vectors/command/insert-node.duplicate-id.error.json +87 -0
  74. package/vectors/command/insert-node.inner-duplicate-id.error.json +115 -0
  75. package/vectors/command/insert-node.invalid-index.error.json +87 -0
  76. package/vectors/command/insert-node.root.json +162 -0
  77. package/vectors/command/insert-node.slot.json +167 -0
  78. package/vectors/command/move-node.into-self.error.json +95 -0
  79. package/vectors/command/move-node.reparent.json +196 -0
  80. package/vectors/command/move-node.within-roots.json +188 -0
  81. package/vectors/command/remove-binding.base.json +159 -0
  82. package/vectors/command/remove-binding.missing.error.json +75 -0
  83. package/vectors/command/remove-node.empties-slot.json +167 -0
  84. package/vectors/command/remove-node.missing.error.json +74 -0
  85. package/vectors/command/remove-node.nested.json +192 -0
  86. package/vectors/command/reorder-children.not-permutation.error.json +85 -0
  87. package/vectors/command/reorder-children.roots.json +182 -0
  88. package/vectors/command/reorder-children.slot.json +192 -0
  89. package/vectors/command/reset-inherited-property.missing.error.json +82 -0
  90. package/vectors/command/reset-inherited-property.single-viewport.json +151 -0
  91. package/vectors/command/reset-inherited-property.two-viewports.json +168 -0
  92. package/vectors/command/restore-node.inner-duplicate-id.error.json +115 -0
  93. package/vectors/command/restore-node.subtree-into-slot.json +195 -0
  94. package/vectors/command/set-binding.add.json +159 -0
  95. package/vectors/command/set-binding.replace.json +178 -0
  96. package/vectors/command/set-property.add.json +143 -0
  97. package/vectors/command/set-property.replace.json +146 -0
  98. package/vectors/command/set-property.viewport-add.json +148 -0
  99. package/vectors/command/unset-property.base.json +143 -0
  100. package/vectors/command/unset-property.missing.error.json +75 -0
  101. package/vectors/command/unset-property.viewport.json +154 -0
@@ -0,0 +1,45 @@
1
+ {
2
+ "schema": "blueprint.schema.json",
3
+ "description": "A published Blueprint must compose at least one root node.",
4
+ "value": {
5
+ "contractVersion": "0.1-draft",
6
+ "dependencyLock": {
7
+ "blocks": [
8
+ {
9
+ "revision": "block-r1",
10
+ "type": "studio.vector/section",
11
+ "version": "1.0.0"
12
+ },
13
+ {
14
+ "revision": "block-r1",
15
+ "type": "studio.vector/text",
16
+ "version": "1.0.0"
17
+ }
18
+ ],
19
+ "theme": {
20
+ "id": "studio.vector/theme",
21
+ "revision": "theme-r1",
22
+ "version": "1.0.0"
23
+ }
24
+ },
25
+ "id": "vector.blueprint",
26
+ "kind": "blueprint",
27
+ "label": {
28
+ "defaultMessage": "Vector Blueprint",
29
+ "key": "studio.vector/blueprint"
30
+ },
31
+ "model": {
32
+ "id": "studio.vector/model",
33
+ "revision": "model-r1",
34
+ "version": "1.0.0"
35
+ },
36
+ "owner": {
37
+ "id": "studio.vector/suite",
38
+ "version": "0.1.0-alpha.0"
39
+ },
40
+ "revision": "blueprint-r1",
41
+ "roots": [],
42
+ "status": "published",
43
+ "version": "1.0.0"
44
+ }
45
+ }
@@ -0,0 +1,58 @@
1
+ {
2
+ "schema": "blueprint.schema.json",
3
+ "description": "A closed Blueprint document rejects unknown top-level members.",
4
+ "value": {
5
+ "contractVersion": "0.1-draft",
6
+ "dependencyLock": {
7
+ "blocks": [
8
+ {
9
+ "revision": "block-r1",
10
+ "type": "studio.vector/section",
11
+ "version": "1.0.0"
12
+ },
13
+ {
14
+ "revision": "block-r1",
15
+ "type": "studio.vector/text",
16
+ "version": "1.0.0"
17
+ }
18
+ ],
19
+ "theme": {
20
+ "id": "studio.vector/theme",
21
+ "revision": "theme-r1",
22
+ "version": "1.0.0"
23
+ }
24
+ },
25
+ "id": "vector.blueprint",
26
+ "kind": "blueprint",
27
+ "label": {
28
+ "defaultMessage": "Vector Blueprint",
29
+ "key": "studio.vector/blueprint"
30
+ },
31
+ "model": {
32
+ "id": "studio.vector/model",
33
+ "revision": "model-r1",
34
+ "version": "1.0.0"
35
+ },
36
+ "owner": {
37
+ "id": "studio.vector/suite",
38
+ "version": "0.1.0-alpha.0"
39
+ },
40
+ "revision": "blueprint-r1",
41
+ "roots": [
42
+ {
43
+ "authoring": {
44
+ "mode": "designer"
45
+ },
46
+ "bindings": {},
47
+ "id": "text-a",
48
+ "properties": {},
49
+ "slots": {},
50
+ "type": "studio.vector/text",
51
+ "version": "1.0.0"
52
+ }
53
+ ],
54
+ "status": "draft",
55
+ "version": "1.0.0",
56
+ "surprise": true
57
+ }
58
+ }
@@ -0,0 +1,103 @@
1
+ {
2
+ "schema": "command-vector.schema.json",
3
+ "description": "Command vectors only use the closed stable failure-code taxonomy.",
4
+ "value": {
5
+ "contractVersion": "0.1-draft",
6
+ "kind": "command-vector",
7
+ "id": "vector.command-vector.insert-node.root",
8
+ "description": "Inserting a node at a root position appends it exactly there; the inverse removal restores the prior document.",
9
+ "initial": {
10
+ "contractVersion": "0.1-draft",
11
+ "dependencyLock": {
12
+ "blocks": [
13
+ {
14
+ "revision": "block-r1",
15
+ "type": "studio.vector/section",
16
+ "version": "1.0.0"
17
+ },
18
+ {
19
+ "revision": "block-r1",
20
+ "type": "studio.vector/text",
21
+ "version": "1.0.0"
22
+ }
23
+ ],
24
+ "theme": {
25
+ "id": "studio.vector/theme",
26
+ "revision": "theme-r1",
27
+ "version": "1.0.0"
28
+ }
29
+ },
30
+ "id": "vector.blueprint",
31
+ "kind": "blueprint",
32
+ "label": {
33
+ "defaultMessage": "Vector Blueprint",
34
+ "key": "studio.vector/blueprint"
35
+ },
36
+ "model": {
37
+ "id": "studio.vector/model",
38
+ "revision": "model-r1",
39
+ "version": "1.0.0"
40
+ },
41
+ "owner": {
42
+ "id": "studio.vector/suite",
43
+ "version": "0.1.0-alpha.0"
44
+ },
45
+ "revision": "blueprint-r1",
46
+ "roots": [
47
+ {
48
+ "authoring": {
49
+ "mode": "designer"
50
+ },
51
+ "bindings": {},
52
+ "id": "text-a",
53
+ "properties": {},
54
+ "slots": {},
55
+ "type": "studio.vector/text",
56
+ "version": "1.0.0"
57
+ }
58
+ ],
59
+ "status": "draft",
60
+ "version": "1.0.0"
61
+ },
62
+ "command": {
63
+ "artifactId": "vector.blueprint",
64
+ "baseStateVersion": 0,
65
+ "contractVersion": "0.1-draft",
66
+ "id": "vector.command.insert-node.root",
67
+ "kind": "command",
68
+ "payload": {
69
+ "destination": {
70
+ "position": 1
71
+ },
72
+ "node": {
73
+ "authoring": {
74
+ "mode": "designer"
75
+ },
76
+ "bindings": {},
77
+ "id": "text-b",
78
+ "properties": {},
79
+ "slots": {},
80
+ "type": "studio.vector/text",
81
+ "version": "1.0.0"
82
+ }
83
+ },
84
+ "sessionGeneration": "session-r1",
85
+ "type": "studio.command/insert-node"
86
+ },
87
+ "expect": {
88
+ "errorCode": "mystery-error"
89
+ },
90
+ "inverse": {
91
+ "artifactId": "vector.blueprint",
92
+ "baseStateVersion": 1,
93
+ "contractVersion": "0.1-draft",
94
+ "id": "vector.inverse.insert-node.root",
95
+ "kind": "command",
96
+ "payload": {
97
+ "nodeId": "text-b"
98
+ },
99
+ "sessionGeneration": "session-r1",
100
+ "type": "studio.command/remove-node"
101
+ }
102
+ }
103
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "schema": "command.schema.json",
3
+ "description": "A batch must contain at least one operation.",
4
+ "value": {
5
+ "contractVersion": "0.1-draft",
6
+ "kind": "command",
7
+ "id": "command-01J5",
8
+ "type": "studio.command/batch",
9
+ "artifactId": "org.example.blueprints/product-card",
10
+ "expectedRevision": "product-card-r5",
11
+ "sessionGeneration": "session-generation-1",
12
+ "baseStateVersion": 12,
13
+ "payload": {
14
+ "operations": []
15
+ }
16
+ }
17
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "schema": "command.schema.json",
3
+ "description": "Duplicate identifier maps reject prototype-polluting member names.",
4
+ "value": {
5
+ "contractVersion": "0.1-draft",
6
+ "kind": "command",
7
+ "id": "command-01J5",
8
+ "type": "studio.command/duplicate-node",
9
+ "artifactId": "org.example.blueprints/product-card",
10
+ "expectedRevision": "product-card-r5",
11
+ "sessionGeneration": "session-generation-1",
12
+ "baseStateVersion": 12,
13
+ "payload": {
14
+ "nodeId": "node-a",
15
+ "idMap": {
16
+ "__proto__": "node-b"
17
+ }
18
+ }
19
+ }
20
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "schema": "command.schema.json",
3
+ "description": "Destination positions are non-negative integers.",
4
+ "value": {
5
+ "contractVersion": "0.1-draft",
6
+ "kind": "command",
7
+ "id": "command-01J5",
8
+ "type": "studio.command/move-node",
9
+ "artifactId": "org.example.blueprints/product-card",
10
+ "expectedRevision": "product-card-r5",
11
+ "sessionGeneration": "session-generation-1",
12
+ "baseStateVersion": 12,
13
+ "payload": {
14
+ "nodeId": "node-price",
15
+ "destination": {
16
+ "position": -1
17
+ }
18
+ }
19
+ }
20
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "schema": "command.schema.json",
3
+ "description": "A batch operation cannot contain another batch.",
4
+ "value": {
5
+ "contractVersion": "0.1-draft",
6
+ "kind": "command",
7
+ "id": "command-01J5",
8
+ "type": "studio.command/batch",
9
+ "artifactId": "org.example.blueprints/product-card",
10
+ "expectedRevision": "product-card-r5",
11
+ "sessionGeneration": "session-generation-1",
12
+ "baseStateVersion": 12,
13
+ "payload": {
14
+ "operations": [
15
+ {
16
+ "type": "studio.command/batch",
17
+ "payload": {
18
+ "operations": []
19
+ }
20
+ }
21
+ ]
22
+ }
23
+ }
24
+ }
@@ -0,0 +1,40 @@
1
+ {
2
+ "schema": "command.schema.json",
3
+ "description": "Pattern application cannot nest inside a batch because its inverse is itself a batch.",
4
+ "value": {
5
+ "artifactId": "vector.blueprint",
6
+ "baseStateVersion": 0,
7
+ "contractVersion": "0.1-draft",
8
+ "id": "vector.command.pattern-in-batch",
9
+ "kind": "command",
10
+ "payload": {
11
+ "operations": [
12
+ {
13
+ "type": "studio.command/apply-pattern",
14
+ "payload": {
15
+ "destination": { "position": 0 },
16
+ "idMap": { "text-p": "text-p1" },
17
+ "nodes": [
18
+ {
19
+ "authoring": { "mode": "designer" },
20
+ "bindings": {},
21
+ "id": "text-p",
22
+ "properties": {},
23
+ "slots": {},
24
+ "type": "studio.vector/text",
25
+ "version": "1.0.0"
26
+ }
27
+ ],
28
+ "pattern": {
29
+ "id": "patterns/hero-with-caption",
30
+ "revision": "pattern-r3",
31
+ "version": "1.2.0"
32
+ }
33
+ }
34
+ }
35
+ ]
36
+ },
37
+ "sessionGeneration": "session-r1",
38
+ "type": "studio.command/batch"
39
+ }
40
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "schema": "command.schema.json",
3
+ "description": "Inheritance reset cannot nest inside a batch because its inverse is itself a batch.",
4
+ "value": {
5
+ "artifactId": "vector.blueprint",
6
+ "baseStateVersion": 0,
7
+ "contractVersion": "0.1-draft",
8
+ "id": "vector.command.reset-inherited-property-in-batch",
9
+ "kind": "command",
10
+ "payload": {
11
+ "operations": [
12
+ {
13
+ "type": "studio.command/reset-inherited-property",
14
+ "payload": {
15
+ "nodeId": "text-a",
16
+ "property": "emphasis"
17
+ }
18
+ }
19
+ ]
20
+ },
21
+ "sessionGeneration": "session-r1",
22
+ "type": "studio.command/batch"
23
+ }
24
+ }
@@ -0,0 +1,23 @@
1
+ {
2
+ "schema": "command.schema.json",
3
+ "description": "The closed command envelope rejects unknown members.",
4
+ "value": {
5
+ "contractVersion": "0.1-draft",
6
+ "kind": "command",
7
+ "id": "command-01J5",
8
+ "type": "studio.command/move-node",
9
+ "artifactId": "org.example.blueprints/product-card",
10
+ "expectedRevision": "product-card-r5",
11
+ "sessionGeneration": "session-generation-1",
12
+ "baseStateVersion": 12,
13
+ "payload": {
14
+ "nodeId": "node-price",
15
+ "destination": {
16
+ "parentNodeId": "node-grid",
17
+ "slot": "items",
18
+ "position": 0
19
+ }
20
+ },
21
+ "audit": "unexpected"
22
+ }
23
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "schema": "command.schema.json",
3
+ "description": "Commands pin the exact draft contract version.",
4
+ "value": {
5
+ "contractVersion": "9.9-final",
6
+ "kind": "command",
7
+ "id": "command-01J5",
8
+ "type": "studio.command/move-node",
9
+ "artifactId": "org.example.blueprints/product-card",
10
+ "expectedRevision": "product-card-r5",
11
+ "sessionGeneration": "session-generation-1",
12
+ "baseStateVersion": 12,
13
+ "payload": {
14
+ "nodeId": "node-price",
15
+ "destination": {
16
+ "parentNodeId": "node-grid",
17
+ "slot": "items",
18
+ "position": 0
19
+ }
20
+ }
21
+ }
22
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "schema": "content-model.schema.json",
3
+ "description": "A published content model must declare at least one field or relationship.",
4
+ "value": {
5
+ "contractVersion": "0.1-draft",
6
+ "kind": "content-model",
7
+ "id": "org.example.models/product",
8
+ "version": "1.0.0",
9
+ "revision": "product-model-r1",
10
+ "owner": {
11
+ "id": "org.example/catalog",
12
+ "version": "1.0.0"
13
+ },
14
+ "status": "published",
15
+ "label": {
16
+ "key": "org.example.catalog/product-model",
17
+ "defaultMessage": "Product"
18
+ },
19
+ "fields": [],
20
+ "relationships": []
21
+ }
22
+ }
@@ -0,0 +1,23 @@
1
+ {
2
+ "schema": "entry.schema.json",
3
+ "description": "Entry values reject prototype-polluting member names.",
4
+ "value": {
5
+ "contractVersion": "0.1-draft",
6
+ "kind": "entry",
7
+ "id": "products/trail-backpack",
8
+ "revision": "entry-r7",
9
+ "model": {
10
+ "id": "org.example.models/product",
11
+ "version": "1.0.0",
12
+ "revision": "product-model-r1"
13
+ },
14
+ "status": "draft",
15
+ "locale": "en-NA",
16
+ "workflowState": "org.example.catalog/draft",
17
+ "values": {
18
+ "__proto__": {
19
+ "polluted": true
20
+ }
21
+ }
22
+ }
23
+ }
@@ -0,0 +1,59 @@
1
+ {
2
+ "schema": "entry.schema.json",
3
+ "description": "Entry locales follow the canonical language-tag profile.",
4
+ "value": {
5
+ "contractVersion": "0.1-draft",
6
+ "kind": "entry",
7
+ "id": "products/trail-backpack",
8
+ "revision": "entry-r7",
9
+ "model": {
10
+ "id": "org.example.models/product",
11
+ "version": "1.0.0",
12
+ "revision": "product-model-r1"
13
+ },
14
+ "status": "draft",
15
+ "locale": "not a locale!",
16
+ "workflowState": "org.example.catalog/draft",
17
+ "values": {
18
+ "name": "Trail Backpack",
19
+ "featured": false,
20
+ "category": {
21
+ "resourceType": "org.example.models/category",
22
+ "id": "categories/outdoor"
23
+ },
24
+ "price": {
25
+ "amount": "1499.00",
26
+ "currency": "NAD"
27
+ },
28
+ "image": {
29
+ "contractVersion": "0.1-draft",
30
+ "kind": "media-reference",
31
+ "assetId": "media/trail-backpack-front",
32
+ "assetRevision": "media-r4",
33
+ "usage": "org.example.catalog/product-hero",
34
+ "renditionIntent": {
35
+ "role": "hero",
36
+ "fit": "cover"
37
+ },
38
+ "accessibility": {
39
+ "mode": "informative",
40
+ "altText": "Green trail backpack shown from the front"
41
+ }
42
+ },
43
+ "description": {
44
+ "type": "doc",
45
+ "content": [
46
+ {
47
+ "type": "paragraph",
48
+ "content": [
49
+ {
50
+ "type": "text",
51
+ "text": "A durable pack for long days outdoors."
52
+ }
53
+ ]
54
+ }
55
+ ]
56
+ }
57
+ }
58
+ }
59
+ }
@@ -0,0 +1,40 @@
1
+ {
2
+ "schema": "host-capabilities.schema.json",
3
+ "description": "Protocol versions are canonical semantic versions.",
4
+ "value": {
5
+ "contractVersion": "0.1-draft",
6
+ "kind": "host-capabilities",
7
+ "host": {
8
+ "id": "org.kumwe/cms",
9
+ "version": "3.0.0-alpha.1",
10
+ "generation": "runtime-generation-42"
11
+ },
12
+ "protocolVersions": ["v1"],
13
+ "ports": [
14
+ {
15
+ "id": "studio.port/artifact",
16
+ "version": "1.0.0",
17
+ "operations": ["studio.operation/load", "studio.operation/save", "studio.operation/publish"]
18
+ },
19
+ {
20
+ "id": "studio.port/preview",
21
+ "version": "1.0.0",
22
+ "operations": ["studio.operation/render-preview", "studio.operation/cancel-preview"]
23
+ },
24
+ {
25
+ "id": "studio.port/media",
26
+ "version": "1.0.0",
27
+ "operations": ["studio.operation/search-media", "studio.operation/upload-media"]
28
+ }
29
+ ],
30
+ "capabilities": [
31
+ {
32
+ "id": "studio.host/server-rendered-preview",
33
+ "version": "1.0.0",
34
+ "configuration": {
35
+ "exact": true
36
+ }
37
+ }
38
+ ]
39
+ }
40
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "schema": "media-reference.schema.json",
3
+ "description": "Every media reference declares an explicit accessibility mode.",
4
+ "value": {
5
+ "contractVersion": "0.1-draft",
6
+ "kind": "media-reference",
7
+ "assetId": "media/trail-backpack-front",
8
+ "assetRevision": "media-r4",
9
+ "usage": "org.example.catalog/product-hero",
10
+ "renditionIntent": {
11
+ "role": "hero",
12
+ "fit": "cover",
13
+ "preferredMediaTypes": ["image/avif", "image/webp"]
14
+ },
15
+ "focalPoint": {
16
+ "x": 0.5,
17
+ "y": 0.46
18
+ },
19
+ "cropIntent": {
20
+ "mode": "aspect-ratio",
21
+ "width": 4,
22
+ "height": 3
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "schema": "media-upload-session.schema.json",
3
+ "description": "A complete upload session must carry the accepted stable asset identity.",
4
+ "value": {
5
+ "contractVersion": "0.1-draft",
6
+ "kind": "media-upload-session",
7
+ "id": "uploads/2b6f0d31",
8
+ "request": {
9
+ "filename": "trail-backpack-side.jpg",
10
+ "mediaType": "image/jpeg",
11
+ "byteSize": 3145728,
12
+ "purpose": "org.example.catalog/product-gallery"
13
+ },
14
+ "state": "complete",
15
+ "progress": {
16
+ "transferredBytes": 3145728,
17
+ "totalBytes": 3145728
18
+ }
19
+ }
20
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "schema": "preview-message.schema.json",
3
+ "description": "Render digests are lower-case hex sha-256 values.",
4
+ "value": {
5
+ "contractVersion": "0.1-draft",
6
+ "kind": "preview-message",
7
+ "channelId": "preview-channel-7f8d",
8
+ "sessionGeneration": "session-generation-1",
9
+ "sequence": 14,
10
+ "type": "studio.preview/render",
11
+ "payload": {
12
+ "artifactId": "org.example.blueprints/product-card",
13
+ "draftDigest": "not-a-digest",
14
+ "draftRevision": "product-card-r5-local-12",
15
+ "viewport": "expanded"
16
+ }
17
+ }
18
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "schema": "rich-text.schema.json",
3
+ "description": "Rich text stores structured nodes only; raw HTML payloads are rejected.",
4
+ "value": {
5
+ "type": "doc",
6
+ "content": [
7
+ {
8
+ "type": "html",
9
+ "value": "<script>alert(1)</script>"
10
+ }
11
+ ]
12
+ }
13
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "schema": "rich-text.schema.json",
3
+ "description": "Rich text only carries the closed portable mark set; unknown marks such as scripts are rejected.",
4
+ "value": {
5
+ "type": "doc",
6
+ "content": [
7
+ {
8
+ "type": "paragraph",
9
+ "content": [
10
+ {
11
+ "type": "text",
12
+ "text": "styled",
13
+ "marks": [{ "type": "script" }]
14
+ }
15
+ ]
16
+ }
17
+ ]
18
+ }
19
+ }