@kumwe/studio-protocol 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 (42) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +22 -0
  3. package/dist/guards.d.ts +4 -0
  4. package/dist/guards.d.ts.map +1 -0
  5. package/dist/guards.js +288 -0
  6. package/dist/guards.js.map +1 -0
  7. package/dist/index.d.ts +4 -0
  8. package/dist/index.d.ts.map +1 -0
  9. package/dist/index.js +4 -0
  10. package/dist/index.js.map +1 -0
  11. package/dist/schemas.d.ts +24 -0
  12. package/dist/schemas.d.ts.map +1 -0
  13. package/dist/schemas.js +66 -0
  14. package/dist/schemas.js.map +1 -0
  15. package/dist/types.d.ts +989 -0
  16. package/dist/types.d.ts.map +1 -0
  17. package/dist/types.js +3 -0
  18. package/dist/types.js.map +1 -0
  19. package/package.json +38 -0
  20. package/schemas/block-definition.schema.json +218 -0
  21. package/schemas/blueprint.schema.json +236 -0
  22. package/schemas/command-vector.schema.json +64 -0
  23. package/schemas/command.schema.json +373 -0
  24. package/schemas/common.schema.json +222 -0
  25. package/schemas/content-model.schema.json +216 -0
  26. package/schemas/entry.schema.json +32 -0
  27. package/schemas/host-capabilities.schema.json +64 -0
  28. package/schemas/host-error.schema.json +42 -0
  29. package/schemas/manifest.json +117 -0
  30. package/schemas/media-asset.schema.json +83 -0
  31. package/schemas/media-reference.schema.json +112 -0
  32. package/schemas/media-upload-session.schema.json +109 -0
  33. package/schemas/pattern.schema.json +50 -0
  34. package/schemas/plugin-manifest.schema.json +124 -0
  35. package/schemas/preview-message.schema.json +226 -0
  36. package/schemas/provenance.schema.json +57 -0
  37. package/schemas/rich-text-projection.schema.json +70 -0
  38. package/schemas/rich-text.schema.json +174 -0
  39. package/schemas/schema-profile.schema.json +161 -0
  40. package/schemas/studio-config.schema.json +244 -0
  41. package/schemas/theme.schema.json +164 -0
  42. package/schemas/unresolved-contribution.schema.json +48 -0
@@ -0,0 +1,216 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schemas.kumwe.org/studio/v1/content-model.schema.json",
4
+ "title": "Studio content model",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "contractVersion",
9
+ "kind",
10
+ "id",
11
+ "version",
12
+ "revision",
13
+ "owner",
14
+ "status",
15
+ "label",
16
+ "fields",
17
+ "relationships"
18
+ ],
19
+ "properties": {
20
+ "contractVersion": { "$ref": "common.schema.json#/$defs/contractVersion" },
21
+ "kind": { "const": "content-model" },
22
+ "id": { "$ref": "common.schema.json#/$defs/stableId" },
23
+ "version": { "$ref": "common.schema.json#/$defs/semanticVersion" },
24
+ "revision": { "$ref": "common.schema.json#/$defs/revision" },
25
+ "owner": { "$ref": "common.schema.json#/$defs/ownerReference" },
26
+ "status": { "enum": ["draft", "published", "retired"] },
27
+ "label": { "$ref": "common.schema.json#/$defs/messageReference" },
28
+ "description": { "$ref": "common.schema.json#/$defs/messageReference" },
29
+ "fields": {
30
+ "type": "array",
31
+ "minItems": 0,
32
+ "maxItems": 1000,
33
+ "items": { "$ref": "#/$defs/field" }
34
+ },
35
+ "relationships": {
36
+ "type": "array",
37
+ "maxItems": 1000,
38
+ "items": { "$ref": "#/$defs/relationship" }
39
+ },
40
+ "extensions": { "$ref": "common.schema.json#/$defs/extensions" }
41
+ },
42
+ "allOf": [
43
+ {
44
+ "if": {
45
+ "properties": { "status": { "const": "published" } },
46
+ "required": ["status"]
47
+ },
48
+ "then": {
49
+ "properties": {
50
+ "fields": { "type": "array", "minItems": 1 }
51
+ }
52
+ }
53
+ }
54
+ ],
55
+ "$defs": {
56
+ "field": {
57
+ "type": "object",
58
+ "additionalProperties": false,
59
+ "required": ["id", "kind", "label", "required", "localized", "cardinality"],
60
+ "properties": {
61
+ "id": { "$ref": "common.schema.json#/$defs/localName" },
62
+ "kind": {
63
+ "oneOf": [
64
+ {
65
+ "enum": [
66
+ "string",
67
+ "rich-text",
68
+ "boolean",
69
+ "integer",
70
+ "decimal",
71
+ "money",
72
+ "date",
73
+ "date-time",
74
+ "enum",
75
+ "media",
76
+ "resource",
77
+ "object",
78
+ "collection"
79
+ ]
80
+ },
81
+ { "$ref": "common.schema.json#/$defs/qualifiedName" }
82
+ ]
83
+ },
84
+ "label": { "$ref": "common.schema.json#/$defs/messageReference" },
85
+ "description": { "$ref": "common.schema.json#/$defs/messageReference" },
86
+ "required": { "type": "boolean" },
87
+ "localized": { "type": "boolean" },
88
+ "cardinality": { "enum": ["one", "many"] },
89
+ "semanticRole": { "$ref": "common.schema.json#/$defs/qualifiedName" },
90
+ "defaultValue": { "$ref": "common.schema.json#/$defs/jsonValue" },
91
+ "authoring": { "$ref": "#/$defs/authoringMetadata" },
92
+ "constraints": {
93
+ "type": "object",
94
+ "additionalProperties": false,
95
+ "properties": {
96
+ "minimum": {
97
+ "type": "string",
98
+ "pattern": "^-?(0|[1-9][0-9]*)(?:\\.[0-9]+)?(?![\\s\\S])",
99
+ "maxLength": 200
100
+ },
101
+ "maximum": {
102
+ "type": "string",
103
+ "pattern": "^-?(0|[1-9][0-9]*)(?:\\.[0-9]+)?(?![\\s\\S])",
104
+ "maxLength": 200
105
+ },
106
+ "scale": { "type": "integer", "minimum": 0, "maximum": 100 },
107
+ "minLength": { "type": "integer", "minimum": 0, "maximum": 10000000 },
108
+ "maxLength": { "type": "integer", "minimum": 0, "maximum": 10000000 },
109
+ "validator": {
110
+ "$ref": "common.schema.json#/$defs/qualifiedName"
111
+ },
112
+ "validatorArguments": {
113
+ "type": "object",
114
+ "maxProperties": 20,
115
+ "propertyNames": {
116
+ "$ref": "common.schema.json#/$defs/safeJsonMemberName"
117
+ },
118
+ "additionalProperties": {
119
+ "$ref": "common.schema.json#/$defs/jsonValue"
120
+ }
121
+ },
122
+ "minItems": { "type": "integer", "minimum": 0, "maximum": 100000 },
123
+ "maxItems": { "type": "integer", "minimum": 0, "maximum": 100000 },
124
+ "allowedMediaKinds": {
125
+ "type": "array",
126
+ "maxItems": 50,
127
+ "uniqueItems": true,
128
+ "items": { "enum": ["image", "video", "audio", "document", "archive", "other"] }
129
+ }
130
+ }
131
+ },
132
+ "enumValues": {
133
+ "type": "array",
134
+ "minItems": 1,
135
+ "maxItems": 1000,
136
+ "items": {
137
+ "type": "object",
138
+ "additionalProperties": false,
139
+ "required": ["value", "label"],
140
+ "properties": {
141
+ "value": { "$ref": "common.schema.json#/$defs/localName" },
142
+ "label": { "$ref": "common.schema.json#/$defs/messageReference" }
143
+ }
144
+ }
145
+ },
146
+ "fields": {
147
+ "type": "array",
148
+ "maxItems": 1000,
149
+ "items": { "$ref": "#/$defs/field" }
150
+ },
151
+ "itemKind": {
152
+ "oneOf": [
153
+ {
154
+ "enum": [
155
+ "string",
156
+ "rich-text",
157
+ "boolean",
158
+ "integer",
159
+ "decimal",
160
+ "money",
161
+ "date",
162
+ "date-time",
163
+ "enum",
164
+ "media",
165
+ "resource",
166
+ "object"
167
+ ]
168
+ },
169
+ { "$ref": "common.schema.json#/$defs/qualifiedName" }
170
+ ]
171
+ },
172
+ "extensions": { "$ref": "common.schema.json#/$defs/extensions" }
173
+ }
174
+ },
175
+ "authoringMetadata": {
176
+ "type": "object",
177
+ "additionalProperties": false,
178
+ "properties": {
179
+ "control": { "$ref": "common.schema.json#/$defs/qualifiedName" },
180
+ "placeholder": { "$ref": "common.schema.json#/$defs/messageReference" },
181
+ "group": { "$ref": "common.schema.json#/$defs/localName" },
182
+ "order": { "type": "integer", "minimum": 0, "maximum": 100000 },
183
+ "readOnly": { "type": "boolean" },
184
+ "hidden": { "type": "boolean" },
185
+ "width": { "enum": ["full", "half", "third", "two-thirds"] }
186
+ }
187
+ },
188
+ "relationship": {
189
+ "type": "object",
190
+ "additionalProperties": false,
191
+ "required": ["id", "kind", "label", "sourceField", "targetModel", "required", "onDelete"],
192
+ "properties": {
193
+ "id": { "$ref": "common.schema.json#/$defs/localName" },
194
+ "kind": { "enum": ["one-to-one", "many-to-one", "one-to-many", "many-to-many"] },
195
+ "label": { "$ref": "common.schema.json#/$defs/messageReference" },
196
+ "sourceField": { "$ref": "common.schema.json#/$defs/localName" },
197
+ "targetModel": { "$ref": "common.schema.json#/$defs/artifactReference" },
198
+ "targetField": { "$ref": "common.schema.json#/$defs/localName" },
199
+ "required": { "type": "boolean" },
200
+ "onDelete": { "enum": ["restrict", "nullify", "detach"] },
201
+ "authoring": {
202
+ "type": "object",
203
+ "additionalProperties": false,
204
+ "required": ["control", "allowCreate"],
205
+ "properties": {
206
+ "control": { "$ref": "common.schema.json#/$defs/qualifiedName" },
207
+ "allowCreate": { "type": "boolean" },
208
+ "displayField": { "$ref": "common.schema.json#/$defs/localName" },
209
+ "searchProvider": { "$ref": "common.schema.json#/$defs/qualifiedName" }
210
+ }
211
+ },
212
+ "extensions": { "$ref": "common.schema.json#/$defs/extensions" }
213
+ }
214
+ }
215
+ }
216
+ }
@@ -0,0 +1,32 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schemas.kumwe.org/studio/v1/entry.schema.json",
4
+ "title": "Studio content entry",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["contractVersion", "kind", "id", "revision", "model", "status", "values"],
8
+ "properties": {
9
+ "contractVersion": { "$ref": "common.schema.json#/$defs/contractVersion" },
10
+ "kind": { "const": "entry" },
11
+ "id": { "$ref": "common.schema.json#/$defs/stableId" },
12
+ "revision": { "$ref": "common.schema.json#/$defs/revision" },
13
+ "model": { "$ref": "common.schema.json#/$defs/lockedArtifactReference" },
14
+ "status": { "enum": ["draft", "in-review", "published", "archived"] },
15
+ "locale": { "$ref": "common.schema.json#/$defs/locale" },
16
+ "translationOf": { "$ref": "common.schema.json#/$defs/stableId" },
17
+ "workflowState": { "$ref": "common.schema.json#/$defs/qualifiedName" },
18
+ "values": {
19
+ "type": "object",
20
+ "maxProperties": 10000,
21
+ "propertyNames": { "$ref": "common.schema.json#/$defs/localName" },
22
+ "additionalProperties": { "$ref": "common.schema.json#/$defs/jsonValue" }
23
+ },
24
+ "compositionOverrides": {
25
+ "type": "object",
26
+ "maxProperties": 1000,
27
+ "propertyNames": { "$ref": "common.schema.json#/$defs/stableId" },
28
+ "additionalProperties": { "$ref": "common.schema.json#/$defs/jsonValue" }
29
+ },
30
+ "extensions": { "$ref": "common.schema.json#/$defs/extensions" }
31
+ }
32
+ }
@@ -0,0 +1,64 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schemas.kumwe.org/studio/v1/host-capabilities.schema.json",
4
+ "title": "Studio host capabilities",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["contractVersion", "kind", "host", "protocolVersions", "ports", "capabilities"],
8
+ "properties": {
9
+ "contractVersion": { "$ref": "common.schema.json#/$defs/contractVersion" },
10
+ "kind": { "const": "host-capabilities" },
11
+ "host": {
12
+ "type": "object",
13
+ "additionalProperties": false,
14
+ "required": ["id", "version", "generation"],
15
+ "properties": {
16
+ "id": { "$ref": "common.schema.json#/$defs/qualifiedName" },
17
+ "version": { "$ref": "common.schema.json#/$defs/semanticVersion" },
18
+ "generation": { "$ref": "common.schema.json#/$defs/revision" }
19
+ }
20
+ },
21
+ "protocolVersions": {
22
+ "type": "array",
23
+ "minItems": 1,
24
+ "maxItems": 20,
25
+ "uniqueItems": true,
26
+ "items": { "$ref": "common.schema.json#/$defs/semanticVersion" }
27
+ },
28
+ "ports": {
29
+ "type": "array",
30
+ "maxItems": 100,
31
+ "items": {
32
+ "type": "object",
33
+ "additionalProperties": false,
34
+ "required": ["id", "version", "operations"],
35
+ "properties": {
36
+ "id": { "$ref": "common.schema.json#/$defs/qualifiedName" },
37
+ "version": { "$ref": "common.schema.json#/$defs/semanticVersion" },
38
+ "operations": {
39
+ "type": "array",
40
+ "minItems": 1,
41
+ "maxItems": 100,
42
+ "uniqueItems": true,
43
+ "items": { "$ref": "common.schema.json#/$defs/qualifiedName" }
44
+ }
45
+ }
46
+ }
47
+ },
48
+ "capabilities": {
49
+ "type": "array",
50
+ "maxItems": 500,
51
+ "items": {
52
+ "type": "object",
53
+ "additionalProperties": false,
54
+ "required": ["id", "version"],
55
+ "properties": {
56
+ "id": { "$ref": "common.schema.json#/$defs/qualifiedName" },
57
+ "version": { "$ref": "common.schema.json#/$defs/semanticVersion" },
58
+ "configuration": { "$ref": "common.schema.json#/$defs/jsonValue" }
59
+ }
60
+ }
61
+ },
62
+ "extensions": { "$ref": "common.schema.json#/$defs/extensions" }
63
+ }
64
+ }
@@ -0,0 +1,42 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schemas.kumwe.org/studio/v1/host-error.schema.json",
4
+ "title": "Studio host port error",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["contractVersion", "kind", "category", "message", "retryable"],
8
+ "properties": {
9
+ "contractVersion": { "$ref": "common.schema.json#/$defs/contractVersion" },
10
+ "kind": { "const": "host-error" },
11
+ "category": {
12
+ "enum": [
13
+ "invalid-request",
14
+ "unauthenticated",
15
+ "forbidden",
16
+ "not-found",
17
+ "conflict",
18
+ "validation-failed",
19
+ "incompatible",
20
+ "limit-exceeded",
21
+ "rate-limited",
22
+ "unavailable",
23
+ "cancelled",
24
+ "internal"
25
+ ]
26
+ },
27
+ "correlationId": { "$ref": "common.schema.json#/$defs/stableId" },
28
+ "message": { "$ref": "common.schema.json#/$defs/messageReference" },
29
+ "retryable": { "type": "boolean" },
30
+ "retryAfterMilliseconds": {
31
+ "type": "integer",
32
+ "minimum": 0,
33
+ "maximum": 86400000
34
+ },
35
+ "revision": { "$ref": "common.schema.json#/$defs/revision" },
36
+ "diagnostics": {
37
+ "type": "array",
38
+ "maxItems": 1000,
39
+ "items": { "$ref": "common.schema.json#/$defs/diagnostic" }
40
+ }
41
+ }
42
+ }
@@ -0,0 +1,117 @@
1
+ {
2
+ "contractVersion": "0.1-draft",
3
+ "epoch": "https://schemas.kumwe.org/studio/v1/",
4
+ "kind": "schema-manifest",
5
+ "schemas": [
6
+ {
7
+ "digest": "sha256-sx4nxAo1fq7Mjp2J3gfsIWRq9vD6nkDDrc1PtWLzfNE=",
8
+ "file": "block-definition.schema.json",
9
+ "id": "https://schemas.kumwe.org/studio/v1/block-definition.schema.json"
10
+ },
11
+ {
12
+ "digest": "sha256-hYSn9/ft0AMu+kR1eRYlHV100hNiqJJkH0nm3NBcJZQ=",
13
+ "file": "blueprint.schema.json",
14
+ "id": "https://schemas.kumwe.org/studio/v1/blueprint.schema.json"
15
+ },
16
+ {
17
+ "digest": "sha256-cpuqAnGwwvMacksx7zezMZhQQGdQAanor4Pwatynic0=",
18
+ "file": "command-vector.schema.json",
19
+ "id": "https://schemas.kumwe.org/studio/v1/command-vector.schema.json"
20
+ },
21
+ {
22
+ "digest": "sha256-Qghm6NeguRjl37F7+hZI2ojmGqkA6i12oFJ0i29skKM=",
23
+ "file": "command.schema.json",
24
+ "id": "https://schemas.kumwe.org/studio/v1/command.schema.json"
25
+ },
26
+ {
27
+ "digest": "sha256-htSwJXFIhBnC96NxNxKgr+h2Fbo/qg8/ydtwguXEesA=",
28
+ "file": "common.schema.json",
29
+ "id": "https://schemas.kumwe.org/studio/v1/common.schema.json"
30
+ },
31
+ {
32
+ "digest": "sha256-M4vvgiYXf1WbIryDzJNdde91fJd5npzfaM8E495eQRw=",
33
+ "file": "content-model.schema.json",
34
+ "id": "https://schemas.kumwe.org/studio/v1/content-model.schema.json"
35
+ },
36
+ {
37
+ "digest": "sha256-BQFVJmT3bwZOfCmXuQrZnYYxjB0FAUV7j1XrdZdIkdw=",
38
+ "file": "entry.schema.json",
39
+ "id": "https://schemas.kumwe.org/studio/v1/entry.schema.json"
40
+ },
41
+ {
42
+ "digest": "sha256-aUL8J4tsw6t00BG80OkuLvhZSQQ0bWKzk1XvYtqdb7g=",
43
+ "file": "host-capabilities.schema.json",
44
+ "id": "https://schemas.kumwe.org/studio/v1/host-capabilities.schema.json"
45
+ },
46
+ {
47
+ "digest": "sha256-6FWXIBdUaiuxpwLJUWnHxnRdcYmR6Ni6WWFCEQFekGw=",
48
+ "file": "host-error.schema.json",
49
+ "id": "https://schemas.kumwe.org/studio/v1/host-error.schema.json"
50
+ },
51
+ {
52
+ "digest": "sha256-tOiXLsL+sv+gnL3sUeAjA/+oumRb5AGSjkeC/1GI+/8=",
53
+ "file": "media-asset.schema.json",
54
+ "id": "https://schemas.kumwe.org/studio/v1/media-asset.schema.json"
55
+ },
56
+ {
57
+ "digest": "sha256-bbC4d8OOPy3/TLpFurhW3IFwzeykLFHZeWQzf8gVeRs=",
58
+ "file": "media-reference.schema.json",
59
+ "id": "https://schemas.kumwe.org/studio/v1/media-reference.schema.json"
60
+ },
61
+ {
62
+ "digest": "sha256-46XVlSre/jC+J75IDUDtCBq8yawymUGuVmUWyhM0GV8=",
63
+ "file": "media-upload-session.schema.json",
64
+ "id": "https://schemas.kumwe.org/studio/v1/media-upload-session.schema.json"
65
+ },
66
+ {
67
+ "digest": "sha256-ys69OuX6KO1efqLjTmOV3K0gQC2GZiAXDXkH06Ddh88=",
68
+ "file": "pattern.schema.json",
69
+ "id": "https://schemas.kumwe.org/studio/v1/pattern.schema.json"
70
+ },
71
+ {
72
+ "digest": "sha256-B5EppWg0j+8fx0wVffmoIYjuZsBSqjveB4Vbp2psRtI=",
73
+ "file": "plugin-manifest.schema.json",
74
+ "id": "https://schemas.kumwe.org/studio/v1/plugin-manifest.schema.json"
75
+ },
76
+ {
77
+ "digest": "sha256-k4h+dRatXPF43BWB2quTouTCbOioU5xkV/m31Rp1AJs=",
78
+ "file": "preview-message.schema.json",
79
+ "id": "https://schemas.kumwe.org/studio/v1/preview-message.schema.json"
80
+ },
81
+ {
82
+ "digest": "sha256-QURE0s0zSfvGXEvy3meE4rQeofecsUVZksqQKfKv4ys=",
83
+ "file": "provenance.schema.json",
84
+ "id": "https://schemas.kumwe.org/studio/v1/provenance.schema.json"
85
+ },
86
+ {
87
+ "digest": "sha256-PKyCGI95WZ6Uojq9u5HvS2wwWU97+V+nmsY4l/Vc040=",
88
+ "file": "rich-text-projection.schema.json",
89
+ "id": "https://schemas.kumwe.org/studio/v1/rich-text-projection.schema.json"
90
+ },
91
+ {
92
+ "digest": "sha256-PgFfnylfsJzq7B0wQq1gAxYA0r6gMx+xiKeT3NiDVqc=",
93
+ "file": "rich-text.schema.json",
94
+ "id": "https://schemas.kumwe.org/studio/v1/rich-text.schema.json"
95
+ },
96
+ {
97
+ "digest": "sha256-yX+70kh/aPaBZiOlNon3R0B4W9ZWCnvOMKDF3ItxkqU=",
98
+ "file": "schema-profile.schema.json",
99
+ "id": "https://schemas.kumwe.org/studio/v1/schema-profile.schema.json"
100
+ },
101
+ {
102
+ "digest": "sha256-FC0lGnAqTIdHLvlwbGyYGdXEK5mwtyhdyrCwt7WzVhY=",
103
+ "file": "studio-config.schema.json",
104
+ "id": "https://schemas.kumwe.org/studio/v1/studio-config.schema.json"
105
+ },
106
+ {
107
+ "digest": "sha256-xzhCb8J2nx+K6kBMciFj1glB4Q6jT8+KUdbUBsNM4h8=",
108
+ "file": "theme.schema.json",
109
+ "id": "https://schemas.kumwe.org/studio/v1/theme.schema.json"
110
+ },
111
+ {
112
+ "digest": "sha256-+0z2ALVZk0I2TVSqtdd150pmB36AIYYi6HsWpNPSATg=",
113
+ "file": "unresolved-contribution.schema.json",
114
+ "id": "https://schemas.kumwe.org/studio/v1/unresolved-contribution.schema.json"
115
+ }
116
+ ]
117
+ }
@@ -0,0 +1,83 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schemas.kumwe.org/studio/v1/media-asset.schema.json",
4
+ "title": "Studio host-owned media asset",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "contractVersion",
9
+ "kind",
10
+ "id",
11
+ "revision",
12
+ "state",
13
+ "mediaKind",
14
+ "mediaType",
15
+ "byteSize",
16
+ "filename",
17
+ "metadata"
18
+ ],
19
+ "properties": {
20
+ "contractVersion": { "$ref": "common.schema.json#/$defs/contractVersion" },
21
+ "kind": { "const": "media-asset" },
22
+ "id": {
23
+ "description": "Host-assigned stable asset identity. Its presence does not grant access, readiness, publication, or delivery authority.",
24
+ "$ref": "common.schema.json#/$defs/stableId"
25
+ },
26
+ "revision": { "$ref": "common.schema.json#/$defs/revision" },
27
+ "state": {
28
+ "description": "Host lifecycle projection. An accepted stable asset can remain processing; every use and publication decision is host-policy gated.",
29
+ "enum": ["processing", "ready", "rejected", "quarantined", "archived"]
30
+ },
31
+ "mediaKind": { "enum": ["image", "video", "audio", "document", "archive", "other"] },
32
+ "mediaType": {
33
+ "type": "string",
34
+ "pattern": "^[a-z0-9!#$&^_.+-]+/[a-z0-9!#$&^_.+-]+(?![\\s\\S])",
35
+ "maxLength": 200
36
+ },
37
+ "byteSize": { "type": "integer", "minimum": 0, "maximum": 1099511627776 },
38
+ "filename": { "type": "string", "minLength": 1, "maxLength": 500 },
39
+ "metadata": {
40
+ "type": "object",
41
+ "additionalProperties": false,
42
+ "properties": {
43
+ "width": { "type": "integer", "minimum": 1, "maximum": 1000000 },
44
+ "height": { "type": "integer", "minimum": 1, "maximum": 1000000 },
45
+ "durationMilliseconds": { "type": "integer", "minimum": 0, "maximum": 864000000 },
46
+ "altText": { "type": "string", "maxLength": 5000 },
47
+ "decorative": { "type": "boolean" },
48
+ "caption": { "type": "string", "maxLength": 20000 },
49
+ "credit": { "type": "string", "maxLength": 2000 },
50
+ "license": { "type": "string", "maxLength": 500 },
51
+ "focalPoint": {
52
+ "type": "object",
53
+ "additionalProperties": false,
54
+ "required": ["x", "y"],
55
+ "properties": {
56
+ "x": { "type": "number", "minimum": 0, "maximum": 1 },
57
+ "y": { "type": "number", "minimum": 0, "maximum": 1 }
58
+ }
59
+ }
60
+ }
61
+ },
62
+ "renditions": {
63
+ "type": "array",
64
+ "maxItems": 100,
65
+ "items": {
66
+ "type": "object",
67
+ "additionalProperties": false,
68
+ "required": ["id", "mediaType", "width", "height"],
69
+ "properties": {
70
+ "id": { "$ref": "common.schema.json#/$defs/localName" },
71
+ "mediaType": {
72
+ "type": "string",
73
+ "pattern": "^[a-z0-9!#$&^_.+-]+/[a-z0-9!#$&^_.+-]+(?![\\s\\S])",
74
+ "maxLength": 200
75
+ },
76
+ "width": { "type": "integer", "minimum": 1, "maximum": 1000000 },
77
+ "height": { "type": "integer", "minimum": 1, "maximum": 1000000 }
78
+ }
79
+ }
80
+ },
81
+ "extensions": { "$ref": "common.schema.json#/$defs/extensions" }
82
+ }
83
+ }
@@ -0,0 +1,112 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schemas.kumwe.org/studio/v1/media-reference.schema.json",
4
+ "title": "Studio persisted media reference",
5
+ "description": "A small, usage-specific reference stored in an artifact. It contains no URL, binary data, storage path, credential, or host delivery authority.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": ["contractVersion", "kind", "assetId", "usage", "accessibility"],
9
+ "properties": {
10
+ "contractVersion": { "$ref": "common.schema.json#/$defs/contractVersion" },
11
+ "kind": { "const": "media-reference" },
12
+ "assetId": { "$ref": "common.schema.json#/$defs/stableId" },
13
+ "assetRevision": { "$ref": "common.schema.json#/$defs/revision" },
14
+ "usage": { "$ref": "common.schema.json#/$defs/qualifiedName" },
15
+ "renditionIntent": {
16
+ "type": "object",
17
+ "additionalProperties": false,
18
+ "required": ["role"],
19
+ "properties": {
20
+ "role": { "$ref": "common.schema.json#/$defs/localName" },
21
+ "fit": { "enum": ["contain", "cover", "fill", "scale-down"] },
22
+ "preferredMediaTypes": {
23
+ "type": "array",
24
+ "maxItems": 10,
25
+ "uniqueItems": true,
26
+ "items": {
27
+ "type": "string",
28
+ "pattern": "^[a-z0-9!#$&^_.+-]+/[a-z0-9!#$&^_.+-]+(?![\\s\\S])",
29
+ "maxLength": 200
30
+ }
31
+ }
32
+ }
33
+ },
34
+ "focalPoint": {
35
+ "type": "object",
36
+ "additionalProperties": false,
37
+ "required": ["x", "y"],
38
+ "properties": {
39
+ "x": { "type": "number", "minimum": 0, "maximum": 1 },
40
+ "y": { "type": "number", "minimum": 0, "maximum": 1 }
41
+ }
42
+ },
43
+ "cropIntent": {
44
+ "oneOf": [
45
+ {
46
+ "type": "object",
47
+ "additionalProperties": false,
48
+ "required": ["mode", "width", "height"],
49
+ "properties": {
50
+ "mode": { "const": "aspect-ratio" },
51
+ "width": { "type": "integer", "minimum": 1, "maximum": 10000 },
52
+ "height": { "type": "integer", "minimum": 1, "maximum": 10000 }
53
+ }
54
+ },
55
+ {
56
+ "type": "object",
57
+ "additionalProperties": false,
58
+ "required": ["mode", "x", "y", "width", "height"],
59
+ "properties": {
60
+ "mode": { "const": "rectangle" },
61
+ "x": { "type": "number", "minimum": 0, "maximum": 1 },
62
+ "y": { "type": "number", "minimum": 0, "maximum": 1 },
63
+ "width": { "type": "number", "exclusiveMinimum": 0, "maximum": 1 },
64
+ "height": { "type": "number", "exclusiveMinimum": 0, "maximum": 1 }
65
+ }
66
+ }
67
+ ]
68
+ },
69
+ "accessibility": {
70
+ "oneOf": [
71
+ {
72
+ "type": "object",
73
+ "additionalProperties": false,
74
+ "required": ["mode", "altText"],
75
+ "properties": {
76
+ "mode": { "const": "informative" },
77
+ "altText": { "type": "string", "minLength": 1, "maxLength": 5000 },
78
+ "caption": { "type": "string", "maxLength": 20000 }
79
+ }
80
+ },
81
+ {
82
+ "type": "object",
83
+ "additionalProperties": false,
84
+ "required": ["mode"],
85
+ "properties": {
86
+ "mode": { "const": "decorative" }
87
+ }
88
+ },
89
+ {
90
+ "type": "object",
91
+ "additionalProperties": false,
92
+ "required": ["mode", "altFieldPath"],
93
+ "properties": {
94
+ "mode": { "const": "bound" },
95
+ "altFieldPath": {
96
+ "type": "array",
97
+ "minItems": 1,
98
+ "maxItems": 32,
99
+ "items": { "$ref": "common.schema.json#/$defs/localName" }
100
+ },
101
+ "captionFieldPath": {
102
+ "type": "array",
103
+ "minItems": 1,
104
+ "maxItems": 32,
105
+ "items": { "$ref": "common.schema.json#/$defs/localName" }
106
+ }
107
+ }
108
+ }
109
+ ]
110
+ }
111
+ }
112
+ }