Skip to content

Commit 58c5b52

Browse files
committed
chore: format
1 parent 0dd1ac9 commit 58c5b52

15 files changed

Lines changed: 65 additions & 52 deletions

File tree

infrastructure/control-panel/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ CONTROL_PANEL_ADMIN_ENAMES_FILE=config/admin-enames.json
129129

130130
```json
131131
{
132-
"admins": ["@admin1.w3id", "@admin2.w3id"]
132+
"admins": ["@admin1.w3id", "@admin2.w3id"]
133133
}
134134
```
135135

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"admins": [
3-
"@7218b67d-da21-54d6-9a85-7c4db1d09768",
4-
"@82f7a77a-f03a-52aa-88fc-1b1e488ad498",
5-
"@35a31f0d-dd76-5780-b383-29f219fcae99",
6-
"@82f7a77a-f03a-52aa-88fc-1b1e488ad498"
7-
]
2+
"admins": [
3+
"@7218b67d-da21-54d6-9a85-7c4db1d09768",
4+
"@82f7a77a-f03a-52aa-88fc-1b1e488ad498",
5+
"@35a31f0d-dd76-5780-b383-29f219fcae99",
6+
"@82f7a77a-f03a-52aa-88fc-1b1e488ad498"
7+
]
88
}

infrastructure/control-panel/src/lib/services/evaultService.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ export class EVaultService {
3030
return freshData;
3131
}
3232

33-
3433
/**
3534
* Get cache status information
3635
*/

infrastructure/control-panel/src/lib/services/notificationService.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ function getBaseUrl(): string {
2828
return `http://localhost:${port}`;
2929
}
3030

31-
export async function sendNotification(
32-
request: SendNotificationRequest
33-
): Promise<SendResult> {
31+
export async function sendNotification(request: SendNotificationRequest): Promise<SendResult> {
3432
const baseUrl = getBaseUrl();
3533
try {
3634
const response = await fetch(`${baseUrl}/api/send`, {
@@ -69,9 +67,9 @@ export async function getDevicesWithTokens(): Promise<
6967
}
7068
}
7169

72-
export async function getDevicesByEName(eName: string): Promise<
73-
{ token: string; platform: string; eName: string }[]
74-
> {
70+
export async function getDevicesByEName(
71+
eName: string
72+
): Promise<{ token: string; platform: string; eName: string }[]> {
7573
const { env } = await import('$env/dynamic/private');
7674
const provisionerUrl =
7775
env.PUBLIC_PROVISIONER_URL || env.PROVISIONER_URL || 'http://localhost:3001';
@@ -110,7 +108,10 @@ export async function sendBulkNotifications(
110108
return {
111109
sent,
112110
failed: failed.length,
113-
errors: failed.map((r) => ({ token: r.token.slice(0, 20) + '...', error: r.error ?? 'Unknown' }))
111+
errors: failed.map((r) => ({
112+
token: r.token.slice(0, 20) + '...',
113+
error: r.error ?? 'Unknown'
114+
}))
114115
};
115116
}
116117

infrastructure/control-panel/src/routes/+layout.svelte

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
{#if isLoginRoute}
2929
<main class="min-h-screen bg-gray-50">
30-
<section class="px-10 pb-10 pt-10">
30+
<section class="px-10 pt-10 pb-10">
3131
{@render children()}
3232
</section>
3333
</main>
@@ -104,7 +104,8 @@
104104
const evaultObjects = evaultIds
105105
.map((id: string) =>
106106
allEVaults.find(
107-
(e: any) => (e.evault || e.ename || e.id) === id
107+
(e: any) =>
108+
(e.evault || e.ename || e.id) === id
108109
)
109110
)
110111
.filter(Boolean);
@@ -125,7 +126,8 @@
125126
) {
126127
const { registryService } =
127128
await import('$lib/services/registry');
128-
const allPlatforms = await registryService.getPlatforms();
129+
const allPlatforms =
130+
await registryService.getPlatforms();
129131
const platformObjects = platformUrls
130132
.map((url: string) =>
131133
allPlatforms.find((p: any) => p.url === url)
@@ -155,11 +157,15 @@
155157
{/if}
156158

157159
{#if data?.user?.ename}
158-
<div class="rounded-full border border-gray-200 bg-gray-50 px-3 py-1 text-sm text-gray-700">
160+
<div
161+
class="rounded-full border border-gray-200 bg-gray-50 px-3 py-1 text-sm text-gray-700"
162+
>
159163
{data.user.ename}
160164
</div>
161165
{/if}
162-
<ButtonAction size="sm" variant="soft" callback={handleLogout}>Logout</ButtonAction>
166+
<ButtonAction size="sm" variant="soft" callback={handleLogout}
167+
>Logout</ButtonAction
168+
>
163169
</div>
164170
</header>
165171
<section class="px-10 pb-10">

infrastructure/control-panel/src/routes/+page.svelte

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -463,8 +463,7 @@
463463
</script>
464464

465465
{#snippet ENameWithType(value: unknown)}
466-
{@const item =
467-
(value as { ename?: string; type?: 'user' | 'group' } | null) ?? null}
466+
{@const item = (value as { ename?: string; type?: 'user' | 'group' } | null) ?? null}
468467
{@const ename = item?.ename || 'N/A'}
469468
{@const type = item?.type || 'group'}
470469
<div class="flex items-center gap-2 whitespace-nowrap">

infrastructure/control-panel/src/routes/api/auth/+server.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,10 @@ type VerifySignatureOutput = {
1919
};
2020

2121
const require = createRequire(import.meta.url);
22-
let verifySignatureFn:
23-
| ((options: VerifySignatureInput) => Promise<VerifySignatureOutput>)
24-
| null = null;
22+
let verifySignatureFn: ((options: VerifySignatureInput) => Promise<VerifySignatureOutput>) | null =
23+
null;
2524

26-
async function verifyW3dsSignature(
27-
options: VerifySignatureInput
28-
): Promise<VerifySignatureOutput> {
25+
async function verifyW3dsSignature(options: VerifySignatureInput): Promise<VerifySignatureOutput> {
2926
if (!verifySignatureFn) {
3027
const signatureValidator = require('signature-validator') as {
3128
verifySignature: (input: VerifySignatureInput) => Promise<VerifySignatureOutput>;
@@ -82,7 +79,10 @@ export const POST: RequestHandler = async ({ request, cookies }) => {
8279
const registryBaseUrl = env.PUBLIC_REGISTRY_URL;
8380
if (!registryBaseUrl) {
8481
console.error('[auth] Missing PUBLIC_REGISTRY_URL');
85-
publishAuthSessionResult(session, { status: 'error', message: 'Server not configured' });
82+
publishAuthSessionResult(session, {
83+
status: 'error',
84+
message: 'Server not configured'
85+
});
8686
return json({ error: 'Server configuration error' }, { status: 500 });
8787
}
8888
console.info('[auth] Verifying signature', {

infrastructure/control-panel/src/routes/api/evaults/+server.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,12 @@ async function resolveVaultIdentity(
110110
return {
111111
type: 'user',
112112
name:
113-
firstNonEmptyString(userProfile.displayName, userProfile.username, vault.ename, vault.evault) ||
114-
defaultName
113+
firstNonEmptyString(
114+
userProfile.displayName,
115+
userProfile.username,
116+
vault.ename,
117+
vault.evault
118+
) || defaultName
115119
};
116120
}
117121

@@ -128,8 +132,7 @@ async function resolveVaultIdentity(
128132
groupManifest.ename,
129133
vault.ename,
130134
vault.evault
131-
) ||
132-
defaultName
135+
) || defaultName
133136
};
134137
}
135138

infrastructure/control-panel/src/routes/api/notifications/send-bulk-all/+server.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import { json } from '@sveltejs/kit';
22
import type { RequestHandler } from '@sveltejs/kit';
3-
import {
4-
getDevicesWithTokens,
5-
sendBulkNotifications
6-
} from '$lib/services/notificationService';
3+
import { getDevicesWithTokens, sendBulkNotifications } from '$lib/services/notificationService';
74

85
export const POST: RequestHandler = async ({ request }) => {
96
try {

infrastructure/control-panel/src/routes/api/notifications/send-bulk/+server.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ export const POST: RequestHandler = async ({ request }) => {
88
const { tokens, platform, payload } = body;
99

1010
if (!Array.isArray(tokens) || tokens.length === 0) {
11-
return json({ success: false, error: 'tokens must be a non-empty array' }, { status: 400 });
11+
return json(
12+
{ success: false, error: 'tokens must be a non-empty array' },
13+
{ status: 400 }
14+
);
1215
}
1316
if (!payload?.title || !payload?.body) {
1417
return json(

0 commit comments

Comments
 (0)