Skip to content

Commit e9cca4b

Browse files
committed
fix(lint): satisfy biome for short.io
Made-with: Cursor
1 parent 5e5d132 commit e9cca4b

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
@@ -60,7 +60,6 @@ import { GuardrailsBlock } from '@/blocks/blocks/guardrails'
6060
import { HexBlock } from '@/blocks/blocks/hex'
6161
import { HubSpotBlock } from '@/blocks/blocks/hubspot'
6262
import { HuggingFaceBlock } from '@/blocks/blocks/huggingface'
63-
import { ShortIoBlock } from '@/blocks/blocks/short_io'
6463
import { HumanInTheLoopBlock } from '@/blocks/blocks/human_in_the_loop'
6564
import { HunterBlock } from '@/blocks/blocks/hunter'
6665
import { ImageGeneratorBlock } from '@/blocks/blocks/image_generator'
@@ -131,6 +130,7 @@ import { ServiceNowBlock } from '@/blocks/blocks/servicenow'
131130
import { SftpBlock } from '@/blocks/blocks/sftp'
132131
import { SharepointBlock } from '@/blocks/blocks/sharepoint'
133132
import { ShopifyBlock } from '@/blocks/blocks/shopify'
133+
import { ShortIoBlock } from '@/blocks/blocks/short_io'
134134
import { SimilarwebBlock } from '@/blocks/blocks/similarweb'
135135
import { SlackBlock } from '@/blocks/blocks/slack'
136136
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
@@ -5853,12 +5853,7 @@ export function HexIcon(props: SVGProps<SVGSVGElement>) {
58535853

58545854
export function ShortIoIcon(props: SVGProps<SVGSVGElement>) {
58555855
return (
5856-
<svg
5857-
{...props}
5858-
viewBox='0 0 64 65'
5859-
fill='none'
5860-
xmlns='http://www.w3.org/2000/svg'
5861-
>
5856+
<svg {...props} viewBox='0 0 64 65' fill='none' xmlns='http://www.w3.org/2000/svg'>
58625857
<rect width='64' height='65' fill='#FFFFFF' />
58635858
<path
58645859
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
@@ -1611,11 +1611,11 @@ import {
16111611
} from '@/tools/shopify'
16121612
import {
16131613
shortIoCreateLinkTool,
1614-
shortIoListDomainsTool,
1615-
shortIoListLinksTool,
16161614
shortIoDeleteLinkTool,
1617-
shortIoGetQrCodeTool,
16181615
shortIoGetAnalyticsTool,
1616+
shortIoGetQrCodeTool,
1617+
shortIoListDomainsTool,
1618+
shortIoListLinksTool,
16191619
} from '@/tools/short_io'
16201620
import {
16211621
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)