- Notifications
You must be signed in to change notification settings - Fork927
Commit26b04cc
authored
chore: switch to generated types (#1394)
* Make column renderer use the same type as its keyThat way the renderer only takes `string` for example when rendering thename field instead of `string | number` when the interface has somefields that are strings and some fields are numbers.This will be necessary when switching to generated types since some ofthe fields are numbers (like the owner count on a template).* Switch fully to generated typesIn some places the organization ID is part of the URL but not part ofthe request so I separated out the ID into a separate argument in therelevant API functions.Otherwise this was a straightforward replacement where I mostly onlyneeded to change some of the interface names (User instead ofUserResponse for example) and add a few missing but required properties.I kind of winged the template form; I am not sure what the differencebetween a template and template version is or why the latter comesbefore the former so the form just returns all the data required tocreate both.* Delete handwritten typesExcept for UserAgent which seems to be purely frontend andReconnectingPTYRequest which is not in codersdk so I am just leaving itfor now.* Remove implemented omitempty as a future ideaThis was implemented in2d3dc43.* Add missing optionalities to generated request interfaces1 parent56076a0 commit26b04cc
File tree
30 files changed
+235
-298
lines changed- codersdk
- scripts/apitypings
- site/src
- api
- components
- CreateUserForm
- Footer
- NavbarView
- Table
- UserDropdown
- UserProfileCard
- UsersTable
- Workspace
- forms
- pages
- TemplatesPages
- OrganizationPage/TemplatePage
- UsersPage
- CreateUserPage
- testHelpers
- xServices
- auth
- buildInfo
- terminal
- users
- workspace
30 files changed
+235
-298
lines changedLines changed: 4 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
24 | 24 |
| |
25 | 25 |
| |
26 | 26 |
| |
27 |
| - | |
| 27 | + | |
28 | 28 |
| |
29 | 29 |
| |
30 | 30 |
| |
31 | 31 |
| |
32 | 32 |
| |
33 | 33 |
| |
34 |
| - | |
| 34 | + | |
35 | 35 |
| |
36 | 36 |
| |
37 | 37 |
| |
| |||
45 | 45 |
| |
46 | 46 |
| |
47 | 47 |
| |
48 |
| - | |
| 48 | + | |
49 | 49 |
| |
50 | 50 |
| |
51 | 51 |
| |
| |||
54 | 54 |
| |
55 | 55 |
| |
56 | 56 |
| |
57 |
| - | |
| 57 | + | |
58 | 58 |
| |
59 | 59 |
| |
60 | 60 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
21 | 21 |
| |
22 | 22 |
| |
23 | 23 |
| |
24 |
| - | |
| 24 | + | |
25 | 25 |
| |
26 |
| - | |
| 26 | + | |
27 | 27 |
| |
28 | 28 |
| |
29 | 29 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
31 | 31 |
| |
32 | 32 |
| |
33 | 33 |
| |
34 |
| - | |
| 34 | + | |
35 | 35 |
| |
36 |
| - | |
| 36 | + | |
37 | 37 |
| |
38 | 38 |
| |
39 | 39 |
| |
|
Lines changed: 1 addition & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5 | 5 |
| |
6 | 6 |
| |
7 | 7 |
| |
8 |
| - | |
| 8 | + | |
9 | 9 |
| |
10 | 10 |
| |
11 | 11 |
| |
| |||
36 | 36 |
| |
37 | 37 |
| |
38 | 38 |
| |
39 |
| - | |
40 | 39 |
|
Lines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | 2 |
| |
3 |
| - | |
| 3 | + | |
4 | 4 |
| |
5 | 5 |
| |
6 | 6 |
| |
| |||
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
15 |
| - | |
| 15 | + | |
16 | 16 |
| |
17 | 17 |
| |
18 | 18 |
| |
| |||
87 | 87 |
| |
88 | 88 |
| |
89 | 89 |
| |
90 |
| - | |
| 90 | + | |
91 | 91 |
| |
92 | 92 |
| |
93 | 93 |
| |
|
Lines changed: 38 additions & 27 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | 2 |
| |
3 |
| - | |
4 | 3 |
| |
5 | 4 |
| |
6 | 5 |
| |
7 | 6 |
| |
8 | 7 |
| |
9 | 8 |
| |
10 |
| - | |
| 9 | + | |
11 | 10 |
| |
12 | 11 |
| |
13 | 12 |
| |
| 13 | + | |
| 14 | + | |
14 | 15 |
| |
15 | 16 |
| |
16 | 17 |
| |
17 | 18 |
| |
| 19 | + | |
| 20 | + | |
18 | 21 |
| |
19 | 22 |
| |
20 | 23 |
| |
21 | 24 |
| |
22 |
| - | |
23 |
| - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
24 | 30 |
| |
25 | 31 |
| |
26 | 32 |
| |
| |||
43 | 49 |
| |
44 | 50 |
| |
45 | 51 |
| |
46 |
| - | |
| 52 | + | |
47 | 53 |
| |
48 | 54 |
| |
49 | 55 |
| |
50 | 56 |
| |
51 | 57 |
| |
52 |
| - | |
| 58 | + | |
53 | 59 |
| |
54 | 60 |
| |
55 | 61 |
| |
| |||
60 | 66 |
| |
61 | 67 |
| |
62 | 68 |
| |
63 |
| - | |
64 |
| - | |
| 69 | + | |
| 70 | + | |
65 | 71 |
| |
66 | 72 |
| |
67 | 73 |
| |
| |||
70 | 76 |
| |
71 | 77 |
| |
72 | 78 |
| |
73 |
| - | |
74 |
| - | |
| 79 | + | |
| 80 | + | |
75 | 81 |
| |
76 | 82 |
| |
77 | 83 |
| |
| |||
80 | 86 |
| |
81 | 87 |
| |
82 | 88 |
| |
83 |
| - | |
84 |
| - | |
| 89 | + | |
| 90 | + | |
85 | 91 |
| |
86 | 92 |
| |
87 | 93 |
| |
88 |
| - | |
89 |
| - | |
| 94 | + | |
| 95 | + | |
90 | 96 |
| |
91 | 97 |
| |
92 | 98 |
| |
93 |
| - | |
94 |
| - | |
| 99 | + | |
| 100 | + | |
95 | 101 |
| |
96 | 102 |
| |
97 | 103 |
| |
98 |
| - | |
99 |
| - | |
| 104 | + | |
| 105 | + | |
100 | 106 |
| |
101 | 107 |
| |
102 | 108 |
| |
103 | 109 |
| |
104 | 110 |
| |
105 | 111 |
| |
106 | 112 |
| |
107 |
| - | |
108 |
| - | |
| 113 | + | |
| 114 | + | |
109 | 115 |
| |
110 | 116 |
| |
111 | 117 |
| |
112 | 118 |
| |
113 | 119 |
| |
114 |
| - | |
115 |
| - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
116 | 124 |
| |
117 | 125 |
| |
118 | 126 |
| |
119 |
| - | |
| 127 | + | |
120 | 128 |
| |
121 | 129 |
| |
122 | 130 |
| |
123 | 131 |
| |
124 |
| - | |
| 132 | + | |
125 | 133 |
| |
126 | 134 |
| |
127 | 135 |
| |
128 | 136 |
| |
129 | 137 |
| |
130 | 138 |
| |
131 |
| - | |
| 139 | + | |
132 | 140 |
| |
133 | 141 |
| |
134 | 142 |
| |
| |||
138 | 146 |
| |
139 | 147 |
| |
140 | 148 |
| |
141 |
| - | |
| 149 | + | |
142 | 150 |
| |
143 | 151 |
| |
144 | 152 |
| |
145 | 153 |
| |
146 | 154 |
| |
147 | 155 |
| |
148 | 156 |
| |
149 |
| - | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
150 | 161 |
| |
151 | 162 |
| |
152 | 163 |
| |
|
Lines changed: 0 additions & 111 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 |
| - | |
2 |
| - | |
3 |
| - | |
4 |
| - | |
5 |
| - | |
6 |
| - | |
7 |
| - | |
8 |
| - | |
9 |
| - | |
10 |
| - | |
11 |
| - | |
12 |
| - | |
13 |
| - | |
14 |
| - | |
15 |
| - | |
16 |
| - | |
17 |
| - | |
18 |
| - | |
19 |
| - | |
20 |
| - | |
21 |
| - | |
22 |
| - | |
23 |
| - | |
24 |
| - | |
25 |
| - | |
26 |
| - | |
27 |
| - | |
28 |
| - | |
29 |
| - | |
30 |
| - | |
31 |
| - | |
32 |
| - | |
33 |
| - | |
34 |
| - | |
35 |
| - | |
36 |
| - | |
37 |
| - | |
38 |
| - | |
39 |
| - | |
40 |
| - | |
41 |
| - | |
42 |
| - | |
43 |
| - | |
44 |
| - | |
45 |
| - | |
46 |
| - | |
47 |
| - | |
48 |
| - | |
49 |
| - | |
50 |
| - | |
51 |
| - | |
52 |
| - | |
53 |
| - | |
54 |
| - | |
55 |
| - | |
56 |
| - | |
57 |
| - | |
58 |
| - | |
59 |
| - | |
60 |
| - | |
61 |
| - | |
62 |
| - | |
63 |
| - | |
64 |
| - | |
65 |
| - | |
66 |
| - | |
67 |
| - | |
68 |
| - | |
69 |
| - | |
70 |
| - | |
71 |
| - | |
72 |
| - | |
73 |
| - | |
74 |
| - | |
75 |
| - | |
76 |
| - | |
77 |
| - | |
78 |
| - | |
79 |
| - | |
80 |
| - | |
81 |
| - | |
82 |
| - | |
83 |
| - | |
84 |
| - | |
85 |
| - | |
86 |
| - | |
87 |
| - | |
88 |
| - | |
89 |
| - | |
90 |
| - | |
91 |
| - | |
92 |
| - | |
93 |
| - | |
94 |
| - | |
95 |
| - | |
96 |
| - | |
97 |
| - | |
98 |
| - | |
99 | 1 |
| |
100 | 2 |
| |
101 | 3 |
| |
102 | 4 |
| |
103 | 5 |
| |
104 | 6 |
| |
105 | 7 |
| |
106 |
| - | |
107 |
| - | |
108 |
| - | |
109 |
| - | |
110 |
| - | |
111 |
| - | |
112 |
| - | |
113 |
| - | |
114 |
| - | |
115 |
| - | |
116 |
| - | |
117 |
| - | |
118 |
| - | |
119 | 8 |
| |
120 | 9 |
| |
121 | 10 |
| |
|
0 commit comments
Comments
(0)