Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"lint": "eslint \"**/*.{vue,ts}\"",
"lint:fix": "eslint \"**/*.{vue,ts}\" --fix",
"lint:deadcode": "knip --exclude binaries,dependencies,unlisted",
"lint:circular": "dpdm --exit-code circular:1 --no-tree --no-warning --progress false --transform './src/main.ts'",
"lint:circular": "dpdm --exit-code circular:1 --no-tree --no-warning --progress false --transform ./src/main.ts",
"prettier": "prettier . --check",
"prettier:write": "prettier . --write",
"stylelint": "stylelint \"**/*.{vue,css}\"",
Expand All @@ -26,21 +26,17 @@
"markdown-it": "^14.1.0",
"openapi-fetch": "^0.13.0",
"pinia": "^2.2.6",
"query-string": "^9.1.1",
"ua-parser-js": "^1.0.39",
"vue": "^3.5.13",
"vue-router": "^4.4.5",
"workbox-window": "^7.3.0"
},
"devDependencies": {
"@eslint/eslintrc": "^3.2.0",
"@eslint/js": "^9.15.0",
"@profcomff/api-uilib": "^2024.9.29",
"@types/markdown-it": "^14.1.2",
"@types/node": "^22.9.3",
"@types/ua-parser-js": "^0.7.39",
"@typescript-eslint/eslint-plugin": "^8.15.0",
"@typescript-eslint/parser": "^8.15.0",
"@vitejs/plugin-vue": "^5.2.0",
"@vue/eslint-config-typescript": "^14.1.3",
"dpdm": "^3.14.0",
Expand All @@ -50,7 +46,6 @@
"eslint-plugin-vue": "^9.31.0",
"globals": "^15.12.0",
"knip": "^5.45.0",
"openapi-typescript": "^7.4.3",
"postcss": "^8.4.49",
"postcss-html": "^1.7.0",
"postcss-preset-env": "^10.1.1",
Expand All @@ -61,9 +56,7 @@
"typescript": "5.6.3",
"typescript-eslint": "^8.26.0",
"vite": "^5.4.11",
"vite-plugin-eslint": "^1.8.1",
"vite-plugin-pwa": "^0.21.0",
"vite-plugin-stylelint": "^5.3.1",
"vite-plugin-vuetify": "^2.0.4",
"vitest": "^2.1.5",
"vue-tsc": "^2.1.10",
Expand Down
415 changes: 24 additions & 391 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/api/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { createClient } from '@profcomff/api-uilib';
import { type Middleware } from 'openapi-fetch';
import { ApiError, ErrorInfo } from './types';

export function recordError(url: string, status: number, error: ApiError | undefined) {
function recordError(url: string, status: number, error: ApiError | undefined) {
if (error) {
const errorInfo: ErrorInfo = {
url,
Expand Down
10 changes: 4 additions & 6 deletions src/api/controllers/auth/AuthApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,23 @@ import { UNKNOWN_DEVICE } from '@/models';
import router from '@/router';
import { apiClient } from '../../client';

export enum UserInfo {
enum UserInfo {
Groups = 'groups',
IndirectGroups = 'indirect_groups',
Scopes = 'scopes',
}

export enum SessionInfo {
enum SessionInfo {
SessionScopes = 'session_scopes',
Token = 'token',
Expires = 'expires',
}

export type MySessionInfo =
type MySessionInfo =
| ('groups' | 'indirect_groups' | 'session_scopes' | 'user_scopes' | 'auth_methods')[]
| undefined;

export type UserSessionById =
| ('groups' | 'indirect_groups' | 'auth_methods' | 'scopes')[]
| undefined;
type UserSessionById = ('groups' | 'indirect_groups' | 'auth_methods' | 'scopes')[] | undefined;

export class AuthApi {
static getScopes = apply(async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/api/controllers/auth/decorators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import router from '@/router';
import { useProfileStore } from '@/store/profile';
import { useToastStore } from '@/store/toast';

export type Func<R = any, FuncArgs extends any[] = any[]> = (...args: FuncArgs) => R;
type Func<R = any, FuncArgs extends any[] = any[]> = (...args: FuncArgs) => R;
type Decorator<F extends Func = Func, DecoratorArgs extends any[] = any[]> = Func<
F,
[F, ...DecoratorArgs]
Expand Down
1 change: 0 additions & 1 deletion src/models/LocalStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ export enum LocalStorageItem {
Token = 'token',
TokenScopes = 'token-scopes',
MarketingId = 'marketing-id',
SuperappAuth = 'superapp-auth',
AppToken = 'app-token',
}

Expand Down
6 changes: 0 additions & 6 deletions src/models/SuperappData.ts

This file was deleted.

41 changes: 6 additions & 35 deletions src/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,6 @@ export type Scope = authComponents['schemas']['ScopeGet'];
export type User = authComponents['schemas']['User'];
export const UNKNOWN_DEVICE = 'unknown device';

export enum AuthMethod {
Email = 'email',
Yandex = 'yandex',
Github = 'github',
Google = 'google',
LkMsu = 'lk-msu',
MyMsu = 'my-msu',
Physics = 'physics-msu',
VK = 'vk',
Authentic = 'authentic',
}

export const AuthMethodLinkList = [
'github',
'google',
Expand All @@ -35,7 +23,8 @@ export const AuthMethodLinkList = [
] as const;
export type AuthMethodLink = (typeof AuthMethodLinkList)[number];

export const AuthMethodNameList = [
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const AuthMethodNameList = [
'email',
'github_auth',
'google_auth',
Expand All @@ -48,18 +37,8 @@ export const AuthMethodNameList = [
] as const;
export type AuthMethodName = (typeof AuthMethodNameList)[number];

export type MySessionInfo =
| ('groups' | 'indirect_groups' | 'session_scopes' | 'user_scopes' | 'auth_methods')[]
| undefined;

export type UserSessionById =
| ('groups' | 'indirect_groups' | 'auth_methods' | 'scopes')[]
| undefined;

export enum SessionInfo {
SessionScopes = 'session_scopes',
Token = 'token',
Expires = 'expires',
}

export interface LoginError {
Expand All @@ -70,7 +49,7 @@ export interface LoginError {
}

// achievement models
export type Reciever = achievementComponents['schemas']['RecieverGet'];
type Reciever = achievementComponents['schemas']['RecieverGet'];
export interface AchievementGet {
id: number;
name: string;
Expand Down Expand Up @@ -98,16 +77,11 @@ export interface AppToken {
}

// general models
export interface Entity {
interface Entity {
id: number;
}

// userdata models
export interface UserdataSource extends Entity {
name: string;
trust_level: number;
}

export interface UserdataCategory extends Entity {
name: string;
read_scope?: string;
Expand All @@ -117,19 +91,17 @@ export interface UserdataCategory extends Entity {

export enum UserdataParamResponseType {
All = 'all',
Last = 'last',
MostTrusted = 'most_trusted',
}

export interface UserdataParam extends Entity {
interface UserdataParam extends Entity {
name: string;
is_required: boolean;
changeable: boolean;
type: UserdataParamResponseType;
category_id: number;
}

export interface UserdataRawItem {
interface UserdataRawItem {
category: string;
param: string;
value?: string | null;
Expand All @@ -141,7 +113,6 @@ export interface UserdataItem {
value: UserdataExtendedValue;
}

export type UserdataAuth = authComponents['schemas']['UsersGet'];
export interface UserdataRaw {
items: UserdataRawItem[];
}
Expand Down