Skip to content

Commit efb0cfd

Browse files
committed
build(types): generate self-service openapi types
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent a787316 commit efb0cfd

File tree

1 file changed

+378
-0
lines changed

1 file changed

+378
-0
lines changed

src/types/openapi/openapi.ts

Lines changed: 378 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,378 @@
1+
/**
2+
* This file was auto-generated by openapi-typescript.
3+
* Do not make direct changes to the file.
4+
*/
5+
6+
export interface paths {
7+
"/ocs/v2.php/apps/profile_fields/api/v1/me/values": {
8+
parameters: {
9+
query?: never;
10+
header?: never;
11+
path?: never;
12+
cookie?: never;
13+
};
14+
/**
15+
* List user-visible fields for the authenticated user
16+
* @description Return active profile fields visible to the authenticated user, together with any current stored value and whether the user can edit the value directly.
17+
*/
18+
get: operations["field_value_api-index"];
19+
put?: never;
20+
post?: never;
21+
delete?: never;
22+
options?: never;
23+
head?: never;
24+
patch?: never;
25+
trace?: never;
26+
};
27+
"/ocs/v2.php/apps/profile_fields/api/v1/me/values/{fieldDefinitionId}": {
28+
parameters: {
29+
query?: never;
30+
header?: never;
31+
path?: never;
32+
cookie?: never;
33+
};
34+
get?: never;
35+
/**
36+
* Upsert the authenticated user's value for an editable field
37+
* @description Create or update the current user's value for a field that allows self-service editing.
38+
*/
39+
put: operations["field_value_api-upsert"];
40+
post?: never;
41+
delete?: never;
42+
options?: never;
43+
head?: never;
44+
patch?: never;
45+
trace?: never;
46+
};
47+
"/ocs/v2.php/apps/profile_fields/api/v1/me/values/{fieldDefinitionId}/visibility": {
48+
parameters: {
49+
query?: never;
50+
header?: never;
51+
path?: never;
52+
cookie?: never;
53+
};
54+
get?: never;
55+
/**
56+
* Update the visibility of the authenticated user's stored value
57+
* @description Change only the visibility of an already stored field value owned by the authenticated user.
58+
*/
59+
put: operations["field_value_api-update-visibility"];
60+
post?: never;
61+
delete?: never;
62+
options?: never;
63+
head?: never;
64+
patch?: never;
65+
trace?: never;
66+
};
67+
}
68+
export type webhooks = Record<string, never>;
69+
export interface components {
70+
schemas: {
71+
Definition: {
72+
/** Format: int64 */
73+
id: number;
74+
field_key: string;
75+
label: string;
76+
type: components["schemas"]["Type"];
77+
admin_only: boolean;
78+
user_editable: boolean;
79+
user_visible: boolean;
80+
initial_visibility: components["schemas"]["Visibility"];
81+
/** Format: int64 */
82+
sort_order: number;
83+
active: boolean;
84+
created_at: string;
85+
updated_at: string;
86+
};
87+
EditableField: {
88+
definition: components["schemas"]["Definition"];
89+
value: components["schemas"]["ValueRecord"];
90+
can_edit: boolean;
91+
};
92+
OCSMeta: {
93+
status: string;
94+
statuscode: number;
95+
message?: string;
96+
totalitems?: string;
97+
itemsperpage?: string;
98+
};
99+
/** @enum {string} */
100+
Type: "text" | "number";
101+
ValuePayload: {
102+
value: Record<string, never>;
103+
};
104+
ValueRecord: {
105+
/** Format: int64 */
106+
id: number;
107+
/** Format: int64 */
108+
field_definition_id: number;
109+
user_uid: string;
110+
value: components["schemas"]["ValuePayload"];
111+
current_visibility: components["schemas"]["Visibility"];
112+
updated_by_uid: string;
113+
updated_at: string;
114+
};
115+
/** @enum {string} */
116+
Visibility: "private" | "users" | "public";
117+
};
118+
responses: never;
119+
parameters: never;
120+
requestBodies: never;
121+
headers: never;
122+
pathItems: never;
123+
}
124+
export type $defs = Record<string, never>;
125+
export interface operations {
126+
"field_value_api-index": {
127+
parameters: {
128+
query?: never;
129+
header: {
130+
/** @description Required to be true for the API request to pass */
131+
"OCS-APIRequest": boolean;
132+
};
133+
path?: never;
134+
cookie?: never;
135+
};
136+
requestBody?: never;
137+
responses: {
138+
/** @description Editable profile fields listed successfully */
139+
200: {
140+
headers: {
141+
[name: string]: unknown;
142+
};
143+
content: {
144+
"application/json": {
145+
ocs: {
146+
meta: components["schemas"]["OCSMeta"];
147+
data: components["schemas"]["EditableField"][];
148+
};
149+
};
150+
};
151+
};
152+
/** @description Authenticated user is required */
153+
401: {
154+
headers: {
155+
[name: string]: unknown;
156+
};
157+
content: {
158+
"application/json": {
159+
ocs: {
160+
meta: components["schemas"]["OCSMeta"];
161+
data: {
162+
message: string;
163+
};
164+
};
165+
};
166+
};
167+
};
168+
};
169+
};
170+
"field_value_api-upsert": {
171+
parameters: {
172+
query?: never;
173+
header: {
174+
/** @description Required to be true for the API request to pass */
175+
"OCS-APIRequest": boolean;
176+
};
177+
path: {
178+
/** @description Identifier of the field definition */
179+
fieldDefinitionId: number;
180+
};
181+
cookie?: never;
182+
};
183+
requestBody?: {
184+
content: {
185+
"application/json": {
186+
/** @description Value payload to persist */
187+
value?: ({
188+
value?: (string | number | boolean) | null;
189+
} | string | number | boolean) | null;
190+
/** @description Visibility to apply to the stored value */
191+
currentVisibility?: string | null;
192+
};
193+
};
194+
};
195+
responses: {
196+
/** @description User field value stored successfully */
197+
200: {
198+
headers: {
199+
[name: string]: unknown;
200+
};
201+
content: {
202+
"application/json": {
203+
ocs: {
204+
meta: components["schemas"]["OCSMeta"];
205+
data: components["schemas"]["ValueRecord"];
206+
};
207+
};
208+
};
209+
};
210+
/** @description Invalid field value payload */
211+
400: {
212+
headers: {
213+
[name: string]: unknown;
214+
};
215+
content: {
216+
"application/json": {
217+
ocs: {
218+
meta: components["schemas"]["OCSMeta"];
219+
data: {
220+
message: string;
221+
};
222+
};
223+
};
224+
};
225+
};
226+
/** @description Authenticated user is required */
227+
401: {
228+
headers: {
229+
[name: string]: unknown;
230+
};
231+
content: {
232+
"application/json": {
233+
ocs: {
234+
meta: components["schemas"]["OCSMeta"];
235+
data: {
236+
message: string;
237+
};
238+
};
239+
};
240+
};
241+
};
242+
/** @description Field cannot be edited by the user */
243+
403: {
244+
headers: {
245+
[name: string]: unknown;
246+
};
247+
content: {
248+
"application/json": {
249+
ocs: {
250+
meta: components["schemas"]["OCSMeta"];
251+
data: {
252+
message: string;
253+
};
254+
};
255+
};
256+
};
257+
};
258+
/** @description Field definition not found */
259+
404: {
260+
headers: {
261+
[name: string]: unknown;
262+
};
263+
content: {
264+
"application/json": {
265+
ocs: {
266+
meta: components["schemas"]["OCSMeta"];
267+
data: {
268+
message: string;
269+
};
270+
};
271+
};
272+
};
273+
};
274+
};
275+
};
276+
"field_value_api-update-visibility": {
277+
parameters: {
278+
query?: never;
279+
header: {
280+
/** @description Required to be true for the API request to pass */
281+
"OCS-APIRequest": boolean;
282+
};
283+
path: {
284+
/** @description Identifier of the field definition */
285+
fieldDefinitionId: number;
286+
};
287+
cookie?: never;
288+
};
289+
requestBody: {
290+
content: {
291+
"application/json": {
292+
/** @description Visibility to apply to the stored value */
293+
currentVisibility: string;
294+
};
295+
};
296+
};
297+
responses: {
298+
/** @description Field visibility updated successfully */
299+
200: {
300+
headers: {
301+
[name: string]: unknown;
302+
};
303+
content: {
304+
"application/json": {
305+
ocs: {
306+
meta: components["schemas"]["OCSMeta"];
307+
data: components["schemas"]["ValueRecord"];
308+
};
309+
};
310+
};
311+
};
312+
/** @description Invalid visibility payload or value missing */
313+
400: {
314+
headers: {
315+
[name: string]: unknown;
316+
};
317+
content: {
318+
"application/json": {
319+
ocs: {
320+
meta: components["schemas"]["OCSMeta"];
321+
data: {
322+
message: string;
323+
};
324+
};
325+
};
326+
};
327+
};
328+
/** @description Authenticated user is required */
329+
401: {
330+
headers: {
331+
[name: string]: unknown;
332+
};
333+
content: {
334+
"application/json": {
335+
ocs: {
336+
meta: components["schemas"]["OCSMeta"];
337+
data: {
338+
message: string;
339+
};
340+
};
341+
};
342+
};
343+
};
344+
/** @description Field visibility cannot be changed by the user */
345+
403: {
346+
headers: {
347+
[name: string]: unknown;
348+
};
349+
content: {
350+
"application/json": {
351+
ocs: {
352+
meta: components["schemas"]["OCSMeta"];
353+
data: {
354+
message: string;
355+
};
356+
};
357+
};
358+
};
359+
};
360+
/** @description Field definition not found */
361+
404: {
362+
headers: {
363+
[name: string]: unknown;
364+
};
365+
content: {
366+
"application/json": {
367+
ocs: {
368+
meta: components["schemas"]["OCSMeta"];
369+
data: {
370+
message: string;
371+
};
372+
};
373+
};
374+
};
375+
};
376+
};
377+
};
378+
}

0 commit comments

Comments
 (0)