@profcomff/api-uilib 2024.7.27 → 2024.9.29
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/.github/workflows/autogen.yaml +1 -3
- package/.github/workflows/publish.yaml +8 -3
- package/README.md +74 -6
- package/package.json +5 -3
- package/{generate.js → scripts/generate.js} +0 -11
- package/scripts/setversion.js +22 -0
- package/src/index.ts +14 -11
- package/src/openapi/services.ts +16 -5
- package/src/openapi/timetable.ts +7 -248
- package/src/index.d.ts +0 -24
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
name: Autogen API bindings
|
|
5
5
|
|
|
6
6
|
on:
|
|
7
|
-
|
|
8
|
-
- cron: "30 00 * * *"
|
|
7
|
+
workflow_dispatch:
|
|
9
8
|
|
|
10
9
|
jobs:
|
|
11
10
|
generate:
|
|
@@ -30,7 +29,6 @@ jobs:
|
|
|
30
29
|
- name: Create Pull Request
|
|
31
30
|
uses: peter-evans/create-pull-request@v6
|
|
32
31
|
with:
|
|
33
|
-
commit-message:
|
|
34
32
|
branch: autogen
|
|
35
33
|
title: Automated API update
|
|
36
34
|
body: |
|
|
@@ -2,7 +2,8 @@ name: Publish package to npm
|
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
4
|
push:
|
|
5
|
-
|
|
5
|
+
tags:
|
|
6
|
+
- 'v*'
|
|
6
7
|
|
|
7
8
|
jobs:
|
|
8
9
|
publish-npm:
|
|
@@ -22,6 +23,10 @@ jobs:
|
|
|
22
23
|
|
|
23
24
|
- run: pnpm install
|
|
24
25
|
|
|
25
|
-
- run:
|
|
26
|
+
- run: |
|
|
27
|
+
VERSION=${{ github.ref_name }}
|
|
28
|
+
pnpm setVersion -v ${VERSION:1}
|
|
29
|
+
|
|
30
|
+
- run: pnpm publish --no-git-checks
|
|
26
31
|
env:
|
|
27
|
-
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
|
|
32
|
+
NODE_AUTH_TOKEN: ${{ secrets.npm_token }}
|
package/README.md
CHANGED
|
@@ -2,13 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
Представляет интерфейс для совершения запросов к API по адресу <https://api.profcomff.com>.
|
|
4
4
|
|
|
5
|
+
Поддерживает типы данных TypeScript и подсветку синтаксиса.
|
|
5
6
|
|
|
6
7
|
[<img src="https://cdn.profcomff.com/easycode/easycode.svg" width="200"></img>](https://easycode.profcomff.com/templates/docker-node/workspace?mode=manual¶m.Repository+URL=https://github.com/profcomff/api-uilib.git¶m.Working+directory=api-uilib)
|
|
7
8
|
|
|
9
|
+
|
|
8
10
|
## Использование
|
|
9
11
|
|
|
12
|
+
Установите библиотеку
|
|
13
|
+
|
|
14
|
+
```shell
|
|
15
|
+
pnpm install @profcomff/api-uilib
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Используйте для совершения запросов к <https://api.test.profcomff.com> и <https://api.profcomff.com>.
|
|
19
|
+
|
|
10
20
|
```ts
|
|
11
|
-
import { createClient } from
|
|
21
|
+
import { createClient } from "@profcomff/api-uilib";
|
|
12
22
|
|
|
13
23
|
// Setup client with base API path
|
|
14
24
|
// You can use environment `import.meta.env.VITE_API_URL` for example
|
|
@@ -20,10 +30,68 @@ setupAuth("myApiTokenHere");
|
|
|
20
30
|
|
|
21
31
|
// Make request
|
|
22
32
|
const me_with_scopes = await apiClient.GET("/auth/me", {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
33
|
+
params: {
|
|
34
|
+
query: {
|
|
35
|
+
info: ["session_scopes"],
|
|
36
|
+
},
|
|
37
|
+
},
|
|
28
38
|
});
|
|
29
39
|
```
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
## Тестирование
|
|
43
|
+
|
|
44
|
+
_На основе <https://openapi-ts.dev/openapi-fetch/testing>._
|
|
45
|
+
|
|
46
|
+
```ts
|
|
47
|
+
import { createTestClient } from "@profcomff/api-uilib";
|
|
48
|
+
import { http, HttpResponse } from 'msw';
|
|
49
|
+
import { afterEach, beforeAll, afterAll, expect, test } from 'vitest';
|
|
50
|
+
import { setupServer } from 'msw/node';
|
|
51
|
+
|
|
52
|
+
export const server = setupServer();
|
|
53
|
+
|
|
54
|
+
beforeAll(() => {
|
|
55
|
+
server.listen({
|
|
56
|
+
onUnhandledRequest: request => {
|
|
57
|
+
throw new Error(`No request handler found for ${request.method} ${request.url}`);
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
afterEach(() => server.resetHandlers());
|
|
63
|
+
afterAll(() => server.close());
|
|
64
|
+
|
|
65
|
+
test('Get basic info from Auth API with hardload', async () => {
|
|
66
|
+
const baseUrl = import.meta.env.VITE_API_URL;
|
|
67
|
+
|
|
68
|
+
const rawData = {
|
|
69
|
+
id: 1,
|
|
70
|
+
email: 'hello@world.com',
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
server.use(http.get(`${baseUrl}/auth/user/1`, () => HttpResponse.json(rawData, { status: 200 })));
|
|
74
|
+
const testClient = createTestClient({ baseUrl }); // Клиент API должен быть инициализирован ПОСЛЕ msw сервера
|
|
75
|
+
|
|
76
|
+
const { data, error } = await testClient
|
|
77
|
+
.GET(
|
|
78
|
+
'/auth/user/{user_id}',
|
|
79
|
+
{ params: { path: { user_id: this.id } },
|
|
80
|
+
});
|
|
81
|
+
expect(data).toEqual(rawData);
|
|
82
|
+
expect(error).toBeUndefined();
|
|
83
|
+
});
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
## Разработка
|
|
88
|
+
|
|
89
|
+
### Автоматическая генерация
|
|
90
|
+
|
|
91
|
+
Используйте команду `pnpm generate` или [CI-пайплайн Autogen API bindings](https://github.com/profcomff/api-uilib/actions/workflows/autogen.yaml) для кодогенерации последней версии биндингов с **продового** API <https://api.profcomff.com>.
|
|
92
|
+
|
|
93
|
+
CI исполняется вручную по нажатии кнопки run workflow. После завершения исполнения новая версия будет доступна для ревью в виде Pull Request с названием "Automated API update".
|
|
94
|
+
|
|
95
|
+
### Релизный процесс
|
|
96
|
+
|
|
97
|
+
Библиотека релизится по созданию тега вида `v*`, где вместо звездочки идет описание версии [по правилам semver](https://semver.org/lang/ru/). Менять версию в `package.json` не нужно.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@profcomff/api-uilib",
|
|
3
|
-
"version": "2024.
|
|
3
|
+
"version": "2024.09.29",
|
|
4
4
|
"description": "API wrappers, autogenerated from openapi.json files",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.d.ts",
|
|
@@ -14,12 +14,14 @@
|
|
|
14
14
|
"@npmcli/package-json": "^5.2.0",
|
|
15
15
|
"openapi-typescript": "^7.1.0",
|
|
16
16
|
"simple-git": "^3.25.0",
|
|
17
|
-
"typescript": "^5.5.4"
|
|
17
|
+
"typescript": "^5.5.4",
|
|
18
|
+
"yargs-parser": "^21.1.1"
|
|
18
19
|
},
|
|
19
20
|
"dependencies": {
|
|
20
21
|
"openapi-fetch": "^0.10.2"
|
|
21
22
|
},
|
|
22
23
|
"scripts": {
|
|
23
|
-
"
|
|
24
|
+
"setVersion": "node ./scripts/setversion.js",
|
|
25
|
+
"generate": "node ./scripts/generate.js"
|
|
24
26
|
}
|
|
25
27
|
}
|
|
@@ -63,7 +63,6 @@ const generate = async () => {
|
|
|
63
63
|
*/
|
|
64
64
|
const updateRepo = async () => {
|
|
65
65
|
const git = simpleGit();
|
|
66
|
-
const date = new Date();
|
|
67
66
|
|
|
68
67
|
// Ensure status
|
|
69
68
|
let status = await git.status();
|
|
@@ -72,16 +71,6 @@ const updateRepo = async () => {
|
|
|
72
71
|
return;
|
|
73
72
|
}
|
|
74
73
|
console.log(`${Object.keys(status.modified).length} files changed`);
|
|
75
|
-
|
|
76
|
-
// Change version in package.json file
|
|
77
|
-
const pkgJson = await PackageJson.load(".");
|
|
78
|
-
pkgJson.update({
|
|
79
|
-
version: `${date.getUTCFullYear()}.${date.getUTCMonth()+1}.${date.getUTCDate()}`,
|
|
80
|
-
});
|
|
81
|
-
pkgJson.save();
|
|
82
|
-
console.log(
|
|
83
|
-
`package.json version updated to ${date.getUTCFullYear()}.${date.getUTCMonth()+1}.${date.getUTCDate()}`
|
|
84
|
-
);
|
|
85
74
|
};
|
|
86
75
|
|
|
87
76
|
generate().then(() => {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const parser = require("yargs-parser");
|
|
2
|
+
const PackageJson = require("@npmcli/package-json");
|
|
3
|
+
|
|
4
|
+
const updateRepo = async (version) => {
|
|
5
|
+
// Change version in package.json file
|
|
6
|
+
const pkgJson = await PackageJson.load(".");
|
|
7
|
+
pkgJson.update({
|
|
8
|
+
version: version,
|
|
9
|
+
});
|
|
10
|
+
pkgJson.save();
|
|
11
|
+
console.log(`package.json version updated to ${version}`);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const [, , ...args] = process.argv;
|
|
15
|
+
const flags = parser(args, {
|
|
16
|
+
string: ["version"],
|
|
17
|
+
alias: {
|
|
18
|
+
version: ["v"],
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
updateRepo(flags.version);
|
package/src/index.ts
CHANGED
|
@@ -4,7 +4,6 @@ import { Middleware } from "openapi-fetch";
|
|
|
4
4
|
import type { paths as achievementPaths } from "./openapi/achievement.ts";
|
|
5
5
|
import type { paths as authPaths } from "./openapi/auth.ts";
|
|
6
6
|
import type { paths as marketingPaths } from "./openapi/marketing.ts";
|
|
7
|
-
import type { paths as pingerPaths } from "./openapi/pinger.ts";
|
|
8
7
|
import type { paths as printPaths } from "./openapi/print.ts";
|
|
9
8
|
import type { paths as servicesPaths } from "./openapi/services.ts";
|
|
10
9
|
import type { paths as socialPaths } from "./openapi/social.ts";
|
|
@@ -12,14 +11,10 @@ import type { paths as timetablePaths } from "./openapi/timetable.ts";
|
|
|
12
11
|
import type { paths as userdataPaths } from "./openapi/userdata.ts";
|
|
13
12
|
|
|
14
13
|
|
|
15
|
-
let currentClient: ReturnType<typeof Client> | undefined = undefined;
|
|
16
|
-
let currentToken: string | undefined = undefined;
|
|
17
|
-
|
|
18
14
|
export type paths = (
|
|
19
15
|
achievementPaths &
|
|
20
16
|
authPaths &
|
|
21
17
|
marketingPaths &
|
|
22
|
-
pingerPaths &
|
|
23
18
|
printPaths &
|
|
24
19
|
servicesPaths &
|
|
25
20
|
socialPaths &
|
|
@@ -27,33 +22,41 @@ export type paths = (
|
|
|
27
22
|
userdataPaths
|
|
28
23
|
);
|
|
29
24
|
|
|
25
|
+
let currentClient: ReturnType<typeof Client<paths>> | undefined = undefined;
|
|
26
|
+
let currentToken: string | undefined = undefined;
|
|
27
|
+
|
|
30
28
|
const authMiddleware: Middleware = {
|
|
31
29
|
async onRequest({ request, options }) {
|
|
32
|
-
|
|
30
|
+
if (currentToken) {
|
|
31
|
+
request.headers.set("Authorization", currentToken);
|
|
32
|
+
}
|
|
33
33
|
return request;
|
|
34
34
|
},
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
-
export const createClient = (baseUrl: string) => {
|
|
37
|
+
export const createClient = (baseUrl: string): ReturnType<typeof Client<paths>> => {
|
|
38
38
|
if (currentClient) {
|
|
39
39
|
throw new Error("Client already initialized");
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
currentClient = Client<paths>({ baseUrl })
|
|
43
|
-
if (currentToken
|
|
43
|
+
if (currentToken) {
|
|
44
44
|
currentClient.use(authMiddleware);
|
|
45
45
|
}
|
|
46
46
|
return currentClient;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
export const
|
|
49
|
+
export const createTestClient = (baseUrl: string): ReturnType<typeof Client<paths>> => {
|
|
50
|
+
return Client<paths>({ baseUrl });
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export const setupAuth = (newToken: string | undefined) => {
|
|
50
54
|
currentToken = newToken;
|
|
51
55
|
if (currentClient !== undefined) {
|
|
52
|
-
if (newToken
|
|
56
|
+
if (!newToken) {
|
|
53
57
|
currentClient.eject(authMiddleware)
|
|
54
58
|
} else {
|
|
55
59
|
currentClient.use(authMiddleware);
|
|
56
60
|
}
|
|
57
61
|
}
|
|
58
62
|
}
|
|
59
|
-
|
package/src/openapi/services.ts
CHANGED
|
@@ -163,6 +163,12 @@ export interface components {
|
|
|
163
163
|
* @description Иконка кнопки
|
|
164
164
|
*/
|
|
165
165
|
icon: string;
|
|
166
|
+
/**
|
|
167
|
+
* Is Hidden
|
|
168
|
+
* @description Спрятана ли кнопка от пользователя
|
|
169
|
+
* @default false
|
|
170
|
+
*/
|
|
171
|
+
is_hidden: boolean;
|
|
166
172
|
/**
|
|
167
173
|
* Link
|
|
168
174
|
* @description Ссылка, на которую перенаправляет кнопка
|
|
@@ -175,12 +181,12 @@ export interface components {
|
|
|
175
181
|
name: string;
|
|
176
182
|
/**
|
|
177
183
|
* Optional Scopes
|
|
178
|
-
* @description
|
|
184
|
+
* @description Какиеп скоупы желательны
|
|
179
185
|
*/
|
|
180
186
|
optional_scopes?: string[] | null;
|
|
181
187
|
/**
|
|
182
188
|
* Required Scopes
|
|
183
|
-
* @description
|
|
189
|
+
* @description Какие скоупы нужны, чтобы кнопка была доступна
|
|
184
190
|
*/
|
|
185
191
|
required_scopes?: string[] | null;
|
|
186
192
|
/** @description Тип открываемой ссылки (Ссылка приложения/Браузер в приложении/Браузер */
|
|
@@ -244,6 +250,11 @@ export interface components {
|
|
|
244
250
|
* @description Иконка кнопки
|
|
245
251
|
*/
|
|
246
252
|
icon?: string | null;
|
|
253
|
+
/**
|
|
254
|
+
* Is Hidden
|
|
255
|
+
* @description Спрятана ли кнопка от пользователя
|
|
256
|
+
*/
|
|
257
|
+
is_hidden?: boolean | null;
|
|
247
258
|
/**
|
|
248
259
|
* Link
|
|
249
260
|
* @description Ссылка, на которую перенаправляет кнопка
|
|
@@ -256,7 +267,7 @@ export interface components {
|
|
|
256
267
|
name?: string | null;
|
|
257
268
|
/**
|
|
258
269
|
* Optional Scopes
|
|
259
|
-
* @description
|
|
270
|
+
* @description Какие скоупы желательны
|
|
260
271
|
*/
|
|
261
272
|
optional_scopes?: string[] | null;
|
|
262
273
|
/**
|
|
@@ -266,7 +277,7 @@ export interface components {
|
|
|
266
277
|
order?: number | null;
|
|
267
278
|
/**
|
|
268
279
|
* Required Scopes
|
|
269
|
-
* @description
|
|
280
|
+
* @description Какие скоупы нужны, чтобы кнопка была доступна
|
|
270
281
|
*/
|
|
271
282
|
required_scopes?: string[] | null;
|
|
272
283
|
/** @description Тип открываемой ссылки (Ссылка приложения/Браузер в приложении/Браузер */
|
|
@@ -276,7 +287,7 @@ export interface components {
|
|
|
276
287
|
* ButtonView
|
|
277
288
|
* @enum {string}
|
|
278
289
|
*/
|
|
279
|
-
ButtonView: "active" | "blocked";
|
|
290
|
+
ButtonView: "active" | "blocked" | "hidden";
|
|
280
291
|
/** CategoryCreate */
|
|
281
292
|
CategoryCreate: {
|
|
282
293
|
/**
|
package/src/openapi/timetable.ts
CHANGED
|
@@ -211,11 +211,9 @@ export interface paths {
|
|
|
211
211
|
path?: never;
|
|
212
212
|
cookie?: never;
|
|
213
213
|
};
|
|
214
|
-
|
|
215
|
-
get: operations["get_all_lecturer_comments_lecturer__lecturer_id__comment__get"];
|
|
214
|
+
get?: never;
|
|
216
215
|
put?: never;
|
|
217
|
-
|
|
218
|
-
post: operations["comment_lecturer_lecturer__lecturer_id__comment__post"];
|
|
216
|
+
post?: never;
|
|
219
217
|
delete?: never;
|
|
220
218
|
options?: never;
|
|
221
219
|
head?: never;
|
|
@@ -229,16 +227,13 @@ export interface paths {
|
|
|
229
227
|
path?: never;
|
|
230
228
|
cookie?: never;
|
|
231
229
|
};
|
|
232
|
-
|
|
233
|
-
get: operations["get_comment_lecturer__lecturer_id__comment__id__get"];
|
|
230
|
+
get?: never;
|
|
234
231
|
put?: never;
|
|
235
232
|
post?: never;
|
|
236
|
-
|
|
237
|
-
delete: operations["delete_comment_lecturer__lecturer_id__comment__id__delete"];
|
|
233
|
+
delete?: never;
|
|
238
234
|
options?: never;
|
|
239
235
|
head?: never;
|
|
240
|
-
|
|
241
|
-
patch: operations["update_comment_lecturer_lecturer__lecturer_id__comment__id__patch"];
|
|
236
|
+
patch?: never;
|
|
242
237
|
trace?: never;
|
|
243
238
|
};
|
|
244
239
|
"/timetable/lecturer/{lecturer_id}/comment/{id}/review/": {
|
|
@@ -250,8 +245,7 @@ export interface paths {
|
|
|
250
245
|
};
|
|
251
246
|
get?: never;
|
|
252
247
|
put?: never;
|
|
253
|
-
|
|
254
|
-
post: operations["review_comment_lecturer__lecturer_id__comment__id__review__post"];
|
|
248
|
+
post?: never;
|
|
255
249
|
delete?: never;
|
|
256
250
|
options?: never;
|
|
257
251
|
head?: never;
|
|
@@ -265,8 +259,7 @@ export interface paths {
|
|
|
265
259
|
path?: never;
|
|
266
260
|
cookie?: never;
|
|
267
261
|
};
|
|
268
|
-
|
|
269
|
-
get: operations["get_unreviewed_comments_lecturer__lecturer_id__comment_review__get"];
|
|
262
|
+
get?: never;
|
|
270
263
|
put?: never;
|
|
271
264
|
post?: never;
|
|
272
265
|
delete?: never;
|
|
@@ -1587,240 +1580,6 @@ export interface operations {
|
|
|
1587
1580
|
};
|
|
1588
1581
|
};
|
|
1589
1582
|
};
|
|
1590
|
-
get_all_lecturer_comments_lecturer__lecturer_id__comment__get: {
|
|
1591
|
-
parameters: {
|
|
1592
|
-
query?: {
|
|
1593
|
-
limit?: number;
|
|
1594
|
-
offset?: number;
|
|
1595
|
-
};
|
|
1596
|
-
header?: never;
|
|
1597
|
-
path: {
|
|
1598
|
-
lecturer_id: number;
|
|
1599
|
-
};
|
|
1600
|
-
cookie?: never;
|
|
1601
|
-
};
|
|
1602
|
-
requestBody?: never;
|
|
1603
|
-
responses: {
|
|
1604
|
-
/** @description Successful Response */
|
|
1605
|
-
200: {
|
|
1606
|
-
headers: {
|
|
1607
|
-
[name: string]: unknown;
|
|
1608
|
-
};
|
|
1609
|
-
content: {
|
|
1610
|
-
"application/json": components["schemas"]["LecturerComments"];
|
|
1611
|
-
};
|
|
1612
|
-
};
|
|
1613
|
-
/** @description Validation Error */
|
|
1614
|
-
422: {
|
|
1615
|
-
headers: {
|
|
1616
|
-
[name: string]: unknown;
|
|
1617
|
-
};
|
|
1618
|
-
content: {
|
|
1619
|
-
"application/json": components["schemas"]["HTTPValidationError"];
|
|
1620
|
-
};
|
|
1621
|
-
};
|
|
1622
|
-
};
|
|
1623
|
-
};
|
|
1624
|
-
comment_lecturer_lecturer__lecturer_id__comment__post: {
|
|
1625
|
-
parameters: {
|
|
1626
|
-
query?: never;
|
|
1627
|
-
header?: never;
|
|
1628
|
-
path: {
|
|
1629
|
-
lecturer_id: number;
|
|
1630
|
-
};
|
|
1631
|
-
cookie?: never;
|
|
1632
|
-
};
|
|
1633
|
-
requestBody: {
|
|
1634
|
-
content: {
|
|
1635
|
-
"application/json": components["schemas"]["LecturerCommentPost"];
|
|
1636
|
-
};
|
|
1637
|
-
};
|
|
1638
|
-
responses: {
|
|
1639
|
-
/** @description Successful Response */
|
|
1640
|
-
200: {
|
|
1641
|
-
headers: {
|
|
1642
|
-
[name: string]: unknown;
|
|
1643
|
-
};
|
|
1644
|
-
content: {
|
|
1645
|
-
"application/json": components["schemas"]["CommentLecturer"];
|
|
1646
|
-
};
|
|
1647
|
-
};
|
|
1648
|
-
/** @description Validation Error */
|
|
1649
|
-
422: {
|
|
1650
|
-
headers: {
|
|
1651
|
-
[name: string]: unknown;
|
|
1652
|
-
};
|
|
1653
|
-
content: {
|
|
1654
|
-
"application/json": components["schemas"]["HTTPValidationError"];
|
|
1655
|
-
};
|
|
1656
|
-
};
|
|
1657
|
-
};
|
|
1658
|
-
};
|
|
1659
|
-
get_comment_lecturer__lecturer_id__comment__id__get: {
|
|
1660
|
-
parameters: {
|
|
1661
|
-
query?: never;
|
|
1662
|
-
header?: never;
|
|
1663
|
-
path: {
|
|
1664
|
-
id: number;
|
|
1665
|
-
lecturer_id: number;
|
|
1666
|
-
};
|
|
1667
|
-
cookie?: never;
|
|
1668
|
-
};
|
|
1669
|
-
requestBody?: never;
|
|
1670
|
-
responses: {
|
|
1671
|
-
/** @description Successful Response */
|
|
1672
|
-
200: {
|
|
1673
|
-
headers: {
|
|
1674
|
-
[name: string]: unknown;
|
|
1675
|
-
};
|
|
1676
|
-
content: {
|
|
1677
|
-
"application/json": components["schemas"]["CommentLecturer"];
|
|
1678
|
-
};
|
|
1679
|
-
};
|
|
1680
|
-
/** @description Validation Error */
|
|
1681
|
-
422: {
|
|
1682
|
-
headers: {
|
|
1683
|
-
[name: string]: unknown;
|
|
1684
|
-
};
|
|
1685
|
-
content: {
|
|
1686
|
-
"application/json": components["schemas"]["HTTPValidationError"];
|
|
1687
|
-
};
|
|
1688
|
-
};
|
|
1689
|
-
};
|
|
1690
|
-
};
|
|
1691
|
-
delete_comment_lecturer__lecturer_id__comment__id__delete: {
|
|
1692
|
-
parameters: {
|
|
1693
|
-
query?: never;
|
|
1694
|
-
header?: never;
|
|
1695
|
-
path: {
|
|
1696
|
-
id: number;
|
|
1697
|
-
lecturer_id: number;
|
|
1698
|
-
};
|
|
1699
|
-
cookie?: never;
|
|
1700
|
-
};
|
|
1701
|
-
requestBody?: never;
|
|
1702
|
-
responses: {
|
|
1703
|
-
/** @description Successful Response */
|
|
1704
|
-
200: {
|
|
1705
|
-
headers: {
|
|
1706
|
-
[name: string]: unknown;
|
|
1707
|
-
};
|
|
1708
|
-
content: {
|
|
1709
|
-
"application/json": unknown;
|
|
1710
|
-
};
|
|
1711
|
-
};
|
|
1712
|
-
/** @description Validation Error */
|
|
1713
|
-
422: {
|
|
1714
|
-
headers: {
|
|
1715
|
-
[name: string]: unknown;
|
|
1716
|
-
};
|
|
1717
|
-
content: {
|
|
1718
|
-
"application/json": components["schemas"]["HTTPValidationError"];
|
|
1719
|
-
};
|
|
1720
|
-
};
|
|
1721
|
-
};
|
|
1722
|
-
};
|
|
1723
|
-
update_comment_lecturer_lecturer__lecturer_id__comment__id__patch: {
|
|
1724
|
-
parameters: {
|
|
1725
|
-
query?: never;
|
|
1726
|
-
header?: never;
|
|
1727
|
-
path: {
|
|
1728
|
-
id: number;
|
|
1729
|
-
lecturer_id: number;
|
|
1730
|
-
};
|
|
1731
|
-
cookie?: never;
|
|
1732
|
-
};
|
|
1733
|
-
requestBody: {
|
|
1734
|
-
content: {
|
|
1735
|
-
"application/json": components["schemas"]["LecturerCommentPatch"];
|
|
1736
|
-
};
|
|
1737
|
-
};
|
|
1738
|
-
responses: {
|
|
1739
|
-
/** @description Successful Response */
|
|
1740
|
-
200: {
|
|
1741
|
-
headers: {
|
|
1742
|
-
[name: string]: unknown;
|
|
1743
|
-
};
|
|
1744
|
-
content: {
|
|
1745
|
-
"application/json": components["schemas"]["CommentLecturer"];
|
|
1746
|
-
};
|
|
1747
|
-
};
|
|
1748
|
-
/** @description Validation Error */
|
|
1749
|
-
422: {
|
|
1750
|
-
headers: {
|
|
1751
|
-
[name: string]: unknown;
|
|
1752
|
-
};
|
|
1753
|
-
content: {
|
|
1754
|
-
"application/json": components["schemas"]["HTTPValidationError"];
|
|
1755
|
-
};
|
|
1756
|
-
};
|
|
1757
|
-
};
|
|
1758
|
-
};
|
|
1759
|
-
review_comment_lecturer__lecturer_id__comment__id__review__post: {
|
|
1760
|
-
parameters: {
|
|
1761
|
-
query?: {
|
|
1762
|
-
action?: "Approved" | "Declined";
|
|
1763
|
-
};
|
|
1764
|
-
header?: never;
|
|
1765
|
-
path: {
|
|
1766
|
-
id: number;
|
|
1767
|
-
lecturer_id: number;
|
|
1768
|
-
};
|
|
1769
|
-
cookie?: never;
|
|
1770
|
-
};
|
|
1771
|
-
requestBody?: never;
|
|
1772
|
-
responses: {
|
|
1773
|
-
/** @description Successful Response */
|
|
1774
|
-
200: {
|
|
1775
|
-
headers: {
|
|
1776
|
-
[name: string]: unknown;
|
|
1777
|
-
};
|
|
1778
|
-
content: {
|
|
1779
|
-
"application/json": components["schemas"]["CommentLecturer"];
|
|
1780
|
-
};
|
|
1781
|
-
};
|
|
1782
|
-
/** @description Validation Error */
|
|
1783
|
-
422: {
|
|
1784
|
-
headers: {
|
|
1785
|
-
[name: string]: unknown;
|
|
1786
|
-
};
|
|
1787
|
-
content: {
|
|
1788
|
-
"application/json": components["schemas"]["HTTPValidationError"];
|
|
1789
|
-
};
|
|
1790
|
-
};
|
|
1791
|
-
};
|
|
1792
|
-
};
|
|
1793
|
-
get_unreviewed_comments_lecturer__lecturer_id__comment_review__get: {
|
|
1794
|
-
parameters: {
|
|
1795
|
-
query?: never;
|
|
1796
|
-
header?: never;
|
|
1797
|
-
path: {
|
|
1798
|
-
lecturer_id: number;
|
|
1799
|
-
};
|
|
1800
|
-
cookie?: never;
|
|
1801
|
-
};
|
|
1802
|
-
requestBody?: never;
|
|
1803
|
-
responses: {
|
|
1804
|
-
/** @description Successful Response */
|
|
1805
|
-
200: {
|
|
1806
|
-
headers: {
|
|
1807
|
-
[name: string]: unknown;
|
|
1808
|
-
};
|
|
1809
|
-
content: {
|
|
1810
|
-
"application/json": components["schemas"]["CommentLecturer"][];
|
|
1811
|
-
};
|
|
1812
|
-
};
|
|
1813
|
-
/** @description Validation Error */
|
|
1814
|
-
422: {
|
|
1815
|
-
headers: {
|
|
1816
|
-
[name: string]: unknown;
|
|
1817
|
-
};
|
|
1818
|
-
content: {
|
|
1819
|
-
"application/json": components["schemas"]["HTTPValidationError"];
|
|
1820
|
-
};
|
|
1821
|
-
};
|
|
1822
|
-
};
|
|
1823
|
-
};
|
|
1824
1583
|
get_lecturer_photos_lecturer__lecturer_id__photo_get: {
|
|
1825
1584
|
parameters: {
|
|
1826
1585
|
query?: {
|
package/src/index.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import Client from "openapi-fetch";
|
|
2
|
-
import type { paths as achievementPaths } from "./openapi/achievement.ts";
|
|
3
|
-
import type { paths as authPaths } from "./openapi/auth.ts";
|
|
4
|
-
import type { paths as marketingPaths } from "./openapi/marketing.ts";
|
|
5
|
-
import type { paths as pingerPaths } from "./openapi/pinger.ts";
|
|
6
|
-
import type { paths as printPaths } from "./openapi/print.ts";
|
|
7
|
-
import type { paths as servicesPaths } from "./openapi/services.ts";
|
|
8
|
-
import type { paths as socialPaths } from "./openapi/social.ts";
|
|
9
|
-
import type { paths as timetablePaths } from "./openapi/timetable.ts";
|
|
10
|
-
import type { paths as userdataPaths } from "./openapi/userdata.ts";
|
|
11
|
-
|
|
12
|
-
export type paths = (
|
|
13
|
-
achievementPaths &
|
|
14
|
-
authPaths &
|
|
15
|
-
marketingPaths &
|
|
16
|
-
pingerPaths &
|
|
17
|
-
printPaths &
|
|
18
|
-
servicesPaths &
|
|
19
|
-
socialPaths &
|
|
20
|
-
timetablePaths &
|
|
21
|
-
userdataPaths
|
|
22
|
-
);
|
|
23
|
-
export function createClient(baseUrl: string): ReturnType<typeof Client<paths>>;
|
|
24
|
-
export function setupAuth(newToken: string | null): void;
|