Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
refactor: remove re-exports from jsm/utils and import directly from s…
…ource

Remove re-exports of getJiraCloudId, parseAtlassianErrorMessage, and
parseJsmErrorMessage from jsm/utils.ts. Update all 21 JSM routes to
import directly from @/tools/jira/utils per CLAUDE.md import rules.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
  • Loading branch information
waleedlatif1 and claude committed Apr 13, 2026
commit 29efba37747b60e1c33688d2bc621981d3092062
12 changes: 4 additions & 8 deletions apps/sim/app/api/tools/jsm/approvals/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,8 @@ import {
validateJiraCloudId,
validateJiraIssueKey,
} from '@/lib/core/security/input-validation'
import {
getJiraCloudId,
getJsmApiBaseUrl,
getJsmHeaders,
parseJsmErrorMessage,
} from '@/tools/jsm/utils'
import { getJiraCloudId, parseAtlassianErrorMessage } from '@/tools/jira/utils'
import { getJsmApiBaseUrl, getJsmHeaders } from '@/tools/jsm/utils'

export const dynamic = 'force-dynamic'

Expand Down Expand Up @@ -104,7 +100,7 @@ export async function POST(request: NextRequest) {

return NextResponse.json(
{
error: parseJsmErrorMessage(response.status, response.statusText, errorText),
error: parseAtlassianErrorMessage(response.status, response.statusText, errorText),
details: errorText,
},
{ status: response.status }
Expand Down Expand Up @@ -160,7 +156,7 @@ export async function POST(request: NextRequest) {

return NextResponse.json(
{
error: parseJsmErrorMessage(response.status, response.statusText, errorText),
error: parseAtlassianErrorMessage(response.status, response.statusText, errorText),
details: errorText,
},
{ status: response.status }
Expand Down
10 changes: 3 additions & 7 deletions apps/sim/app/api/tools/jsm/comment/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@ import { createLogger } from '@sim/logger'
import { type NextRequest, NextResponse } from 'next/server'
import { checkInternalAuth } from '@/lib/auth/hybrid'
import { validateJiraCloudId, validateJiraIssueKey } from '@/lib/core/security/input-validation'
import {
getJiraCloudId,
getJsmApiBaseUrl,
getJsmHeaders,
parseJsmErrorMessage,
} from '@/tools/jsm/utils'
import { getJiraCloudId, parseAtlassianErrorMessage } from '@/tools/jira/utils'
import { getJsmApiBaseUrl, getJsmHeaders } from '@/tools/jsm/utils'

export const dynamic = 'force-dynamic'

Expand Down Expand Up @@ -86,7 +82,7 @@ export async function POST(request: NextRequest) {

return NextResponse.json(
{
error: parseJsmErrorMessage(response.status, response.statusText, errorText),
error: parseAtlassianErrorMessage(response.status, response.statusText, errorText),
details: errorText,
},
{ status: response.status }
Expand Down
10 changes: 3 additions & 7 deletions apps/sim/app/api/tools/jsm/comments/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@ import { createLogger } from '@sim/logger'
import { type NextRequest, NextResponse } from 'next/server'
import { checkInternalAuth } from '@/lib/auth/hybrid'
import { validateJiraCloudId, validateJiraIssueKey } from '@/lib/core/security/input-validation'
import {
getJiraCloudId,
getJsmApiBaseUrl,
getJsmHeaders,
parseJsmErrorMessage,
} from '@/tools/jsm/utils'
import { getJiraCloudId, parseAtlassianErrorMessage } from '@/tools/jira/utils'
import { getJsmApiBaseUrl, getJsmHeaders } from '@/tools/jsm/utils'

export const dynamic = 'force-dynamic'

Expand Down Expand Up @@ -88,7 +84,7 @@ export async function POST(request: NextRequest) {

return NextResponse.json(
{
error: parseJsmErrorMessage(response.status, response.statusText, errorText),
error: parseAtlassianErrorMessage(response.status, response.statusText, errorText),
details: errorText,
},
{ status: response.status }
Expand Down
12 changes: 4 additions & 8 deletions apps/sim/app/api/tools/jsm/customers/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@ import { createLogger } from '@sim/logger'
import { type NextRequest, NextResponse } from 'next/server'
import { checkInternalAuth } from '@/lib/auth/hybrid'
import { validateAlphanumericId, validateJiraCloudId } from '@/lib/core/security/input-validation'
import {
getJiraCloudId,
getJsmApiBaseUrl,
getJsmHeaders,
parseJsmErrorMessage,
} from '@/tools/jsm/utils'
import { getJiraCloudId, parseAtlassianErrorMessage } from '@/tools/jira/utils'
import { getJsmApiBaseUrl, getJsmHeaders } from '@/tools/jsm/utils'

export const dynamic = 'force-dynamic'

Expand Down Expand Up @@ -101,7 +97,7 @@ export async function POST(request: NextRequest) {

return NextResponse.json(
{
error: parseJsmErrorMessage(response.status, response.statusText, errorText),
error: parseAtlassianErrorMessage(response.status, response.statusText, errorText),
details: errorText,
},
{ status: response.status }
Expand Down Expand Up @@ -141,7 +137,7 @@ export async function POST(request: NextRequest) {

return NextResponse.json(
{
error: parseJsmErrorMessage(response.status, response.statusText, errorText),
error: parseAtlassianErrorMessage(response.status, response.statusText, errorText),
details: errorText,
},
{ status: response.status }
Expand Down
10 changes: 3 additions & 7 deletions apps/sim/app/api/tools/jsm/forms/issue/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@ import { createLogger } from '@sim/logger'
import { type NextRequest, NextResponse } from 'next/server'
import { checkInternalAuth } from '@/lib/auth/hybrid'
import { validateJiraCloudId, validateJiraIssueKey } from '@/lib/core/security/input-validation'
import {
getJiraCloudId,
getJsmFormsApiBaseUrl,
getJsmHeaders,
parseJsmErrorMessage,
} from '@/tools/jsm/utils'
import { getJiraCloudId, parseAtlassianErrorMessage } from '@/tools/jira/utils'
import { getJsmFormsApiBaseUrl, getJsmHeaders } from '@/tools/jsm/utils'

export const dynamic = 'force-dynamic'

Expand Down Expand Up @@ -70,7 +66,7 @@ export async function POST(request: NextRequest) {

return NextResponse.json(
{
error: parseJsmErrorMessage(response.status, response.statusText, errorText),
error: parseAtlassianErrorMessage(response.status, response.statusText, errorText),
details: errorText,
},
{ status: response.status }
Expand Down
10 changes: 3 additions & 7 deletions apps/sim/app/api/tools/jsm/forms/structure/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@ import { createLogger } from '@sim/logger'
import { type NextRequest, NextResponse } from 'next/server'
import { checkInternalAuth } from '@/lib/auth/hybrid'
import { validateJiraCloudId, validateJiraIssueKey } from '@/lib/core/security/input-validation'
import {
getJiraCloudId,
getJsmFormsApiBaseUrl,
getJsmHeaders,
parseJsmErrorMessage,
} from '@/tools/jsm/utils'
import { getJiraCloudId, parseAtlassianErrorMessage } from '@/tools/jira/utils'
import { getJsmFormsApiBaseUrl, getJsmHeaders } from '@/tools/jsm/utils'

export const dynamic = 'force-dynamic'

Expand Down Expand Up @@ -80,7 +76,7 @@ export async function POST(request: NextRequest) {

return NextResponse.json(
{
error: parseJsmErrorMessage(response.status, response.statusText, errorText),
error: parseAtlassianErrorMessage(response.status, response.statusText, errorText),
details: errorText,
},
{ status: response.status }
Expand Down
10 changes: 3 additions & 7 deletions apps/sim/app/api/tools/jsm/forms/templates/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@ import { createLogger } from '@sim/logger'
import { type NextRequest, NextResponse } from 'next/server'
import { checkInternalAuth } from '@/lib/auth/hybrid'
import { validateJiraCloudId, validateJiraIssueKey } from '@/lib/core/security/input-validation'
import {
getJiraCloudId,
getJsmFormsApiBaseUrl,
getJsmHeaders,
parseJsmErrorMessage,
} from '@/tools/jsm/utils'
import { getJiraCloudId, parseAtlassianErrorMessage } from '@/tools/jira/utils'
import { getJsmFormsApiBaseUrl, getJsmHeaders } from '@/tools/jsm/utils'

export const dynamic = 'force-dynamic'

Expand Down Expand Up @@ -70,7 +66,7 @@ export async function POST(request: NextRequest) {

return NextResponse.json(
{
error: parseJsmErrorMessage(response.status, response.statusText, errorText),
error: parseAtlassianErrorMessage(response.status, response.statusText, errorText),
details: errorText,
},
{ status: response.status }
Expand Down
12 changes: 4 additions & 8 deletions apps/sim/app/api/tools/jsm/organization/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,8 @@ import {
validateEnum,
validateJiraCloudId,
} from '@/lib/core/security/input-validation'
import {
getJiraCloudId,
getJsmApiBaseUrl,
getJsmHeaders,
parseJsmErrorMessage,
} from '@/tools/jsm/utils'
import { getJiraCloudId, parseAtlassianErrorMessage } from '@/tools/jira/utils'
import { getJsmApiBaseUrl, getJsmHeaders } from '@/tools/jsm/utils'

export const dynamic = 'force-dynamic'

Expand Down Expand Up @@ -92,7 +88,7 @@ export async function POST(request: NextRequest) {

return NextResponse.json(
{
error: parseJsmErrorMessage(response.status, response.statusText, errorText),
error: parseAtlassianErrorMessage(response.status, response.statusText, errorText),
details: errorText,
},
{ status: response.status }
Expand Down Expand Up @@ -163,7 +159,7 @@ export async function POST(request: NextRequest) {

return NextResponse.json(
{
error: parseJsmErrorMessage(response.status, response.statusText, errorText),
error: parseAtlassianErrorMessage(response.status, response.statusText, errorText),
details: errorText,
},
{ status: response.status }
Expand Down
10 changes: 3 additions & 7 deletions apps/sim/app/api/tools/jsm/organizations/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@ import { createLogger } from '@sim/logger'
import { type NextRequest, NextResponse } from 'next/server'
import { checkInternalAuth } from '@/lib/auth/hybrid'
import { validateAlphanumericId, validateJiraCloudId } from '@/lib/core/security/input-validation'
import {
getJiraCloudId,
getJsmApiBaseUrl,
getJsmHeaders,
parseJsmErrorMessage,
} from '@/tools/jsm/utils'
import { getJiraCloudId, parseAtlassianErrorMessage } from '@/tools/jira/utils'
import { getJsmApiBaseUrl, getJsmHeaders } from '@/tools/jsm/utils'

export const dynamic = 'force-dynamic'

Expand Down Expand Up @@ -75,7 +71,7 @@ export async function POST(request: NextRequest) {

return NextResponse.json(
{
error: parseJsmErrorMessage(response.status, response.statusText, errorText),
error: parseAtlassianErrorMessage(response.status, response.statusText, errorText),
details: errorText,
},
{ status: response.status }
Expand Down
12 changes: 4 additions & 8 deletions apps/sim/app/api/tools/jsm/participants/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,8 @@ import {
validateJiraCloudId,
validateJiraIssueKey,
} from '@/lib/core/security/input-validation'
import {
getJiraCloudId,
getJsmApiBaseUrl,
getJsmHeaders,
parseJsmErrorMessage,
} from '@/tools/jsm/utils'
import { getJiraCloudId, parseAtlassianErrorMessage } from '@/tools/jira/utils'
import { getJsmApiBaseUrl, getJsmHeaders } from '@/tools/jsm/utils'

export const dynamic = 'force-dynamic'

Expand Down Expand Up @@ -101,7 +97,7 @@ export async function POST(request: NextRequest) {

return NextResponse.json(
{
error: parseJsmErrorMessage(response.status, response.statusText, errorText),
error: parseAtlassianErrorMessage(response.status, response.statusText, errorText),
details: errorText,
},
{ status: response.status }
Expand Down Expand Up @@ -155,7 +151,7 @@ export async function POST(request: NextRequest) {

return NextResponse.json(
{
error: parseJsmErrorMessage(response.status, response.statusText, errorText),
error: parseAtlassianErrorMessage(response.status, response.statusText, errorText),
details: errorText,
},
{ status: response.status }
Expand Down
10 changes: 3 additions & 7 deletions apps/sim/app/api/tools/jsm/queues/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@ import { createLogger } from '@sim/logger'
import { type NextRequest, NextResponse } from 'next/server'
import { checkInternalAuth } from '@/lib/auth/hybrid'
import { validateAlphanumericId, validateJiraCloudId } from '@/lib/core/security/input-validation'
import {
getJiraCloudId,
getJsmApiBaseUrl,
getJsmHeaders,
parseJsmErrorMessage,
} from '@/tools/jsm/utils'
import { getJiraCloudId, parseAtlassianErrorMessage } from '@/tools/jira/utils'
import { getJsmApiBaseUrl, getJsmHeaders } from '@/tools/jsm/utils'

export const dynamic = 'force-dynamic'

Expand Down Expand Up @@ -84,7 +80,7 @@ export async function POST(request: NextRequest) {

return NextResponse.json(
{
error: parseJsmErrorMessage(response.status, response.statusText, errorText),
error: parseAtlassianErrorMessage(response.status, response.statusText, errorText),
details: errorText,
},
{ status: response.status }
Expand Down
12 changes: 4 additions & 8 deletions apps/sim/app/api/tools/jsm/request/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,8 @@ import {
validateJiraCloudId,
validateJiraIssueKey,
} from '@/lib/core/security/input-validation'
import {
getJiraCloudId,
getJsmApiBaseUrl,
getJsmHeaders,
parseJsmErrorMessage,
} from '@/tools/jsm/utils'
import { getJiraCloudId, parseAtlassianErrorMessage } from '@/tools/jira/utils'
import { getJsmApiBaseUrl, getJsmHeaders } from '@/tools/jsm/utils'

export const dynamic = 'force-dynamic'

Expand Down Expand Up @@ -141,7 +137,7 @@ export async function POST(request: NextRequest) {

return NextResponse.json(
{
error: parseJsmErrorMessage(response.status, response.statusText, errorText),
error: parseAtlassianErrorMessage(response.status, response.statusText, errorText),
details: errorText,
},
{ status: response.status }
Expand Down Expand Up @@ -210,7 +206,7 @@ export async function POST(request: NextRequest) {

return NextResponse.json(
{
error: parseJsmErrorMessage(response.status, response.statusText, errorText),
error: parseAtlassianErrorMessage(response.status, response.statusText, errorText),
details: errorText,
},
{ status: response.status }
Expand Down
10 changes: 3 additions & 7 deletions apps/sim/app/api/tools/jsm/requests/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,8 @@ import {
validateEnum,
validateJiraCloudId,
} from '@/lib/core/security/input-validation'
import {
getJiraCloudId,
getJsmApiBaseUrl,
getJsmHeaders,
parseJsmErrorMessage,
} from '@/tools/jsm/utils'
import { getJiraCloudId, parseAtlassianErrorMessage } from '@/tools/jira/utils'
import { getJsmApiBaseUrl, getJsmHeaders } from '@/tools/jsm/utils'

export const dynamic = 'force-dynamic'

Expand Down Expand Up @@ -124,7 +120,7 @@ export async function POST(request: NextRequest) {

return NextResponse.json(
{
error: parseJsmErrorMessage(response.status, response.statusText, errorText),
error: parseAtlassianErrorMessage(response.status, response.statusText, errorText),
details: errorText,
},
{ status: response.status }
Expand Down
10 changes: 3 additions & 7 deletions apps/sim/app/api/tools/jsm/requesttypefields/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@ import { createLogger } from '@sim/logger'
import { type NextRequest, NextResponse } from 'next/server'
import { checkInternalAuth } from '@/lib/auth/hybrid'
import { validateAlphanumericId, validateJiraCloudId } from '@/lib/core/security/input-validation'
import {
getJiraCloudId,
getJsmApiBaseUrl,
getJsmHeaders,
parseJsmErrorMessage,
} from '@/tools/jsm/utils'
import { getJiraCloudId, parseAtlassianErrorMessage } from '@/tools/jira/utils'
import { getJsmApiBaseUrl, getJsmHeaders } from '@/tools/jsm/utils'

export const dynamic = 'force-dynamic'

Expand Down Expand Up @@ -80,7 +76,7 @@ export async function POST(request: NextRequest) {

return NextResponse.json(
{
error: parseJsmErrorMessage(response.status, response.statusText, errorText),
error: parseAtlassianErrorMessage(response.status, response.statusText, errorText),
details: errorText,
},
{ status: response.status }
Expand Down
Loading
Loading