Skip to content

Commit 376a851

Browse files
committed
fix(lint): satisfy biome for short.io
Made-with: Cursor
1 parent 3339b2d commit 376a851

File tree

10 files changed

+52
-23
lines changed

10 files changed

+52
-23
lines changed

apps/sim/app/api/tools/short_io/qr/route.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,10 @@ export async function POST(request: NextRequest) {
8787
} catch (error: unknown) {
8888
if (error instanceof z.ZodError) {
8989
return NextResponse.json(
90-
{ success: false, error: `Validation error: ${error.errors.map((e) => e.message).join(', ')}` },
90+
{
91+
success: false,
92+
error: `Validation error: ${error.errors.map((e) => e.message).join(', ')}`,
93+
},
9194
{ status: 400 }
9295
)
9396
}

apps/sim/blocks/blocks/short_io.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,15 +165,15 @@ export const ShortIoBlock: BlockConfig<ToolResponse> = {
165165
const out: Record<string, unknown> = { ...rest, apiKey }
166166
if (size !== undefined && size !== '') {
167167
const n = Number(size)
168-
if (typeof n === 'number' && !isNaN(n) && n >= 1 && n <= 99) out.size = n
168+
if (typeof n === 'number' && !Number.isNaN(n) && n >= 1 && n <= 99) out.size = n
169169
}
170170
if (operation === 'list_links' && domainId !== undefined && domainId !== '') {
171171
const d = Number(domainId)
172-
if (typeof d === 'number' && !isNaN(d)) out.domainId = d
172+
if (typeof d === 'number' && !Number.isNaN(d)) out.domainId = d
173173
}
174174
if (operation === 'list_links' && limit !== undefined && limit !== '') {
175175
const l = Number(limit)
176-
if (typeof l === 'number' && !isNaN(l) && l >= 1 && l <= 150) out.limit = l
176+
if (typeof l === 'number' && !Number.isNaN(l) && l >= 1 && l <= 150) out.limit = l
177177
}
178178
return out
179179
},

apps/sim/blocks/registry.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ import { GuardrailsBlock } from '@/blocks/blocks/guardrails'
6464
import { HexBlock } from '@/blocks/blocks/hex'
6565
import { HubSpotBlock } from '@/blocks/blocks/hubspot'
6666
import { HuggingFaceBlock } from '@/blocks/blocks/huggingface'
67-
import { ShortIoBlock } from '@/blocks/blocks/short_io'
6867
import { HumanInTheLoopBlock } from '@/blocks/blocks/human_in_the_loop'
6968
import { HunterBlock } from '@/blocks/blocks/hunter'
7069
import { ImageGeneratorBlock } from '@/blocks/blocks/image_generator'
@@ -135,6 +134,7 @@ import { ServiceNowBlock } from '@/blocks/blocks/servicenow'
135134
import { SftpBlock } from '@/blocks/blocks/sftp'
136135
import { SharepointBlock } from '@/blocks/blocks/sharepoint'
137136
import { ShopifyBlock } from '@/blocks/blocks/shopify'
137+
import { ShortIoBlock } from '@/blocks/blocks/short_io'
138138
import { SimilarwebBlock } from '@/blocks/blocks/similarweb'
139139
import { SlackBlock } from '@/blocks/blocks/slack'
140140
import { SmtpBlock } from '@/blocks/blocks/smtp'

apps/sim/components/icons.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5932,12 +5932,7 @@ export function HexIcon(props: SVGProps<SVGSVGElement>) {
59325932

59335933
export function ShortIoIcon(props: SVGProps<SVGSVGElement>) {
59345934
return (
5935-
<svg
5936-
{...props}
5937-
viewBox='0 0 64 65'
5938-
fill='none'
5939-
xmlns='http://www.w3.org/2000/svg'
5940-
>
5935+
<svg {...props} viewBox='0 0 64 65' fill='none' xmlns='http://www.w3.org/2000/svg'>
59415936
<rect width='64' height='65' fill='#FFFFFF' />
59425937
<path
59435938
d='M41.1 45.7c0 2-.8 3.5-2.5 4.6-1.6 1-3.8 1.6-6.5 1.6-3.4 0-6-.8-8-2.3-2-1.6-3-3.6-3.2-6.1l-16.3-.4c0 4.1 1.2 7.8 3.6 11.1A24 24 0 0 0 18 62c2.2 1 4.5 1.7 7 2.2l.4.1H0V.2h24.9A25.4 25.4 0 0 0 9.3 9.5C7.1 12.5 6 15.9 6 19.7c0 4.2.9 7.6 2.6 10.1 1.7 2.5 4 4.4 6.8 5.7 2.8 1.3 6.3 2.3 10.6 3.2 4.4.9 7.5 1.6 9.5 2.2 1.9.5 3.3 1.1 4.3 1.9.8.6 1.3 1.6 1.3 2.9Z'

apps/sim/tools/registry.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1664,11 +1664,11 @@ import {
16641664
} from '@/tools/shopify'
16651665
import {
16661666
shortIoCreateLinkTool,
1667-
shortIoListDomainsTool,
1668-
shortIoListLinksTool,
16691667
shortIoDeleteLinkTool,
1670-
shortIoGetQrCodeTool,
16711668
shortIoGetAnalyticsTool,
1669+
shortIoGetQrCodeTool,
1670+
shortIoListDomainsTool,
1671+
shortIoListLinksTool,
16721672
} from '@/tools/short_io'
16731673
import {
16741674
similarwebBounceRateTool,

apps/sim/tools/short_io/delete_link.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,18 @@ export const shortIoDeleteLinkTool: ToolConfig<ShortIoDeleteLinkParams, ToolResp
77
description: 'Delete a short link by ID (e.g. lnk_abc123_abcdef). Rate limit 20/s.',
88
version: '1.0',
99
params: {
10-
apiKey: { type: 'string', required: true, visibility: 'user-only', description: 'Short.io Secret API Key' },
11-
linkId: { type: 'string', required: true, visibility: 'user-or-llm', description: 'Link ID to delete' },
10+
apiKey: {
11+
type: 'string',
12+
required: true,
13+
visibility: 'user-only',
14+
description: 'Short.io Secret API Key',
15+
},
16+
linkId: {
17+
type: 'string',
18+
required: true,
19+
visibility: 'user-or-llm',
20+
description: 'Link ID to delete',
21+
},
1222
},
1323
request: {
1424
url: (params) => `https://api.short.io/links/${encodeURIComponent(params.linkId)}`,

apps/sim/tools/short_io/get_analytics.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,16 @@ export const shortIoGetAnalyticsTool: ToolConfig<ShortIoGetAnalyticsParams, Tool
3232
visibility: 'user-or-llm',
3333
description: 'Period: today, yesterday, last7, last30, total, week, month, lastmonth',
3434
},
35-
tz: { type: 'string', required: false, visibility: 'hidden', description: 'Timezone (default UTC)' },
35+
tz: {
36+
type: 'string',
37+
required: false,
38+
visibility: 'hidden',
39+
description: 'Timezone (default UTC)',
40+
},
3641
},
3742
request: {
3843
url: (params) => {
39-
const base = 'https://statistics.short.io/statistics/link/' + encodeURIComponent(params.linkId)
44+
const base = `https://statistics.short.io/statistics/link/${encodeURIComponent(params.linkId)}`
4045
const period = STATS_PERIOD_MAP[params.period] ?? params.period ?? 'last30'
4146
const q = new URLSearchParams({ period })
4247
if (params.tz) q.set('tz', params.tz)

apps/sim/tools/short_io/get_qr_code.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,12 @@ export const shortIoGetQrCodeTool: ToolConfig<ShortIoGetQrParams, ToolResponse>
3131
visibility: 'user-or-llm',
3232
description: 'Background color hex (e.g. FFFFFF)',
3333
},
34-
size: { type: 'number', required: false, visibility: 'user-or-llm', description: 'QR size 1–99' },
34+
size: {
35+
type: 'number',
36+
required: false,
37+
visibility: 'user-or-llm',
38+
description: 'QR size 1–99',
39+
},
3540
type: {
3641
type: 'string',
3742
required: false,
@@ -58,7 +63,8 @@ export const shortIoGetQrCodeTool: ToolConfig<ShortIoGetQrParams, ToolResponse>
5863
useDomainSettings: params.useDomainSettings ?? true,
5964
}
6065
if (params.color != null && params.color !== '') body.color = params.color
61-
if (params.backgroundColor != null && params.backgroundColor !== '') body.backgroundColor = params.backgroundColor
66+
if (params.backgroundColor != null && params.backgroundColor !== '')
67+
body.backgroundColor = params.backgroundColor
6268
if (params.size != null && params.size >= 1 && params.size <= 99) body.size = params.size
6369
if (params.type === 'svg' || params.type === 'png') body.type = params.type
6470
return body

apps/sim/tools/short_io/list_domains.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ export const shortIoListDomainsTool: ToolConfig<ShortIoListDomainsParams, ToolRe
77
description: 'List Short.io domains. Returns domain IDs and details for use in List Links.',
88
version: '1.0',
99
params: {
10-
apiKey: { type: 'string', required: true, visibility: 'user-only', description: 'Short.io Secret API Key' },
10+
apiKey: {
11+
type: 'string',
12+
required: true,
13+
visibility: 'user-only',
14+
description: 'Short.io Secret API Key',
15+
},
1116
},
1217
request: {
1318
url: 'https://api.short.io/api/domains',
@@ -23,7 +28,7 @@ export const shortIoListDomainsTool: ToolConfig<ShortIoListDomainsParams, ToolRe
2328
return { success: false, output: { success: false, error: err } }
2429
}
2530
const data = await response.json().catch(() => ({}))
26-
const list = Array.isArray(data) ? data : data.domains ?? data.list ?? []
31+
const list = Array.isArray(data) ? data : (data.domains ?? data.list ?? [])
2732
return {
2833
success: true,
2934
output: { success: true, domains: list, count: list.length },

apps/sim/tools/short_io/list_links.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ export const shortIoListLinksTool: ToolConfig<ShortIoListLinksParams, ToolRespon
88
'List short links for a domain. Requires domain_id (from List Domains or dashboard). Max 150 per request.',
99
version: '1.0',
1010
params: {
11-
apiKey: { type: 'string', required: true, visibility: 'user-only', description: 'Short.io Secret API Key' },
11+
apiKey: {
12+
type: 'string',
13+
required: true,
14+
visibility: 'user-only',
15+
description: 'Short.io Secret API Key',
16+
},
1217
domainId: {
1318
type: 'number',
1419
required: true,

0 commit comments

Comments
 (0)