From 069241dbbcffbb6e5f7a5df6f15214e13bd77cec Mon Sep 17 00:00:00 2001 From: Piyush Gupta Date: Thu, 16 Oct 2025 00:49:15 +0530 Subject: [PATCH] fix: review comments --- .../laravel-forge/laravel-forge-connection-fns.ts | 2 +- .../laravel-forge/laravel-forge-connection-service.ts | 2 +- .../laravel-forge/laravel-forge-sync-schemas.ts | 7 ++++--- .../secret-sync/laravel-forge/laravel-forge-sync-types.ts | 2 +- docs/integrations/secret-syncs/laravel-forge.mdx | 4 ++-- .../src/hooks/api/appConnections/laravel-forge/queries.tsx | 4 ++-- .../src/hooks/api/secretSyncs/types/laravel-forge-sync.ts | 2 +- 7 files changed, 12 insertions(+), 11 deletions(-) diff --git a/backend/src/services/app-connection/laravel-forge/laravel-forge-connection-fns.ts b/backend/src/services/app-connection/laravel-forge/laravel-forge-connection-fns.ts index 108c934fc..e63c659a7 100644 --- a/backend/src/services/app-connection/laravel-forge/laravel-forge-connection-fns.ts +++ b/backend/src/services/app-connection/laravel-forge/laravel-forge-connection-fns.ts @@ -148,7 +148,7 @@ export const listLaravelForgeServers = async ( export const listLaravelForgeSites = async ( appConnection: TLaravelForgeConnection, organizationSlug: string, - serverId: number + serverId: string ): Promise => { const { credentials } = appConnection; const { apiToken } = credentials; diff --git a/backend/src/services/app-connection/laravel-forge/laravel-forge-connection-service.ts b/backend/src/services/app-connection/laravel-forge/laravel-forge-connection-service.ts index cc7fc8790..fc3c2bf80 100644 --- a/backend/src/services/app-connection/laravel-forge/laravel-forge-connection-service.ts +++ b/backend/src/services/app-connection/laravel-forge/laravel-forge-connection-service.ts @@ -54,7 +54,7 @@ export const laravelForgeConnectionService = (getAppConnection: TGetAppConnectio connectionId: string, actor: OrgServiceActor, organizationSlug: string, - serverId: number + serverId: string ): Promise => { const appConnection = await getAppConnection(AppConnection.LaravelForge, connectionId, actor); try { diff --git a/backend/src/services/secret-sync/laravel-forge/laravel-forge-sync-schemas.ts b/backend/src/services/secret-sync/laravel-forge/laravel-forge-sync-schemas.ts index 0350dd501..0ab946e03 100644 --- a/backend/src/services/secret-sync/laravel-forge/laravel-forge-sync-schemas.ts +++ b/backend/src/services/secret-sync/laravel-forge/laravel-forge-sync-schemas.ts @@ -26,9 +26,10 @@ const LaravelForgeSyncDestinationConfigSchema = z.object({ ) .describe(SecretSyncs.DESTINATION_CONFIG.LARAVEL_FORGE.orgSlug), orgName: z.string().optional().describe(SecretSyncs.DESTINATION_CONFIG.LARAVEL_FORGE.orgName), - serverId: z.coerce - .number() - .int("Server ID must be a valid integer") + serverId: z + .string() + .min(1, "Server ID is required") + .regex(/^\d+$/, "Server ID must be a valid integer") .describe(SecretSyncs.DESTINATION_CONFIG.LARAVEL_FORGE.serverId), serverName: z.string().optional().describe(SecretSyncs.DESTINATION_CONFIG.LARAVEL_FORGE.serverName), siteId: z.string().min(1, "Site ID is required").describe(SecretSyncs.DESTINATION_CONFIG.LARAVEL_FORGE.siteId), diff --git a/backend/src/services/secret-sync/laravel-forge/laravel-forge-sync-types.ts b/backend/src/services/secret-sync/laravel-forge/laravel-forge-sync-types.ts index e4d624af1..faa5dffa4 100644 --- a/backend/src/services/secret-sync/laravel-forge/laravel-forge-sync-types.ts +++ b/backend/src/services/secret-sync/laravel-forge/laravel-forge-sync-types.ts @@ -21,7 +21,7 @@ export type TLaravelForgeSyncWithCredentials = TLaravelForgeSync & { export type TGetLaravelForgeSecrets = { apiToken: string; orgSlug: string; - serverId: number; + serverId: string; siteId: string; }; diff --git a/docs/integrations/secret-syncs/laravel-forge.mdx b/docs/integrations/secret-syncs/laravel-forge.mdx index ee794a599..c93abb94a 100644 --- a/docs/integrations/secret-syncs/laravel-forge.mdx +++ b/docs/integrations/secret-syncs/laravel-forge.mdx @@ -102,7 +102,7 @@ description: "Learn how to configure a Laravel Forge Sync for Infisical." }, "destinationConfig": { "orgSlug": "org-abc123", - "serverId": "server-abc123", + "serverId": "123", "siteId": "site-abc123" } }' @@ -146,7 +146,7 @@ description: "Learn how to configure a Laravel Forge Sync for Infisical." "destination": "laravel-forge", "destinationConfig": { "orgSlug": "org-abc123", - "serverId": "server-abc123", + "serverId": "123", "siteId": "site-abc123" } } diff --git a/frontend/src/hooks/api/appConnections/laravel-forge/queries.tsx b/frontend/src/hooks/api/appConnections/laravel-forge/queries.tsx index 3cbab178c..6986a94da 100644 --- a/frontend/src/hooks/api/appConnections/laravel-forge/queries.tsx +++ b/frontend/src/hooks/api/appConnections/laravel-forge/queries.tsx @@ -11,7 +11,7 @@ const laravelForgeConnectionKeys = { [...laravelForgeConnectionKeys.all, "organizations", connectionId] as const, listServers: (connectionId: string, organizationSlug: string) => [...laravelForgeConnectionKeys.all, "servers", connectionId, organizationSlug] as const, - listSites: (connectionId: string, organizationSlug: string, serverId: number) => + listSites: (connectionId: string, organizationSlug: string, serverId: string) => [...laravelForgeConnectionKeys.all, "sites", connectionId, organizationSlug, serverId] as const }; @@ -72,7 +72,7 @@ export const useLaravelForgeConnectionListServers = ( export const useLaravelForgeConnectionListSites = ( connectionId: string, organizationSlug: string, - serverId: number, + serverId: string, options?: Omit< UseQueryOptions< TLaravelForgeSite[], diff --git a/frontend/src/hooks/api/secretSyncs/types/laravel-forge-sync.ts b/frontend/src/hooks/api/secretSyncs/types/laravel-forge-sync.ts index 40e53c044..cce693a48 100644 --- a/frontend/src/hooks/api/secretSyncs/types/laravel-forge-sync.ts +++ b/frontend/src/hooks/api/secretSyncs/types/laravel-forge-sync.ts @@ -7,7 +7,7 @@ export type TLaravelForgeSync = TRootSecretSync & { destinationConfig: { orgSlug: string; orgName: string; - serverId: number; + serverId: string; serverName: string; siteId: string; siteName: string;