@kumwe/studio-testkit 0.1.0-alpha.2 → 0.1.0-alpha.4
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/dist/host-testbed.d.ts +13 -1
- package/dist/host-testbed.d.ts.map +1 -1
- package/dist/host-testbed.js +26 -0
- package/dist/host-testbed.js.map +1 -1
- package/invalid/command.malformed-size-role.json +18 -0
- package/package.json +2 -2
- package/vectors/command/batch.size-roles.json +180 -0
- package/vectors/command/set-size-role.base.json +144 -0
- package/vectors/command/set-size-role.duplicate.json +148 -0
- package/vectors/command/set-size-role.viewport-add.json +154 -0
- package/vectors/command/unset-size-role.missing.error.json +78 -0
- package/vectors/command/unset-size-role.viewport.json +154 -0
- package/vectors/media/accept.plan-deterministic.json +26 -0
- package/vectors/media/accept.size-at-boundary.json +26 -0
- package/vectors/media/cancel.complete-noop.json +30 -0
- package/vectors/media/cancel.requested.json +30 -0
- package/vectors/media/cancel.transferring.json +30 -0
- package/vectors/media/cancel.verifying.json +30 -0
- package/vectors/media/reject.disallowed-kind.json +23 -0
- package/vectors/media/reject.filename-empty.json +22 -0
- package/vectors/media/reject.filename-path.json +23 -0
- package/vectors/media/reject.size-one-byte-over.json +23 -0
- package/vectors/media/retry.fresh-session.json +26 -0
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
{
|
|
2
|
+
"contractVersion": "0.1-draft",
|
|
3
|
+
"kind": "command-vector",
|
|
4
|
+
"id": "vector.command-vector.set-size-role.viewport-add",
|
|
5
|
+
"description": "Assigning a responsive size-role override materialises the responsiveSizeRoles map for that axis and viewport while the base role stays untouched; the inverse unset removes the empty containers again.",
|
|
6
|
+
"initial": {
|
|
7
|
+
"contractVersion": "0.1-draft",
|
|
8
|
+
"dependencyLock": {
|
|
9
|
+
"blocks": [
|
|
10
|
+
{
|
|
11
|
+
"revision": "block-r1",
|
|
12
|
+
"type": "studio.vector/section",
|
|
13
|
+
"version": "1.0.0"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"revision": "block-r1",
|
|
17
|
+
"type": "studio.vector/text",
|
|
18
|
+
"version": "1.0.0"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"theme": {
|
|
22
|
+
"id": "studio.vector/theme",
|
|
23
|
+
"revision": "theme-r1",
|
|
24
|
+
"version": "1.0.0"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"id": "vector.blueprint",
|
|
28
|
+
"kind": "blueprint",
|
|
29
|
+
"label": {
|
|
30
|
+
"defaultMessage": "Vector Blueprint",
|
|
31
|
+
"key": "studio.vector/blueprint"
|
|
32
|
+
},
|
|
33
|
+
"model": {
|
|
34
|
+
"id": "studio.vector/model",
|
|
35
|
+
"revision": "model-r1",
|
|
36
|
+
"version": "1.0.0"
|
|
37
|
+
},
|
|
38
|
+
"owner": {
|
|
39
|
+
"id": "studio.vector/suite",
|
|
40
|
+
"version": "0.1.0-alpha.0"
|
|
41
|
+
},
|
|
42
|
+
"revision": "blueprint-r1",
|
|
43
|
+
"roots": [
|
|
44
|
+
{
|
|
45
|
+
"authoring": {
|
|
46
|
+
"mode": "designer"
|
|
47
|
+
},
|
|
48
|
+
"bindings": {},
|
|
49
|
+
"id": "text-a",
|
|
50
|
+
"properties": {},
|
|
51
|
+
"slots": {},
|
|
52
|
+
"type": "studio.vector/text",
|
|
53
|
+
"version": "1.0.0",
|
|
54
|
+
"sizeRoles": {
|
|
55
|
+
"inline": "full"
|
|
56
|
+
}
|
|
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.set-size-role.viewport-add",
|
|
67
|
+
"kind": "command",
|
|
68
|
+
"payload": {
|
|
69
|
+
"axis": "inline",
|
|
70
|
+
"nodeId": "text-a",
|
|
71
|
+
"role": "half",
|
|
72
|
+
"viewport": "wide"
|
|
73
|
+
},
|
|
74
|
+
"sessionGeneration": "session-r1",
|
|
75
|
+
"type": "studio.command/set-size-role"
|
|
76
|
+
},
|
|
77
|
+
"expect": {
|
|
78
|
+
"document": {
|
|
79
|
+
"contractVersion": "0.1-draft",
|
|
80
|
+
"dependencyLock": {
|
|
81
|
+
"blocks": [
|
|
82
|
+
{
|
|
83
|
+
"revision": "block-r1",
|
|
84
|
+
"type": "studio.vector/section",
|
|
85
|
+
"version": "1.0.0"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"revision": "block-r1",
|
|
89
|
+
"type": "studio.vector/text",
|
|
90
|
+
"version": "1.0.0"
|
|
91
|
+
}
|
|
92
|
+
],
|
|
93
|
+
"theme": {
|
|
94
|
+
"id": "studio.vector/theme",
|
|
95
|
+
"revision": "theme-r1",
|
|
96
|
+
"version": "1.0.0"
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
"id": "vector.blueprint",
|
|
100
|
+
"kind": "blueprint",
|
|
101
|
+
"label": {
|
|
102
|
+
"defaultMessage": "Vector Blueprint",
|
|
103
|
+
"key": "studio.vector/blueprint"
|
|
104
|
+
},
|
|
105
|
+
"model": {
|
|
106
|
+
"id": "studio.vector/model",
|
|
107
|
+
"revision": "model-r1",
|
|
108
|
+
"version": "1.0.0"
|
|
109
|
+
},
|
|
110
|
+
"owner": {
|
|
111
|
+
"id": "studio.vector/suite",
|
|
112
|
+
"version": "0.1.0-alpha.0"
|
|
113
|
+
},
|
|
114
|
+
"revision": "blueprint-r1",
|
|
115
|
+
"roots": [
|
|
116
|
+
{
|
|
117
|
+
"authoring": {
|
|
118
|
+
"mode": "designer"
|
|
119
|
+
},
|
|
120
|
+
"bindings": {},
|
|
121
|
+
"id": "text-a",
|
|
122
|
+
"properties": {},
|
|
123
|
+
"slots": {},
|
|
124
|
+
"type": "studio.vector/text",
|
|
125
|
+
"version": "1.0.0",
|
|
126
|
+
"responsiveSizeRoles": {
|
|
127
|
+
"inline": {
|
|
128
|
+
"wide": "half"
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
"sizeRoles": {
|
|
132
|
+
"inline": "full"
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
],
|
|
136
|
+
"status": "draft",
|
|
137
|
+
"version": "1.0.0"
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
"inverse": {
|
|
141
|
+
"artifactId": "vector.blueprint",
|
|
142
|
+
"baseStateVersion": 1,
|
|
143
|
+
"contractVersion": "0.1-draft",
|
|
144
|
+
"id": "vector.inverse.set-size-role.viewport-add",
|
|
145
|
+
"kind": "command",
|
|
146
|
+
"payload": {
|
|
147
|
+
"axis": "inline",
|
|
148
|
+
"nodeId": "text-a",
|
|
149
|
+
"viewport": "wide"
|
|
150
|
+
},
|
|
151
|
+
"sessionGeneration": "session-r1",
|
|
152
|
+
"type": "studio.command/unset-size-role"
|
|
153
|
+
}
|
|
154
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
{
|
|
2
|
+
"contractVersion": "0.1-draft",
|
|
3
|
+
"kind": "command-vector",
|
|
4
|
+
"id": "vector.command-vector.unset-size-role.missing.error",
|
|
5
|
+
"description": "Unsetting an axis that carries no size role fails with property-not-found even when the other axis is assigned.",
|
|
6
|
+
"initial": {
|
|
7
|
+
"contractVersion": "0.1-draft",
|
|
8
|
+
"dependencyLock": {
|
|
9
|
+
"blocks": [
|
|
10
|
+
{
|
|
11
|
+
"revision": "block-r1",
|
|
12
|
+
"type": "studio.vector/section",
|
|
13
|
+
"version": "1.0.0"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"revision": "block-r1",
|
|
17
|
+
"type": "studio.vector/text",
|
|
18
|
+
"version": "1.0.0"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"theme": {
|
|
22
|
+
"id": "studio.vector/theme",
|
|
23
|
+
"revision": "theme-r1",
|
|
24
|
+
"version": "1.0.0"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"id": "vector.blueprint",
|
|
28
|
+
"kind": "blueprint",
|
|
29
|
+
"label": {
|
|
30
|
+
"defaultMessage": "Vector Blueprint",
|
|
31
|
+
"key": "studio.vector/blueprint"
|
|
32
|
+
},
|
|
33
|
+
"model": {
|
|
34
|
+
"id": "studio.vector/model",
|
|
35
|
+
"revision": "model-r1",
|
|
36
|
+
"version": "1.0.0"
|
|
37
|
+
},
|
|
38
|
+
"owner": {
|
|
39
|
+
"id": "studio.vector/suite",
|
|
40
|
+
"version": "0.1.0-alpha.0"
|
|
41
|
+
},
|
|
42
|
+
"revision": "blueprint-r1",
|
|
43
|
+
"roots": [
|
|
44
|
+
{
|
|
45
|
+
"authoring": {
|
|
46
|
+
"mode": "designer"
|
|
47
|
+
},
|
|
48
|
+
"bindings": {},
|
|
49
|
+
"id": "text-a",
|
|
50
|
+
"properties": {},
|
|
51
|
+
"slots": {},
|
|
52
|
+
"type": "studio.vector/text",
|
|
53
|
+
"version": "1.0.0",
|
|
54
|
+
"sizeRoles": {
|
|
55
|
+
"inline": "full"
|
|
56
|
+
}
|
|
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.unset-size-role.missing.error",
|
|
67
|
+
"kind": "command",
|
|
68
|
+
"payload": {
|
|
69
|
+
"axis": "block",
|
|
70
|
+
"nodeId": "text-a"
|
|
71
|
+
},
|
|
72
|
+
"sessionGeneration": "session-r1",
|
|
73
|
+
"type": "studio.command/unset-size-role"
|
|
74
|
+
},
|
|
75
|
+
"expect": {
|
|
76
|
+
"errorCode": "property-not-found"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
{
|
|
2
|
+
"contractVersion": "0.1-draft",
|
|
3
|
+
"kind": "command-vector",
|
|
4
|
+
"id": "vector.command-vector.unset-size-role.viewport",
|
|
5
|
+
"description": "Unsetting the only responsive size-role override drops the emptied responsiveSizeRoles containers so the viewport inherits the base role again; the inverse restores the override.",
|
|
6
|
+
"initial": {
|
|
7
|
+
"contractVersion": "0.1-draft",
|
|
8
|
+
"dependencyLock": {
|
|
9
|
+
"blocks": [
|
|
10
|
+
{
|
|
11
|
+
"revision": "block-r1",
|
|
12
|
+
"type": "studio.vector/section",
|
|
13
|
+
"version": "1.0.0"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"revision": "block-r1",
|
|
17
|
+
"type": "studio.vector/text",
|
|
18
|
+
"version": "1.0.0"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"theme": {
|
|
22
|
+
"id": "studio.vector/theme",
|
|
23
|
+
"revision": "theme-r1",
|
|
24
|
+
"version": "1.0.0"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"id": "vector.blueprint",
|
|
28
|
+
"kind": "blueprint",
|
|
29
|
+
"label": {
|
|
30
|
+
"defaultMessage": "Vector Blueprint",
|
|
31
|
+
"key": "studio.vector/blueprint"
|
|
32
|
+
},
|
|
33
|
+
"model": {
|
|
34
|
+
"id": "studio.vector/model",
|
|
35
|
+
"revision": "model-r1",
|
|
36
|
+
"version": "1.0.0"
|
|
37
|
+
},
|
|
38
|
+
"owner": {
|
|
39
|
+
"id": "studio.vector/suite",
|
|
40
|
+
"version": "0.1.0-alpha.0"
|
|
41
|
+
},
|
|
42
|
+
"revision": "blueprint-r1",
|
|
43
|
+
"roots": [
|
|
44
|
+
{
|
|
45
|
+
"authoring": {
|
|
46
|
+
"mode": "designer"
|
|
47
|
+
},
|
|
48
|
+
"bindings": {},
|
|
49
|
+
"id": "text-a",
|
|
50
|
+
"properties": {},
|
|
51
|
+
"slots": {},
|
|
52
|
+
"type": "studio.vector/text",
|
|
53
|
+
"version": "1.0.0",
|
|
54
|
+
"responsiveSizeRoles": {
|
|
55
|
+
"inline": {
|
|
56
|
+
"wide": "half"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"sizeRoles": {
|
|
60
|
+
"inline": "full"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
"status": "draft",
|
|
65
|
+
"version": "1.0.0"
|
|
66
|
+
},
|
|
67
|
+
"command": {
|
|
68
|
+
"artifactId": "vector.blueprint",
|
|
69
|
+
"baseStateVersion": 0,
|
|
70
|
+
"contractVersion": "0.1-draft",
|
|
71
|
+
"id": "vector.command.unset-size-role.viewport",
|
|
72
|
+
"kind": "command",
|
|
73
|
+
"payload": {
|
|
74
|
+
"axis": "inline",
|
|
75
|
+
"nodeId": "text-a",
|
|
76
|
+
"viewport": "wide"
|
|
77
|
+
},
|
|
78
|
+
"sessionGeneration": "session-r1",
|
|
79
|
+
"type": "studio.command/unset-size-role"
|
|
80
|
+
},
|
|
81
|
+
"expect": {
|
|
82
|
+
"document": {
|
|
83
|
+
"contractVersion": "0.1-draft",
|
|
84
|
+
"dependencyLock": {
|
|
85
|
+
"blocks": [
|
|
86
|
+
{
|
|
87
|
+
"revision": "block-r1",
|
|
88
|
+
"type": "studio.vector/section",
|
|
89
|
+
"version": "1.0.0"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"revision": "block-r1",
|
|
93
|
+
"type": "studio.vector/text",
|
|
94
|
+
"version": "1.0.0"
|
|
95
|
+
}
|
|
96
|
+
],
|
|
97
|
+
"theme": {
|
|
98
|
+
"id": "studio.vector/theme",
|
|
99
|
+
"revision": "theme-r1",
|
|
100
|
+
"version": "1.0.0"
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"id": "vector.blueprint",
|
|
104
|
+
"kind": "blueprint",
|
|
105
|
+
"label": {
|
|
106
|
+
"defaultMessage": "Vector Blueprint",
|
|
107
|
+
"key": "studio.vector/blueprint"
|
|
108
|
+
},
|
|
109
|
+
"model": {
|
|
110
|
+
"id": "studio.vector/model",
|
|
111
|
+
"revision": "model-r1",
|
|
112
|
+
"version": "1.0.0"
|
|
113
|
+
},
|
|
114
|
+
"owner": {
|
|
115
|
+
"id": "studio.vector/suite",
|
|
116
|
+
"version": "0.1.0-alpha.0"
|
|
117
|
+
},
|
|
118
|
+
"revision": "blueprint-r1",
|
|
119
|
+
"roots": [
|
|
120
|
+
{
|
|
121
|
+
"authoring": {
|
|
122
|
+
"mode": "designer"
|
|
123
|
+
},
|
|
124
|
+
"bindings": {},
|
|
125
|
+
"id": "text-a",
|
|
126
|
+
"properties": {},
|
|
127
|
+
"slots": {},
|
|
128
|
+
"type": "studio.vector/text",
|
|
129
|
+
"version": "1.0.0",
|
|
130
|
+
"sizeRoles": {
|
|
131
|
+
"inline": "full"
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
],
|
|
135
|
+
"status": "draft",
|
|
136
|
+
"version": "1.0.0"
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
"inverse": {
|
|
140
|
+
"artifactId": "vector.blueprint",
|
|
141
|
+
"baseStateVersion": 1,
|
|
142
|
+
"contractVersion": "0.1-draft",
|
|
143
|
+
"id": "vector.inverse.unset-size-role.viewport",
|
|
144
|
+
"kind": "command",
|
|
145
|
+
"payload": {
|
|
146
|
+
"axis": "inline",
|
|
147
|
+
"nodeId": "text-a",
|
|
148
|
+
"role": "half",
|
|
149
|
+
"viewport": "wide"
|
|
150
|
+
},
|
|
151
|
+
"sessionGeneration": "session-r1",
|
|
152
|
+
"type": "studio.command/set-size-role"
|
|
153
|
+
}
|
|
154
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"contractVersion": "0.1-draft",
|
|
3
|
+
"kind": "media-vector",
|
|
4
|
+
"id": "vector.media-vector.accept.plan-deterministic",
|
|
5
|
+
"description": "A well-formed request inside every policy bound is accepted with the deterministic plan derived from the policy: same maximum, same chunk size, same resumability.",
|
|
6
|
+
"policy": {
|
|
7
|
+
"acceptedMediaTypes": ["image/jpeg", "image/png"],
|
|
8
|
+
"chunkBytes": 1024,
|
|
9
|
+
"maximumBytes": 4096,
|
|
10
|
+
"resumable": true
|
|
11
|
+
},
|
|
12
|
+
"request": {
|
|
13
|
+
"filename": "windhoek-skyline.jpg",
|
|
14
|
+
"mediaType": "image/jpeg",
|
|
15
|
+
"byteSize": 2500,
|
|
16
|
+
"purpose": "studio.media/entry-image"
|
|
17
|
+
},
|
|
18
|
+
"expect": {
|
|
19
|
+
"outcome": "accepted",
|
|
20
|
+
"plan": {
|
|
21
|
+
"maximumBytes": 4096,
|
|
22
|
+
"chunkBytes": 1024,
|
|
23
|
+
"resumable": true
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"contractVersion": "0.1-draft",
|
|
3
|
+
"kind": "media-vector",
|
|
4
|
+
"id": "vector.media-vector.accept.size-at-boundary",
|
|
5
|
+
"description": "A request of exactly the policy maximum byte size is accepted: the size bound is inclusive.",
|
|
6
|
+
"policy": {
|
|
7
|
+
"acceptedMediaTypes": ["image/jpeg", "image/png"],
|
|
8
|
+
"chunkBytes": 1024,
|
|
9
|
+
"maximumBytes": 4096,
|
|
10
|
+
"resumable": true
|
|
11
|
+
},
|
|
12
|
+
"request": {
|
|
13
|
+
"filename": "boundary.png",
|
|
14
|
+
"mediaType": "image/png",
|
|
15
|
+
"byteSize": 4096,
|
|
16
|
+
"purpose": "studio.media/entry-image"
|
|
17
|
+
},
|
|
18
|
+
"expect": {
|
|
19
|
+
"outcome": "accepted",
|
|
20
|
+
"plan": {
|
|
21
|
+
"maximumBytes": 4096,
|
|
22
|
+
"chunkBytes": 1024,
|
|
23
|
+
"resumable": true
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"contractVersion": "0.1-draft",
|
|
3
|
+
"kind": "media-vector",
|
|
4
|
+
"id": "vector.media-vector.cancel.complete-noop",
|
|
5
|
+
"description": "Cancelling after the session has completed is not legal and does nothing: the session stays complete and the accepted asset identity is kept.",
|
|
6
|
+
"policy": {
|
|
7
|
+
"acceptedMediaTypes": ["image/jpeg", "image/png"],
|
|
8
|
+
"chunkBytes": 1024,
|
|
9
|
+
"maximumBytes": 4096,
|
|
10
|
+
"resumable": true
|
|
11
|
+
},
|
|
12
|
+
"request": {
|
|
13
|
+
"filename": "completed.jpg",
|
|
14
|
+
"mediaType": "image/jpeg",
|
|
15
|
+
"byteSize": 1500,
|
|
16
|
+
"purpose": "studio.media/entry-image"
|
|
17
|
+
},
|
|
18
|
+
"expect": {
|
|
19
|
+
"outcome": "accepted",
|
|
20
|
+
"plan": {
|
|
21
|
+
"maximumBytes": 4096,
|
|
22
|
+
"chunkBytes": 1024,
|
|
23
|
+
"resumable": true
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"cancel": {
|
|
27
|
+
"during": "complete",
|
|
28
|
+
"finalState": "complete"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"contractVersion": "0.1-draft",
|
|
3
|
+
"kind": "media-vector",
|
|
4
|
+
"id": "vector.media-vector.cancel.requested",
|
|
5
|
+
"description": "Cancelling while the session is still requested — before the host answers authorization — is legal and ends the session in cancelled without any transfer.",
|
|
6
|
+
"policy": {
|
|
7
|
+
"acceptedMediaTypes": ["image/jpeg", "image/png"],
|
|
8
|
+
"chunkBytes": 1024,
|
|
9
|
+
"maximumBytes": 4096,
|
|
10
|
+
"resumable": true
|
|
11
|
+
},
|
|
12
|
+
"request": {
|
|
13
|
+
"filename": "cancelled-early.jpg",
|
|
14
|
+
"mediaType": "image/jpeg",
|
|
15
|
+
"byteSize": 2000,
|
|
16
|
+
"purpose": "studio.media/entry-image"
|
|
17
|
+
},
|
|
18
|
+
"expect": {
|
|
19
|
+
"outcome": "accepted",
|
|
20
|
+
"plan": {
|
|
21
|
+
"maximumBytes": 4096,
|
|
22
|
+
"chunkBytes": 1024,
|
|
23
|
+
"resumable": true
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"cancel": {
|
|
27
|
+
"during": "requested",
|
|
28
|
+
"finalState": "cancelled"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"contractVersion": "0.1-draft",
|
|
3
|
+
"kind": "media-vector",
|
|
4
|
+
"id": "vector.media-vector.cancel.transferring",
|
|
5
|
+
"description": "Cancelling mid-transfer is legal: the session ends in cancelled, keeps the plan and the progress reached so far, and sends no further chunks.",
|
|
6
|
+
"policy": {
|
|
7
|
+
"acceptedMediaTypes": ["image/jpeg", "image/png"],
|
|
8
|
+
"chunkBytes": 1024,
|
|
9
|
+
"maximumBytes": 4096,
|
|
10
|
+
"resumable": true
|
|
11
|
+
},
|
|
12
|
+
"request": {
|
|
13
|
+
"filename": "cancelled-mid-transfer.jpg",
|
|
14
|
+
"mediaType": "image/jpeg",
|
|
15
|
+
"byteSize": 3000,
|
|
16
|
+
"purpose": "studio.media/entry-image"
|
|
17
|
+
},
|
|
18
|
+
"expect": {
|
|
19
|
+
"outcome": "accepted",
|
|
20
|
+
"plan": {
|
|
21
|
+
"maximumBytes": 4096,
|
|
22
|
+
"chunkBytes": 1024,
|
|
23
|
+
"resumable": true
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"cancel": {
|
|
27
|
+
"during": "transferring",
|
|
28
|
+
"finalState": "cancelled"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"contractVersion": "0.1-draft",
|
|
3
|
+
"kind": "media-vector",
|
|
4
|
+
"id": "vector.media-vector.cancel.verifying",
|
|
5
|
+
"description": "Cancelling while the host verifies the transferred bytes is legal: the session ends in cancelled and never reports an accepted asset.",
|
|
6
|
+
"policy": {
|
|
7
|
+
"acceptedMediaTypes": ["image/jpeg", "image/png"],
|
|
8
|
+
"chunkBytes": 1024,
|
|
9
|
+
"maximumBytes": 4096,
|
|
10
|
+
"resumable": true
|
|
11
|
+
},
|
|
12
|
+
"request": {
|
|
13
|
+
"filename": "cancelled-verifying.png",
|
|
14
|
+
"mediaType": "image/png",
|
|
15
|
+
"byteSize": 2048,
|
|
16
|
+
"purpose": "studio.media/entry-image"
|
|
17
|
+
},
|
|
18
|
+
"expect": {
|
|
19
|
+
"outcome": "accepted",
|
|
20
|
+
"plan": {
|
|
21
|
+
"maximumBytes": 4096,
|
|
22
|
+
"chunkBytes": 1024,
|
|
23
|
+
"resumable": true
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"cancel": {
|
|
27
|
+
"during": "verifying",
|
|
28
|
+
"finalState": "cancelled"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"contractVersion": "0.1-draft",
|
|
3
|
+
"kind": "media-vector",
|
|
4
|
+
"id": "vector.media-vector.reject.disallowed-kind",
|
|
5
|
+
"description": "A well-formed media type outside the policy's accepted kinds fails with the generic upload failure; the user-facing message never echoes the declared media type.",
|
|
6
|
+
"policy": {
|
|
7
|
+
"acceptedMediaTypes": ["image/jpeg", "image/png"],
|
|
8
|
+
"chunkBytes": 1024,
|
|
9
|
+
"maximumBytes": 4096,
|
|
10
|
+
"resumable": true
|
|
11
|
+
},
|
|
12
|
+
"request": {
|
|
13
|
+
"filename": "archive.zip",
|
|
14
|
+
"mediaType": "application/zip",
|
|
15
|
+
"byteSize": 2048,
|
|
16
|
+
"purpose": "studio.media/entry-image"
|
|
17
|
+
},
|
|
18
|
+
"expect": {
|
|
19
|
+
"outcome": "rejected",
|
|
20
|
+
"code": "studio.media/upload-failed",
|
|
21
|
+
"messageMustNotContain": ["application/zip"]
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"contractVersion": "0.1-draft",
|
|
3
|
+
"kind": "media-vector",
|
|
4
|
+
"id": "vector.media-vector.reject.filename-empty",
|
|
5
|
+
"description": "An empty filename violates the canonical upload request shape and is rejected before any session state is exchanged with the host.",
|
|
6
|
+
"policy": {
|
|
7
|
+
"acceptedMediaTypes": ["image/jpeg", "image/png"],
|
|
8
|
+
"chunkBytes": 1024,
|
|
9
|
+
"maximumBytes": 4096,
|
|
10
|
+
"resumable": true
|
|
11
|
+
},
|
|
12
|
+
"request": {
|
|
13
|
+
"filename": "",
|
|
14
|
+
"mediaType": "image/png",
|
|
15
|
+
"byteSize": 2048,
|
|
16
|
+
"purpose": "studio.media/entry-image"
|
|
17
|
+
},
|
|
18
|
+
"expect": {
|
|
19
|
+
"outcome": "rejected",
|
|
20
|
+
"code": "studio.media/upload-failed"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"contractVersion": "0.1-draft",
|
|
3
|
+
"kind": "media-vector",
|
|
4
|
+
"id": "vector.media-vector.reject.filename-path",
|
|
5
|
+
"description": "A filename carrying path separators is rejected: per the media contract, upload filenames are display metadata, never storage paths. The user-facing message never echoes the offending name.",
|
|
6
|
+
"policy": {
|
|
7
|
+
"acceptedMediaTypes": ["image/jpeg", "image/png"],
|
|
8
|
+
"chunkBytes": 1024,
|
|
9
|
+
"maximumBytes": 4096,
|
|
10
|
+
"resumable": true
|
|
11
|
+
},
|
|
12
|
+
"request": {
|
|
13
|
+
"filename": "../uploads/skyline.jpg",
|
|
14
|
+
"mediaType": "image/jpeg",
|
|
15
|
+
"byteSize": 2048,
|
|
16
|
+
"purpose": "studio.media/entry-image"
|
|
17
|
+
},
|
|
18
|
+
"expect": {
|
|
19
|
+
"outcome": "rejected",
|
|
20
|
+
"code": "studio.media/upload-failed",
|
|
21
|
+
"messageMustNotContain": ["../uploads/skyline.jpg"]
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"contractVersion": "0.1-draft",
|
|
3
|
+
"kind": "media-vector",
|
|
4
|
+
"id": "vector.media-vector.reject.size-one-byte-over",
|
|
5
|
+
"description": "A request one byte over the policy maximum fails with the stable oversize code; the user-facing message never echoes the raw byte counts, which travel only as machine-readable diagnostic parameters.",
|
|
6
|
+
"policy": {
|
|
7
|
+
"acceptedMediaTypes": ["image/jpeg", "image/png"],
|
|
8
|
+
"chunkBytes": 1024,
|
|
9
|
+
"maximumBytes": 4096,
|
|
10
|
+
"resumable": true
|
|
11
|
+
},
|
|
12
|
+
"request": {
|
|
13
|
+
"filename": "one-byte-over.png",
|
|
14
|
+
"mediaType": "image/png",
|
|
15
|
+
"byteSize": 4097,
|
|
16
|
+
"purpose": "studio.media/entry-image"
|
|
17
|
+
},
|
|
18
|
+
"expect": {
|
|
19
|
+
"outcome": "rejected",
|
|
20
|
+
"code": "studio.media/upload-too-large",
|
|
21
|
+
"messageMustNotContain": ["4097", "4096"]
|
|
22
|
+
}
|
|
23
|
+
}
|