Automate browser based workflows with AI
Python aiapiautomationbrowserbrowser-automationcomputergptllmplaywrightpowerautomatepuppeteerpythonrpaseleniumvisionworkflow
fix onepassword router (#3105)
LawyZheng1e315e39cd73
diff --git a/skyvern-frontend/src/hooks/useOnePasswordToken.ts b/skyvern-frontend/src/hooks/useOnePasswordToken.tsindex 3d3b075be..da1a0ea4c 100644--- a/skyvern-frontend/src/hooks/useOnePasswordToken.ts+++ b/skyvern-frontend/src/hooks/useOnePasswordToken.ts@@ -17,9 +17,9 @@ export function useOnePasswordToken() {useQuery<OnePasswordTokenApiResponse>({queryKey: ["onePasswordToken"],queryFn: async () => {- const client = await getClient(credentialGetter);+ const client = await getClient(credentialGetter, "sans-api-v1");return await client- .get("/auth-tokens/onepassword")+ .get("/credentials/onepassword/get").then((response) => response.data.token).catch(() => null);},@@ -27,9 +27,9 @@ export function useOnePasswordToken() {const createOrUpdateTokenMutation = useMutation({mutationFn: async (data: CreateOnePasswordTokenRequest) => {- const client = await getClient(credentialGetter);+ const client = await getClient(credentialGetter, "sans-api-v1");return await client- .post("/auth-tokens/onepassword", data)+ .post("/credentials/onepassword/create", data).then((response) => response.data as CreateOnePasswordTokenResponse);},onSuccess: () => {diff --git a/skyvern/forge/sdk/routes/credentials.py b/skyvern/forge/sdk/routes/credentials.pyindex 8b3017353..b36937ae5 100644--- a/skyvern/forge/sdk/routes/credentials.py+++ b/skyvern/forge/sdk/routes/credentials.py@@ -375,7 +375,7 @@ async def get_credentials(@base_router.get(- "/credentials/onepassword",+ "/credentials/onepassword/get",response_model=CreateOnePasswordTokenResponse,summary="Get OnePassword service account token",description="Retrieves the current OnePassword service account token for the organization.",@@ -385,7 +385,7 @@ async def get_credentials(},)@base_router.get(- "/credentials/onepassword/",+ "/credentials/onepassword/get/",response_model=CreateOnePasswordTokenResponse,include_in_schema=False,)@@ -400,7 +400,6 @@ async def get_onepassword_token(organization_id=current_org.organization_id,token_type=OrganizationAuthTokenType.onepassword_service_account,)-if not auth_token:raise HTTPException(status_code=404,@@ -425,7 +424,7 @@ async def get_onepassword_token(@base_router.post(- "/credentials/onepassword",+ "/credentials/onepassword/create",response_model=CreateOnePasswordTokenResponse,summary="Create or update OnePassword service account token",description="Creates or updates a OnePassword service account token for the current organization. Only one valid token is allowed per organization.",@@ -435,7 +434,7 @@ async def get_onepassword_token(},)@base_router.post(- "/credentials/onepassword/",+ "/credentials/onepassword/create/",response_model=CreateOnePasswordTokenResponse,include_in_schema=False,)