Skip to content

Commit d31061c

Browse files
committed
Updated to latest perfectionist
1 parent 19b73ab commit d31061c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+913
-1044
lines changed

src/Exceptionless.Web/ClientApp/.vscode/extensions.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"bradlc.vscode-tailwindcss",
55
"dbaeumer.vscode-eslint",
66
"esbenp.prettier-vscode",
7+
"ms-playwright.playwright",
78
"selemondev.vscode-shadcn-svelte",
89
"vitest.explorer"
910
]

src/Exceptionless.Web/ClientApp/package-lock.json

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

src/Exceptionless.Web/ClientApp/package.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,31 +23,31 @@
2323
"upgrade": "ncu -i"
2424
},
2525
"devDependencies": {
26-
"@iconify-json/lucide": "^1.2.14",
27-
"@playwright/test": "^1.48.2",
26+
"@iconify-json/lucide": "^1.2.15",
27+
"@playwright/test": "^1.49.0",
2828
"@sveltejs/adapter-static": "^3.0.6",
2929
"@sveltejs/kit": "^2.8.1",
30-
"@sveltejs/vite-plugin-svelte": "^4.0.0",
30+
"@sveltejs/vite-plugin-svelte": "^4.0.1",
3131
"@types/eslint": "^9.6.1",
32-
"@types/node": "^22.9.0",
32+
"@types/node": "^22.9.1",
3333
"@types/throttle-debounce": "^5.0.2",
3434
"autoprefixer": "^10.4.20",
3535
"cross-env": "^7.0.3",
36-
"eslint": "^9.14.0",
36+
"eslint": "^9.15.0",
3737
"eslint-config-prettier": "^9.1.0",
38-
"eslint-plugin-perfectionist": "^3.9.1",
38+
"eslint-plugin-perfectionist": "^4.0.3",
3939
"eslint-plugin-svelte": "^2.46.0",
4040
"npm-run-all": "^4.1.5",
4141
"postcss": "^8.4.49",
4242
"prettier": "^3.3.3",
4343
"prettier-plugin-svelte": "^3.2.8",
44-
"prettier-plugin-tailwindcss": "^0.6.8",
45-
"svelte": "^5.2.0",
46-
"svelte-check": "^4.0.7",
44+
"prettier-plugin-tailwindcss": "^0.6.9",
45+
"svelte": "^5.2.6",
46+
"svelte-check": "^4.0.9",
4747
"swagger-typescript-api": "^13.0.23",
4848
"tslib": "^2.8.1",
4949
"typescript": "^5.6.3",
50-
"typescript-eslint": "^8.14.0",
50+
"typescript-eslint": "^8.15.0",
5151
"vite": "^5.4.11",
5252
"vitest": "^2.1.5"
5353
},
@@ -59,17 +59,17 @@
5959
"@tanstack/svelte-query-devtools": "https://pkg.pr.new/@tanstack/svelte-query-devtools@ccce0b8",
6060
"@tanstack/svelte-table": "^9.0.0-alpha.10",
6161
"@typeschema/class-validator": "^0.3.0",
62-
"bits-ui": "^1.0.0-next.57",
62+
"bits-ui": "^1.0.0-next.63",
6363
"class-validator": "^0.14.1",
6464
"clsx": "^2.1.1",
6565
"formsnap": "^2.0.0-next.1",
66-
"mode-watcher": "^0.4.1",
66+
"mode-watcher": "^0.5.0",
6767
"oidc-client-ts": "^3.1.0",
68-
"pretty-ms": "^9.1.0",
68+
"pretty-ms": "^9.2.0",
6969
"runed": "^0.15.3",
7070
"svelte-sonner": "^0.3.28",
7171
"svelte-time": "^0.9.0",
72-
"sveltekit-superforms": "^2.20.0",
72+
"sveltekit-superforms": "^2.20.1",
7373
"tailwind-merge": "^2.5.4",
7474
"tailwind-variants": "^0.3.0",
7575
"tailwindcss": "^3.4.15",

src/Exceptionless.Web/ClientApp/src/lib/features/auth/index.svelte.ts

Lines changed: 64 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -16,52 +16,6 @@ export const googleClientId = env.PUBLIC_GOOGLE_APPID;
1616
export const microsoftClientId = env.PUBLIC_MICROSOFT_APPID;
1717
export const enableOAuthLogin = facebookClientId || gitHubClientId || googleClientId || microsoftClientId;
1818

19-
export async function login(email: string, password: string) {
20-
const data: Login = { email, password };
21-
const client = useFetchClient();
22-
const response = await client.postJSON<TokenResult>('auth/login', data, {
23-
expectedStatusCodes: [401, 422]
24-
});
25-
26-
if (response.ok && response.data?.token) {
27-
accessToken.value = response.data.token;
28-
} else if (response.status === 401) {
29-
response.problem.setErrorMessage('Invalid email or password');
30-
}
31-
32-
return response;
33-
}
34-
35-
export async function gotoLogin() {
36-
const { url } = get(page);
37-
const isAuthPath = url.pathname.startsWith('/next/login') || url.pathname.startsWith('/next/logout');
38-
const redirect = url.pathname === '/next/' || isAuthPath ? '/next/login' : `/next/login?redirect=${url.pathname}`;
39-
await goto(redirect, { replaceState: true });
40-
}
41-
42-
export async function logout() {
43-
const client = useFetchClient();
44-
await client.get('auth/logout', { expectedStatusCodes: [200, 401] });
45-
accessToken.value = null;
46-
}
47-
48-
export async function liveLogin(redirectUrl?: string) {
49-
if (!microsoftClientId) {
50-
throw new Error('Live client id not set');
51-
}
52-
53-
await oauthLogin({
54-
authUrl: 'https://login.live.com/oauth20_authorize.srf',
55-
clientId: microsoftClientId,
56-
extraParams: {
57-
display: 'popup'
58-
},
59-
provider: 'live',
60-
redirectUrl,
61-
scope: 'wl.emails'
62-
});
63-
}
64-
6519
export async function facebookLogin(redirectUrl?: string) {
6620
if (!facebookClientId) {
6721
throw new Error('Facebook client id not set');
@@ -76,6 +30,21 @@ export async function facebookLogin(redirectUrl?: string) {
7630
});
7731
}
7832

33+
export async function githubLogin(redirectUrl?: string) {
34+
if (!gitHubClientId) {
35+
throw new Error('GitHub client id not set');
36+
}
37+
38+
await oauthLogin({
39+
authUrl: 'https://github.com/login/oauth/authorize',
40+
clientId: gitHubClientId,
41+
popupOptions: { height: 618, width: 1020 },
42+
provider: 'github',
43+
redirectUrl,
44+
scope: 'user:email'
45+
});
46+
}
47+
7948
export async function googleLogin(redirectUrl?: string) {
8049
if (!googleClientId) {
8150
throw new Error('Google client id not set');
@@ -97,19 +66,50 @@ export async function googleLogin(redirectUrl?: string) {
9766
});
9867
}
9968

100-
export async function githubLogin(redirectUrl?: string) {
101-
if (!gitHubClientId) {
102-
throw new Error('GitHub client id not set');
69+
export async function gotoLogin() {
70+
const { url } = get(page);
71+
const isAuthPath = url.pathname.startsWith('/next/login') || url.pathname.startsWith('/next/logout');
72+
const redirect = url.pathname === '/next/' || isAuthPath ? '/next/login' : `/next/login?redirect=${url.pathname}`;
73+
await goto(redirect, { replaceState: true });
74+
}
75+
76+
export async function liveLogin(redirectUrl?: string) {
77+
if (!microsoftClientId) {
78+
throw new Error('Live client id not set');
10379
}
10480

10581
await oauthLogin({
106-
authUrl: 'https://github.com/login/oauth/authorize',
107-
clientId: gitHubClientId,
108-
popupOptions: { height: 618, width: 1020 },
109-
provider: 'github',
82+
authUrl: 'https://login.live.com/oauth20_authorize.srf',
83+
clientId: microsoftClientId,
84+
extraParams: {
85+
display: 'popup'
86+
},
87+
provider: 'live',
11088
redirectUrl,
111-
scope: 'user:email'
89+
scope: 'wl.emails'
90+
});
91+
}
92+
93+
export async function login(email: string, password: string) {
94+
const data: Login = { email, password };
95+
const client = useFetchClient();
96+
const response = await client.postJSON<TokenResult>('auth/login', data, {
97+
expectedStatusCodes: [401, 422]
11298
});
99+
100+
if (response.ok && response.data?.token) {
101+
accessToken.value = response.data.token;
102+
} else if (response.status === 401) {
103+
response.problem.setErrorMessage('Invalid email or password');
104+
}
105+
106+
return response;
107+
}
108+
109+
export async function logout() {
110+
const client = useFetchClient();
111+
await client.get('auth/logout', { expectedStatusCodes: [200, 401] });
112+
accessToken.value = null;
113113
}
114114

115115
async function oauthLogin(options: {
@@ -163,6 +163,16 @@ async function oauthLogin(options: {
163163
}
164164
}
165165

166+
function stringifyOptions(options: object): string {
167+
const parts = [];
168+
169+
for (const [key, value] of Object.entries(options)) {
170+
parts.push(key + '=' + value);
171+
}
172+
173+
return parts.join(',');
174+
}
175+
166176
function waitForUrl(popup: Window, redirectUri: string): Promise<{ code: string; state: string }> {
167177
return new Promise((resolve, reject) => {
168178
const polling = setInterval(() => {
@@ -207,13 +217,3 @@ function waitForUrl(popup: Window, redirectUri: string): Promise<{ code: string;
207217
}, 500);
208218
});
209219
}
210-
211-
function stringifyOptions(options: object): string {
212-
const parts = [];
213-
214-
for (const [key, value] of Object.entries(options)) {
215-
parts.push(key + '=' + value);
216-
}
217-
218-
return parts.join(',');
219-
}

src/Exceptionless.Web/ClientApp/src/lib/features/events/api.svelte.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ export interface GetEventByIdProps {
1616
id: string | undefined;
1717
}
1818

19+
export interface GetEventsByStackIdProps {
20+
limit?: number;
21+
stackId: string | undefined;
22+
}
23+
1924
export type GetEventsMode = 'stack_frequent' | 'stack_new' | 'stack_recent' | 'stack_users' | 'summary' | null;
2025

2126
export interface IGetEventsParams {
@@ -45,11 +50,6 @@ export function getEventByIdQuery(props: GetEventByIdProps) {
4550
}));
4651
}
4752

48-
export interface GetEventsByStackIdProps {
49-
limit?: number;
50-
stackId: string | undefined;
51-
}
52-
5353
export function getEventsByStackIdQuery(props: GetEventsByStackIdProps) {
5454
const queryClient = useQueryClient();
5555

0 commit comments

Comments
 (0)