Skip to content

Commit 054164e

Browse files
authored
formatting (#312)
## Изменения <!-- Опишите здесь на языке, понятном каждому, изменения, сделанные в исходном коде по пунктам. --> Прогнал форматирование согласно #306, почистил часть кода. ## Детали реализации <!-- Здесь можно описать технические детали по пунктам. --> ## Check-List <!-- После сохранения у следующих полей появятся галочки, которые нужно проставить мышкой --> - [ ] Вы проверили свой код перед отправкой запроса? - [ ] Вы написали тесты к реализованным функциям? - [ ] Вы не забыли применить форматирование `black` и `isort` для _Back-End_ или `Prettier` для _Front-End_?
1 parent e842eca commit 054164e

File tree

8 files changed

+37
-449
lines changed

8 files changed

+37
-449
lines changed

package.json

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"lint": "eslint \"**/*.{vue,ts}\"",
1414
"lint:fix": "eslint \"**/*.{vue,ts}\" --fix",
1515
"lint:deadcode": "knip --exclude binaries,dependencies,unlisted",
16-
"lint:circular": "dpdm --exit-code circular:1 --no-tree --no-warning --progress false --transform './src/main.ts'",
16+
"lint:circular": "dpdm --exit-code circular:1 --no-tree --no-warning --progress false --transform ./src/main.ts",
1717
"prettier": "prettier . --check",
1818
"prettier:write": "prettier . --write",
1919
"stylelint": "stylelint \"**/*.{vue,css}\"",
@@ -26,21 +26,17 @@
2626
"markdown-it": "^14.1.0",
2727
"openapi-fetch": "^0.13.0",
2828
"pinia": "^2.2.6",
29-
"query-string": "^9.1.1",
3029
"ua-parser-js": "^1.0.39",
3130
"vue": "^3.5.13",
3231
"vue-router": "^4.4.5",
3332
"workbox-window": "^7.3.0"
3433
},
3534
"devDependencies": {
36-
"@eslint/eslintrc": "^3.2.0",
3735
"@eslint/js": "^9.15.0",
3836
"@profcomff/api-uilib": "^2024.9.29",
3937
"@types/markdown-it": "^14.1.2",
4038
"@types/node": "^22.9.3",
4139
"@types/ua-parser-js": "^0.7.39",
42-
"@typescript-eslint/eslint-plugin": "^8.15.0",
43-
"@typescript-eslint/parser": "^8.15.0",
4440
"@vitejs/plugin-vue": "^5.2.0",
4541
"@vue/eslint-config-typescript": "^14.1.3",
4642
"dpdm": "^3.14.0",
@@ -50,7 +46,6 @@
5046
"eslint-plugin-vue": "^9.31.0",
5147
"globals": "^15.12.0",
5248
"knip": "^5.45.0",
53-
"openapi-typescript": "^7.4.3",
5449
"postcss": "^8.4.49",
5550
"postcss-html": "^1.7.0",
5651
"postcss-preset-env": "^10.1.1",
@@ -61,9 +56,7 @@
6156
"typescript": "5.6.3",
6257
"typescript-eslint": "^8.26.0",
6358
"vite": "^5.4.11",
64-
"vite-plugin-eslint": "^1.8.1",
6559
"vite-plugin-pwa": "^0.21.0",
66-
"vite-plugin-stylelint": "^5.3.1",
6760
"vite-plugin-vuetify": "^2.0.4",
6861
"vitest": "^2.1.5",
6962
"vue-tsc": "^2.1.10",

pnpm-lock.yaml

Lines changed: 24 additions & 391 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/api/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { createClient } from '@profcomff/api-uilib';
22
import { type Middleware } from 'openapi-fetch';
33
import { ApiError, ErrorInfo } from './types';
44

5-
export function recordError(url: string, status: number, error: ApiError | undefined) {
5+
function recordError(url: string, status: number, error: ApiError | undefined) {
66
if (error) {
77
const errorInfo: ErrorInfo = {
88
url,

src/api/controllers/auth/AuthApi.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,23 @@ import { UNKNOWN_DEVICE } from '@/models';
99
import router from '@/router';
1010
import { apiClient } from '../../client';
1111

12-
export enum UserInfo {
12+
enum UserInfo {
1313
Groups = 'groups',
1414
IndirectGroups = 'indirect_groups',
1515
Scopes = 'scopes',
1616
}
1717

18-
export enum SessionInfo {
18+
enum SessionInfo {
1919
SessionScopes = 'session_scopes',
2020
Token = 'token',
2121
Expires = 'expires',
2222
}
2323

24-
export type MySessionInfo =
24+
type MySessionInfo =
2525
| ('groups' | 'indirect_groups' | 'session_scopes' | 'user_scopes' | 'auth_methods')[]
2626
| undefined;
2727

28-
export type UserSessionById =
29-
| ('groups' | 'indirect_groups' | 'auth_methods' | 'scopes')[]
30-
| undefined;
28+
type UserSessionById = ('groups' | 'indirect_groups' | 'auth_methods' | 'scopes')[] | undefined;
3129

3230
export class AuthApi {
3331
static getScopes = apply(async () => {

src/api/controllers/auth/decorators.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import router from '@/router';
66
import { useProfileStore } from '@/store/profile';
77
import { useToastStore } from '@/store/toast';
88

9-
export type Func<R = any, FuncArgs extends any[] = any[]> = (...args: FuncArgs) => R;
9+
type Func<R = any, FuncArgs extends any[] = any[]> = (...args: FuncArgs) => R;
1010
type Decorator<F extends Func = Func, DecoratorArgs extends any[] = any[]> = Func<
1111
F,
1212
[F, ...DecoratorArgs]

src/models/LocalStorage.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ export enum LocalStorageItem {
33
Token = 'token',
44
TokenScopes = 'token-scopes',
55
MarketingId = 'marketing-id',
6-
SuperappAuth = 'superapp-auth',
76
AppToken = 'app-token',
87
}
98

src/models/SuperappData.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/models/index.ts

Lines changed: 6 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,6 @@ export type Scope = authComponents['schemas']['ScopeGet'];
1111
export type User = authComponents['schemas']['User'];
1212
export const UNKNOWN_DEVICE = 'unknown device';
1313

14-
export enum AuthMethod {
15-
Email = 'email',
16-
Yandex = 'yandex',
17-
Github = 'github',
18-
Google = 'google',
19-
LkMsu = 'lk-msu',
20-
MyMsu = 'my-msu',
21-
Physics = 'physics-msu',
22-
VK = 'vk',
23-
Authentic = 'authentic',
24-
}
25-
2614
export const AuthMethodLinkList = [
2715
'github',
2816
'google',
@@ -35,7 +23,8 @@ export const AuthMethodLinkList = [
3523
] as const;
3624
export type AuthMethodLink = (typeof AuthMethodLinkList)[number];
3725

38-
export const AuthMethodNameList = [
26+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
27+
const AuthMethodNameList = [
3928
'email',
4029
'github_auth',
4130
'google_auth',
@@ -48,18 +37,8 @@ export const AuthMethodNameList = [
4837
] as const;
4938
export type AuthMethodName = (typeof AuthMethodNameList)[number];
5039

51-
export type MySessionInfo =
52-
| ('groups' | 'indirect_groups' | 'session_scopes' | 'user_scopes' | 'auth_methods')[]
53-
| undefined;
54-
55-
export type UserSessionById =
56-
| ('groups' | 'indirect_groups' | 'auth_methods' | 'scopes')[]
57-
| undefined;
58-
5940
export enum SessionInfo {
60-
SessionScopes = 'session_scopes',
6141
Token = 'token',
62-
Expires = 'expires',
6342
}
6443

6544
export interface LoginError {
@@ -70,7 +49,7 @@ export interface LoginError {
7049
}
7150

7251
// achievement models
73-
export type Reciever = achievementComponents['schemas']['RecieverGet'];
52+
type Reciever = achievementComponents['schemas']['RecieverGet'];
7453
export interface AchievementGet {
7554
id: number;
7655
name: string;
@@ -98,16 +77,11 @@ export interface AppToken {
9877
}
9978

10079
// general models
101-
export interface Entity {
80+
interface Entity {
10281
id: number;
10382
}
10483

10584
// userdata models
106-
export interface UserdataSource extends Entity {
107-
name: string;
108-
trust_level: number;
109-
}
110-
11185
export interface UserdataCategory extends Entity {
11286
name: string;
11387
read_scope?: string;
@@ -117,19 +91,17 @@ export interface UserdataCategory extends Entity {
11791

11892
export enum UserdataParamResponseType {
11993
All = 'all',
120-
Last = 'last',
121-
MostTrusted = 'most_trusted',
12294
}
12395

124-
export interface UserdataParam extends Entity {
96+
interface UserdataParam extends Entity {
12597
name: string;
12698
is_required: boolean;
12799
changeable: boolean;
128100
type: UserdataParamResponseType;
129101
category_id: number;
130102
}
131103

132-
export interface UserdataRawItem {
104+
interface UserdataRawItem {
133105
category: string;
134106
param: string;
135107
value?: string | null;
@@ -141,7 +113,6 @@ export interface UserdataItem {
141113
value: UserdataExtendedValue;
142114
}
143115

144-
export type UserdataAuth = authComponents['schemas']['UsersGet'];
145116
export interface UserdataRaw {
146117
items: UserdataRawItem[];
147118
}

0 commit comments

Comments
 (0)