Skip to content

Commit 5b26dfe

Browse files
committed
msw: Add trustpub_data field on version model
1 parent af34f96 commit 5b26dfe

File tree

11 files changed

+21
-0
lines changed

11 files changed

+21
-0
lines changed

packages/crates-io-msw/handlers/crates/downloads.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ test('includes related versions', async function () {
9999
published_by: null,
100100
readme_path: '/api/v1/crates/rand/1.0.0/readme',
101101
rust_version: null,
102+
trustpub_data: null,
102103
updated_at: '2017-02-24T12:34:56Z',
103104
yank_message: null,
104105
yanked: false,
@@ -120,6 +121,7 @@ test('includes related versions', async function () {
120121
published_by: null,
121122
readme_path: '/api/v1/crates/rand/1.0.1/readme',
122123
rust_version: null,
124+
trustpub_data: null,
123125
updated_at: '2017-02-24T12:34:56Z',
124126
yank_message: null,
125127
yanked: false,

packages/crates-io-msw/handlers/crates/get.test.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ test('returns a crate object for known crates', async function () {
6464
published_by: null,
6565
readme_path: '/api/v1/crates/rand/1.0.0-beta.1/readme',
6666
rust_version: null,
67+
trustpub_data: null,
6768
updated_at: '2017-02-24T12:34:56Z',
6869
yanked: false,
6970
yank_message: null,
@@ -128,6 +129,7 @@ test('works for non-canonical names', async function () {
128129
published_by: null,
129130
readme_path: '/api/v1/crates/foo-bar/1.0.0-beta.1/readme',
130131
rust_version: null,
132+
trustpub_data: null,
131133
updated_at: '2017-02-24T12:34:56Z',
132134
yanked: false,
133135
yank_message: null,
@@ -165,6 +167,7 @@ test('includes related versions', async function () {
165167
published_by: null,
166168
readme_path: '/api/v1/crates/rand/1.2.0/readme',
167169
rust_version: null,
170+
trustpub_data: null,
168171
updated_at: '2017-02-24T12:34:56Z',
169172
yanked: false,
170173
yank_message: null,
@@ -186,6 +189,7 @@ test('includes related versions', async function () {
186189
published_by: null,
187190
readme_path: '/api/v1/crates/rand/1.1.0/readme',
188191
rust_version: null,
192+
trustpub_data: null,
189193
updated_at: '2017-02-24T12:34:56Z',
190194
yanked: false,
191195
yank_message: null,
@@ -207,6 +211,7 @@ test('includes related versions', async function () {
207211
published_by: null,
208212
readme_path: '/api/v1/crates/rand/1.0.0/readme',
209213
rust_version: null,
214+
trustpub_data: null,
210215
updated_at: '2017-02-24T12:34:56Z',
211216
yanked: false,
212217
yank_message: null,

packages/crates-io-msw/handlers/crates/reverse-dependencies.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ test('returns a paginated list of crate versions depending to the specified crat
8484
published_by: null,
8585
readme_path: '/api/v1/crates/baz/1.0.1/readme',
8686
rust_version: null,
87+
trustpub_data: null,
8788
updated_at: '2017-02-24T12:34:56Z',
8889
yanked: false,
8990
yank_message: null,
@@ -105,6 +106,7 @@ test('returns a paginated list of crate versions depending to the specified crat
105106
published_by: null,
106107
readme_path: '/api/v1/crates/bar/1.0.0/readme',
107108
rust_version: null,
109+
trustpub_data: null,
108110
updated_at: '2017-02-24T12:34:56Z',
109111
yanked: false,
110112
yank_message: null,

packages/crates-io-msw/handlers/versions/follow-updates.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ test('returns latest versions of followed crates', async function () {
4141
published_by: null,
4242
readme_path: '/api/v1/crates/foo/1.2.3/readme',
4343
rust_version: null,
44+
trustpub_data: null,
4445
updated_at: '2017-02-24T12:34:56Z',
4546
yanked: false,
4647
yank_message: null,

packages/crates-io-msw/handlers/versions/get.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ test('returns a version object for known version', async function () {
4242
published_by: null,
4343
readme_path: '/api/v1/crates/rand/1.0.0-beta.1/readme',
4444
rust_version: null,
45+
trustpub_data: null,
4546
updated_at: '2017-02-24T12:34:56Z',
4647
yank_message: null,
4748
yanked: false,

packages/crates-io-msw/handlers/versions/list.test.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ test('returns all versions belonging to the specified crate', async function ()
4747
published_by: null,
4848
readme_path: '/api/v1/crates/rand/1.2.0/readme',
4949
rust_version: '1.69',
50+
trustpub_data: null,
5051
updated_at: '2017-02-24T12:34:56Z',
5152
yanked: false,
5253
yank_message: null,
@@ -74,6 +75,7 @@ test('returns all versions belonging to the specified crate', async function ()
7475
},
7576
readme_path: '/api/v1/crates/rand/1.1.0/readme',
7677
rust_version: null,
78+
trustpub_data: null,
7779
updated_at: '2017-02-24T12:34:56Z',
7880
yanked: false,
7981
yank_message: null,
@@ -95,6 +97,7 @@ test('returns all versions belonging to the specified crate', async function ()
9597
published_by: null,
9698
readme_path: '/api/v1/crates/rand/1.0.0/readme',
9799
rust_version: null,
100+
trustpub_data: null,
98101
updated_at: '2017-02-24T12:34:56Z',
99102
yanked: false,
100103
yank_message: null,

packages/crates-io-msw/handlers/versions/patch.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ test('yanks the version', async function () {
7272
published_by: null,
7373
readme_path: '/api/v1/crates/foo/1.0.0/readme',
7474
rust_version: null,
75+
trustpub_data: null,
7576
updated_at: '2017-02-24T12:34:56Z',
7677
yank_message: 'some reason',
7778
yanked: true,
@@ -102,6 +103,7 @@ test('yanks the version', async function () {
102103
published_by: null,
103104
readme_path: '/api/v1/crates/foo/1.0.0/readme',
104105
rust_version: null,
106+
trustpub_data: null,
105107
updated_at: '2017-02-24T12:34:56Z',
106108
yank_message: null,
107109
yanked: false,

packages/crates-io-msw/models/dependency.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ test('happy path', ({ expect }) => {
7676
"publishedBy": null,
7777
"readme": null,
7878
"rust_version": null,
79+
"trustpub_data": null,
7980
"updated_at": "2017-02-24T12:34:56Z",
8081
"yank_message": null,
8182
"yanked": false,

packages/crates-io-msw/models/version-download.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ test('happy path', ({ expect }) => {
4646
"publishedBy": null,
4747
"readme": null,
4848
"rust_version": null,
49+
"trustpub_data": null,
4950
"updated_at": "2017-02-24T12:34:56Z",
5051
"yank_message": null,
5152
"yanked": false,

packages/crates-io-msw/models/version.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export default {
1818
crate_size: Number,
1919
readme: nullable(String),
2020
rust_version: nullable(String),
21+
trustpub_data: nullable(Object),
2122

2223
crate: oneOf('crate'),
2324
publishedBy: nullable(oneOf('user')),
@@ -34,6 +35,7 @@ export default {
3435
applyDefault(attrs, 'crate_size', () => (((attrs.id + 13) * 42) % 13) * 54_321);
3536
applyDefault(attrs, 'readme', () => null);
3637
applyDefault(attrs, 'rust_version', () => null);
38+
applyDefault(attrs, 'trustpub_data', () => null);
3739

3840
if (!attrs.crate) {
3941
throw new Error(`Missing \`crate\` relationship on \`version:${attrs.num}\``);

0 commit comments

Comments
 (0)