Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

chore(devex): fail raw api calls outside the api layer (#105720)

Julian Bez8ff2cf4df74f
diff --git a/.semgrep/rules/security/prefer-codegen-api.test.ts b/.semgrep/rules/security/prefer-codegen-api.test.ts
index 6fb9900c4ac6..8a6a3e75b556 100644
--- a/.semgrep/rules/security/prefer-codegen-api.test.ts
+++ b/.semgrep/rules/security/prefer-codegen-api.test.ts
@@ -36,6 +36,21 @@ const i2 = await api.get<PaginatedResponse<Foo>>(`api/foo`)
// ruleid: prefer-codegen-api
const i3 = await api.get<CountedPaginatedResponse<ChangeRequest>>(`api/foo`)
+// ruleid: prefer-codegen-api
+const i4 = await api.getResponse(`api/foo`)
+
+// ruleid: prefer-codegen-api
+const i5 = await api.createResponse(`api/foo`, {})
+
+// ruleid: prefer-codegen-api
+await api.stream(`api/foo`, { onMessage })
+
+// ruleid: prefer-codegen-api
+const i6 = await api.createWithUploadProgress<Foo>(`api/foo`, formData)
+
+// ruleid: prefer-codegen-api
+const i7 = await api.loadPaginatedResults<Foo>(`api/foo`)
+
// ok: prefer-codegen-api
const j = await api.integrations.authorizeUrl()
@@ -45,5 +60,13 @@ const k = await api.dashboards.list()
// ok: prefer-codegen-api
const l = await legalDocumentsList(orgId)
-// nosemgrep: prefer-codegen-api
+// nosemgrep: prefer-codegen-api -- Follows the pagination URL the server returns.
const m = await api.get(`api/foo`)
+
+// ruleid: prefer-codegen-api-reason
+// nosemgrep: prefer-codegen-api
+const n = await api.get(`api/foo`)
+
+// ruleid: prefer-codegen-api-reason
+/* nosemgrep: prefer-codegen-api */
+const o = await api.get(`api/foo`)
diff --git a/.semgrep/rules/security/prefer-codegen-api.yaml b/.semgrep/rules/security/prefer-codegen-api.yaml
index 00fc8114b536..dbe914371353 100644
--- a/.semgrep/rules/security/prefer-codegen-api.yaml
+++ b/.semgrep/rules/security/prefer-codegen-api.yaml
@@ -1,17 +1,22 @@
rules:
- id: prefer-codegen-api
message: >-
- Manual `api.<verb>(...)` call in product frontend code. Prefer the generated
- client in `products/<product>/frontend/generated/api.ts`.
+ Raw `api.<verb>(...)` call outside the API layer. It puts a hand-written URL
+ and an unchecked response type at the call site, so a backend change breaks it
+ at runtime instead of at compile time. Call the generated function instead:
+ `products/<product>/frontend/generated/api.ts` for a product endpoint,
+ `frontend/src/generated/core/api.ts` for a core endpoint.
Agents: invoke the `adopting-generated-api-types` skill
(`.agents/skills/adopting-generated-api-types/SKILL.md`) for the migration
workflow. Humans: run `hogli product:maturity --codegen <product>` to see
the suggested generated function per call site.
- If no generated equivalent is available yet (endpoint missing OpenAPI tags,
- dynamic URL, etc.), add `// nosemgrep: prefer-codegen-api` above this line —
- the maturity tooling continues to track tagged sites.
+ If no generated function covers the endpoint, add its OpenAPI schema
+ (`/improving-drf-endpoints`) and run `hogli build:openapi`. Only a URL that the
+ server returns (a pagination `next` link, an export download) or a route
+ outside the API may stay raw. Mark it with
+ `// nosemgrep: prefer-codegen-api -- <reason>` on the line above.
severity: ERROR
languages: [typescript, javascript]
# Namespaced calls (api.signalReports.list()) are a different AST shape and
@@ -20,19 +25,63 @@ rules:
# job's --baseline-commit pass blocks only the ones a pull request adds.
pattern-either:
- pattern: api.get(...)
+ - pattern: api.getResponse(...)
+ - pattern: api.stream(...)
- pattern: api.post(...)
+ - pattern: api.create(...)
+ - pattern: api.createResponse(...)
+ - pattern: api.createWithUploadProgress(...)
- pattern: api.put(...)
- pattern: api.patch(...)
- - pattern: api.delete(...)
- - pattern: api.create(...)
- pattern: api.update(...)
+ - pattern: api.delete(...)
+ - pattern: api.loadPaginatedResults(...)
# Semgrep's TypeScript parser treats generic-typed calls (api.create<T>())
# as a different AST shape that AST-level patterns above don't match,
# so fall back to a regex. Bounds the type args by `(` rather than `>` so
# nested generics like api.get<PaginatedResponse<Foo>>(...) still match.
- - pattern-regex: '\bapi\.(get|post|put|patch|delete|create|update)<[^(]*>\s*\('
+ - pattern-regex: '\bapi\.(get|getResponse|stream|post|create|createResponse|createWithUploadProgress|put|patch|update|delete|loadPaginatedResults)<[^(]*>\s*\('
+ paths:
+ include:
+ - '/frontend/src/'
+ - '/products/*/frontend/'
+ exclude:
+ - '**/generated/**'
+ # The API layer itself: the transport, the mutator the generated
+ # functions call, and the SSE reconnect wrapper over api.stream.
+ - '/frontend/src/lib/api.ts'
+ - '/frontend/src/lib/api-orval-mutator.ts'
+ - '/frontend/src/lib/api-stream.ts'
+ # Tests exercise the transport on purpose (retries, re-authentication),
+ # and a test is not where the frontend's API contract lives.
+ - '**/*.test.ts'
+ - '**/*.test.tsx'
+ - '**/*.spec.ts'
+ - '**/*.spec.tsx'
+
+ - id: prefer-codegen-api-reason
+ message: >-
+ A `prefer-codegen-api` suppression needs a reason. Write it after ` -- ` on the
+ same line, for example
+ `// nosemgrep: prefer-codegen-api -- Follows the pagination URL the server returns.`
+ The reason tells the next reader whether the raw call is a real exception or
+ debt to migrate.
+ severity: ERROR
+ languages: [typescript, javascript]
+ # Semgrep matches a nosemgrep id exactly, so the bare marker that silences
+ # prefer-codegen-api on this line does not silence this rule.
+ pattern-regex: '(?://|/\*)\s*nosemgrep:[^\n]*?prefer-codegen-api(?![\w-])(?![^\n]*?\s--\s*[^\s*])'
+ # Same scope as prefer-codegen-api.
paths:
include:
+ - '/frontend/src/'
- '/products/*/frontend/'
exclude:
- '**/generated/**'
+ - '/frontend/src/lib/api.ts'
+ - '/frontend/src/lib/api-orval-mutator.ts'
+ - '/frontend/src/lib/api-stream.ts'
+ - '**/*.test.ts'
+ - '**/*.test.tsx'
+ - '**/*.spec.ts'
+ - '**/*.spec.tsx'
diff --git a/frontend/src/layout/navigation-3000/sidepanel/panels/access_control/ResolutionPreview/resolutionPreviewLogic.ts b/frontend/src/layout/navigation-3000/sidepanel/panels/access_control/ResolutionPreview/resolutionPreviewLogic.ts
index 964fb8efa33c..63cdaa604fd1 100644
--- a/frontend/src/layout/navigation-3000/sidepanel/panels/access_control/ResolutionPreview/resolutionPreviewLogic.ts
+++ b/frontend/src/layout/navigation-3000/sidepanel/panels/access_control/ResolutionPreview/resolutionPreviewLogic.ts
@@ -113,6 +113,7 @@ export const resolutionPreviewLogic = kea<resolutionPreviewLogicType>([
null as ResolutionPreviewResponse | null,
{
loadPreview: async () =>
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.get<ResolutionPreviewResponse>(
`api/projects/${values.currentTeamIdStrict}/access_control_resolution_preview`
),
@@ -122,6 +123,7 @@ export const resolutionPreviewLogic = kea<resolutionPreviewLogicType>([
false,
{
acceptResolution: async () => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.create(`api/projects/${values.currentTeamIdStrict}/access_control_resolution_accept`)
return true
},
diff --git a/frontend/src/layout/navigation-3000/sidepanel/panels/access_control/ResourceAccessControlsV2/accessControlsLogic.ts b/frontend/src/layout/navigation-3000/sidepanel/panels/access_control/ResourceAccessControlsV2/accessControlsLogic.ts
index ca23ea6be749..f31b6142d98b 100644
--- a/frontend/src/layout/navigation-3000/sidepanel/panels/access_control/ResourceAccessControlsV2/accessControlsLogic.ts
+++ b/frontend/src/layout/navigation-3000/sidepanel/panels/access_control/ResourceAccessControlsV2/accessControlsLogic.ts
@@ -1039,6 +1039,7 @@ export const accessControlsLogic = kea<accessControlsLogicType>([
null as AccessControlDefaultsResponse | null,
{
loadDefaults: async () =>
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use organizationsProjectsAccessControlDefaultsRetrieve() from 'products/access_control/frontend/generated/api' instead.
api.get<AccessControlDefaultsResponse>(`api/projects/${props.projectId}/access_control_defaults`),
},
],
@@ -1046,6 +1047,7 @@ export const accessControlsLogic = kea<accessControlsLogicType>([
null as AccessControlRolesResponse | null,
{
loadRoles: async () =>
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use organizationsProjectsAccessControlRolesRetrieve() from 'products/access_control/frontend/generated/api' instead.
api.get<AccessControlRolesResponse>(`api/projects/${props.projectId}/access_control_roles`),
},
],
@@ -1053,6 +1055,7 @@ export const accessControlsLogic = kea<accessControlsLogicType>([
null as AccessControlMembersResponse | null,
{
loadMembers: async () =>
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use organizationsProjectsAccessControlMembersRetrieve() from 'products/access_control/frontend/generated/api' instead.
api.get<AccessControlMembersResponse>(`api/projects/${props.projectId}/access_control_members`),
},
],
@@ -1066,6 +1069,7 @@ export const accessControlsLogic = kea<accessControlsLogicType>([
? `access_control_roles?role_id=${subject.subjectId}`
: `access_control_members?member_id=${subject.subjectId}`
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const response = await api.get<{ results: AccessControlSettingsEntry[] }>(
`api/projects/${props.projectId}/${query}`
)
diff --git a/frontend/src/layout/navigation-3000/sidepanel/panels/access_control/ResourceAccessControlsV2/accessDetailLogic.ts b/frontend/src/layout/navigation-3000/sidepanel/panels/access_control/ResourceAccessControlsV2/accessDetailLogic.ts
index d769f768e0bc..b2de63a922d4 100644
--- a/frontend/src/layout/navigation-3000/sidepanel/panels/access_control/ResourceAccessControlsV2/accessDetailLogic.ts
+++ b/frontend/src/layout/navigation-3000/sidepanel/panels/access_control/ResourceAccessControlsV2/accessDetailLogic.ts
@@ -387,6 +387,7 @@ export const accessDetailLogic = kea<accessDetailLogicType>([
[] as AccessObjectRule[],
{
loadObjects: async () =>
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
(await api.get<{ results: AccessObjectRule[] }>(subjectRulesEndpoint(props, 'objects'))).results,
},
],
@@ -394,6 +395,7 @@ export const accessDetailLogic = kea<accessDetailLogicType>([
[] as AccessPropertyRule[],
{
loadProperties: async () =>
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
(await api.get<{ results: AccessPropertyRule[] }>(subjectRulesEndpoint(props, 'properties')))
.results,
},
@@ -404,6 +406,7 @@ export const accessDetailLogic = kea<accessDetailLogicType>([
setObjectRule: async ({ resource, resourceId, level }) => {
// A null level clears the subject's rule on the object
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.put(`api/projects/${props.projectId}/access_control_object_rules`, {
resource,
resource_id: resourceId,
diff --git a/frontend/src/layout/navigation-3000/sidepanel/panels/access_control/ResourceAccessControlsV2/addObjectOverrideModalLogic.ts b/frontend/src/layout/navigation-3000/sidepanel/panels/access_control/ResourceAccessControlsV2/addObjectOverrideModalLogic.ts
index fd324cf7b37a..7ef96214a890 100644
--- a/frontend/src/layout/navigation-3000/sidepanel/panels/access_control/ResourceAccessControlsV2/addObjectOverrideModalLogic.ts
+++ b/frontend/src/layout/navigation-3000/sidepanel/panels/access_control/ResourceAccessControlsV2/addObjectOverrideModalLogic.ts
@@ -939,6 +939,7 @@ export const addObjectOverrideModalLogic = kea<addObjectOverrideModalLogicType>(
loadObjectOptions: async (_, breakpoint) => {
await breakpoint(300)
// One backend endpoint serves every resource type with correct display names
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const response = await api.get<{ results: ObjectOption[] }>(
`api/projects/${props.projectId}/access_control_object_search?resource=${values.resource}&search=${encodeURIComponent(
values.search
@@ -1006,6 +1007,7 @@ export const addObjectOverrideModalLogic = kea<addObjectOverrideModalLogicType>(
// and silently replace the selection
await breakpoint(300)
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const response = await api.get<{ results: ObjectOption[] }>(
`api/projects/${props.projectId}/access_control_object_search?resource=${resource}&id=${encodeURIComponent(
lookupId
diff --git a/frontend/src/layout/navigation-3000/sidepanel/panels/access_control/ResourceAccessControlsV2/addPropertyRestrictionModalLogic.ts b/frontend/src/layout/navigation-3000/sidepanel/panels/access_control/ResourceAccessControlsV2/addPropertyRestrictionModalLogic.ts
index 55006756b447..cad06e0c324a 100644
--- a/frontend/src/layout/navigation-3000/sidepanel/panels/access_control/ResourceAccessControlsV2/addPropertyRestrictionModalLogic.ts
+++ b/frontend/src/layout/navigation-3000/sidepanel/panels/access_control/ResourceAccessControlsV2/addPropertyRestrictionModalLogic.ts
@@ -158,6 +158,7 @@ export const addPropertyRestrictionModalLogic = kea<addPropertyRestrictionModalL
{
loadPropertyOptions: async (_, breakpoint) => {
await breakpoint(300)
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use propertyDefinitionsList() from '~/generated/core/api' instead.
const response = await api.get<{ results: { id: string; name: string }[] }>(
`api/projects/${props.projectId}/property_definitions/?type=${values.propertyType}&limit=20&search=${encodeURIComponent(
values.search
diff --git a/frontend/src/layout/navigation-3000/sidepanel/panels/access_control/accessControlLogic.ts b/frontend/src/layout/navigation-3000/sidepanel/panels/access_control/accessControlLogic.ts
index 22088d1dee78..9ea0a51241e6 100644
--- a/frontend/src/layout/navigation-3000/sidepanel/panels/access_control/accessControlLogic.ts
+++ b/frontend/src/layout/navigation-3000/sidepanel/panels/access_control/accessControlLogic.ts
@@ -856,6 +856,7 @@ export const accessControlLogic = kea<accessControlLogicType>([
{
loadAccessControls: async () => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
const response = await api.get<AccessControlResponseType>(values.endpoint)
return response
} catch {
@@ -876,6 +877,7 @@ export const accessControlLogic = kea<accessControlLogicType>([
},
updateAccessControlDefault: async ({ level, source }) => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
await api.put<AccessControlType, AccessControlUpdateType>(values.endpoint, {
access_level: level,
})
@@ -892,6 +894,7 @@ export const accessControlLogic = kea<accessControlLogicType>([
updateAccessControlRoles: async ({ accessControls, source }) => {
for (const { role, level } of accessControls) {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
await api.put<AccessControlType, AccessControlUpdateType>(values.endpoint, {
role: role,
access_level: level,
@@ -913,6 +916,7 @@ export const accessControlLogic = kea<accessControlLogicType>([
updateAccessControlMembers: async ({ accessControls, source }) => {
for (const { member, level } of accessControls) {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
await api.put<AccessControlType, AccessControlUpdateType>(values.endpoint, {
organization_member: member,
access_level: level,
diff --git a/frontend/src/layout/navigation-3000/sidepanel/panels/access_control/resourcesAccessControlLogic.ts b/frontend/src/layout/navigation-3000/sidepanel/panels/access_control/resourcesAccessControlLogic.ts
index 51579791ea6c..0c4a41edea95 100644
--- a/frontend/src/layout/navigation-3000/sidepanel/panels/access_control/resourcesAccessControlLogic.ts
+++ b/frontend/src/layout/navigation-3000/sidepanel/panels/access_control/resourcesAccessControlLogic.ts
@@ -133,6 +133,7 @@ export const resourcesAccessControlLogic = kea<resourcesAccessControlLogicType>(
{
updateResourceAccessControls: async ({ accessControls, saveType }) => {
for (const control of accessControls) {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.put<AccessControlTypeRole>(
`api/projects/${values.currentProjectId}/resource_access_controls`,
{
diff --git a/frontend/src/layout/navigation-3000/sidepanel/panels/access_control/roleAccessControlLogic.ts b/frontend/src/layout/navigation-3000/sidepanel/panels/access_control/roleAccessControlLogic.ts
index 30d69e2ca8bc..1267128deba5 100644
--- a/frontend/src/layout/navigation-3000/sidepanel/panels/access_control/roleAccessControlLogic.ts
+++ b/frontend/src/layout/navigation-3000/sidepanel/panels/access_control/roleAccessControlLogic.ts
@@ -320,6 +320,7 @@ export const roleAccessControlLogic = kea<roleAccessControlLogicType>([
null as AccessControlResponseType | null,
{
loadResourceAccessControls: async () => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const response = await api.get<AccessControlResponseType>(
`api/projects/${values.currentProjectId}/resource_access_controls`
)
diff --git a/frontend/src/layout/navigation-3000/sidepanel/panels/activity/notificationsSSE.ts b/frontend/src/layout/navigation-3000/sidepanel/panels/activity/notificationsSSE.ts
index 469c4846ec42..469354d1cd9f 100644
--- a/frontend/src/layout/navigation-3000/sidepanel/panels/activity/notificationsSSE.ts
+++ b/frontend/src/layout/navigation-3000/sidepanel/panels/activity/notificationsSSE.ts
@@ -21,6 +21,7 @@ export function connectToNotificationsSSE(
hooks: NotificationsSSEHooks = {}
): Promise<void> {
let firstMessageSeen = false
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
return api.stream(url, {
headers: {
Authorization: `Bearer ${token}`,
diff --git a/frontend/src/layout/navigation-3000/sidepanel/panels/activity/sidePanelActivityLogic.tsx b/frontend/src/layout/navigation-3000/sidepanel/panels/activity/sidePanelActivityLogic.tsx
index 8364f11510a6..e221fc62e02d 100644
--- a/frontend/src/layout/navigation-3000/sidepanel/panels/activity/sidePanelActivityLogic.tsx
+++ b/frontend/src/layout/navigation-3000/sidepanel/panels/activity/sidePanelActivityLogic.tsx
@@ -207,6 +207,7 @@ export const sidePanelActivityLogic = kea<sidePanelActivityLogicType>([
return values.allActivityResponse
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
const response = await api.get<PaginatedResponse<ActivityLogItem>>(values.allActivityResponse.next)
response.results = [...values.allActivityResponse.results, ...response.results]
diff --git a/frontend/src/layout/navigation-3000/sidepanel/panels/activity/sidePanelNotificationsLogic.tsx b/frontend/src/layout/navigation-3000/sidepanel/panels/activity/sidePanelNotificationsLogic.tsx
index 94dfa1dfbcfb..28e8b29e6296 100644
--- a/frontend/src/layout/navigation-3000/sidepanel/panels/activity/sidePanelNotificationsLogic.tsx
+++ b/frontend/src/layout/navigation-3000/sidepanel/panels/activity/sidePanelNotificationsLogic.tsx
@@ -670,6 +670,7 @@ export const sidePanelNotificationsLogic = kea<sidePanelNotificationsLogicType>(
try {
const [response] = await Promise.all([
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
api.get<ChangesResponse>(
`api/projects/${values.currentProjectId}/my_notifications?` +
toParams({ unread: onlyUnread })
@@ -715,6 +716,7 @@ export const sidePanelNotificationsLogic = kea<sidePanelNotificationsLogicType>(
a.created_at.isAfter(b.created_at) ? a : b
)
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.create(`api/projects/${values.currentProjectId}/my_notifications/bookmark`, {
bookmark: latestNotification.created_at.toISOString(),
})
@@ -1017,6 +1019,7 @@ export const sidePanelNotificationsLogic = kea<sidePanelNotificationsLogicType>(
},
refreshInAppUnreadCount: async () => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. notificationsUnreadCountRetrieve() from 'products/notifications/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
const countResp = await api.get<{ count: number }>(
`api/projects/${values.currentProjectId}/notifications/unread_count/`
)
@@ -1327,6 +1330,7 @@ export const sidePanelNotificationsLogic = kea<sidePanelNotificationsLogicType>(
// Swallow
}
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. notificationsUnreadCountRetrieve() from 'products/notifications/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
const countResp = await api.get<{ count: number }>(
`api/projects/${values.currentProjectId}/notifications/unread_count/`
)
diff --git a/frontend/src/layout/navigation-3000/sidepanel/panels/max/sidePanelMaxAPI.ts b/frontend/src/layout/navigation-3000/sidepanel/panels/max/sidePanelMaxAPI.ts
index 02036d197a0e..71b2cd2f2e3e 100644
--- a/frontend/src/layout/navigation-3000/sidepanel/panels/max/sidePanelMaxAPI.ts
+++ b/frontend/src/layout/navigation-3000/sidepanel/panels/max/sidePanelMaxAPI.ts
@@ -26,6 +26,7 @@ export const sidePanelMaxAPI = {
sessionStorage.setItem('max_session_id', sessionId)
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call to a route outside /api/, with an unchecked response type. No generated function can cover it until the route is in the OpenAPI schema.
const response = await api.createResponse(`/max/chat/`, {
message,
role: 'user',
diff --git a/frontend/src/layout/navigation/ImpersonationNotice/impersonationNoticeLogic.ts b/frontend/src/layout/navigation/ImpersonationNotice/impersonationNoticeLogic.ts
index 0e850cc43d9a..d6be717b1f5d 100644
--- a/frontend/src/layout/navigation/ImpersonationNotice/impersonationNoticeLogic.ts
+++ b/frontend/src/layout/navigation/ImpersonationNotice/impersonationNoticeLogic.ts
@@ -383,6 +383,7 @@ export const impersonationNoticeLogic = kea<impersonationNoticeLogicType>([
// app and the overlay along with it. On success we hand the fetched
// user to loadUserSuccess ourselves so userLogic stays in sync.
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use usersRetrieve() from '~/generated/core/api' instead.
const freshUser = await api.get<UserType>('api/users/@me/')
if (freshUser?.is_impersonated) {
actions.loadUserSuccess(freshUser)
diff --git a/frontend/src/layout/navigation/projectNoticeLogic.tsx b/frontend/src/layout/navigation/projectNoticeLogic.tsx
index 7aa45561a885..eeed803a1df4 100644
--- a/frontend/src/layout/navigation/projectNoticeLogic.tsx
+++ b/frontend/src/layout/navigation/projectNoticeLogic.tsx
@@ -369,6 +369,7 @@ export const projectNoticeLogic = kea<projectNoticeLogicType>([
__default: null as null | ProxyRecord[],
loadRecords: async () => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use proxyRecordsList() from 'products/platform_features/frontend/generated/api' instead.
const response = await api.get(`api/organizations/${values.currentOrganizationId}/proxy_records`)
return response.results
} catch (error) {
diff --git a/frontend/src/lib/approvals/approvalsGateLogic.ts b/frontend/src/lib/approvals/approvalsGateLogic.ts
index 1bb1a9474e7e..e6e0cba41324 100644
--- a/frontend/src/lib/approvals/approvalsGateLogic.ts
+++ b/frontend/src/lib/approvals/approvalsGateLogic.ts
@@ -73,6 +73,7 @@ export const approvalsGateLogic = kea<approvalsGateLogicType>([
}
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use approvalPoliciesList() from 'products/platform_features/frontend/generated/api' instead.
const response = await api.get(`api/projects/${values.currentTeamIdStrict}/approval_policies/`)
return (response.results || []).filter((p: ApprovalPolicy) => p.enabled)
} catch {
diff --git a/frontend/src/lib/components/BulkActions/BulkUpdateTagsForm.tsx b/frontend/src/lib/components/BulkActions/BulkUpdateTagsForm.tsx
index efe1ad847f66..f07472dc7f7e 100644
--- a/frontend/src/lib/components/BulkActions/BulkUpdateTagsForm.tsx
+++ b/frontend/src/lib/components/BulkActions/BulkUpdateTagsForm.tsx
@@ -60,6 +60,7 @@ export function BulkUpdateTagsForm({
const submit = async (): Promise<void> => {
setLoading(true)
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const response = (await api.create(`api/projects/${currentProjectId}/${resource}/bulk_update_tags/`, {
ids: Array.from(selectedIds),
action: tagAction,
diff --git a/frontend/src/lib/components/DefinitionPopover/definitionPopoverLogic.ts b/frontend/src/lib/components/DefinitionPopover/definitionPopoverLogic.ts
index 77a92b99a34a..77c294d0d1b6 100644
--- a/frontend/src/lib/components/DefinitionPopover/definitionPopoverLogic.ts
+++ b/frontend/src/lib/components/DefinitionPopover/definitionPopoverLogic.ts
@@ -222,6 +222,7 @@ export const definitionPopoverLogic = kea<definitionPopoverLogicType>([
if (values.isAction) {
// Action Definitions
const _action = definition as ActionType
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use actionsPartialUpdate() from 'products/actions/frontend/generated/api' instead.
definition = await api.update(
`api/projects/${values.currentProjectId}/actions/${_action.id}`,
_action
@@ -230,6 +231,7 @@ export const definitionPopoverLogic = kea<definitionPopoverLogicType>([
} else if (values.isEvent) {
// Event Definitions
const _event = definition as EventDefinition
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use eventDefinitionsPartialUpdate() from 'products/event_definitions/frontend/generated/api' instead.
definition = await api.update(
`api/projects/${values.currentProjectId}/event_definitions/${_event.id}`,
{
@@ -244,6 +246,7 @@ export const definitionPopoverLogic = kea<definitionPopoverLogicType>([
) {
// Event Property Definitions
const _eventProperty = definition as PropertyDefinition
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use propertyDefinitionsPartialUpdate() from '~/generated/core/api' instead.
definition = await api.update(
`api/projects/${values.currentProjectId}/property_definitions/${_eventProperty.id}`,
_eventProperty
@@ -254,6 +257,7 @@ export const definitionPopoverLogic = kea<definitionPopoverLogicType>([
} else if (values.type === TaxonomicFilterGroupType.Cohorts) {
// Cohort
const _cohort = definition as CohortType
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use cohortsPartialUpdate() from 'products/cohorts/frontend/generated/api' instead.
definition = await api.update(
`api/projects/${values.currentProjectId}/cohorts/${_cohort.id}`,
_cohort
diff --git a/frontend/src/lib/components/ExportButton/exporter.tsx b/frontend/src/lib/components/ExportButton/exporter.tsx
index fe8e6894f57c..5badfde57178 100644
--- a/frontend/src/lib/components/ExportButton/exporter.tsx
+++ b/frontend/src/lib/components/ExportButton/exporter.tsx
@@ -20,6 +20,7 @@ export function downloadBlob(content: Blob, filename: string): void {
export async function exportedAssetBlob(asset: ExportedAssetType): Promise<Blob> {
const contentUrl = api.exports.determineExportFetchUrl(asset.id)
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
const response = await api.getResponse(contentUrl)
return await response.blob()
}
diff --git a/frontend/src/lib/components/ExportButton/exportsLogic.ts b/frontend/src/lib/components/ExportButton/exportsLogic.ts
index ea10da93bb50..2983055db973 100644
--- a/frontend/src/lib/components/ExportButton/exportsLogic.ts
+++ b/frontend/src/lib/components/ExportButton/exportsLogic.ts
@@ -371,6 +371,7 @@ export const exportsLogic = kea<exportsLogicType>([
const toastId = 'toast-' + Math.random()
try {
lemonToast.info('Saving cohort...', { toastId, autoClose: false })
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use cohortsCreate() from 'products/cohorts/frontend/generated/api' instead.
const cohort: CohortType = await api.create('api/cohort', {
is_static: true,
name: name || 'Query cohort',
diff --git a/frontend/src/lib/components/HedgehogMode/hedgehogModeLogic.ts b/frontend/src/lib/components/HedgehogMode/hedgehogModeLogic.ts
index 6a6d02a99903..af0ddbdb3d3b 100644
--- a/frontend/src/lib/components/HedgehogMode/hedgehogModeLogic.ts
+++ b/frontend/src/lib/components/HedgehogMode/hedgehogModeLogic.ts
@@ -178,6 +178,7 @@ export const hedgehogModeLogic = kea<hedgehogModeLogicType>([
return null
}
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
return await api.get<Partial<HedgehogConfig>>(endpoint)
},
@@ -198,6 +199,7 @@ export const hedgehogModeLogic = kea<hedgehogModeLogicType>([
}
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
const newConfig: Partial<HedgehogConfig> = await api.update(endpoint, payload)
return newConfig ?? null
} catch (e) {
diff --git a/frontend/src/lib/components/HelpMenu/healthSummaryLogic.tsx b/frontend/src/lib/components/HelpMenu/healthSummaryLogic.tsx
index 7f5be48b9511..e6e4c2f7f75f 100644
--- a/frontend/src/lib/components/HelpMenu/healthSummaryLogic.tsx
+++ b/frontend/src/lib/components/HelpMenu/healthSummaryLogic.tsx
@@ -63,6 +63,7 @@ export const healthSummaryLogic = kea<healthSummaryLogicType>([
{
loadHealthSummary: async (): Promise<HealthIssueSummary | null> => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
return await api.get(`api/projects/${values.currentTeamIdStrict}/health_issues/summary/`)
} catch {
return null
diff --git a/frontend/src/lib/components/Metalytics/metalyticsLogic.ts b/frontend/src/lib/components/Metalytics/metalyticsLogic.ts
index 49a1b7a87328..dd05b3f881f1 100644
--- a/frontend/src/lib/components/Metalytics/metalyticsLogic.ts
+++ b/frontend/src/lib/components/Metalytics/metalyticsLogic.ts
@@ -222,6 +222,7 @@ export const metalyticsLogic = kea<metalyticsLogicType>([
},
instanceId: async (instanceId) => {
if (instanceId) {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
void api.create(`/api/projects/${values.currentProjectId}/metalytics/`, {
metric_name: 'viewed',
instance_id: instanceId,
diff --git a/frontend/src/lib/components/PropertiesTimeline/propertiesTimelineLogic.ts b/frontend/src/lib/components/PropertiesTimeline/propertiesTimelineLogic.ts
index 79f7c789b757..57c21d27d5eb 100644
--- a/frontend/src/lib/components/PropertiesTimeline/propertiesTimelineLogic.ts
+++ b/frontend/src/lib/components/PropertiesTimeline/propertiesTimelineLogic.ts
@@ -114,6 +114,7 @@ export const propertiesTimelineLogic = kea<propertiesTimelineLogicType>([
{
loadResult: async () => {
if (props.actor.type === 'person') {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. personsPropertiesTimelineRetrieve() from 'products/persons/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
const response = await api.get<RawPropertiesTimelineResult>(
`api/projects/${values.currentTeamId}/persons/${
props.actor.id
diff --git a/frontend/src/lib/components/PropertyFilters/components/groupKeySelectLogic.ts b/frontend/src/lib/components/PropertyFilters/components/groupKeySelectLogic.ts
index cc16c61e5f35..c75deb6b53de 100644
--- a/frontend/src/lib/components/PropertyFilters/components/groupKeySelectLogic.ts
+++ b/frontend/src/lib/components/PropertyFilters/components/groupKeySelectLogic.ts
@@ -29,6 +29,7 @@ export async function findGroups(
const results = await Promise.all(
groupKeys.map(async (groupKey) => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use groupsFindRetrieve() from 'products/groups/frontend/generated/api' instead.
const response: Group = await api.get(
`api/projects/${teamId}/groups/find/?${new URLSearchParams({
group_type_index: String(groupTypeIndex),
@@ -158,6 +159,7 @@ export const groupKeySelectLogic = kea<groupKeySelectLogicType>([
if (search) {
params.search = search
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use groupsList() from 'products/groups/frontend/generated/api' instead.
const response = await api.get(
`api/projects/${values.currentTeamId}/groups/?${new URLSearchParams(
Object.entries(params).map(([k, v]) => [k, String(v)])
diff --git a/frontend/src/lib/components/SaveToCohortModalContent/saveToCohortModalContentLogic.ts b/frontend/src/lib/components/SaveToCohortModalContent/saveToCohortModalContentLogic.ts
index a0f86aef90ed..b61e714aadcb 100644
--- a/frontend/src/lib/components/SaveToCohortModalContent/saveToCohortModalContentLogic.ts
+++ b/frontend/src/lib/components/SaveToCohortModalContent/saveToCohortModalContentLogic.ts
@@ -167,6 +167,7 @@ export const saveToCohortModalContentLogic = kea<saveToCohortModalContentLogicTy
const toastId = `save-cohort-${cohort.id}-${Date.now()}`
try {
lemonToast.info('Saving cohort...', { toastId, autoClose: false })
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use cohortsPartialUpdate() from 'products/cohorts/frontend/generated/api' instead.
await api.update(`api/projects/${values.currentProjectId}/cohorts/${cohort.id}`, {
query: query,
})
diff --git a/frontend/src/lib/components/Shortcuts/utils/DebugCHQueriesImpl.tsx b/frontend/src/lib/components/Shortcuts/utils/DebugCHQueriesImpl.tsx
index acf98bd7ad93..843a152f6501 100644
--- a/frontend/src/lib/components/Shortcuts/utils/DebugCHQueriesImpl.tsx
+++ b/frontend/src/lib/components/Shortcuts/utils/DebugCHQueriesImpl.tsx
@@ -132,6 +132,7 @@ const debugCHQueriesLogic = kea<debugCHQueriesLogicType>([
} else if (props.experimentId) {
params.append('experiment_id', String(props.experimentId))
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
return await api.get(`api/debug_ch_queries/?${params.toString()}`)
},
},
diff --git a/frontend/src/lib/components/TagSelect.tsx b/frontend/src/lib/components/TagSelect.tsx
index 1e08ebbdfd8b..2c9ac66ff8cd 100644
--- a/frontend/src/lib/components/TagSelect.tsx
+++ b/frontend/src/lib/components/TagSelect.tsx
@@ -42,6 +42,7 @@ function useTagSource(options: TagOption[] | undefined, customLoadTags: LoadTags
return { results: [], hasMore: false }
}
const params = new URLSearchParams({ search: query, limit: String(TAGS_PER_PAGE), offset: String(offset) })
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const page: PaginatedResponse<string> = await api.get(`api/projects/${currentTeamId}/tags?${params}`)
return {
results: page.results.map((tag) => ({ tag })),
diff --git a/frontend/src/lib/components/TaxonomicFilter/hooks/fetchTaxonomicListPage.ts b/frontend/src/lib/components/TaxonomicFilter/hooks/fetchTaxonomicListPage.ts
index 999f91da7fe5..f7f63e8e87f3 100644
--- a/frontend/src/lib/components/TaxonomicFilter/hooks/fetchTaxonomicListPage.ts
+++ b/frontend/src/lib/components/TaxonomicFilter/hooks/fetchTaxonomicListPage.ts
@@ -76,6 +76,7 @@ export async function fetchTaxonomicListPage({
const useScoped = group.scopedEndpoint && !isExpanded
const primaryUrl = useScoped ? group.scopedEndpoint! : remoteEndpoint
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
const primary = await api.get(combineUrl(primaryUrl, baseParams).url, { signal })
const results = primary?.results ?? primary ?? []
diff --git a/frontend/src/lib/components/TaxonomicFilter/infiniteListLogic.ts b/frontend/src/lib/components/TaxonomicFilter/infiniteListLogic.ts
index b6c443e4ce45..bd15fc60888f 100644
--- a/frontend/src/lib/components/TaxonomicFilter/infiniteListLogic.ts
+++ b/frontend/src/lib/components/TaxonomicFilter/infiniteListLogic.ts
@@ -242,6 +242,7 @@ async function fetchCachedListResponse(
if (apiCache[url]) {
return apiCache[url]
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
const response = await api.get(url, options)
// Never cache an empty response. A transient empty result (a backend blip, a race) would
// otherwise be pinned for the full timeout, so an event that actually exists keeps reading as
diff --git a/frontend/src/lib/components/TimeSensitiveAuthentication/timeSensitiveAuthenticationLogic.ts b/frontend/src/lib/components/TimeSensitiveAuthentication/timeSensitiveAuthenticationLogic.ts
index bd553f3131cc..2ac57c9b91f3 100644
--- a/frontend/src/lib/components/TimeSensitiveAuthentication/timeSensitiveAuthenticationLogic.ts
+++ b/frontend/src/lib/components/TimeSensitiveAuthentication/timeSensitiveAuthenticationLogic.ts
@@ -277,6 +277,7 @@ export const timeSensitiveAuthenticationLogic = kea<timeSensitiveAuthenticationL
null as PrecheckResponseType | null,
{
precheck: async () => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const response = await api.create('api/login/precheck', { email: values.user!.email })
return { status: 'completed', ...response }
},
@@ -290,6 +291,7 @@ export const timeSensitiveAuthenticationLogic = kea<timeSensitiveAuthenticationL
// Step 1: Get authentication options from server
const beginResponse =
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.create<PublicKeyCredentialRequestOptionsJSON>('api/login/2fa/passkey/begin/')
// Step 2: Use SimpleWebAuthn to get assertion from authenticator
@@ -304,6 +306,7 @@ export const timeSensitiveAuthenticationLogic = kea<timeSensitiveAuthenticationL
})
// Step 3: Send assertion to server to complete 2FA
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.create('api/login/token', {
credential_id: assertion.id,
response: assertion.response,
@@ -319,6 +322,7 @@ export const timeSensitiveAuthenticationLogic = kea<timeSensitiveAuthenticationL
checkPasskeysAvailable: async () => {
try {
// Get available 2FA methods
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const methods = await api.get<TwoFAMethodsResponse>('api/login/2fa/passkey/methods/')
// Store TOTP availability for UI
actions.setTotpAvailable(methods.has_totp)
@@ -346,8 +350,10 @@ export const timeSensitiveAuthenticationLogic = kea<timeSensitiveAuthenticationL
try {
if (!token) {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.create('api/login', { email, password })
} else {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.create('api/login/token', { token })
}
} catch (e: unknown) {
diff --git a/frontend/src/lib/components/ViewRecordingButton/sessionRecordingViewedLogic.ts b/frontend/src/lib/components/ViewRecordingButton/sessionRecordingViewedLogic.ts
index ae69c45d4803..fc5cc71ffe10 100644
--- a/frontend/src/lib/components/ViewRecordingButton/sessionRecordingViewedLogic.ts
+++ b/frontend/src/lib/components/ViewRecordingButton/sessionRecordingViewedLogic.ts
@@ -86,6 +86,7 @@ export const sessionRecordingViewedLogic = kea<sessionRecordingViewedLogicType>(
return { viewed: false, otherViewers: 0 }
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const response = await api.get(
`/api/projects/${values.currentTeamId}/session_recordings/${props.sessionRecordingId}/viewed`
)
diff --git a/frontend/src/lib/integrations/IntegrationView.tsx b/frontend/src/lib/integrations/IntegrationView.tsx
index 01eea5b7c099..8c741d73a1b3 100644
--- a/frontend/src/lib/integrations/IntegrationView.tsx
+++ b/frontend/src/lib/integrations/IntegrationView.tsx
@@ -131,6 +131,7 @@ export function IntegrationView({
onBeforeManage={
currentTeam?.id
? async () => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. integrationsGithubPrepareCallbackCreate() from 'products/integrations/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
await api.create(
`api/projects/${currentTeam.id}/integrations/github/prepare_callback/`,
{
diff --git a/frontend/src/lib/logic/apiStatusLogic.ts b/frontend/src/lib/logic/apiStatusLogic.ts
index 50e19195664f..52e989bd2a3f 100644
--- a/frontend/src/lib/logic/apiStatusLogic.ts
+++ b/frontend/src/lib/logic/apiStatusLogic.ts
@@ -228,6 +228,7 @@ export const apiStatusLogic = kea<apiStatusLogicType>([
if (now - 10000 > (cache.lastUnauthorizedCheck ?? 0)) {
cache.lastUnauthorizedCheck = Date.now()
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use usersRetrieve() from '~/generated/core/api' instead.
await api.get('api/users/@me/').catch((error: any) => {
if (error.status === 401) {
userLogic.findMounted()?.actions.logout(true)
diff --git a/frontend/src/lib/logic/eventIngestionRestrictionLogic.ts b/frontend/src/lib/logic/eventIngestionRestrictionLogic.ts
index 68279541b672..177264ca28e4 100644
--- a/frontend/src/lib/logic/eventIngestionRestrictionLogic.ts
+++ b/frontend/src/lib/logic/eventIngestionRestrictionLogic.ts
@@ -67,6 +67,7 @@ export const eventIngestionRestrictionLogic = kea<eventIngestionRestrictionLogic
__default: [] as EventIngestionRestriction[],
loadEventIngestionRestrictions: async () => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use organizationsProjectsEventIngestionRestrictionsList() from '~/generated/core/api' instead.
const response = await api.get(
`api/projects/${values.currentTeamIdStrict}/event_ingestion_restrictions/`
)
diff --git a/frontend/src/lib/logic/preflightLogic.tsx b/frontend/src/lib/logic/preflightLogic.tsx
index 3c9730c2ecff..e501703abf4b 100644
--- a/frontend/src/lib/logic/preflightLogic.tsx
+++ b/frontend/src/lib/logic/preflightLogic.tsx
@@ -125,6 +125,7 @@ export const preflightLogic = kea<preflightLogicType>([
null as PreflightStatus | null,
{
loadPreflight: async () => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call to a route outside /api/, with an unchecked response type. No generated function can cover it until the route is in the OpenAPI schema.
const response = await api.get<PreflightStatus>('_preflight/')
return response
},
diff --git a/frontend/src/lib/utils/deleteWithUndo.tsx b/frontend/src/lib/utils/deleteWithUndo.tsx
index 966842e52b21..1c2c60eca91b 100644
--- a/frontend/src/lib/utils/deleteWithUndo.tsx
+++ b/frontend/src/lib/utils/deleteWithUndo.tsx
@@ -16,6 +16,7 @@ export async function deleteWithUndo<T extends Record<string, any>>({
callback?: (undo: boolean, object: T) => void
}): Promise<void> {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.update(`api/${props.endpoint}/${props.object[props.idField || 'id']}`, {
...props.object,
deleted: !undo,
@@ -56,6 +57,7 @@ export async function deleteInsightWithUndo({
callback?: (undo: boolean, object: InsightModel) => void
}): Promise<void> {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.update(`api/${props.endpoint}/${props.object[props.idField || 'id']}`, {
...props.object,
deleted: !undo,
diff --git a/frontend/src/models/annotationsModel.ts b/frontend/src/models/annotationsModel.ts
index 822b45334221..41525b7eb231 100644
--- a/frontend/src/models/annotationsModel.ts
+++ b/frontend/src/models/annotationsModel.ts
@@ -241,6 +241,7 @@ export const annotationsModel = kea<annotationsModelType>([
loadAnnotationsNext: async () => {
let results: RawAnnotationType[] = []
if (values.next) {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
const response = await api.get(values.next)
actions.setNext(response.next)
results = response.results
diff --git a/frontend/src/models/dashboardsModel.tsx b/frontend/src/models/dashboardsModel.tsx
index c0690300e6fb..43e0f3dd5c68 100644
--- a/frontend/src/models/dashboardsModel.tsx
+++ b/frontend/src/models/dashboardsModel.tsx
@@ -429,6 +429,7 @@ export const dashboardsModel = kea<dashboardsModelType>([
url ||
`api/projects/${teamLogic.values.currentTeamId}/dashboards/?limit=2000&exclude_generated=true`
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
const dashboards: PaginatedResponse<DashboardType> = await api.get(apiUrl)
return {
@@ -450,6 +451,7 @@ export const dashboardsModel = kea<dashboardsModelType>([
const beforeChange = { ...values.rawDashboards[id] }
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use dashboardsPartialUpdate() from 'products/dashboards/frontend/generated/api' instead.
const response = await api.update<DashboardType>(
`api/projects/${teamLogic.values.currentTeamId}/dashboards/${id}`,
payload
@@ -472,6 +474,7 @@ export const dashboardsModel = kea<dashboardsModelType>([
button: {
label: 'Undo',
action: async () => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use dashboardsPartialUpdate() from 'products/dashboards/frontend/generated/api' instead.
const reverted = await api.update<DashboardType>(
`api/projects/${teamLogic.values.currentTeamId}/dashboards/${id}`,
beforeChange
@@ -496,6 +499,7 @@ export const dashboardsModel = kea<dashboardsModelType>([
},
deleteDashboard: async ({ id, deleteInsights }) => {
const deleted = getQueryBasedDashboard(
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use dashboardsPartialUpdate() from 'products/dashboards/frontend/generated/api' instead.
await api.update(`api/projects/${teamLogic.values.currentTeamId}/dashboards/${id}`, {
deleted: true,
delete_insights: deleteInsights,
@@ -506,6 +510,7 @@ export const dashboardsModel = kea<dashboardsModelType>([
},
restoreDashboard: async ({ id }) => {
const restored = getQueryBasedDashboard(
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use dashboardsPartialUpdate() from 'products/dashboards/frontend/generated/api' instead.
await api.update(`api/projects/${teamLogic.values.currentTeamId}/dashboards/${id}`, {
deleted: false,
})
@@ -514,6 +519,7 @@ export const dashboardsModel = kea<dashboardsModelType>([
return restored
},
pinDashboard: async ({ id, source }) => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use dashboardsPartialUpdate() from 'products/dashboards/frontend/generated/api' instead.
const response = await api.update(`api/projects/${teamLogic.values.currentTeamId}/dashboards/${id}`, {
pinned: true,
})
@@ -521,6 +527,7 @@ export const dashboardsModel = kea<dashboardsModelType>([
return getQueryBasedDashboard(response)!
},
unpinDashboard: async ({ id, source }) => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use dashboardsPartialUpdate() from 'products/dashboards/frontend/generated/api' instead.
const response = await api.update<DashboardType>(
`api/projects/${teamLogic.values.currentTeamId}/dashboards/${id}`,
{
@@ -531,6 +538,7 @@ export const dashboardsModel = kea<dashboardsModelType>([
return getQueryBasedDashboard(response)!
},
duplicateDashboard: async ({ id, name, show, duplicateTiles }) => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use dashboardsCreate() from 'products/dashboards/frontend/generated/api' instead.
const result = await api.create<DashboardType>(
`api/projects/${teamLogic.values.currentTeamId}/dashboards/`,
{
diff --git a/frontend/src/models/groupsModel.ts b/frontend/src/models/groupsModel.ts
index 6b988446b381..a3227be30719 100644
--- a/frontend/src/models/groupsModel.ts
+++ b/frontend/src/models/groupsModel.ts
@@ -166,10 +166,12 @@ export const groupsModel = kea<groupsModelType>([
if (!values.currentProjectId) {
return []
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
return await api.get(`api/projects/${values.currentProjectId}/groups_types`)
},
updateGroupTypesMetadata: async (payload: Array<GroupType>) => {
if (values.groupsEnabled) {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
return await api.update(
`/api/projects/${values.currentProjectId}/groups_types/update_metadata`,
payload
@@ -179,11 +181,13 @@ export const groupsModel = kea<groupsModelType>([
},
deleteGroupType: async (groupTypeIndex: number) => {
if (values.groupsEnabled) {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.delete(`/api/projects/${values.currentProjectId}/groups_types/${groupTypeIndex}`)
}
return []
},
createDetailDashboard: async (groupTypeIndex: number) => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const groupType = await api.put(
`/api/projects/${values.currentProjectId}/groups_types/create_detail_dashboard`,
{ group_type_index: groupTypeIndex }
@@ -208,6 +212,7 @@ export const groupsModel = kea<groupsModelType>([
groupTypeIndex: number
defaultColumns: string[]
}) => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const groupType = await api.put(
`/api/projects/${values.currentProjectId}/groups_types/set_default_columns`,
{ group_type_index: groupTypeIndex, default_columns: defaultColumns }
diff --git a/frontend/src/models/propertyDefinitionsModel.ts b/frontend/src/models/propertyDefinitionsModel.ts
index 6dc93ce9515f..bc8b960cffdc 100644
--- a/frontend/src/models/propertyDefinitionsModel.ts
+++ b/frontend/src/models/propertyDefinitionsModel.ts
@@ -597,6 +597,7 @@ export const propertyDefinitionsModel = kea<propertyDefinitionsModelType>([
actions.setOptionsSearchInput(propertyKey, newInput || '')
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
const responseData: { results: PropValue[]; refreshing: boolean } = await api.get(
constructValuesEndpoint(
endpoint,
diff --git a/frontend/src/queries/nodes/DataNode/dataNodeLogic.ts b/frontend/src/queries/nodes/DataNode/dataNodeLogic.ts
index a0741887f214..2f92b2fbe306 100644
--- a/frontend/src/queries/nodes/DataNode/dataNodeLogic.ts
+++ b/frontend/src/queries/nodes/DataNode/dataNodeLogic.ts
@@ -2100,6 +2100,7 @@ export const dataNodeLogic = kea<dataNodeLogicType>([
abortQuery: async ({ queryId }) => {
try {
const { currentTeamId } = values
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.delete(`api/projects/${currentTeamId}/query/${queryId}/`)
} catch (e) {
console.warn('Failed cancelling query', e)
diff --git a/frontend/src/queries/nodes/HogQLQuery/hogQLQueryEditorLogic.tsx b/frontend/src/queries/nodes/HogQLQuery/hogQLQueryEditorLogic.tsx
index ac827024515a..2a7c70266612 100644
--- a/frontend/src/queries/nodes/HogQLQuery/hogQLQueryEditorLogic.tsx
+++ b/frontend/src/queries/nodes/HogQLQuery/hogQLQueryEditorLogic.tsx
@@ -213,6 +213,7 @@ export const hogQLQueryEditorLogic = kea<hogQLQueryEditorLogicType>([
)
}
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
const result = await api.get(
combineUrl(`api/projects/${values.currentProjectId}/query/draft_sql/`, {
prompt: values.prompt,
@@ -234,6 +235,7 @@ export const hogQLQueryEditorLogic = kea<hogQLQueryEditorLogicType>([
)
}
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
const result = await api.get(
combineUrl(`api/projects/@current/query/draft_sql/`, {
prompt,
diff --git a/frontend/src/queries/query.ts b/frontend/src/queries/query.ts
index cd9b517ad7ac..412fd0821e7b 100644
--- a/frontend/src/queries/query.ts
+++ b/frontend/src/queries/query.ts
@@ -284,6 +284,7 @@ export async function performQuery<N extends DataNode>(
try {
if (isPersonsNode(queryNode)) {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
response = await api.get(getPersonsEndpoint(queryNode), methodOptions)
} else {
response = await executeQuery(
diff --git a/frontend/src/scenes/Unsubscribe/unsubscribeLogic.ts b/frontend/src/scenes/Unsubscribe/unsubscribeLogic.ts
index 7a4ed41d2420..18e94f4c2000 100644
--- a/frontend/src/scenes/Unsubscribe/unsubscribeLogic.ts
+++ b/frontend/src/scenes/Unsubscribe/unsubscribeLogic.ts
@@ -47,6 +47,7 @@ export const unsubscribeLogic = kea<unsubscribeLogicType>([
unsubscription: {
__default: false as boolean,
attemptUnsubscribe: async ({ token }) => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const res = await api.get(`api/unsubscribe?token=${token}`)
return res.success
},
diff --git a/frontend/src/scenes/activity/live/liveEventsLogic.tsx b/frontend/src/scenes/activity/live/liveEventsLogic.tsx
index 5114568951df..ceba791a291f 100644
--- a/frontend/src/scenes/activity/live/liveEventsLogic.tsx
+++ b/frontend/src/scenes/activity/live/liveEventsLogic.tsx
@@ -256,6 +256,7 @@ export const liveEventsLogic = kea<liveEventsLogicType>([
cache.disposables.add(() => {
cache.batch = []
const controller = new AbortController()
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
void api.stream(url.toString(), {
headers: {
Authorization: `Bearer ${values.currentTeam?.live_events_token}`,
diff --git a/frontend/src/scenes/agentic/agenticAuthorizeLogic.ts b/frontend/src/scenes/agentic/agenticAuthorizeLogic.ts
index 5c1aec497fca..5b82ef0688e9 100644
--- a/frontend/src/scenes/agentic/agenticAuthorizeLogic.ts
+++ b/frontend/src/scenes/agentic/agenticAuthorizeLogic.ts
@@ -257,6 +257,7 @@ export const agenticAuthorizeLogic = kea<agenticAuthorizeLogicType>([
null as TeamBasicType[] | null,
{
loadAllTeams: async () => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
return await api.loadPaginatedResults('api/projects')
},
},
@@ -265,6 +266,7 @@ export const agenticAuthorizeLogic = kea<agenticAuthorizeLogicType>([
null as { partner_name: string; scopes: string[] } | null,
{
loadPendingAuth: async () => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
return await api.get(`api/agentic/authorize/pending/?state=${encodeURIComponent(values.state)}`)
},
},
@@ -295,6 +297,7 @@ export const agenticAuthorizeLogic = kea<agenticAuthorizeLogicType>([
let response
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
response = await api.create(
'api/agentic/authorize/confirm/',
{ state: values.state, team_id: formValues.scoped_teams[0] },
diff --git a/frontend/src/scenes/appContextLogic.ts b/frontend/src/scenes/appContextLogic.ts
index 82ad8c5882d1..6ce915c906b0 100644
--- a/frontend/src/scenes/appContextLogic.ts
+++ b/frontend/src/scenes/appContextLogic.ts
@@ -59,6 +59,7 @@ export const appContextLogic = kea<appContextLogicType>([
const preloadedUser = appContext?.current_user
if (appContext && preloadedUser) {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use usersRetrieve() from '~/generated/core/api' instead.
void api.get('api/users/@me/').then((remoteUser: UserType) => {
if (remoteUser.uuid !== preloadedUser.uuid) {
console.error(`Preloaded user ${preloadedUser.uuid} does not match remote user ${remoteUser.uuid}`)
diff --git a/frontend/src/scenes/approvals/approvalLogic.tsx b/frontend/src/scenes/approvals/approvalLogic.tsx
index 80e49afb296f..29f06d818130 100644
--- a/frontend/src/scenes/approvals/approvalLogic.tsx
+++ b/frontend/src/scenes/approvals/approvalLogic.tsx
@@ -116,6 +116,7 @@ export const approvalLogic = kea<approvalLogicType>([
return null
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use changeRequestsRetrieve() from 'products/platform_features/frontend/generated/api' instead.
const response = await api.get<ChangeRequest>(
`api/projects/${values.currentTeamId}/change_requests/${props.id}/`
)
@@ -175,6 +176,7 @@ export const approvalLogic = kea<approvalLogicType>([
return {
approveChangeRequest: async ({ reason }) => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use changeRequestsApproveCreate() from 'products/platform_features/frontend/generated/api' instead.
const response = await api.create(
`api/projects/${values.currentTeamId}/change_requests/${props.id}/approve/`,
{ reason: reason || '' }
@@ -196,6 +198,7 @@ export const approvalLogic = kea<approvalLogicType>([
},
rejectChangeRequest: async ({ reason }) => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use changeRequestsRejectCreate() from 'products/platform_features/frontend/generated/api' instead.
await api.create(`api/projects/${values.currentTeamId}/change_requests/${props.id}/reject/`, {
reason,
})
@@ -207,6 +210,7 @@ export const approvalLogic = kea<approvalLogicType>([
},
cancelChangeRequest: async ({ reason }) => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. changeRequestsCancelCreate() from 'products/platform_features/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
await api.create(`api/projects/${values.currentTeamId}/change_requests/${props.id}/cancel/`, {
reason,
})
diff --git a/frontend/src/scenes/approvals/approvalsLogic.tsx b/frontend/src/scenes/approvals/approvalsLogic.tsx
index 3ea9d97ccf25..e4c57c5a1bfc 100644
--- a/frontend/src/scenes/approvals/approvalsLogic.tsx
+++ b/frontend/src/scenes/approvals/approvalsLogic.tsx
@@ -147,6 +147,7 @@ export const approvalsLogic = kea<approvalsLogicType>([
...(values.filters.requester && { requester: values.filters.requester.toString() }),
}).toString()}`
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
const response = await api.get<CountedPaginatedResponse<ChangeRequest>>(actualUrl)
breakpoint()
@@ -197,6 +198,7 @@ export const approvalsLogic = kea<approvalsLogicType>([
},
approveChangeRequest: async ({ id, reason }) => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use changeRequestsApproveCreate() from 'products/platform_features/frontend/generated/api' instead.
await api.create(`api/projects/${values.currentTeamId}/change_requests/${id}/approve/`, {
reason: reason || '',
})
@@ -208,6 +210,7 @@ export const approvalsLogic = kea<approvalsLogicType>([
},
rejectChangeRequest: async ({ id, reason }) => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use changeRequestsRejectCreate() from 'products/platform_features/frontend/generated/api' instead.
await api.create(`api/projects/${values.currentTeamId}/change_requests/${id}/reject/`, {
reason,
})
diff --git a/frontend/src/scenes/approvals/changeRequestsLogic.ts b/frontend/src/scenes/approvals/changeRequestsLogic.ts
index 746c14f50c33..98d008f653d1 100644
--- a/frontend/src/scenes/approvals/changeRequestsLogic.ts
+++ b/frontend/src/scenes/approvals/changeRequestsLogic.ts
@@ -165,6 +165,7 @@ export const changeRequestsLogic = kea<changeRequestsLogicType>([
params.action_key = props.actionKey
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use changeRequestsList() from 'products/platform_features/frontend/generated/api' instead.
const response = await api.get(
`api/projects/${values.currentTeamId}/change_requests?${toParams(params)}`
)
@@ -206,6 +207,7 @@ export const changeRequestsLogic = kea<changeRequestsLogicType>([
listeners(({ actions, values }) => ({
approveRequest: async ({ id }) => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use changeRequestsApproveCreate() from 'products/platform_features/frontend/generated/api' instead.
const response = await api.create(
`api/projects/${values.currentTeamId}/change_requests/${id}/approve/`,
{}
@@ -231,6 +233,7 @@ export const changeRequestsLogic = kea<changeRequestsLogicType>([
rejectRequest: async ({ id, reason }) => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use changeRequestsRejectCreate() from 'products/platform_features/frontend/generated/api' instead.
await api.create(`api/projects/${values.currentTeamId}/change_requests/${id}/reject/`, { reason })
lemonToast.success('Change request rejected')
actions.loadChangeRequestsSuccess(values.changeRequests.filter((cr) => cr.id !== id))
@@ -241,6 +244,7 @@ export const changeRequestsLogic = kea<changeRequestsLogicType>([
cancelRequest: async ({ id, reason }) => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. changeRequestsCancelCreate() from 'products/platform_features/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
await api.create(`api/projects/${values.currentTeamId}/change_requests/${id}/cancel/`, { reason })
lemonToast.success('Change request canceled')
// Optimistically remove the canceled CR so the banner disappears immediately
diff --git a/frontend/src/scenes/approvals/pendingApprovalsLogic.ts b/frontend/src/scenes/approvals/pendingApprovalsLogic.ts
index 7dc59d34057b..3e97ce321bfd 100644
--- a/frontend/src/scenes/approvals/pendingApprovalsLogic.ts
+++ b/frontend/src/scenes/approvals/pendingApprovalsLogic.ts
@@ -71,6 +71,7 @@ export const pendingApprovalsLogic = kea<pendingApprovalsLogicType>([
return []
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use changeRequestsList() from 'products/platform_features/frontend/generated/api' instead.
const response = await api.get(
`api/projects/${values.currentTeamId}/change_requests?${toParams({ state: 'pending,approved' })}`
)
diff --git a/frontend/src/scenes/audit-logs/advancedActivityLogsLogic.tsx b/frontend/src/scenes/audit-logs/advancedActivityLogsLogic.tsx
index b4f5e7cf8ed2..9c0c6b07b19d 100644
--- a/frontend/src/scenes/audit-logs/advancedActivityLogsLogic.tsx
+++ b/frontend/src/scenes/audit-logs/advancedActivityLogsLogic.tsx
@@ -465,6 +465,7 @@ export const advancedActivityLogsLogic = kea<advancedActivityLogsLogicType>([
params.append('page_size', ADVANCED_ACTIVITY_PAGE_SIZE.toString())
const [response] = await Promise.all([
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
api.get(`${values.advancedActivityLogsBaseUrl}/?${params}`),
ensureActivityDescribersLoaded(),
])
@@ -477,6 +478,7 @@ export const advancedActivityLogsLogic = kea<advancedActivityLogsLogicType>([
null as AvailableFilters | null,
{
loadAvailableFilters: async () => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
const response = await api.get(`${values.advancedActivityLogsBaseUrl}/available_filters/`)
return response
},
@@ -489,6 +491,7 @@ export const advancedActivityLogsLogic = kea<advancedActivityLogsLogicType>([
loadExports: async () => {
const params = new URLSearchParams()
params.append('context_path', '/advanced_activity_logs/')
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use exportsList() from '~/generated/core/api' instead.
const response = await api.get(`api/projects/${values.currentTeamIdStrict}/exports/?${params}`)
return response.results || []
},
@@ -779,6 +782,7 @@ export const advancedActivityLogsLogic = kea<advancedActivityLogsLogicType>([
item_ids: values.filters.item_ids,
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use advancedActivityLogsExportCreate() from 'products/platform_features/frontend/generated/api' instead.
await api.create(`api/projects/${values.currentProjectId}/advanced_activity_logs/export/`, {
format,
filters: filtersToExport,
diff --git a/frontend/src/scenes/authentication/account/credential-review/credentialReviewLogic.ts b/frontend/src/scenes/authentication/account/credential-review/credentialReviewLogic.ts
index 5bcade0ce60d..d1b8722d0199 100644
--- a/frontend/src/scenes/authentication/account/credential-review/credentialReviewLogic.ts
+++ b/frontend/src/scenes/authentication/account/credential-review/credentialReviewLogic.ts
@@ -36,6 +36,7 @@ export const credentialReviewLogic = kea<credentialReviewLogicType>([
listeners({
markComplete: async () => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. usersCredentialsReviewCompleteCreate() from '~/generated/core/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
await api.create('api/users/@me/credentials_review_complete/')
} catch {
lemonToast.error('Could not save your review. Try again.')
diff --git a/frontend/src/scenes/authentication/cli/cliAuthorizeLogic.ts b/frontend/src/scenes/authentication/cli/cliAuthorizeLogic.ts
index fca6b95ce61f..25838f1d7e6c 100644
--- a/frontend/src/scenes/authentication/cli/cliAuthorizeLogic.ts
+++ b/frontend/src/scenes/authentication/cli/cliAuthorizeLogic.ts
@@ -284,6 +284,7 @@ export const cliAuthorizeLogic = kea<cliAuthorizeLogicType>([
[] as { id: number; name: string }[],
{
loadProjects: async (organizationId: string) => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use organizationsProjectsList() from '~/generated/core/api' instead.
const response = await api.get(`api/organizations/${organizationId}/projects/`)
return response.results || []
},
@@ -310,6 +311,7 @@ export const cliAuthorizeLogic = kea<cliAuthorizeLogicType>([
}),
submit: async ({ userCode, projectId, scopes }) => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const response = await api.create('api/cli-auth/authorize/', {
user_code: userCode.toUpperCase().replace(/\s/g, ''),
project_id: projectId,
diff --git a/frontend/src/scenes/authentication/cli/cliLiveLogic.ts b/frontend/src/scenes/authentication/cli/cliLiveLogic.ts
index 2265c4b9fdf2..d83375ed0a3c 100644
--- a/frontend/src/scenes/authentication/cli/cliLiveLogic.ts
+++ b/frontend/src/scenes/authentication/cli/cliLiveLogic.ts
@@ -95,6 +95,7 @@ export const cliLiveLogic = kea<cliLiveLogicType>([
[] as { id: number; name: string }[],
{
loadProjects: async () => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const response = await api.get('api/projects/')
return response.results || []
},
@@ -119,6 +120,7 @@ export const cliLiveLogic = kea<cliLiveLogicType>([
}
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use organizationsProjectsRetrieve() from '~/generated/core/api' instead.
const team = await api.get(`api/projects/${projectId}/`)
const token = team.live_events_token
if (!token) {
diff --git a/frontend/src/scenes/authentication/invite-signup/inviteSignupLogic.ts b/frontend/src/scenes/authentication/invite-signup/inviteSignupLogic.ts
index e1346c4abaea..74626ead0155 100644
--- a/frontend/src/scenes/authentication/invite-signup/inviteSignupLogic.ts
+++ b/frontend/src/scenes/authentication/invite-signup/inviteSignupLogic.ts
@@ -250,6 +250,7 @@ export const inviteSignupLogic = kea<inviteSignupLogicType>([
breakpoint()
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
return await api.get(`api/signup/${id}/`)
} catch (e: any) {
if (e.status === 400) {
@@ -277,6 +278,7 @@ export const inviteSignupLogic = kea<inviteSignupLogicType>([
if (!values.invite) {
return null
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
return api.create(`api/signup/${values.invite.id}/`)
},
},
@@ -318,6 +320,7 @@ export const inviteSignupLogic = kea<inviteSignupLogicType>([
submitPayload.next_url = nextUrl
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const res = await api.create(`api/signup/${values.invite.id}/`, submitPayload)
location.href = res.redirect_url || '/' // hard refresh because the current_organization changed
} catch (e) {
@@ -339,6 +342,7 @@ export const inviteSignupLogic = kea<inviteSignupLogicType>([
const targetEmail = values.invite?.target_email
if ((error.status === undefined || error.status >= 500) && targetEmail) {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.create('api/signup/precheck', { email: targetEmail })
} catch (probeError) {
const probe = probeError as Record<string, any>
@@ -397,6 +401,7 @@ export const inviteSignupLogic = kea<inviteSignupLogicType>([
actions.setPasskeyError(null)
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const beginResponse = await api.create<RegistrationBeginResponse>(
'api/webauthn/signup-register/begin/',
{ email }
@@ -421,6 +426,7 @@ export const inviteSignupLogic = kea<inviteSignupLogicType>([
},
})
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.create('api/webauthn/signup-register/complete/', attestation)
actions.setPasskeyRegistered(true)
diff --git a/frontend/src/scenes/authentication/login-2fa/login2FALogic.ts b/frontend/src/scenes/authentication/login-2fa/login2FALogic.ts
index f7a61d83fb52..ed75078a25cd 100644
--- a/frontend/src/scenes/authentication/login-2fa/login2FALogic.ts
+++ b/frontend/src/scenes/authentication/login-2fa/login2FALogic.ts
@@ -214,6 +214,7 @@ export const login2FALogic = kea<login2FALogicType>([
try {
// Step 1: Get authentication options from server
const beginResponse =
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.create<PublicKeyCredentialRequestOptionsJSON>('api/login/2fa/passkey/begin/')
// Step 2: Use SimpleWebAuthn to get assertion from authenticator
@@ -228,6 +229,7 @@ export const login2FALogic = kea<login2FALogicType>([
})
// Step 3: Send assertion to server to complete 2FA
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.create<LoginTokenResponse>('api/login/token', {
credential_id: assertion.id,
response: assertion.response,
@@ -253,6 +255,7 @@ export const login2FALogic = kea<login2FALogicType>([
checkPasskeysAvailable: async () => {
try {
// Get available 2FA methods
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const methods = await api.get<TwoFAMethodsResponse>('api/login/2fa/passkey/methods/')
// Store TOTP availability for UI
actions.setTotpAvailable(methods.has_totp)
@@ -275,6 +278,7 @@ export const login2FALogic = kea<login2FALogicType>([
submit: async ({ token }, breakpoint) => {
breakpoint()
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.create<LoginTokenResponse>('api/login/token', { token })
} catch (e: unknown) {
if (e instanceof ApiError) {
diff --git a/frontend/src/scenes/authentication/login/loginLogic.ts b/frontend/src/scenes/authentication/login/loginLogic.ts
index f70d5fd992da..556ce3c883dc 100644
--- a/frontend/src/scenes/authentication/login/loginLogic.ts
+++ b/frontend/src/scenes/authentication/login/loginLogic.ts
@@ -484,6 +484,7 @@ export const loginLogic = kea<loginLogicType>([
breakpoint()
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const response = await api.create<any>('api/login/precheck', { email })
return { status: 'completed', ...response, email }
} catch {
@@ -499,6 +500,7 @@ export const loginLogic = kea<loginLogicType>([
resendCodeBasedVerification: async (_, breakpoint) => {
breakpoint()
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const response = await api.create<any>('api/login/code-based-verification/resend')
lemonToast.success('Verification email resent')
return response
@@ -594,6 +596,7 @@ export const loginLogic = kea<loginLogicType>([
// Clear any previous passkey errors when submitting with password
actions.clearGeneralError()
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
return await api.create<any>('api/login', { email, password })
} catch (e) {
const { code, detail } = e as Record<string, any>
@@ -645,6 +648,7 @@ export const loginLogic = kea<loginLogicType>([
breakpoint()
actions.clearGeneralError()
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
return await api.create<any>('api/login/code-based-verification', {
code: normalizeVerificationCode(code),
email: values.login.email,
diff --git a/frontend/src/scenes/authentication/password-reset/passwordResetLogic.ts b/frontend/src/scenes/authentication/password-reset/passwordResetLogic.ts
index 0161fc450f7c..ea67f87a7ed5 100644
--- a/frontend/src/scenes/authentication/password-reset/passwordResetLogic.ts
+++ b/frontend/src/scenes/authentication/password-reset/passwordResetLogic.ts
@@ -233,6 +233,7 @@ export const passwordResetLogic = kea<passwordResetLogicType>([
{
validateResetToken: async ({ uuid, token }: { uuid: string; token: string }) => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.get(`api/reset/${uuid}/?token=${token}`)
return { success: true, token, uuid }
} catch (e: any) {
@@ -267,6 +268,7 @@ export const passwordResetLogic = kea<passwordResetLogicType>([
breakpoint()
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.create('api/reset/', { email })
} catch (e: any) {
actions.setRequestPasswordResetManualErrors({ email: e.detail ?? 'An error occurred' })
@@ -295,6 +297,7 @@ export const passwordResetLogic = kea<passwordResetLogicType>([
return
}
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const response = await api.create(`api/reset/${values.validatedResetToken.uuid}/`, {
password,
token: values.validatedResetToken.token,
diff --git a/frontend/src/scenes/authentication/shared/devLoginLogic.ts b/frontend/src/scenes/authentication/shared/devLoginLogic.ts
index 4925bd3fc00a..096142b22ce1 100644
--- a/frontend/src/scenes/authentication/shared/devLoginLogic.ts
+++ b/frontend/src/scenes/authentication/shared/devLoginLogic.ts
@@ -116,6 +116,7 @@ export const devLoginLogic = kea<devLoginLogicType>([
loadDevUsers: async (_, breakpoint) => {
breakpoint()
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const response = await api.get<{ users: DevUser[] }>('api/login/dev')
breakpoint()
return response.users
@@ -153,6 +154,7 @@ export const devLoginLogic = kea<devLoginLogicType>([
const { loginLogic, redirectAfterLogin } = await import('scenes/authentication/login/loginLogic')
loginLogic.actions.clearGeneralError()
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.create<any>('api/login/dev', { email })
} catch (e) {
const { code, detail } = e as Record<string, any>
@@ -163,6 +165,7 @@ export const devLoginLogic = kea<devLoginLogicType>([
},
createFreshAccount: async () => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.create<any>('api/login/dev', { create_fresh_account: true })
} catch (e) {
actions.createFreshAccountFailure((e as Record<string, any>).detail || 'Failed to create account')
diff --git a/frontend/src/scenes/authentication/shared/passkeyLogic.ts b/frontend/src/scenes/authentication/shared/passkeyLogic.ts
index 5ababbddc9b7..8033c4531e37 100644
--- a/frontend/src/scenes/authentication/shared/passkeyLogic.ts
+++ b/frontend/src/scenes/authentication/shared/passkeyLogic.ts
@@ -171,6 +171,7 @@ export const passkeyLogic = kea<passkeyLogicType>([
startPasskeyAuthentication: async () => {
try {
// Step 1: Get authentication options from server
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const beginResponse = await api.create<PasskeyLoginBeginResponse>('api/webauthn/login/begin/')
// Step 2: Use SimpleWebAuthn to get assertion from authenticator
@@ -190,6 +191,7 @@ export const passkeyLogic = kea<passkeyLogicType>([
})
// Step 3: Send assertion to server to complete login
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.create('api/webauthn/login/complete/', assertion)
return null
@@ -237,6 +239,7 @@ export const passkeyLogic = kea<passkeyLogicType>([
return
}
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const beginResponse = await api.create<PasskeyLoginBeginResponse>('api/webauthn/login/begin/')
const assertion = await startAuthentication({
optionsJSON: {
@@ -250,6 +253,7 @@ export const passkeyLogic = kea<passkeyLogicType>([
},
useBrowserAutofill: true,
})
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.create('api/webauthn/login/complete/', assertion)
redirectAfterLogin()
} catch (e: unknown) {
diff --git a/frontend/src/scenes/authentication/signup/signupForm/signupLogic.ts b/frontend/src/scenes/authentication/signup/signupForm/signupLogic.ts
index ca850a874784..d5408f766219 100644
--- a/frontend/src/scenes/authentication/signup/signupForm/signupLogic.ts
+++ b/frontend/src/scenes/authentication/signup/signupForm/signupLogic.ts
@@ -427,6 +427,7 @@ export const signupLogic = kea<signupLogicType>([
actions.setPasskeyError(null)
let precheckResponse: SignupEmailPrecheckResponse
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
precheckResponse = await api.create<SignupEmailPrecheckResponse>('api/signup/precheck', {
email,
})
@@ -526,6 +527,7 @@ export const signupLogic = kea<signupLogicType>([
signupData.challenge_nonce = values.challengeNonce
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const res = await api.create('api/signup/', signupData)
if (!payload.organization_name?.trim()) {
@@ -628,6 +630,7 @@ export const signupLogic = kea<signupLogicType>([
resendPendingInvite: async ({ email }, breakpoint) => {
actions.setPendingInviteResending(true)
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.create('api/signup/resend-invite', { email })
breakpoint()
actions.setPendingInviteResent(true)
@@ -675,6 +678,7 @@ export const signupLogic = kea<signupLogicType>([
try {
// Step 1: Begin registration - get options from server
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const beginResponse = await api.create<RegistrationBeginResponse>(
'api/webauthn/signup-register/begin/',
{ email }
@@ -701,6 +705,7 @@ export const signupLogic = kea<signupLogicType>([
})
// Step 3: Complete registration - send attestation to server
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.create('api/webauthn/signup-register/complete/', attestation)
actions.setPasskeyRegistered(true)
diff --git a/frontend/src/scenes/authentication/two-factor-reset/twoFactorResetLogic.ts b/frontend/src/scenes/authentication/two-factor-reset/twoFactorResetLogic.ts
index a2f430f6fea4..6509509d97f2 100644
--- a/frontend/src/scenes/authentication/two-factor-reset/twoFactorResetLogic.ts
+++ b/frontend/src/scenes/authentication/two-factor-reset/twoFactorResetLogic.ts
@@ -142,6 +142,7 @@ export const twoFactorResetLogic = kea<twoFactorResetLogicType>([
{
validateResetToken: async ({ uuid, token }: { uuid: string; token: string }) => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const response = await api.get<ValidatedTokenResponse>(`api/reset_2fa/${uuid}/?token=${token}`)
return response
} catch (e: any) {
@@ -162,6 +163,7 @@ export const twoFactorResetLogic = kea<twoFactorResetLogicType>([
null as ResetResponse | null,
{
executeReset: async ({ uuid, token }: { uuid: string; token: string }) => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const response = await api.create<ResetResponse>(`api/reset_2fa/${uuid}/`, { token })
return response
},
diff --git a/frontend/src/scenes/authentication/two-factor-setup/twoFactorLogic.ts b/frontend/src/scenes/authentication/two-factor-setup/twoFactorLogic.ts
index 0f68bf780486..f6d0a0ff030f 100644
--- a/frontend/src/scenes/authentication/two-factor-setup/twoFactorLogic.ts
+++ b/frontend/src/scenes/authentication/two-factor-setup/twoFactorLogic.ts
@@ -359,6 +359,7 @@ export const twoFactorLogic = kea<twoFactorLogicType>([
actions.setSetupCallOngoing(true)
breakpoint()
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. usersTwoFactorStartSetupRetrieve() from '~/generated/core/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
const response = await api.get('api/users/@me/two_factor_start_setup/')
return response
},
@@ -368,6 +369,7 @@ export const twoFactorLogic = kea<twoFactorLogicType>([
null as TwoFactorStatusApi | null,
{
loadStatus: async () => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use usersTwoFactorStatusRetrieve() from '~/generated/core/api' instead.
return await api.get<TwoFactorStatusApi>('api/users/@me/two_factor_status/')
},
},
@@ -376,6 +378,7 @@ export const twoFactorLogic = kea<twoFactorLogicType>([
null as { backup_codes: string[] } | null,
{
generateBackupCodes: async () => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. usersTwoFactorBackupCodesCreate() from '~/generated/core/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
return await api.create<any>('api/users/@me/two_factor_backup_codes/')
},
},
@@ -390,6 +393,7 @@ export const twoFactorLogic = kea<twoFactorLogicType>([
submit: async ({ token }, breakpoint) => {
breakpoint()
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. usersTwoFactorValidateCreate() from '~/generated/core/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
return await api.create<any>('api/users/@me/two_factor_validate/', { token })
} catch (e) {
const { code, detail } = e as Record<string, any>
@@ -407,6 +411,7 @@ export const twoFactorLogic = kea<twoFactorLogicType>([
},
disable2FA: async () => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. usersTwoFactorDisableCreate() from '~/generated/core/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
await api.create<any>('api/users/@me/two_factor_disable/')
lemonToast.success('2FA disabled successfully. The page will reload.')
actions.loadStatus()
diff --git a/frontend/src/scenes/authentication/verify-email/verifyEmailLogic.ts b/frontend/src/scenes/authentication/verify-email/verifyEmailLogic.ts
index c2942d196209..80e35e076941 100644
--- a/frontend/src/scenes/authentication/verify-email/verifyEmailLogic.ts
+++ b/frontend/src/scenes/authentication/verify-email/verifyEmailLogic.ts
@@ -187,6 +187,7 @@ export const verifyEmailLogic = kea<verifyEmailLogicType>([
return values.verificationResult
}
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. usersVerifyEmailCreate() from '~/generated/core/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
const response = await api.create<PostVerifyResponse>(`api/users/verify_email/`, {
uuid,
code,
@@ -208,6 +209,7 @@ export const verifyEmailLogic = kea<verifyEmailLogicType>([
{
requestVerificationCode: async ({ uuid }: { uuid: string }) => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. usersRequestEmailVerificationCreate() from '~/generated/core/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
await api.create(`api/users/request_email_verification/`, { uuid })
lemonToast.success('We sent a new code to your email address. Please check your inbox.')
// A resend invalidates the previous code, so drop it and its error (the
diff --git a/frontend/src/scenes/billing/billingLogic.tsx b/frontend/src/scenes/billing/billingLogic.tsx
index 753aba0e8698..1eaa6e5ed6f4 100644
--- a/frontend/src/scenes/billing/billingLogic.tsx
+++ b/frontend/src/scenes/billing/billingLogic.tsx
@@ -857,6 +857,7 @@ export const billingLogic = kea<billingLogicType>([
// for customers running into performance issues until we have a more permanent fix
// of splitting the billing and forecasting data.
const skipForecasting = values.featureFlags[FEATURE_FLAGS.BILLING_SKIP_FORECASTING]
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
const response = await api.get(
'api/billing' + (skipForecasting ? '?include_forecasting=false' : '')
)
@@ -866,6 +867,7 @@ export const billingLogic = kea<billingLogicType>([
updateBillingLimits: async (limits: { [key: string]: number | null }) => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const response = await api.update('api/billing', { custom_limits_usd: limits })
lemonToast.success('Billing limits updated')
actions.loadBilling()
@@ -888,6 +890,7 @@ export const billingLogic = kea<billingLogicType>([
actions.resetUnsubscribeError()
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. billingDeactivateCreate() from 'products/billing/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
const response = await api.createResponse('api/billing/deactivate', { products: key })
const jsonRes = await getJSONOrNull(response)
@@ -943,6 +946,7 @@ export const billingLogic = kea<billingLogicType>([
},
switchFlatrateSubscriptionPlan: async (data: SwitchPlanPayload, breakpoint) => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. billingSubscriptionSwitchPlanCreate() from 'products/billing/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
await api.create('api/billing/subscription/switch-plan', data)
const productDisplayName = capitalizeFirstLetter(data.to_product_key)
@@ -975,6 +979,7 @@ export const billingLogic = kea<billingLogicType>([
loadInvoices: async () => {
// First check to see if there are open invoices
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. billingGetInvoicesRetrieve() from 'products/billing/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
const res = await api.getResponse('api/billing/get_invoices?status=open')
const jsonRes = await getJSONOrNull(res)
const numOpenInvoices = jsonRes['count']
@@ -1019,6 +1024,7 @@ export const billingLogic = kea<billingLogicType>([
loadCreditOverview: async () => {
// Check if the user is subscribed
if (values.billing?.has_active_subscription) {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. billingCreditsOverviewRetrieve() from 'products/billing/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
const response = await api.get('api/billing/credits/overview')
if (!values.creditForm.creditInput) {
@@ -1056,6 +1062,7 @@ export const billingLogic = kea<billingLogicType>([
[] as BillingProductV2Type[],
{
loadProducts: async () => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const response = await api.get('api/billing/available_products')
return response
},
@@ -1289,6 +1296,7 @@ export const billingLogic = kea<billingLogicType>([
submit: async ({ license }, breakpoint) => {
await breakpoint(500)
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. billingLicensePartialUpdate() from 'products/billing/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
await api.update('api/billing/license', {
license,
})
@@ -1314,6 +1322,7 @@ export const billingLogic = kea<billingLogicType>([
collectionMethod: 'charge_automatically',
},
submit: async ({ creditInput, collectionMethod }) => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. billingCreditsPurchaseCreate() from 'products/billing/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
await api.create('api/billing/credits/purchase', {
annual_credit_amount_usd: +creditInput,
collection_method: collectionMethod,
diff --git a/frontend/src/scenes/billing/billingProductLogic.ts b/frontend/src/scenes/billing/billingProductLogic.ts
index 15eeb9830ec9..bf7f574009b2 100644
--- a/frontend/src/scenes/billing/billingProductLogic.ts
+++ b/frontend/src/scenes/billing/billingProductLogic.ts
@@ -1185,6 +1185,7 @@ export const billingProductLogic = kea<billingProductLogicType>([
handleProductUpgrade: async ({ products, redirectPath }) => {
try {
const body: Record<string, string> = { products }
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. billingActivateCreate() from 'products/billing/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
const response = await api.create('api/billing/activate', body)
if (response.success) {
@@ -1268,6 +1269,7 @@ export const billingProductLogic = kea<billingProductLogicType>([
activateTrial: async (_, breakpoint) => {
actions.setTrialLoading(true)
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. billingTrialsActivateCreate() from 'products/billing/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
await api.create(`api/billing/trials/activate`, {
type: 'autosubscribe',
target: props.product.type,
@@ -1284,6 +1286,7 @@ export const billingProductLogic = kea<billingProductLogicType>([
cancelTrial: async (_, breakpoint) => {
actions.setTrialLoading(true)
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. billingTrialsCancelCreate() from 'products/billing/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
await api.create(`api/billing/trials/cancel`)
lemonToast.success('Your trial has been cancelled!')
if (values.surveyID) {
@@ -1306,6 +1309,7 @@ export const billingProductLogic = kea<billingProductLogicType>([
removeBillingLimitNextPeriod: async ({ productType }) => {
actions.setRemovingBillingLimitNextPeriod(true)
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.update('api/billing', { reset_limit_next_period: productType })
lemonToast.success('Billing limit for next period has been removed.')
} catch (error) {
diff --git a/frontend/src/scenes/billing/billingSpendLogic.ts b/frontend/src/scenes/billing/billingSpendLogic.ts
index 5b49624de618..88dfc5a3d4eb 100644
--- a/frontend/src/scenes/billing/billingSpendLogic.ts
+++ b/frontend/src/scenes/billing/billingSpendLogic.ts
@@ -406,6 +406,7 @@ export const billingSpendLogic = kea<billingSpendLogicType>([
// from every report the organization has filed, cached for a day on its side.
loadTeamIdOptions: async (): Promise<number[]> => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use billingUsageTeamOptionsRetrieve() from 'products/billing/frontend/generated/api' instead.
const response = await api.get('api/billing/usage/team_options/')
return response?.team_id_options ?? []
} catch {
@@ -453,6 +454,7 @@ export const billingSpendLogic = kea<billingSpendLogicType>([
// itself when there is a cap, and reads every project on every product in
// one pass when there is not, so nothing is asked per product or per page.
// Past what it can hold it refuses with guidance, which the catch below shows.
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use billingSpendRetrieve() from 'products/billing/frontend/generated/api' instead.
return await api.get(`api/billing/spend/?${toParams(params)}`)
} catch (error) {
// An actionable error names something the person can change, so it is
diff --git a/frontend/src/scenes/billing/billingUsageLogic.ts b/frontend/src/scenes/billing/billingUsageLogic.ts
index 4f97bb3718ae..7c7709ac5a22 100644
--- a/frontend/src/scenes/billing/billingUsageLogic.ts
+++ b/frontend/src/scenes/billing/billingUsageLogic.ts
@@ -479,6 +479,7 @@ export const billingUsageLogic = kea<billingUsageLogicType>([
// from every report the organization has filed, cached for a day on its side.
loadTeamIdOptions: async (): Promise<number[]> => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use billingUsageTeamOptionsRetrieve() from 'products/billing/frontend/generated/api' instead.
const response = await api.get('api/billing/usage/team_options/')
return response?.team_id_options ?? []
} catch {
@@ -525,6 +526,7 @@ export const billingUsageLogic = kea<billingUsageLogicType>([
// itself when there is a cap, and reads every project on every key in one
// pass when there is not, so nothing is asked per usage type or per page.
// Past what it can hold it refuses with guidance, which the catch below shows.
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use billingUsageRetrieve() from 'products/billing/frontend/generated/api' instead.
return await api.get(`api/billing/usage/?${toParams(params)}`)
} catch (error) {
const billingUsageError = getBillingUsageError(error)
diff --git a/frontend/src/scenes/billing/paymentEntryLogic.ts b/frontend/src/scenes/billing/paymentEntryLogic.ts
index 9bca3b39cfd2..c9111a7f3e60 100644
--- a/frontend/src/scenes/billing/paymentEntryLogic.ts
+++ b/frontend/src/scenes/billing/paymentEntryLogic.ts
@@ -160,6 +160,7 @@ export const paymentEntryLogic = kea<paymentEntryLogicType>([
if (product?.type) {
body.intent_product = product.type
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. billingActivateCreate() from 'products/billing/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
const response = await api.create('api/billing/activate', body)
if (response.success) {
@@ -206,6 +207,7 @@ export const paymentEntryLogic = kea<paymentEntryLogicType>([
actions.setLoading(true)
actions.clearErrors()
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. billingActivateAuthorizeCreate() from 'products/billing/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
const response = await api.create('api/billing/activate/authorize')
actions.setClientSecret(response.clientSecret)
actions.setLoading(false)
@@ -227,6 +229,7 @@ export const paymentEntryLogic = kea<paymentEntryLogicType>([
try {
const urlParams = new URLSearchParams(window.location.search)
const searchPaymentIntentId = urlParams.get('payment_intent')
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. billingActivateAuthorizeStatusCreate() from 'products/billing/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
const response = await api.create('api/billing/activate/authorize/status', {
payment_intent_id: paymentIntentId || searchPaymentIntentId,
})
diff --git a/frontend/src/scenes/cohorts/cohortCalculationHistorySceneLogic.ts b/frontend/src/scenes/cohorts/cohortCalculationHistorySceneLogic.ts
index c45991ba6641..de73cb047e7f 100644
--- a/frontend/src/scenes/cohorts/cohortCalculationHistorySceneLogic.ts
+++ b/frontend/src/scenes/cohorts/cohortCalculationHistorySceneLogic.ts
@@ -137,6 +137,7 @@ export const cohortCalculationHistorySceneLogic = kea<cohortCalculationHistorySc
breakpoint()
try {
const offset = (values.page - 1) * values.limit
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. cohortsCalculationHistoryRetrieve() from 'products/cohorts/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
const response = await api.get(
`api/cohort/${props.cohortId}/calculation_history/?limit=${values.limit}&offset=${offset}`
)
diff --git a/frontend/src/scenes/cohorts/cohortEditLogic.ts b/frontend/src/scenes/cohorts/cohortEditLogic.ts
index 9df7702df5d4..16602cd2a5d6 100644
--- a/frontend/src/scenes/cohorts/cohortEditLogic.ts
+++ b/frontend/src/scenes/cohorts/cohortEditLogic.ts
@@ -1043,6 +1043,7 @@ export const cohortEditLogic = kea<cohortEditLogicType>([
kind: NodeKind.HogQLQuery,
query: `SELECT person_id FROM ${sourceTable} WHERE cohort_id = ${values.cohort.id}`,
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use cohortsCreate() from 'products/cohorts/frontend/generated/api' instead.
cohort = await api.create('api/cohort', {
is_static: true,
name: `${values.cohort.name} (static copy)`,
diff --git a/frontend/src/scenes/coupons/couponLogic.ts b/frontend/src/scenes/coupons/couponLogic.ts
index bf9f3e802d43..fece112031d3 100644
--- a/frontend/src/scenes/coupons/couponLogic.ts
+++ b/frontend/src/scenes/coupons/couponLogic.ts
@@ -163,6 +163,7 @@ export const couponLogic = kea<couponLogicType>([
if (values.isAdminOrOwner === false && values.currentOrganization) {
return null
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. billingCouponsOverviewRetrieve() from 'products/billing/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
return await api.get('api/billing/coupons/overview')
},
},
@@ -205,6 +206,7 @@ export const couponLogic = kea<couponLogicType>([
},
submit: async (formValues: CouponFormValues) => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. billingCouponsClaimCreate() from 'products/billing/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
const res = await api.create('api/billing/coupons/claim', {
code: formValues.code,
})
diff --git a/frontend/src/scenes/dashboard/dashboardLogic.tsx b/frontend/src/scenes/dashboard/dashboardLogic.tsx
index 8011d6f96ca9..ab2400572380 100644
--- a/frontend/src/scenes/dashboard/dashboardLogic.tsx
+++ b/frontend/src/scenes/dashboard/dashboardLogic.tsx
@@ -1559,6 +1559,7 @@ export const dashboardLogic = kea<dashboardLogicType>([
values.filtersOverrideForLoad,
values.currentDashboardVariables
)
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
const dashboardResponse: Response = await api.getResponse(apiUrl)
const dashboard: DashboardType | null = await getJSONOrNull(dashboardResponse)
@@ -1677,6 +1678,7 @@ export const dashboardLogic = kea<dashboardLogicType>([
: {
tiles: layoutsToUpdate,
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use dashboardsPartialUpdate() from 'products/dashboards/frontend/generated/api' instead.
const persistedDashboard: DashboardType = await api.update(
`api/projects/${values.currentTeamId}/dashboards/${props.id}`,
payload
@@ -1716,6 +1718,7 @@ export const dashboardLogic = kea<dashboardLogicType>([
removeTile: async ({ tile }) => {
// The reducer drops the tile optimistically; here we only persist and roll back on failure.
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use dashboardsPartialUpdate() from 'products/dashboards/frontend/generated/api' instead.
await api.update(`api/projects/${values.currentTeamId}/dashboards/${props.id}`, {
tiles: [{ id: tile.id, deleted: true }],
})
@@ -1763,6 +1766,7 @@ export const dashboardLogic = kea<dashboardLogicType>([
const { duplicateLayouts, tilesToUpdate } = calculateDuplicateLayout(values.layouts, tile.id)
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use dashboardsPartialUpdate() from 'products/dashboards/frontend/generated/api' instead.
const dashboard: DashboardType = await api.update(
`api/projects/${values.currentTeamId}/dashboards/${props.id}`,
{
@@ -1786,6 +1790,7 @@ export const dashboardLogic = kea<dashboardLogicType>([
if (fromDashboard !== props.id) {
return values.dashboard
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. dashboardsMoveTilePartialUpdate() from 'products/dashboards/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
const dashboard: DashboardType = await api.update(
`api/projects/${teamLogic.values.currentTeamId}/dashboards/${props.id}/move_tile`,
{
@@ -1827,6 +1832,7 @@ export const dashboardLogic = kea<dashboardLogicType>([
}
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. dashboardsCopyTileCreate() from 'products/dashboards/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
await api.create(
`api/projects/${teamLogic.values.currentTeamId}/dashboards/${toDashboard}/copy_tile`,
{ fromDashboardId: fromDashboard, tileId: tile.id }
@@ -3454,6 +3460,7 @@ export const dashboardLogic = kea<dashboardLogicType>([
const previousColor = values.tiles.find((tile) => tile.id === tileId)?.color
actions.setTileProperty(tileId, { color })
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use dashboardsPartialUpdate() from 'products/dashboards/frontend/generated/api' instead.
await api.update(`api/projects/${values.currentTeamId}/dashboards/${props.id}`, {
tiles: [{ id: tileId, color }],
})
@@ -3472,6 +3479,7 @@ export const dashboardLogic = kea<dashboardLogicType>([
const newValue = previousValue === false
actions.setTileProperty(tileId, { show_description: newValue })
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use dashboardsPartialUpdate() from 'products/dashboards/frontend/generated/api' instead.
await api.update(`api/projects/${values.currentTeamId}/dashboards/${props.id}`, {
tiles: [{ id: tileId, show_description: newValue }],
})
@@ -3701,6 +3709,7 @@ export const dashboardLogic = kea<dashboardLogicType>([
}
const undoTileRemoval = async (): Promise<void> => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use dashboardsPartialUpdate() from 'products/dashboards/frontend/generated/api' instead.
await api.update(`api/projects/${values.currentTeamId}/dashboards/${props.id}`, {
tiles: [{ id: tile.id, deleted: false }],
})
@@ -3875,6 +3884,7 @@ export const dashboardLogic = kea<dashboardLogicType>([
cache.dashboardTileSpacingSaveInFlight = true
actions.setDashboardTileSpacingSaving(true)
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use dashboardsPartialUpdate() from 'products/dashboards/frontend/generated/api' instead.
const dashboard = await api.update<DashboardType>(
`api/projects/${values.currentTeamId}/dashboards/${props.id}`,
{
@@ -3918,6 +3928,7 @@ export const dashboardLogic = kea<dashboardLogicType>([
: DashboardGridCompaction.Vertical
cache.dashboardGridCompactionSaveInFlight = true
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use dashboardsPartialUpdate() from 'products/dashboards/frontend/generated/api' instead.
const dashboard = await api.update<DashboardType>(
`api/projects/${values.currentTeamId}/dashboards/${props.id}`,
{
@@ -4297,6 +4308,7 @@ export const dashboardLogic = kea<dashboardLogicType>([
const widgetsPayload = widgets.map(({ widgetType, config }) => ({ widget_type: widgetType, config }))
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use dashboardsWidgetsBatchCreate() from 'products/dashboards/frontend/generated/api' instead.
const response = await api.create(
`api/projects/${teamLogic.values.currentTeamId}/dashboards/${dashboardId}/widgets/batch/`,
{ widgets: widgetsPayload }
@@ -4340,6 +4352,7 @@ export const dashboardLogic = kea<dashboardLogicType>([
const settings = values.currentDashboardSettings
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use dashboardsPartialUpdate() from 'products/dashboards/frontend/generated/api' instead.
const dashboard = await api.update(`api/projects/${values.currentTeamId}/dashboards/${props.id}`, {
filters: settings.filters,
variables: settings.variables,
@@ -4582,6 +4595,7 @@ export const dashboardLogic = kea<dashboardLogicType>([
const insightIds = insights.map((insight: InsightModel) => insight?.id).filter((id): id is number => !!id)
if (insightIds.length > 0 && values.currentTeamId && !isSharedView()) {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. insightsViewedCreate() from 'products/product_analytics/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
void api.create(`api/projects/${values.currentTeamId}/insights/viewed`, {
insight_ids: insightIds,
})
@@ -4866,6 +4880,7 @@ export const dashboardLogic = kea<dashboardLogicType>([
const wasIgnored = !!tile.filters_overrides?.ignoreDashboardFilters
const isIgnored = !!tileFilterOverrides.ignoreDashboardFilters
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use dashboardsPartialUpdate() from 'products/dashboards/frontend/generated/api' instead.
await api.update(`api/projects/${teamLogic.values.currentTeamId}/dashboards/${props.id}`, {
tiles: [{ id: tile.id, filters_overrides: tileFilterOverrides }],
})
diff --git a/frontend/src/scenes/dashboard/dashboardUtils.ts b/frontend/src/scenes/dashboard/dashboardUtils.ts
index 8f36c196f38d..486e74304205 100644
--- a/frontend/src/scenes/dashboard/dashboardUtils.ts
+++ b/frontend/src/scenes/dashboard/dashboardUtils.ts
@@ -307,6 +307,7 @@ export async function getInsightWithRetry(
...(variablesOverride ? { variables_override: variablesOverride } : {}),
...(tileFiltersOverride ? { tile_filters_override: tileFiltersOverride } : {}),
})}`
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
const insightResponse: Response = await api.getResponse(apiUrl, methodOptions)
const legacyInsight: InsightModel | null = await getJSONOrNull(insightResponse)
const result = legacyInsight !== null ? getQueryBasedInsightModel(legacyInsight) : null
@@ -327,6 +328,7 @@ export async function getInsightWithRetry(
...(tileFiltersOverride ? { tile_filters_override: tileFiltersOverride } : {}),
})}`
// The async call returns an insight with a query_status object
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
const insightResponse = await api.get(asyncApiUrl, methodOptions)
if (insightResponse?.query_status?.id) {
@@ -341,6 +343,7 @@ export async function getInsightWithRetry(
...(variablesOverride ? { variables_override: variablesOverride } : {}),
...(tileFiltersOverride ? { tile_filters_override: tileFiltersOverride } : {}),
})}`
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
const refreshedInsightResponse: Response = await api.getResponse(
cacheUrl,
methodOptions
diff --git a/frontend/src/scenes/dashboard/dashboards/dashboardsLogic.ts b/frontend/src/scenes/dashboard/dashboards/dashboardsLogic.ts
index 3f489d3b8d5f..3d7df8383f6b 100644
--- a/frontend/src/scenes/dashboard/dashboards/dashboardsLogic.ts
+++ b/frontend/src/scenes/dashboard/dashboards/dashboardsLogic.ts
@@ -363,6 +363,7 @@ export const dashboardsLogic = kea<dashboardsLogicType>([
if (folder != null) {
params.append('folder', folder)
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use dashboardsList() from 'products/dashboards/frontend/generated/api' instead.
const response: PaginatedResponse<DashboardBasicType> = await api.get(
`api/projects/${teamId}/dashboards/?${params.toString()}`
)
@@ -383,6 +384,7 @@ export const dashboardsLogic = kea<dashboardsLogicType>([
return { count: 0, next: null, previous: null, results: [] }
}
const params = new URLSearchParams({ search, limit: '50', offset: String(offset) })
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const tagPage: PaginatedResponse<string> = await api.get(
`api/projects/${teamId}/tags?${params.toString()}`
)
diff --git a/frontend/src/scenes/dashboard/newDashboardLogic.ts b/frontend/src/scenes/dashboard/newDashboardLogic.ts
index 71bbe3da3635..107020a76d53 100644
--- a/frontend/src/scenes/dashboard/newDashboardLogic.ts
+++ b/frontend/src/scenes/dashboard/newDashboardLogic.ts
@@ -352,6 +352,7 @@ export const newDashboardLogic = kea<newDashboardLogicType>([
// would mislabel as "Could not create dashboard" even though creation succeeded.
const redirectAfterCreation = values.redirectAfterCreation
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use dashboardsCreate() from 'products/dashboards/frontend/generated/api' instead.
const result: DashboardType = await api.create(
`api/projects/${teamLogic.values.currentTeamId}/dashboards/`,
{
@@ -421,6 +422,7 @@ export const newDashboardLogic = kea<newDashboardLogicType>([
try {
actions.hideNewDashboardModal()
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. dashboardsCreateFromTemplateJsonCreate() from 'products/dashboards/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
const result: DashboardType = await api.create(
`api/projects/${teamLogic.values.currentTeamId}/dashboards/create_from_template_json`,
{
diff --git a/frontend/src/scenes/data-management/MaterializedColumns/CreateSlotModal.tsx b/frontend/src/scenes/data-management/MaterializedColumns/CreateSlotModal.tsx
index 146e12001587..bc9c7335b687 100644
--- a/frontend/src/scenes/data-management/MaterializedColumns/CreateSlotModal.tsx
+++ b/frontend/src/scenes/data-management/MaterializedColumns/CreateSlotModal.tsx
@@ -29,6 +29,7 @@ export function CreateSlotModal(): JSX.Element {
setIsSubmitting(true)
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.create(`api/projects/${currentTeam.id}/materialized_column_slots/assign_slot/`, {
property_definition_id: selectedPropertyId,
})
diff --git a/frontend/src/scenes/data-management/MaterializedColumns/materializedColumnsLogic.ts b/frontend/src/scenes/data-management/MaterializedColumns/materializedColumnsLogic.ts
index f2a14ba33d37..695ea523cdb6 100644
--- a/frontend/src/scenes/data-management/MaterializedColumns/materializedColumnsLogic.ts
+++ b/frontend/src/scenes/data-management/MaterializedColumns/materializedColumnsLogic.ts
@@ -171,6 +171,7 @@ export const materializedColumnsLogic = kea<materializedColumnsLogicType>([
if (!values.currentTeam) {
return []
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const response = await api.get(`api/projects/${values.currentTeam.id}/materialized_column_slots/`)
return response.results || []
},
@@ -183,6 +184,7 @@ export const materializedColumnsLogic = kea<materializedColumnsLogicType>([
if (!values.currentTeam) {
return null
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
return await api.get(`api/projects/${values.currentTeam.id}/materialized_column_slots/slot_usage/`)
},
},
@@ -194,6 +196,7 @@ export const materializedColumnsLogic = kea<materializedColumnsLogicType>([
if (!values.currentTeam) {
return []
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
return await api.get(
`api/projects/${values.currentTeam.id}/materialized_column_slots/available_properties/`
)
@@ -207,6 +210,7 @@ export const materializedColumnsLogic = kea<materializedColumnsLogicType>([
if (!values.currentTeam) {
return []
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
return await api.get(
`api/projects/${values.currentTeam.id}/materialized_column_slots/auto_materialized/`
)
@@ -247,6 +251,7 @@ export const materializedColumnsLogic = kea<materializedColumnsLogicType>([
if (!values.currentTeam) {
return
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.delete(`api/projects/${values.currentTeam.id}/materialized_column_slots/${slotId}/`)
lemonToast.success('Slot deleted successfully')
actions.loadSlots()
@@ -260,6 +265,7 @@ export const materializedColumnsLogic = kea<materializedColumnsLogicType>([
if (!values.currentTeam) {
return
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.create(
`api/projects/${values.currentTeam.id}/materialized_column_slots/${slotId}/retry_backfill/`,
{}
diff --git a/frontend/src/scenes/data-management/events/eventDefinitionsTableLogic.ts b/frontend/src/scenes/data-management/events/eventDefinitionsTableLogic.ts
index 6ee8edff2950..fe188379d230 100644
--- a/frontend/src/scenes/data-management/events/eventDefinitionsTableLogic.ts
+++ b/frontend/src/scenes/data-management/events/eventDefinitionsTableLogic.ts
@@ -413,6 +413,7 @@ export const eventDefinitionsTableLogic = kea<eventDefinitionsTableLogicType>([
await breakpoint(200)
cache.eventsStartTime = performance.now()
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
const response = await api.get(url)
breakpoint()
@@ -550,6 +551,7 @@ export const eventDefinitionsTableLogic = kea<eventDefinitionsTableLogicType>([
Array.from([...values.eventDefinitionPropertiesLoading, definition.id])
)
cache.propertiesStartTime = performance.now()
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
const response = await api.get(url)
breakpoint()
@@ -560,6 +562,7 @@ export const eventDefinitionsTableLogic = kea<eventDefinitionsTableLogicType>([
if (exampleUrl && exampleUrl in (cache.apiCache ?? {})) {
exampleEventProperties = cache.apiCache[exampleUrl]
} else {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
exampleEventProperties = (await api.get(exampleUrl))?.results?.[0].properties ?? {}
cache.apiCache = {
...cache.apiCache,
diff --git a/frontend/src/scenes/data-management/events/eventInsightsLogic.ts b/frontend/src/scenes/data-management/events/eventInsightsLogic.ts
index 075cacb28553..d90695fabcb1 100644
--- a/frontend/src/scenes/data-management/events/eventInsightsLogic.ts
+++ b/frontend/src/scenes/data-management/events/eventInsightsLogic.ts
@@ -114,6 +114,7 @@ export const eventInsightsLogic = kea<eventInsightsLogicType>([
params.events = [props.event]
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use insightsList() from 'products/product_analytics/frontend/generated/api' instead.
const response = await api.get(`api/projects/${values.currentTeamId}/insights/?${toParams(params)}`)
return {
diff --git a/frontend/src/scenes/data-management/ingestion-warnings-v2/ingestionWarningsV2Logic.ts b/frontend/src/scenes/data-management/ingestion-warnings-v2/ingestionWarningsV2Logic.ts
index fe32d10178d1..789d59d5bf32 100644
--- a/frontend/src/scenes/data-management/ingestion-warnings-v2/ingestionWarningsV2Logic.ts
+++ b/frontend/src/scenes/data-management/ingestion-warnings-v2/ingestionWarningsV2Logic.ts
@@ -201,6 +201,7 @@ export const ingestionWarningsV2Logic = kea<ingestionWarningsV2LogicType>([
...(category ? { category } : {}),
...(severity ? { severity } : {}),
})
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const response = await api.get(
`api/projects/${values.currentProjectId}/ingestion_warnings_v2/?${params}`
)
diff --git a/frontend/src/scenes/data-management/ingestion-warnings/ingestionWarningsLogic.ts b/frontend/src/scenes/data-management/ingestion-warnings/ingestionWarningsLogic.ts
index 07fa08989096..30e30ba5793a 100644
--- a/frontend/src/scenes/data-management/ingestion-warnings/ingestionWarningsLogic.ts
+++ b/frontend/src/scenes/data-management/ingestion-warnings/ingestionWarningsLogic.ts
@@ -104,6 +104,7 @@ export const ingestionWarningsLogic = kea<ingestionWarningsLogicType>([
{
loadData: async () => {
const q = values.searchQuery ? `?q=${values.searchQuery}` : ''
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const { results } = await api.get(`api/projects/${values.currentProjectId}/ingestion_warnings${q}`)
return results
},
diff --git a/frontend/src/scenes/data-management/properties/propertyDefinitionsTableLogic.ts b/frontend/src/scenes/data-management/properties/propertyDefinitionsTableLogic.ts
index 49f8db5cd73a..a5cd7bab06d7 100644
--- a/frontend/src/scenes/data-management/properties/propertyDefinitionsTableLogic.ts
+++ b/frontend/src/scenes/data-management/properties/propertyDefinitionsTableLogic.ts
@@ -217,6 +217,7 @@ export const propertyDefinitionsTableLogic = kea<propertyDefinitionsTableLogicTy
}
cache.propertiesStartTime = performance.now()
await breakpoint(200)
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
const response = await api.get(url)
breakpoint()
diff --git a/frontend/src/scenes/data-management/schema/schemaManagementLogic.ts b/frontend/src/scenes/data-management/schema/schemaManagementLogic.ts
index 42e3b75af066..d068d6bedf45 100644
--- a/frontend/src/scenes/data-management/schema/schemaManagementLogic.ts
+++ b/frontend/src/scenes/data-management/schema/schemaManagementLogic.ts
@@ -276,11 +276,13 @@ export const schemaManagementLogic = kea<schemaManagementLogicType>([
[] as SchemaPropertyGroup[],
{
loadPropertyGroups: async () => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const response = await api.get(`api/projects/${values.currentProjectId}/schema_property_groups/`)
return response.results || response || []
},
createPropertyGroup: async (data: Partial<SchemaPropertyGroup>) => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const response = await api.create(
`api/projects/${values.currentProjectId}/schema_property_groups/`,
data
@@ -295,6 +297,7 @@ export const schemaManagementLogic = kea<schemaManagementLogicType>([
},
updatePropertyGroup: async ({ id, data }: { id: string; data: Partial<SchemaPropertyGroup> }) => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const response = await api.update(
`api/projects/${values.currentProjectId}/schema_property_groups/${id}/`,
data
@@ -442,6 +445,7 @@ export const schemaManagementLogic = kea<schemaManagementLogicType>([
listeners(({ actions, values }) => ({
deletePropertyGroup: async ({ id }) => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.delete(`api/projects/${values.currentProjectId}/schema_property_groups/${id}/`)
actions.loadPropertyGroups()
lemonToast.success('Property group deleted')
diff --git a/frontend/src/scenes/data-management/variables/insightsLoader.ts b/frontend/src/scenes/data-management/variables/insightsLoader.ts
index 03b39b856477..c1a3c34a9b81 100644
--- a/frontend/src/scenes/data-management/variables/insightsLoader.ts
+++ b/frontend/src/scenes/data-management/variables/insightsLoader.ts
@@ -27,6 +27,7 @@ export async function fetchInsightsUsingVariable(teamId: number, variableId: str
// Paginate through all insights
while (true) {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use insightsList() from 'products/product_analytics/frontend/generated/api' instead.
const legacyResponse: CountedPaginatedResponse<InsightModel> = await api.get(
`api/projects/${teamId}/insights/?basic=true&limit=${limit}&offset=${offset}`
)
diff --git a/frontend/src/scenes/data-pipelines/batch-exports/batchExportBackfillsLogic.tsx b/frontend/src/scenes/data-pipelines/batch-exports/batchExportBackfillsLogic.tsx
index 692ebee085a6..9669d1bf0611 100644
--- a/frontend/src/scenes/data-pipelines/batch-exports/batchExportBackfillsLogic.tsx
+++ b/frontend/src/scenes/data-pipelines/batch-exports/batchExportBackfillsLogic.tsx
@@ -156,6 +156,7 @@ export const batchExportBackfillsLogic = kea<batchExportBackfillsLogicType>([
return values.backfillsPaginatedResponse
}
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
const res = await api.get<PaginatedResponse<RawBatchExportBackfill>>(nextUrl)
res.results = [...(values.backfillsPaginatedResponse?.results ?? []), ...res.results]
diff --git a/frontend/src/scenes/data-pipelines/batch-exports/batchExportRunsLogic.tsx b/frontend/src/scenes/data-pipelines/batch-exports/batchExportRunsLogic.tsx
index db6181050eae..2b5410de011a 100644
--- a/frontend/src/scenes/data-pipelines/batch-exports/batchExportRunsLogic.tsx
+++ b/frontend/src/scenes/data-pipelines/batch-exports/batchExportRunsLogic.tsx
@@ -184,6 +184,7 @@ export const batchExportRunsLogic = kea<batchExportRunsLogicType>([
if (!nextUrl) {
return values.runsPaginatedResponse
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
const res = await api.get<PaginatedResponse<RawBatchExportRun>>(nextUrl)
res.results = [...(values.runsPaginatedResponse?.results ?? []), ...res.results]
diff --git a/frontend/src/scenes/data-pipelines/batch-exports/batchExportsListLogic.ts b/frontend/src/scenes/data-pipelines/batch-exports/batchExportsListLogic.ts
index 4aa3b40accc9..45355ef1af57 100644
--- a/frontend/src/scenes/data-pipelines/batch-exports/batchExportsListLogic.ts
+++ b/frontend/src/scenes/data-pipelines/batch-exports/batchExportsListLogic.ts
@@ -87,6 +87,7 @@ export const batchExportsListLogic = kea<batchExportsListLogicType>([
{
loadBatchExports: async () => {
const firstPage = await batchExportsList(String(values.currentTeamId))
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
const otherPages = await api.loadPaginatedResults<BatchExportApi>(firstPage.next ?? null)
return [...firstPage.results, ...otherPages]
},
diff --git a/frontend/src/scenes/data-pipelines/event-filtering/eventFilterLogic.ts b/frontend/src/scenes/data-pipelines/event-filtering/eventFilterLogic.ts
index 8ba154e15f0c..993b1e6cd8c1 100644
--- a/frontend/src/scenes/data-pipelines/event-filtering/eventFilterLogic.ts
+++ b/frontend/src/scenes/data-pipelines/event-filtering/eventFilterLogic.ts
@@ -414,6 +414,7 @@ export const eventFilterLogic = kea<eventFilterLogicType>([
...formValues,
test_cases: formValues.test_cases.map(({ _key, ...tc }) => tc),
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.create(`api/projects/${currentTeamId}/event_filter/`, payload)
lemonToast.success('Event filter saved')
},
@@ -546,6 +547,7 @@ export const eventFilterLogic = kea<eventFilterLogicType>([
// Load existing config from the API on mount
afterMount(({ actions, values }) => {
const { currentTeamId } = values
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
api.get(`api/projects/${currentTeamId}/event_filter/`)
.then((data) => {
if (!data) {
diff --git a/frontend/src/scenes/data-pipelines/legacy-plugins/pipelinePluginConfigurationLogic.tsx b/frontend/src/scenes/data-pipelines/legacy-plugins/pipelinePluginConfigurationLogic.tsx
index 7dc8f9e5d3fb..e747ac91b7be 100644
--- a/frontend/src/scenes/data-pipelines/legacy-plugins/pipelinePluginConfigurationLogic.tsx
+++ b/frontend/src/scenes/data-pipelines/legacy-plugins/pipelinePluginConfigurationLogic.tsx
@@ -230,6 +230,7 @@ export const pipelinePluginConfigurationLogic = kea<pipelinePluginConfigurationL
return (
plugins[props.pluginId] ||
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
api.get(`api/organizations/${values.currentOrganizationId}/plugins/${props.pluginId}`)
)
},
diff --git a/frontend/src/scenes/data-pipelines/utils/nonHogFunctionsLogic.tsx b/frontend/src/scenes/data-pipelines/utils/nonHogFunctionsLogic.tsx
index 755c89260548..1b72f9566d77 100644
--- a/frontend/src/scenes/data-pipelines/utils/nonHogFunctionsLogic.tsx
+++ b/frontend/src/scenes/data-pipelines/utils/nonHogFunctionsLogic.tsx
@@ -90,9 +90,11 @@ export const nonHogFunctionsLogic = kea<nonHogFunctionsLogicType>([
// NOTE: This is super temporary until we have fully migrated off of plugins
loadHogFunctionPluginsDestinations: async () => {
const [pluginConfigs, plugins] = await Promise.all([
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
api.loadPaginatedResults<PluginConfigTypeNew>(
`api/projects/${values.currentProjectId}/pipeline_destination_configs`
),
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
api.loadPaginatedResults<PluginType>(
`api/organizations/${values.currentOrganizationId}/pipeline_destinations`
),
@@ -140,9 +142,11 @@ export const nonHogFunctionsLogic = kea<nonHogFunctionsLogicType>([
// NOTE: This is super temporary until we have fully migrated off of plugins
loadHogFunctionPluginsSiteApps: async () => {
const [pluginConfigs, plugins] = await Promise.all([
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
api.loadPaginatedResults<PluginConfigTypeNew>(
`api/projects/${values.currentProjectId}/pipeline_frontend_apps_configs`
),
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
api.loadPaginatedResults<PluginType>(
`api/organizations/${values.currentOrganizationId}/pipeline_frontend_apps`
),
diff --git a/frontend/src/scenes/data-warehouse/editor/draftsLogic.tsx b/frontend/src/scenes/data-warehouse/editor/draftsLogic.tsx
index 9dd8f9f683ed..7c177b5889e5 100644
--- a/frontend/src/scenes/data-warehouse/editor/draftsLogic.tsx
+++ b/frontend/src/scenes/data-warehouse/editor/draftsLogic.tsx
@@ -150,6 +150,7 @@ export const draftsLogic = kea<draftsLogicType>([
},
loadMoreDrafts: async () => {
if (values.draftsResponse.next) {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
const drafts = await api.get<PaginatedResponse<DataWarehouseSavedQueryDraft>>(
values.draftsResponse.next
)
diff --git a/frontend/src/scenes/experiments/ExperimentForm/variantsPanelLogic.ts b/frontend/src/scenes/experiments/ExperimentForm/variantsPanelLogic.ts
index 01c5b96defc7..d975570fc79f 100644
--- a/frontend/src/scenes/experiments/ExperimentForm/variantsPanelLogic.ts
+++ b/frontend/src/scenes/experiments/ExperimentForm/variantsPanelLogic.ts
@@ -238,6 +238,7 @@ export const variantsPanelLogic = kea<variantsPanelLogicType>({
}
// Double-check with API for recently created flags
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use featureFlagsList() from 'products/feature_flags/frontend/generated/api' instead.
const response = await api.get(
`api/projects/${values.currentProjectId}/feature_flags/?${toParams({ search: key })}`
)
diff --git a/frontend/src/scenes/experiments/ExperimentTabContent/createDraftExperimentFromFlagLogic.ts b/frontend/src/scenes/experiments/ExperimentTabContent/createDraftExperimentFromFlagLogic.ts
index 3008eb874866..834244257bb2 100644
--- a/frontend/src/scenes/experiments/ExperimentTabContent/createDraftExperimentFromFlagLogic.ts
+++ b/frontend/src/scenes/experiments/ExperimentTabContent/createDraftExperimentFromFlagLogic.ts
@@ -127,6 +127,7 @@ export const createDraftExperimentFromFlagLogic = kea<createDraftExperimentFromF
}
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use experimentsCreate() from 'products/experiments/frontend/generated/api' instead.
const experiment: Experiment = await api.create(
`api/projects/${values.currentProjectId}/experiments`,
payload
diff --git a/frontend/src/scenes/experiments/RunningTimeCalculator/runningTimeLogic.ts b/frontend/src/scenes/experiments/RunningTimeCalculator/runningTimeLogic.ts
index de157aea2494..bcaa977b7898 100644
--- a/frontend/src/scenes/experiments/RunningTimeCalculator/runningTimeLogic.ts
+++ b/frontend/src/scenes/experiments/RunningTimeCalculator/runningTimeLogic.ts
@@ -643,6 +643,7 @@ export const runningTimeLogic = kea<runningTimeLogicType>([
// carry the handshake and absorb the response — otherwise every open tab of a running
// experiment goes silently stale on results load and later scalar saves 409.
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use experimentsPartialUpdate() from 'products/experiments/frontend/generated/api' instead.
const response: Experiment = await api.update(
`api/projects/${currentProjectId}/experiments/${props.experiment.id}`,
{
@@ -662,6 +663,7 @@ export const runningTimeLogic = kea<runningTimeLogicType>([
// and resync the snapshot so this tab stops being stale (and the guard above stops
// re-persisting the same values against fresh server state).
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use experimentsRetrieve() from 'products/experiments/frontend/generated/api' instead.
const fresh: Experiment = await api.get(
`api/projects/${currentProjectId}/experiments/${props.experiment.id}`
)
diff --git a/frontend/src/scenes/experiments/SharedMetrics/sharedMetricLogic.tsx b/frontend/src/scenes/experiments/SharedMetrics/sharedMetricLogic.tsx
index 6e5ea09b8397..5d20ee8ee87b 100644
--- a/frontend/src/scenes/experiments/SharedMetrics/sharedMetricLogic.tsx
+++ b/frontend/src/scenes/experiments/SharedMetrics/sharedMetricLogic.tsx
@@ -191,6 +191,7 @@ export const sharedMetricLogic = kea<sharedMetricLogicType>([
const { sharedMetricId } = props
if (sharedMetricId) {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use experimentSavedMetricsRetrieve() from 'products/experiments/frontend/generated/api' instead.
const response = await api.get(
`api/projects/${values.currentProjectId}/experiment_saved_metrics/${sharedMetricId}`
)
@@ -230,6 +231,7 @@ export const sharedMetricLogic = kea<sharedMetricLogicType>([
}
actions.setMetricSaving(true)
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use experimentSavedMetricsCreate() from 'products/experiments/frontend/generated/api' instead.
const response = await api.create(
`api/projects/${values.currentProjectId}/experiment_saved_metrics/`,
values.sharedMetric
@@ -257,6 +259,7 @@ export const sharedMetricLogic = kea<sharedMetricLogicType>([
}
actions.setMetricSaving(true)
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use experimentSavedMetricsPartialUpdate() from 'products/experiments/frontend/generated/api' instead.
const response = await api.update(
`api/projects/${values.currentProjectId}/experiment_saved_metrics/${values.sharedMetricId}`,
values.sharedMetric
@@ -282,6 +285,7 @@ export const sharedMetricLogic = kea<sharedMetricLogicType>([
},
deleteSharedMetric: async () => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. experimentSavedMetricsDestroy() from 'products/experiments/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
await api.delete(
`api/projects/${values.currentProjectId}/experiment_saved_metrics/${values.sharedMetricId}`
)
diff --git a/frontend/src/scenes/experiments/SharedMetrics/sharedMetricsLogic.tsx b/frontend/src/scenes/experiments/SharedMetrics/sharedMetricsLogic.tsx
index ae3d5b510609..250e900f27d2 100644
--- a/frontend/src/scenes/experiments/SharedMetrics/sharedMetricsLogic.tsx
+++ b/frontend/src/scenes/experiments/SharedMetrics/sharedMetricsLogic.tsx
@@ -114,6 +114,7 @@ export const sharedMetricsLogic = kea<sharedMetricsLogicType>([
offset: (values.page - 1) * PAGE_SIZE,
search: values.searchTerm || undefined,
})
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use experimentSavedMetricsList() from 'products/experiments/frontend/generated/api' instead.
const response: CountedPaginatedResponse<SharedMetric> = await api.get(
`api/projects/${values.currentProjectId}/experiment_saved_metrics?${params}`
)
@@ -136,6 +137,7 @@ export const sharedMetricsLogic = kea<sharedMetricsLogicType>([
},
updateSharedMetricTags: async ({ metricId, tags }) => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use experimentSavedMetricsPartialUpdate() from 'products/experiments/frontend/generated/api' instead.
await api.update(`api/projects/${values.currentProjectId}/experiment_saved_metrics/${metricId}`, {
tags,
})
@@ -147,6 +149,7 @@ export const sharedMetricsLogic = kea<sharedMetricsLogicType>([
},
deleteSharedMetric: async ({ metricId }) => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. experimentSavedMetricsDestroy() from 'products/experiments/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
await api.delete(`api/projects/${values.currentProjectId}/experiment_saved_metrics/${metricId}`)
lemonToast.success('Shared metric deleted successfully')
actions.loadSharedMetrics()
diff --git a/frontend/src/scenes/experiments/experimentLogic.tsx b/frontend/src/scenes/experiments/experimentLogic.tsx
index 361e9c5b7ed0..3c37226f8fd8 100644
--- a/frontend/src/scenes/experiments/experimentLogic.tsx
+++ b/frontend/src/scenes/experiments/experimentLogic.tsx
@@ -2338,6 +2338,7 @@ export const experimentLogic = kea<experimentLogicType>([
launchExperiment: async () => {
actions.setLaunchExperimentLoading(true)
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. experimentsLaunchCreate() from 'products/experiments/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
const experiment: Experiment = await api.create(
`/api/projects/${values.currentProjectId}/experiments/${values.experimentId}/launch`
)
@@ -2374,6 +2375,7 @@ export const experimentLogic = kea<experimentLogicType>([
endExperiment: async ({ openCleanupPr, repository, setRepositoryAsTeamDefault }) => {
actions.setEndExperimentLoading(true)
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. experimentsEndCreate() from 'products/experiments/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
const response: Experiment = await api.create(
`/api/projects/${values.currentProjectId}/experiments/${values.experimentId}/end`,
{
@@ -2406,6 +2408,7 @@ export const experimentLogic = kea<experimentLogicType>([
},
pauseExperiment: async () => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. experimentsPauseCreate() from 'products/experiments/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
const response: Experiment = await api.create(
`/api/projects/${values.currentProjectId}/experiments/${values.experimentId}/pause`
)
@@ -2417,6 +2420,7 @@ export const experimentLogic = kea<experimentLogicType>([
},
resumeExperiment: async () => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. experimentsResumeCreate() from 'products/experiments/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
const response: Experiment = await api.create(
`/api/projects/${values.currentProjectId}/experiments/${values.experimentId}/resume`
)
@@ -2432,6 +2436,7 @@ export const experimentLogic = kea<experimentLogicType>([
}
actions.setFreezeExposureLoading(true)
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. experimentsFreezeExposureCreate() from 'products/experiments/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
const response: Experiment = await api.create(
`/api/projects/${values.currentProjectId}/experiments/${values.experimentId}/freeze_exposure`
)
@@ -2450,6 +2455,7 @@ export const experimentLogic = kea<experimentLogicType>([
}
actions.setUnfreezeExposureLoading(true)
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. experimentsUnfreezeExposureCreate() from 'products/experiments/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
const response: Experiment = await api.create(
`/api/projects/${values.currentProjectId}/experiments/${values.experimentId}/unfreeze_exposure`
)
@@ -2464,6 +2470,7 @@ export const experimentLogic = kea<experimentLogicType>([
},
archiveExperiment: async ({ disableFeatureFlag }) => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. experimentsArchiveCreate() from 'products/experiments/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
const response: Experiment = await api.create(
`/api/projects/${values.currentProjectId}/experiments/${values.experimentId}/archive`,
{ disable_feature_flag: disableFeatureFlag }
@@ -2477,6 +2484,7 @@ export const experimentLogic = kea<experimentLogicType>([
},
unarchiveExperiment: async () => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. experimentsUnarchiveCreate() from 'products/experiments/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
const response: Experiment = await api.create(
`/api/projects/${values.currentProjectId}/experiments/${values.experimentId}/unarchive`
)
@@ -2716,6 +2724,7 @@ export const experimentLogic = kea<experimentLogicType>([
},
resetRunningExperiment: async () => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. experimentsResetCreate() from 'products/experiments/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
const response: Experiment = await api.create(
`/api/projects/${values.currentProjectId}/experiments/${values.experimentId}/reset`
)
@@ -2766,6 +2775,7 @@ export const experimentLogic = kea<experimentLogicType>([
}) => {
actions.setEndExperimentLoading(true)
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. experimentsShipVariantCreate() from 'products/experiments/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
const response: Experiment = await api.create(
`/api/projects/${values.currentProjectId}/experiments/${values.experimentId}/ship_variant`,
{
@@ -2819,6 +2829,7 @@ export const experimentLogic = kea<experimentLogicType>([
...withoutProjectedFlagConfig(values.experiment.parameters),
variant_screenshot_media_ids: variantPreviewMediaIds,
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use experimentsPartialUpdate() from 'products/experiments/frontend/generated/api' instead.
const response: Experiment = await api.update(
`api/projects/${values.currentProjectId}/experiments/${values.experimentId}`,
{
@@ -2849,6 +2860,7 @@ export const experimentLogic = kea<experimentLogicType>([
...withoutProjectedFlagConfig(values.experiment.parameters),
variant_notes: variantNotes,
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use experimentsPartialUpdate() from 'products/experiments/frontend/generated/api' instead.
const response: Experiment = await api.update(
`api/projects/${values.currentProjectId}/experiments/${values.experimentId}`,
{
@@ -2907,6 +2919,7 @@ export const experimentLogic = kea<experimentLogicType>([
const combinedMetricsIds = [...existingMetricsIds, ...newMetricsIds]
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use experimentsPartialUpdate() from 'products/experiments/frontend/generated/api' instead.
await api.update(`api/projects/${values.currentProjectId}/experiments/${values.experimentId}`, {
...toConcurrencyPayload(values.unmodifiedExperiment),
saved_metrics_ids: combinedMetricsIds,
@@ -2949,6 +2962,7 @@ export const experimentLogic = kea<experimentLogicType>([
)
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use experimentsPartialUpdate() from 'products/experiments/frontend/generated/api' instead.
await api.update(`api/projects/${values.currentProjectId}/experiments/${values.experimentId}`, {
...toConcurrencyPayload(values.unmodifiedExperiment),
saved_metrics_ids: sharedMetricsIds,
@@ -3002,6 +3016,7 @@ export const experimentLogic = kea<experimentLogicType>([
/**
* create a new dashboard
*/
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use dashboardsCreate() from 'products/dashboards/frontend/generated/api' instead.
const dashboard: DashboardType = await api.create(`api/projects/${values.currentTeamId}/dashboards/`, {
name: 'Experiment: ' + values.experiment.name,
description: `Dashboard for [${experimentUrl}](${experimentUrl})`,
@@ -3035,6 +3050,7 @@ export const experimentLogic = kea<experimentLogicType>([
for (const query of metrics) {
const insightQuery = queryBuilder(query)
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use insightsCreate() from 'products/product_analytics/frontend/generated/api' instead.
await api.create(`api/projects/${projectLogic.values.currentProjectId}/insights`, {
name: query.name || undefined,
query: insightQuery,
@@ -3270,6 +3286,7 @@ export const experimentLogic = kea<experimentLogicType>([
// Deliberately not the updateExperiment loader: kea-loaders swallows the rejection
// into a Failure action, and a silent failure here would leave the table showing an
// order that never saved.
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use experimentsPartialUpdate() from 'products/experiments/frontend/generated/api' instead.
const response: Experiment = await api.update(
`api/projects/${values.currentProjectId}/experiments/${values.experimentId}`,
{
@@ -3618,6 +3635,7 @@ export const experimentLogic = kea<experimentLogicType>([
void payload?.triggeredBy
if (values.experimentId && values.experimentId !== 'new') {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use experimentsRetrieve() from 'products/experiments/frontend/generated/api' instead.
const response: Experiment = await api.get(
`api/projects/${values.currentProjectId}/experiments/${values.experimentId}`
)
@@ -3647,6 +3665,7 @@ export const experimentLogic = kea<experimentLogicType>([
// response instead of the one both dispatches started from.
const send = async (): Promise<Experiment> => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use experimentsPartialUpdate() from 'products/experiments/frontend/generated/api' instead.
const response: Experiment = await api.update(
`api/projects/${values.currentProjectId}/experiments/${values.experimentId}`,
{ ...toConcurrencyPayload(values.unmodifiedExperiment), ...update }
@@ -3668,6 +3687,7 @@ export const experimentLogic = kea<experimentLogicType>([
// user's edit isn't lost — they can review the fresh state and save again.
const preserved = conflictPreservedFields(update)
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use experimentsRetrieve() from 'products/experiments/frontend/generated/api' instead.
const fresh: Experiment = await api.get(
`api/projects/${values.currentProjectId}/experiments/${values.experimentId}`
)
diff --git a/frontend/src/scenes/experiments/experimentTabLogic.ts b/frontend/src/scenes/experiments/experimentTabLogic.ts
index e01389cae091..356c293df1b7 100644
--- a/frontend/src/scenes/experiments/experimentTabLogic.ts
+++ b/frontend/src/scenes/experiments/experimentTabLogic.ts
@@ -58,6 +58,7 @@ export const experimentTabLogic = kea<experimentTabLogicType>([
[] as Experiment[],
{
loadRelatedExperiments: async () => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use experimentsList() from 'products/experiments/frontend/generated/api' instead.
const response = await api.get(
`api/projects/${values.currentProjectId}/experiments/?feature_flag_id=${props.featureFlagId}`
)
diff --git a/frontend/src/scenes/experiments/experimentTimeseriesLogic.ts b/frontend/src/scenes/experiments/experimentTimeseriesLogic.ts
index a019b8044e6d..18b5329654f2 100644
--- a/frontend/src/scenes/experiments/experimentTimeseriesLogic.ts
+++ b/frontend/src/scenes/experiments/experimentTimeseriesLogic.ts
@@ -159,6 +159,7 @@ export const experimentTimeseriesLogic = kea<experimentTimeseriesLogicType>([
throw new Error('Metric fingerprint is required')
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. experimentsTimeseriesResultsRetrieve() from 'products/experiments/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
const response = await api.get(
`api/projects/${values.currentProjectId}/experiments/${props.experiment.id}/timeseries_results/?metric_uuid=${metric.uuid}&fingerprint=${metric.fingerprint}`
)
@@ -170,6 +171,7 @@ export const experimentTimeseriesLogic = kea<experimentTimeseriesLogicType>([
}
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. experimentsRecalculateTimeseriesCreate() from 'products/experiments/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
const response = await api.createResponse(
`api/projects/${values.currentProjectId}/experiments/${props.experiment.id}/recalculate_timeseries/`,
{
diff --git a/frontend/src/scenes/experiments/holdoutsLogic.tsx b/frontend/src/scenes/experiments/holdoutsLogic.tsx
index 4bcc7bb40b10..c06511a9f905 100644
--- a/frontend/src/scenes/experiments/holdoutsLogic.tsx
+++ b/frontend/src/scenes/experiments/holdoutsLogic.tsx
@@ -153,10 +153,12 @@ export const holdoutsLogic = kea<holdoutsLogicType>([
[] as ExperimentHoldoutType[],
{
loadHoldouts: async () => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use experimentHoldoutsList() from 'products/experiments/frontend/generated/api' instead.
const response = await api.get(`api/projects/${values.currentProjectId}/experiment_holdouts/`)
return response.results as ExperimentHoldoutType[]
},
createHoldout: async () => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use experimentHoldoutsCreate() from 'products/experiments/frontend/generated/api' instead.
const response = await api.create(
`api/projects/${values.currentProjectId}/experiment_holdouts/`,
values.holdout
@@ -165,6 +167,7 @@ export const holdoutsLogic = kea<holdoutsLogicType>([
return [...values.holdouts, response] as ExperimentHoldoutType[]
},
updateHoldout: async ({ id, holdout }) => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use experimentHoldoutsPartialUpdate() from 'products/experiments/frontend/generated/api' instead.
const response = await api.update(
`api/projects/${values.currentProjectId}/experiment_holdouts/${id}/`,
holdout
@@ -172,6 +175,7 @@ export const holdoutsLogic = kea<holdoutsLogicType>([
return values.holdouts.map((h) => (h.id === id ? response : h)) as ExperimentHoldoutType[]
},
deleteHoldout: async ({ id }) => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. experimentHoldoutsDestroy() from 'products/experiments/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
await api.delete(`api/projects/${values.currentProjectId}/experiment_holdouts/${id}/`)
return values.holdouts.filter((h) => h.id !== id)
},
diff --git a/frontend/src/scenes/experiments/staff/queryPerformanceLogic.ts b/frontend/src/scenes/experiments/staff/queryPerformanceLogic.ts
index bfe1f57a86e3..ece1b9ba233e 100644
--- a/frontend/src/scenes/experiments/staff/queryPerformanceLogic.ts
+++ b/frontend/src/scenes/experiments/staff/queryPerformanceLogic.ts
@@ -451,9 +451,11 @@ export const queryPerformanceLogic = kea<queryPerformanceLogicType>([
if (values.search) {
params.append('search', values.search)
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
return await api.get(`api/debug_ch_queries/precomputation_teams/?${params.toString()}`)
},
setPrecomputation: async ({ teamId, enabled }) => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const updated: PrecomputationTeam = await api.create('api/debug_ch_queries/precomputation_teams/', {
team_id: teamId,
experiment_precomputation_enabled: enabled,
@@ -472,6 +474,7 @@ export const queryPerformanceLogic = kea<queryPerformanceLogicType>([
null as CacheHealthResponse | null,
{
loadCacheHealth: async () => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
return await api.get('api/debug_ch_queries/cache_health/')
},
},
@@ -480,6 +483,7 @@ export const queryPerformanceLogic = kea<queryPerformanceLogicType>([
null as CacheGrowthResponse | null,
{
loadCacheGrowth: async () => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
return await api.get(`api/debug_ch_queries/cache_growth/?hours=${values.cacheGrowthHoursBack}`)
},
},
@@ -488,6 +492,7 @@ export const queryPerformanceLogic = kea<queryPerformanceLogicType>([
null as PrecomputeOverviewResponse | null,
{
loadPrecomputeOverview: async () => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
return await api.get(`api/debug_ch_queries/precompute_overview/?hours=${values.overviewHoursBack}`)
},
},
@@ -496,6 +501,7 @@ export const queryPerformanceLogic = kea<queryPerformanceLogicType>([
null as PrecomputeTimeseriesResponse | null,
{
loadPrecomputeTimeseries: async () => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
return await api.get(
`api/debug_ch_queries/precompute_timeseries/?hours=${values.timeseriesHoursBack}`
)
@@ -524,6 +530,7 @@ export const queryPerformanceLogic = kea<queryPerformanceLogicType>([
if (values.exceptionCodeFilter) {
params.append('exception_code', values.exceptionCodeFilter)
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
return await api.get(`api/debug_ch_queries/slowest_queries/?${params.toString()}`)
},
},
diff --git a/frontend/src/scenes/feature-flags/FeatureFlags.tsx b/frontend/src/scenes/feature-flags/FeatureFlags.tsx
index 12760f9455f1..2bf3a35678b8 100644
--- a/frontend/src/scenes/feature-flags/FeatureFlags.tsx
+++ b/frontend/src/scenes/feature-flags/FeatureFlags.tsx
@@ -654,6 +654,7 @@ export function OverviewTab({
setMatchingFlagIdsLoading(true)
try {
const { limit, offset, ...filters } = paramsFromFilters
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. featureFlagsMatchingIdsRetrieve() from 'products/feature_flags/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
const response = (await api.get(
`api/projects/${currentProjectId}/feature_flags/matching_ids/?${toParams(filters)}`
)) as { ids: number[]; total: number }
diff --git a/frontend/src/scenes/feature-flags/defaultEvaluationContextsLogic.ts b/frontend/src/scenes/feature-flags/defaultEvaluationContextsLogic.ts
index d350ead2c536..588858255d19 100644
--- a/frontend/src/scenes/feature-flags/defaultEvaluationContextsLogic.ts
+++ b/frontend/src/scenes/feature-flags/defaultEvaluationContextsLogic.ts
@@ -274,6 +274,7 @@ export const defaultEvaluationContextsLogic = kea<defaultEvaluationContextsLogic
return null
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. organizationsProjectsDefaultEvaluationContextsRetrieve() from '~/generated/core/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
const response = await api.get(`/api/projects/${teamId}/default_evaluation_contexts/`)
return response as DefaultEvaluationContextsResponse
},
@@ -285,6 +286,7 @@ export const defaultEvaluationContextsLogic = kea<defaultEvaluationContextsLogic
}
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. organizationsProjectsDefaultEvaluationContextsCreate() from '~/generated/core/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
const response = await api.create(`/api/projects/${teamId}/default_evaluation_contexts/`, {
context_name: contextName,
})
@@ -325,6 +327,7 @@ export const defaultEvaluationContextsLogic = kea<defaultEvaluationContextsLogic
}
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. organizationsProjectsDefaultEvaluationContextsDestroy() from '~/generated/core/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
await api.delete(
`/api/projects/${teamId}/default_evaluation_contexts/?context_name=${encodeURIComponent(contextName)}`
)
@@ -353,6 +356,7 @@ export const defaultEvaluationContextsLogic = kea<defaultEvaluationContextsLogic
}
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use organizationsProjectsEvaluationContextSuggestionsCreate() from 'products/feature_flags/frontend/generated/api' instead.
await api.create(`/api/projects/${teamId}/evaluation_context_suggestions/`, {
context_name: contextName,
})
@@ -380,6 +384,7 @@ export const defaultEvaluationContextsLogic = kea<defaultEvaluationContextsLogic
}
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use organizationsProjectsEvaluationContextSuggestionsDestroy() from 'products/feature_flags/frontend/generated/api' instead.
await api.delete(
`/api/projects/${teamId}/evaluation_context_suggestions/?context_name=${encodeURIComponent(contextName)}`
)
diff --git a/frontend/src/scenes/feature-flags/defaultReleaseConditionsLogic.ts b/frontend/src/scenes/feature-flags/defaultReleaseConditionsLogic.ts
index 044a3a50531b..197e8f41e231 100644
--- a/frontend/src/scenes/feature-flags/defaultReleaseConditionsLogic.ts
+++ b/frontend/src/scenes/feature-flags/defaultReleaseConditionsLogic.ts
@@ -17,6 +17,7 @@ export interface DefaultReleaseConditionsResponse {
}
export async function fetchDefaultReleaseConditions(teamId: number): Promise<DefaultReleaseConditionsResponse> {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. organizationsProjectsDefaultReleaseConditionsRetrieve() from '~/generated/core/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
return await api.get(`/api/projects/${teamId}/default_release_conditions/`)
}
@@ -170,6 +171,7 @@ export const defaultReleaseConditionsLogic = kea<defaultReleaseConditionsLogicTy
throw new Error('No team selected')
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. organizationsProjectsDefaultReleaseConditionsUpdate() from '~/generated/core/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
return (await api.put(`/api/projects/${teamId}/default_release_conditions/`, {
enabled: values.localEnabled,
default_groups: values.localGroups ?? [],
diff --git a/frontend/src/scenes/feature-flags/featureFlagLogic.ts b/frontend/src/scenes/feature-flags/featureFlagLogic.ts
index 82a8b6da3ccd..fb70cbc89931 100644
--- a/frontend/src/scenes/feature-flags/featureFlagLogic.ts
+++ b/frontend/src/scenes/feature-flags/featureFlagLogic.ts
@@ -3114,6 +3114,7 @@ export const featureFlagLogic = kea<featureFlagLogicType>([
let savedFlag: FeatureFlagType
if (!updatedFlag.id) {
// Creating a new flag
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use featureFlagsCreate() from 'products/feature_flags/frontend/generated/api' instead.
savedFlag = await api.create(
`api/projects/${values.currentProjectId}/feature_flags`,
preparedFlag
@@ -3151,6 +3152,7 @@ export const featureFlagLogic = kea<featureFlagLogicType>([
?.actions.markTaskAsCompleted(SetupTaskId.UpdateFeatureFlagReleaseConditions)
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use featureFlagsPartialUpdate() from 'products/feature_flags/frontend/generated/api' instead.
savedFlag = await api.update(
`api/projects/${values.currentProjectId}/feature_flags/${updatedFlag.id}`,
{
@@ -3187,11 +3189,13 @@ export const featureFlagLogic = kea<featureFlagLogicType>([
let savedFlag: FeatureFlagType
if (!updatedFlag.id) {
// Creating a new flag
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use featureFlagsCreate() from 'products/feature_flags/frontend/generated/api' instead.
savedFlag = await api.create(
`api/projects/${values.currentProjectId}/feature_flags`,
preparedFlag
)
} else {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use featureFlagsPartialUpdate() from 'products/feature_flags/frontend/generated/api' instead.
savedFlag = await api.update(
`api/projects/${values.currentProjectId}/feature_flags/${updatedFlag.id}`,
{
@@ -3219,6 +3223,7 @@ export const featureFlagLogic = kea<featureFlagLogicType>([
if (!values.featureFlag.id) {
throw new Error('Cannot toggle active state of unsaved flag')
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use featureFlagsPartialUpdate() from 'products/feature_flags/frontend/generated/api' instead.
const savedFlag = await api.update(
`api/projects/${values.currentProjectId}/feature_flags/${values.featureFlag.id}`,
{ active }
@@ -3239,6 +3244,7 @@ export const featureFlagLogic = kea<featureFlagLogicType>([
throw new Error('Cannot archive an unsaved flag')
}
// Archiving also disables the flag — the backend rejects archived+enabled flags
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use featureFlagsPartialUpdate() from 'products/feature_flags/frontend/generated/api' instead.
const savedFlag = await api.update(
`api/projects/${values.currentProjectId}/feature_flags/${values.featureFlag.id}`,
archived ? { archived: true, active: false } : { archived: false }
@@ -3298,6 +3304,7 @@ export const featureFlagLogic = kea<featureFlagLogicType>([
{
loadRelatedInsights: async () => {
if (props.id && props.id !== 'new' && values.featureFlag.key) {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use insightsList() from 'products/product_analytics/frontend/generated/api' instead.
const response = await api.get<PaginatedResponse<InsightModel>>(
`api/projects/${values.currentProjectId}/insights/?feature_flag=${values.featureFlag.key}&order=-created_at`
)
@@ -3513,6 +3520,7 @@ export const featureFlagLogic = kea<featureFlagLogicType>([
loadDependentFlags: async () => {
const { currentProjectId } = values
if (currentProjectId && props.id && props.id !== 'new' && props.id !== 'link') {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use featureFlagsDependentFlagsList() from 'products/feature_flags/frontend/generated/api' instead.
return await api.get(
`api/projects/${currentProjectId}/feature_flags/${props.id}/dependent_flags/`
)
@@ -3764,6 +3772,7 @@ export const featureFlagLogic = kea<featureFlagLogicType>([
enrichUsageDashboard: async (_, breakpoint) => {
if (props.id) {
await breakpoint(1000) // in ms
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.create(
`api/projects/${values.currentProjectId}/feature_flags/${props.id}/enrich_usage_dashboard`
)
@@ -4366,6 +4375,7 @@ export const featureFlagLogic = kea<featureFlagLogicType>([
return
}
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use featureFlagsPartialUpdate() from 'products/feature_flags/frontend/generated/api' instead.
const savedFlag = await api.update(`api/projects/${values.currentProjectId}/feature_flags/${flag.id}`, {
name,
})
@@ -4403,6 +4413,7 @@ export const featureFlagLogic = kea<featureFlagLogicType>([
await breakpoint(250)
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use featureFlagsPartialUpdate() from 'products/feature_flags/frontend/generated/api' instead.
const savedFlag = await api.update(`api/projects/${values.currentProjectId}/feature_flags/${flag.id}`, {
tags,
})
diff --git a/frontend/src/scenes/feature-flags/featureFlagReleaseConditionsLogic.ts b/frontend/src/scenes/feature-flags/featureFlagReleaseConditionsLogic.ts
index 7815a16f188b..82e850d8715b 100644
--- a/frontend/src/scenes/feature-flags/featureFlagReleaseConditionsLogic.ts
+++ b/frontend/src/scenes/feature-flags/featureFlagReleaseConditionsLogic.ts
@@ -857,6 +857,7 @@ export const featureFlagReleaseConditionsLogic = kea<featureFlagReleaseCondition
actions.setTotalCount(sortKey, undefined)
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use featureFlagsUserBlastRadiusCreate() from 'products/feature_flags/frontend/generated/api' instead.
const response: UserBlastRadiusType = await api.create(
`api/projects/${values.currentProjectId}/feature_flags/user_blast_radius`,
{
diff --git a/frontend/src/scenes/feature-flags/featureFlagsLogic.ts b/frontend/src/scenes/feature-flags/featureFlagsLogic.ts
index c5fcaa2ddc0b..6aec38f655ff 100644
--- a/frontend/src/scenes/feature-flags/featureFlagsLogic.ts
+++ b/frontend/src/scenes/feature-flags/featureFlagsLogic.ts
@@ -461,6 +461,7 @@ export const featureFlagsLogic = kea<featureFlagsLogicType>([
// then filter this page against filters it was never requested under.
const params = values.paramsFromFilters
const filters = values.filters
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use featureFlagsList() from 'products/feature_flags/frontend/generated/api' instead.
const response = await api.get(
`api/projects/${values.currentProjectId}/feature_flags/?${toParams(params)}`
)
@@ -476,6 +477,7 @@ export const featureFlagsLogic = kea<featureFlagsLogicType>([
},
updateFeatureFlag: async ({ id, payload }: { id: number; payload: Partial<FeatureFlagType> }) => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use featureFlagsPartialUpdate() from 'products/feature_flags/frontend/generated/api' instead.
const response = await api.update(
`api/projects/${values.currentProjectId}/feature_flags/${id}`,
payload
@@ -511,6 +513,7 @@ export const featureFlagsLogic = kea<featureFlagsLogicType>([
via?: FeatureFlagArchivedSource
}) => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use featureFlagsPartialUpdate() from 'products/feature_flags/frontend/generated/api' instead.
const response = await api.update(
`api/projects/${values.currentProjectId}/feature_flags/${id}`,
archived ? { archived: true, active: false } : { archived: false }
diff --git a/frontend/src/scenes/feature-flags/flagSelectionLogic.ts b/frontend/src/scenes/feature-flags/flagSelectionLogic.ts
index 68a8c4cd96e5..ec65753e4f27 100644
--- a/frontend/src/scenes/feature-flags/flagSelectionLogic.ts
+++ b/frontend/src/scenes/feature-flags/flagSelectionLogic.ts
@@ -545,12 +545,14 @@ export const flagSelectionLogic = kea<flagSelectionLogicType>([
bulkDeleteFlags: async ({ ids, allMatching }: { ids: number[]; allMatching: boolean }) => {
if (allMatching) {
const { limit, offset, ...filters } = values.paramsFromFilters
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use featureFlagsBulkDeleteCreate() from 'products/feature_flags/frontend/generated/api' instead.
const response = await api.create(
`api/projects/${values.currentProjectId}/feature_flags/bulk_delete/`,
{ filters }
)
return response as BulkDeleteResult
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use featureFlagsBulkDeleteCreate() from 'products/feature_flags/frontend/generated/api' instead.
const response = await api.create(
`api/projects/${values.currentProjectId}/feature_flags/bulk_delete/`,
{ ids }
diff --git a/frontend/src/scenes/health/categoryDetail/healthCategoryDetailLogic.ts b/frontend/src/scenes/health/categoryDetail/healthCategoryDetailLogic.ts
index 1ae0b7b371fc..4930131349e7 100644
--- a/frontend/src/scenes/health/categoryDetail/healthCategoryDetailLogic.ts
+++ b/frontend/src/scenes/health/categoryDetail/healthCategoryDetailLogic.ts
@@ -154,6 +154,7 @@ export const healthCategoryDetailLogic = kea<healthCategoryDetailLogicType>([
const queryString = new URLSearchParams(params).toString()
const url = `api/projects/${values.currentTeamIdStrict}/health_issues/?${queryString}`
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
return await api.get(url)
} catch {
lemonToast.error('Failed to load health issues')
@@ -251,6 +252,7 @@ export const healthCategoryDetailLogic = kea<healthCategoryDetailLogicType>([
},
snoozeIssue: async ({ id, duration }) => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.update(`api/projects/${values.currentTeamIdStrict}/health_issues/${id}/`, {
snoozed_until: duration,
})
@@ -262,6 +264,7 @@ export const healthCategoryDetailLogic = kea<healthCategoryDetailLogicType>([
},
dismissIssue: async ({ id }) => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.update(`api/projects/${values.currentTeamIdStrict}/health_issues/${id}/`, {
dismissed: true,
})
@@ -273,6 +276,7 @@ export const healthCategoryDetailLogic = kea<healthCategoryDetailLogicType>([
},
undismissIssue: async ({ id }) => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.update(`api/projects/${values.currentTeamIdStrict}/health_issues/${id}/`, {
dismissed: false,
})
diff --git a/frontend/src/scenes/health/healthSceneLogic.tsx b/frontend/src/scenes/health/healthSceneLogic.tsx
index 399558f3ff57..f03d6481c0bb 100644
--- a/frontend/src/scenes/health/healthSceneLogic.tsx
+++ b/frontend/src/scenes/health/healthSceneLogic.tsx
@@ -156,6 +156,7 @@ export const healthSceneLogic = kea<healthSceneLogicType>([
const queryString = new URLSearchParams(params).toString()
const url = `api/projects/${values.currentTeamIdStrict}/health_issues/?${queryString}`
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
return await api.get(url)
},
},
@@ -219,6 +220,7 @@ export const healthSceneLogic = kea<healthSceneLogicType>([
refreshHealthData: async ({ isManual }, breakpoint) => {
const url = `api/projects/${values.currentTeamIdStrict}/health_issues/refresh/`
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
const response = await api.create<{
scheduled_kinds: string[]
kinds_failed: string[]
@@ -285,6 +287,7 @@ export const healthSceneLogic = kea<healthSceneLogicType>([
},
snoozeIssue: async ({ id, duration }) => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.update(`api/projects/${values.currentTeamIdStrict}/health_issues/${id}/`, {
snoozed_until: duration,
})
@@ -296,6 +299,7 @@ export const healthSceneLogic = kea<healthSceneLogicType>([
},
dismissIssue: async ({ id }) => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.update(`api/projects/${values.currentTeamIdStrict}/health_issues/${id}/`, {
dismissed: true,
})
@@ -307,6 +311,7 @@ export const healthSceneLogic = kea<healthSceneLogicType>([
},
undismissIssue: async ({ id }) => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.update(`api/projects/${values.currentTeamIdStrict}/health_issues/${id}/`, {
dismissed: false,
})
diff --git a/frontend/src/scenes/health/pipelineStatus/pipelineHealthLogic.ts b/frontend/src/scenes/health/pipelineStatus/pipelineHealthLogic.ts
index dfa07b47a444..a22dfe1a2b5e 100644
--- a/frontend/src/scenes/health/pipelineStatus/pipelineHealthLogic.ts
+++ b/frontend/src/scenes/health/pipelineStatus/pipelineHealthLogic.ts
@@ -110,6 +110,7 @@ export const pipelineHealthLogic = kea<pipelineHealthLogicType>([
return null
}
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. dataWarehouseDataHealthIssuesRetrieve() from 'products/data_warehouse/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
const response = await api.get<DataHealthIssuesResponse>(
`api/projects/${values.currentTeamIdStrict}/data_warehouse/data_health_issues/`
)
diff --git a/frontend/src/scenes/insights/insightUsageLogic.ts b/frontend/src/scenes/insights/insightUsageLogic.ts
index 73c70274da68..a4901c674db2 100644
--- a/frontend/src/scenes/insights/insightUsageLogic.ts
+++ b/frontend/src/scenes/insights/insightUsageLogic.ts
@@ -108,6 +108,7 @@ export const insightUsageLogic = kea<insightUsageLogicType>([
// Report the insight being viewed to our '/viewed' endpoint.
// Used for "recently viewed insights", and in insights dashboard.
if (values.insight.id && !isSharedView()) {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. insightsViewedCreate() from 'products/product_analytics/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
void api.create(`api/projects/${values.currentProjectId}/insights/viewed`, {
insight_ids: [values.insight.id],
})
diff --git a/frontend/src/scenes/insights/utils.tsx b/frontend/src/scenes/insights/utils.tsx
index 9a200b2c2aec..06f6bbad32fc 100644
--- a/frontend/src/scenes/insights/utils.tsx
+++ b/frontend/src/scenes/insights/utils.tsx
@@ -199,7 +199,8 @@ export async function getInsightId(shortId: InsightShortId): Promise<number | un
return insightId
? insightId
- : (await api.get(`api/projects/${getCurrentTeamId()}/insights/?short_id=${encodeURIComponent(shortId)}`))
+ : // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use insightsList() from 'products/product_analytics/frontend/generated/api' instead.
+ (await api.get(`api/projects/${getCurrentTeamId()}/insights/?short_id=${encodeURIComponent(shortId)}`))
.results[0]?.id
}
diff --git a/frontend/src/scenes/instance/AsyncMigrations/asyncMigrationsLogic.ts b/frontend/src/scenes/instance/AsyncMigrations/asyncMigrationsLogic.ts
index b9987ee277cf..04c5cea63e6f 100644
--- a/frontend/src/scenes/instance/AsyncMigrations/asyncMigrationsLogic.ts
+++ b/frontend/src/scenes/instance/AsyncMigrations/asyncMigrationsLogic.ts
@@ -273,6 +273,7 @@ export const asyncMigrationsLogic = kea<asyncMigrationsLogicType>([
if (!userLogic.values.user?.is_staff) {
return []
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
return (await api.get('api/async_migrations')).results
},
},
@@ -284,6 +285,7 @@ export const asyncMigrationsLogic = kea<asyncMigrationsLogicType>([
if (!userLogic.values.user?.is_staff) {
return []
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const settings: InstanceSetting[] = (await api.get('api/instance_settings')).results
return settings.filter((setting) => setting.key.includes('ASYNC_MIGRATIONS'))
},
@@ -338,6 +340,7 @@ export const asyncMigrationsLogic = kea<asyncMigrationsLogicType>([
)
},
updateMigrationStatus: async ({ migration, endpoint, message }) => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const res = await api.create(`/api/async_migrations/${migration.id}/${endpoint}`, {
parameters: migration.parameters,
})
@@ -351,6 +354,7 @@ export const asyncMigrationsLogic = kea<asyncMigrationsLogicType>([
updateSetting: async ({ settingKey, newValue }) => {
// TODO: Use systemStatusLogic.ts for consistency
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.update(`/api/instance_settings/${settingKey}`, {
value: newValue,
})
@@ -364,6 +368,7 @@ export const asyncMigrationsLogic = kea<asyncMigrationsLogicType>([
},
loadAsyncMigrationErrors: async ({ migrationId }) => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const errorsForMigration = await api.get(`api/async_migrations/${migrationId}/errors`)
actions.loadAsyncMigrationErrorsSuccess(migrationId, errorsForMigration)
} catch (error) {
diff --git a/frontend/src/scenes/instance/DeadLetterQueue/deadLetterQueueLogic.ts b/frontend/src/scenes/instance/DeadLetterQueue/deadLetterQueueLogic.ts
index 9bd0070fbf0e..db2888d43f6f 100644
--- a/frontend/src/scenes/instance/DeadLetterQueue/deadLetterQueueLogic.ts
+++ b/frontend/src/scenes/instance/DeadLetterQueue/deadLetterQueueLogic.ts
@@ -143,6 +143,7 @@ export const deadLetterQueueLogic = kea<deadLetterQueueLogicType>([
if (values.filters.after) {
params.after = values.filters.after
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
return (await api.get(`api/dead_letter_queue?${new URLSearchParams(params).toString()}`)).results
},
},
@@ -163,6 +164,7 @@ export const deadLetterQueueLogic = kea<deadLetterQueueLogicType>([
if (values.filters.after) {
params.after = values.filters.after
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const res = await api.get(`api/dead_letter_queue/${key}?${new URLSearchParams(params).toString()}`)
actions.addRowsToMetric(key, res.subrows.rows)
}
diff --git a/frontend/src/scenes/instance/SystemStatus/staffUsersLogic.ts b/frontend/src/scenes/instance/SystemStatus/staffUsersLogic.ts
index 821faeb72308..b593e31e102c 100644
--- a/frontend/src/scenes/instance/SystemStatus/staffUsersLogic.ts
+++ b/frontend/src/scenes/instance/SystemStatus/staffUsersLogic.ts
@@ -121,6 +121,7 @@ export const staffUsersLogic = kea<staffUsersLogicType>([
[] as UserType[],
{
loadAllUsers: async () => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use usersList() from '~/generated/core/api' instead.
return (await api.get('api/users')).results ?? []
},
addStaffUsers: async () => {
@@ -128,6 +129,7 @@ export const staffUsersLogic = kea<staffUsersLogicType>([
actions.setStaffUsersToBeAdded([])
const newStaffUsers = await Promise.all(
staffUsersToBeAdded.map(
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use usersPartialUpdate() from '~/generated/core/api' instead.
async (userUuid) => await api.update<UserType>(`api/users/${userUuid}`, { is_staff: true })
)
)
@@ -139,6 +141,7 @@ export const staffUsersLogic = kea<staffUsersLogicType>([
return updatedAllUsers
},
deleteStaffUser: async ({ userUuid }) => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use usersPartialUpdate() from '~/generated/core/api' instead.
await api.update<UserType>(`api/users/${userUuid}`, { is_staff: false })
if (values.user?.uuid === userUuid) {
actions.loadUser() // Loads the main user object to properly reflect staff user changes
diff --git a/frontend/src/scenes/instance/SystemStatus/systemStatusLogic.ts b/frontend/src/scenes/instance/SystemStatus/systemStatusLogic.ts
index 298a2c11f42d..88aef9615c48 100644
--- a/frontend/src/scenes/instance/SystemStatus/systemStatusLogic.ts
+++ b/frontend/src/scenes/instance/SystemStatus/systemStatusLogic.ts
@@ -205,6 +205,7 @@ export const systemStatusLogic = kea<systemStatusLogicType>([
return null
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
return (await api.get('api/instance_status')).results ?? null
},
},
@@ -213,6 +214,7 @@ export const systemStatusLogic = kea<systemStatusLogicType>([
[] as InstanceSetting[],
{
loadInstanceSettings: async () => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
return (await api.get('api/instance_settings')).results ?? []
},
},
@@ -220,6 +222,7 @@ export const systemStatusLogic = kea<systemStatusLogicType>([
queries: [
null as SystemStatusQueriesResult | null,
{
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
loadQueries: async () => (await api.get('api/instance_status/queries')).results,
},
],
@@ -302,6 +305,7 @@ export const systemStatusLogic = kea<systemStatusLogicType>([
actions.setUpdatedInstanceConfigCount(0)
await Promise.all(
Object.entries(values.instanceConfigEditingState).map(async ([key, value]) => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.update(`api/instance_settings/${key}`, {
value,
})
diff --git a/frontend/src/scenes/notebooks/AddExperimentsToNotebookModal/addExperimentsToNotebookModalLogic.ts b/frontend/src/scenes/notebooks/AddExperimentsToNotebookModal/addExperimentsToNotebookModalLogic.ts
index 49626f68826c..0d85889d0ee6 100644
--- a/frontend/src/scenes/notebooks/AddExperimentsToNotebookModal/addExperimentsToNotebookModalLogic.ts
+++ b/frontend/src/scenes/notebooks/AddExperimentsToNotebookModal/addExperimentsToNotebookModalLogic.ts
@@ -117,6 +117,7 @@ export const addExperimentsToNotebookModalLogic = kea<addExperimentsToNotebookMo
params.order = order
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use experimentsList() from 'products/experiments/frontend/generated/api' instead.
const response = await api.get(`api/projects/${values.currentTeamId}/experiments/?${toParams(params)}`)
breakpoint()
diff --git a/frontend/src/scenes/oauth/oauthAuthorizeLogic.ts b/frontend/src/scenes/oauth/oauthAuthorizeLogic.ts
index f7f91d99115e..3d48d698cc47 100644
--- a/frontend/src/scenes/oauth/oauthAuthorizeLogic.ts
+++ b/frontend/src/scenes/oauth/oauthAuthorizeLogic.ts
@@ -153,6 +153,7 @@ const oauthAuthorize = async (
// any printable ASCII in `state`, so a raw-JSON state must reach the API byte-for-byte.
const params = new URLSearchParams(window.location.search)
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call to a route outside /api/, with an unchecked response type. No generated function can cover it until the route is in the OpenAPI schema.
const response = await api.create('/oauth/authorize/', {
client_id: params.get('client_id'),
redirect_uri: params.get('redirect_uri'),
@@ -437,10 +438,12 @@ export const oauthAuthorizeLogic = kea<oauthAuthorizeLogicType>([
loadAllTeams: async () => {
const user = userLogic.values.user
if (!user?.organizations?.length) {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
return await api.loadPaginatedResults('api/projects')
}
const results = await Promise.all(
user.organizations.map((org) =>
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use organizationsProjectsList() from '~/generated/core/api' instead.
api.loadPaginatedResults<TeamBasicType>(`api/organizations/${org.id}/projects`)
)
)
@@ -484,6 +487,7 @@ export const oauthAuthorizeLogic = kea<oauthAuthorizeLogicType>([
try {
const orgId = values.selectedOrganization
const endpoint = orgId ? `api/organizations/${orgId}/projects/` : 'api/projects/'
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
await api.create(endpoint, { name })
lemonToast.success(`Project "${name}" created`)
actions.setShowCreateProject(false)
diff --git a/frontend/src/scenes/onboarding/legacy/exit/onboardingExitLogic.ts b/frontend/src/scenes/onboarding/legacy/exit/onboardingExitLogic.ts
index 19c81b6c7c38..49b6a877b1f4 100644
--- a/frontend/src/scenes/onboarding/legacy/exit/onboardingExitLogic.ts
+++ b/frontend/src/scenes/onboarding/legacy/exit/onboardingExitLogic.ts
@@ -240,6 +240,7 @@ export const onboardingExitLogic = kea<onboardingExitLogicType>([
// matches what the rest of the app (and `isOnboardingRedirectSuppressed`) expects, and
// `onboarding_skipped_at` reliably lands in state before the scene change fires.
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use usersRetrieve() from '~/generated/core/api' instead.
const freshUser = await api.get<UserType>('api/users/@me/')
actions.loadUserSuccess(freshUser)
} catch {
diff --git a/frontend/src/scenes/onboarding/shared/wizard-sync/wizardCloudRunLogic.ts b/frontend/src/scenes/onboarding/shared/wizard-sync/wizardCloudRunLogic.ts
index 5232476f1330..5e678772cf5d 100644
--- a/frontend/src/scenes/onboarding/shared/wizard-sync/wizardCloudRunLogic.ts
+++ b/frontend/src/scenes/onboarding/shared/wizard-sync/wizardCloudRunLogic.ts
@@ -231,6 +231,7 @@ export const wizardCloudRunLogic = kea<wizardCloudRunLogicType>([
// workflow) and returns the run handle. Live progress is surfaced by the Installation
// layer (installationProgressLogic), which streams this run's TaskRun pipeline merged
// with the wizard session detail.
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const { task_id, run_id } = await api.create<{ task_id: string; run_id: string; status: string }>(
'api/wizard/cloud_run',
{
diff --git a/frontend/src/scenes/organization/ConfirmOrganization/confirmOrganizationLogic.ts b/frontend/src/scenes/organization/ConfirmOrganization/confirmOrganizationLogic.ts
index 4a1228899e9c..209b9827a626 100644
--- a/frontend/src/scenes/organization/ConfirmOrganization/confirmOrganizationLogic.ts
+++ b/frontend/src/scenes/organization/ConfirmOrganization/confirmOrganizationLogic.ts
@@ -162,6 +162,7 @@ export const confirmOrganizationLogic = kea<confirmOrganizationLogicType>([
submit: async (formValues) => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.create('api/social_signup/', {
...formValues,
// Trim rather than reject: surrounding whitespace is still a good signup
diff --git a/frontend/src/scenes/organizationLogic.tsx b/frontend/src/scenes/organizationLogic.tsx
index f6786b44b45b..8cfb6773cd5b 100644
--- a/frontend/src/scenes/organizationLogic.tsx
+++ b/frontend/src/scenes/organizationLogic.tsx
@@ -268,6 +268,7 @@ export const organizationLogic = kea<organizationLogicType>([
return null
}
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use retrieve() from 'products/platform_features/frontend/generated/api' instead.
return await api.get('api/organizations/@current')
} catch (error) {
if (error instanceof ApiError && error.status && error.status < 500) {
@@ -283,6 +284,7 @@ export const organizationLogic = kea<organizationLogicType>([
},
createOrganization: async (name: string) => {
await timeSensitiveAuthenticationLogic.findMounted()?.asyncActions.checkReauthentication()
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use create() from 'products/platform_features/frontend/generated/api' instead.
return await api.create('api/organizations/', { name })
},
updateOrganization: async (payload: OrganizationUpdatePayload) => {
@@ -291,6 +293,7 @@ export const organizationLogic = kea<organizationLogicType>([
}
// Check if re-authentication is required, if so, await its completion (or failure)
await timeSensitiveAuthenticationLogic.findMounted()?.asyncActions.checkReauthentication()
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use partialUpdate() from 'products/platform_features/frontend/generated/api' instead.
const updatedOrganization = await api.update(
`api/organizations/${values.currentOrganization.id}`,
payload
@@ -299,8 +302,10 @@ export const organizationLogic = kea<organizationLogicType>([
return updatedOrganization
},
completeOnboarding: async () =>
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.create(`api/organizations/${values.currentOrganization!.id}/onboarding/`, {}),
migrateAccessControlVersion: async () => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.create(`api/organizations/${values.currentOrganization!.id}/migrate_access_control/`, {})
window.location.reload()
return values.currentOrganization // Return current organization state since the page will reload anyway
@@ -403,6 +408,7 @@ export const organizationLogic = kea<organizationLogicType>([
},
deleteOrganization: async ({ organizationId, redirectPath }) => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. destroy() from 'products/platform_features/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
await api.delete(`api/organizations/${organizationId}`)
actions.deleteOrganizationSuccess({ redirectPath })
} catch (e) {
diff --git a/frontend/src/scenes/project-homepage/projectHomepageLogic.tsx b/frontend/src/scenes/project-homepage/projectHomepageLogic.tsx
index 1d03701baa7c..c5cb7c2e6038 100644
--- a/frontend/src/scenes/project-homepage/projectHomepageLogic.tsx
+++ b/frontend/src/scenes/project-homepage/projectHomepageLogic.tsx
@@ -72,6 +72,7 @@ export const projectHomepageLogic = kea<projectHomepageLogicType>([
[] as InsightModel[],
{
loadRecentInsights: async () => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. insightsMyLastViewedRetrieve() from 'products/product_analytics/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
const insights = await api.get<InsightModel[]>(
`api/projects/${values.currentProjectId}/insights/my_last_viewed`
)
diff --git a/frontend/src/scenes/projectLogic.ts b/frontend/src/scenes/projectLogic.ts
index 8570d909613a..2c4bee70c9a1 100644
--- a/frontend/src/scenes/projectLogic.ts
+++ b/frontend/src/scenes/projectLogic.ts
@@ -220,6 +220,7 @@ export const projectLogic = kea<projectLogicType>([
return null
}
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
return await api.get('api/projects/@current')
} catch {
return values.currentProject
@@ -230,6 +231,7 @@ export const projectLogic = kea<projectLogicType>([
throw new Error('Current project has not been loaded yet, so it cannot be updated!')
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use organizationsProjectsPartialUpdate() from '~/generated/core/api' instead.
const patchedProject = await api.update<ProjectType>(
`api/projects/${values.currentProject.id}`,
payload
@@ -262,6 +264,7 @@ export const projectLogic = kea<projectLogicType>([
// Let failures (e.g. a 403 for non-admins) propagate: kea-loaders surfaces the API
// error toast and clears the loading state, and createProjectSuccess never fires — so we
// don't switch into a project that wasn't created or leave the modal stuck open.
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
return await api.create('api/projects/', { name })
},
cancelProjectDeletion: async () => {
@@ -282,10 +285,12 @@ export const projectLogic = kea<projectLogicType>([
null as ProjectType | null,
{
moveProject: async ({ project, organizationId }) => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. organizationsProjectsChangeOrganizationCreate() from '~/generated/core/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
const res = await api.create<ProjectType>(`api/projects/${project.id}/change_organization`, {
organization_id: organizationId,
})
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use usersPartialUpdate() from '~/generated/core/api' instead.
await api.update('api/users/@me/', { set_current_organization: organizationId })
return res
@@ -329,6 +334,7 @@ export const projectLogic = kea<projectLogicType>([
},
deleteProject: async ({ project }) => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. organizationsProjectsDestroy() from '~/generated/core/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
await api.delete(`api/projects/${project.id}`)
actions.deleteProjectSuccess()
} catch (e) {
diff --git a/frontend/src/scenes/resource-transfer/resourceTransferLogic.ts b/frontend/src/scenes/resource-transfer/resourceTransferLogic.ts
index 9da28ff53ac9..6f525f65a0b4 100644
--- a/frontend/src/scenes/resource-transfer/resourceTransferLogic.ts
+++ b/frontend/src/scenes/resource-transfer/resourceTransferLogic.ts
@@ -192,6 +192,7 @@ export const resourceTransferLogic = kea<resourceTransferLogicType>([
throw new Error('Missing required fields for preview')
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
return await api.create<PreviewResponse>(
`api/organizations/${currentOrganization.id}/resource_transfers/preview/`,
{
@@ -213,6 +214,7 @@ export const resourceTransferLogic = kea<resourceTransferLogicType>([
throw new Error('Missing required fields for transfer')
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
return await api.create<TransferResponse>(
`api/organizations/${currentOrganization.id}/resource_transfers/transfer/`,
{
diff --git a/frontend/src/scenes/resource-transfer/resourceTransferRowLogic.ts b/frontend/src/scenes/resource-transfer/resourceTransferRowLogic.ts
index 33782c55e2fb..ad89e43e91ed 100644
--- a/frontend/src/scenes/resource-transfer/resourceTransferRowLogic.ts
+++ b/frontend/src/scenes/resource-transfer/resourceTransferRowLogic.ts
@@ -95,6 +95,7 @@ export const resourceTransferRowLogic = kea<resourceTransferRowLogicType>([
throw new Error('Missing required fields for search')
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
return await api.create<SearchResponse>(
`api/organizations/${currentOrganization.id}/resource_transfers/search/`,
{
diff --git a/frontend/src/scenes/saved-insights/addSavedInsightsModalLogic.ts b/frontend/src/scenes/saved-insights/addSavedInsightsModalLogic.ts
index c2e236f4c322..ea8f5d74a1cf 100644
--- a/frontend/src/scenes/saved-insights/addSavedInsightsModalLogic.ts
+++ b/frontend/src/scenes/saved-insights/addSavedInsightsModalLogic.ts
@@ -266,6 +266,7 @@ export const addSavedInsightsModalLogic = kea<addSavedInsightsModalLogicType>([
params.tags = JSON.stringify(tags)
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use insightsList() from 'products/product_analytics/frontend/generated/api' instead.
const response = await api.get(
`api/projects/${teamLogic.values.currentTeamId}/insights/?${toParams(params)}`
)
@@ -281,6 +282,7 @@ export const addSavedInsightsModalLogic = kea<addSavedInsightsModalLogicType>([
userInsights: {
__default: { count: 0 },
loadUserInsights: async () => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use insightsList() from 'products/product_analytics/frontend/generated/api' instead.
const response = await api.get(
`api/projects/${teamLogic.values.currentTeamId}/insights/?${toParams({
user: true,
diff --git a/frontend/src/scenes/saved-insights/savedInsightsLogic.ts b/frontend/src/scenes/saved-insights/savedInsightsLogic.ts
index 884461718170..49f4035b13f8 100644
--- a/frontend/src/scenes/saved-insights/savedInsightsLogic.ts
+++ b/frontend/src/scenes/saved-insights/savedInsightsLogic.ts
@@ -410,6 +410,7 @@ export const savedInsightsLogic = kea<savedInsightsLogicType>([
basic: true,
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use insightsList() from 'products/product_analytics/frontend/generated/api' instead.
const legacyResponse: CountedPaginatedResponse<InsightModel> = await api.get(
`api/projects/${teamLogic.values.currentTeamId}/insights/?${toParams(params)}`
)
@@ -467,6 +468,7 @@ export const savedInsightsLogic = kea<savedInsightsLogicType>([
null as InsightBulkDeleteResponseApi | null,
{
bulkDeleteInsights: async ({ ids }: { ids: number[] }) => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use insightsBulkDeleteCreate() from 'products/product_analytics/frontend/generated/api' instead.
return (await api.create(`api/projects/${values.currentTeamId}/insights/bulk_delete/`, {
ids,
})) as InsightBulkDeleteResponseApi
@@ -477,6 +479,7 @@ export const savedInsightsLogic = kea<savedInsightsLogicType>([
null as InsightBulkRestoreResponseApi | null,
{
bulkRestoreInsights: async ({ ids }: { ids: number[] }) => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use insightsBulkRestoreCreate() from 'products/product_analytics/frontend/generated/api' instead.
return (await api.create(`api/projects/${values.currentTeamId}/insights/bulk_restore/`, {
ids,
})) as InsightBulkRestoreResponseApi
diff --git a/frontend/src/scenes/sceneLogic.tsx b/frontend/src/scenes/sceneLogic.tsx
index 2cc52d5434b1..e068725df3fb 100644
--- a/frontend/src/scenes/sceneLogic.tsx
+++ b/frontend/src/scenes/sceneLogic.tsx
@@ -705,6 +705,7 @@ export const sceneLogic = kea<sceneLogicType>([
if (isSharedView()) {
return
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use userHomeSettingsPartialUpdate() from 'products/platform_features/frontend/generated/api' instead.
api.update('api/user_home_settings/@me/', {
homepage: tab ? tabToPersistableSnapshot(tab) : null,
}).catch((error) => {
diff --git a/frontend/src/scenes/settings/environment/coreEventsLogic.ts b/frontend/src/scenes/settings/environment/coreEventsLogic.ts
index b9ac5ffc41b3..e405f5228a9f 100644
--- a/frontend/src/scenes/settings/environment/coreEventsLogic.ts
+++ b/frontend/src/scenes/settings/environment/coreEventsLogic.ts
@@ -109,6 +109,7 @@ export const coreEventsLogic = kea<coreEventsLogicType>([
return []
}
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use coreEventsList() from 'products/core_events/frontend/generated/api' instead.
const response = await api.get(`api/projects/${values.currentTeamId}/core_events/`)
const events = (response.results || []).map(toCoreEvent)
actions.setCoreEvents(events)
@@ -128,6 +129,7 @@ export const coreEventsLogic = kea<coreEventsLogicType>([
return
}
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use coreEventsCreate() from 'products/core_events/frontend/generated/api' instead.
await api.create(`api/projects/${values.currentTeamId}/core_events/`, event)
actions.loadCoreEvents()
lemonToast.success('Core event added')
@@ -140,6 +142,7 @@ export const coreEventsLogic = kea<coreEventsLogicType>([
return
}
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use coreEventsPartialUpdate() from 'products/core_events/frontend/generated/api' instead.
await api.update(`api/projects/${values.currentTeamId}/core_events/${event.id}/`, event)
actions.loadCoreEvents()
lemonToast.success('Core event updated')
@@ -152,6 +155,7 @@ export const coreEventsLogic = kea<coreEventsLogicType>([
return
}
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. coreEventsDestroy() from 'products/core_events/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
await api.delete(`api/projects/${values.currentTeamId}/core_events/${eventId}/`)
actions.loadCoreEvents()
lemonToast.success('Core event removed')
diff --git a/frontend/src/scenes/settings/environment/experimentsConfigLogic.ts b/frontend/src/scenes/settings/environment/experimentsConfigLogic.ts
index 56e90277d7d8..67abfae79ec0 100644
--- a/frontend/src/scenes/settings/environment/experimentsConfigLogic.ts
+++ b/frontend/src/scenes/settings/environment/experimentsConfigLogic.ts
@@ -77,6 +77,7 @@ export const experimentsConfigLogic = kea<experimentsConfigLogicType>([
null as ExperimentsConfig | null,
{
loadExperimentsConfig: async (): Promise<ExperimentsConfig> => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. organizationsProjectsExperimentsConfigRetrieve() from '~/generated/core/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
return await api.get(`api/projects/${values.currentTeamId}/experiments_config/`)
},
},
@@ -104,6 +105,7 @@ export const experimentsConfigLogic = kea<experimentsConfigLogicType>([
listeners(({ actions, values }) => ({
updateExperimentsConfig: async ({ payload }) => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. organizationsProjectsExperimentsConfigPartialUpdate() from '~/generated/core/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
await api.update(`api/projects/${values.currentTeamId}/experiments_config/`, payload)
} catch (error: any) {
lemonToast.error(error.data?.detail || 'Failed to update experiment settings. Please try again.')
diff --git a/frontend/src/scenes/settings/environment/jsSnippetVersionPinLogic.ts b/frontend/src/scenes/settings/environment/jsSnippetVersionPinLogic.ts
index fded41d35a1c..783c18d0eb77 100644
--- a/frontend/src/scenes/settings/environment/jsSnippetVersionPinLogic.ts
+++ b/frontend/src/scenes/settings/environment/jsSnippetVersionPinLogic.ts
@@ -79,6 +79,7 @@ export const jsSnippetVersionPinLogic = kea<jsSnippetVersionPinLogicType>([
if (!teamId) {
return null
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
return await api.get(`api/projects/${teamId}/js-snippet/version`)
},
saveVersionPin: async ({ pin }: { pin: string | null }) => {
@@ -86,6 +87,7 @@ export const jsSnippetVersionPinLogic = kea<jsSnippetVersionPinLogicType>([
if (!teamId) {
return null
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const response = await api.update(`api/projects/${teamId}/js-snippet/version`, {
js_snippet_version: pin,
})
diff --git a/frontend/src/scenes/settings/environment/pathCleaningSuggestionsLogic.ts b/frontend/src/scenes/settings/environment/pathCleaningSuggestionsLogic.ts
index 42b42d1a934d..58e50296d85c 100644
--- a/frontend/src/scenes/settings/environment/pathCleaningSuggestionsLogic.ts
+++ b/frontend/src/scenes/settings/environment/pathCleaningSuggestionsLogic.ts
@@ -199,6 +199,7 @@ export const pathCleaningSuggestionsLogic = kea<pathCleaningSuggestionsLogicType
}
// Suggestions are stored as health issues; the newest active, non-dismissed one is
// the actionable suggestion.
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const response = await api.get<{ results: HealthIssueRecord[] }>(
`api/projects/${values.currentTeamId}/health_issues/?kind=${PATH_CLEANING_SUGGESTIONS_KIND}&status=active&dismissed=false`
)
@@ -281,6 +282,7 @@ export const pathCleaningSuggestionsLogic = kea<pathCleaningSuggestionsLogicType
return
}
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.update(`api/projects/${values.currentTeamId}/health_issues/${id}/`, { dismissed: true })
} catch {
actions.unhandleSuggestion(id)
diff --git a/frontend/src/scenes/settings/organization/Approvals/approvalPoliciesLogic.tsx b/frontend/src/scenes/settings/organization/Approvals/approvalPoliciesLogic.tsx
index 66300e1e2fe5..35d7ee41126f 100644
--- a/frontend/src/scenes/settings/organization/Approvals/approvalPoliciesLogic.tsx
+++ b/frontend/src/scenes/settings/organization/Approvals/approvalPoliciesLogic.tsx
@@ -75,6 +75,7 @@ export const approvalPoliciesLogic = kea<approvalPoliciesLogicType>([
if (!teamId || !values.hasAvailableFeature(AvailableFeature.APPROVALS)) {
return []
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use approvalPoliciesList() from 'products/platform_features/frontend/generated/api' instead.
const response = await api.get<{ results: ApprovalPolicy[] }>(
`api/projects/${teamId}/approval_policies/`
)
@@ -97,6 +98,7 @@ export const approvalPoliciesLogic = kea<approvalPoliciesLogicType>([
if (!teamId) {
throw new Error('No team selected')
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use approvalPoliciesCreate() from 'products/platform_features/frontend/generated/api' instead.
await api.create(`api/projects/${teamId}/approval_policies/`, policy)
lemonToast.success('Approval policy created')
actions.loadPolicies()
@@ -110,6 +112,7 @@ export const approvalPoliciesLogic = kea<approvalPoliciesLogicType>([
if (!teamId) {
throw new Error('No team selected')
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use approvalPoliciesPartialUpdate() from 'products/platform_features/frontend/generated/api' instead.
await api.update(`api/projects/${teamId}/approval_policies/${id}/`, policy)
lemonToast.success('Approval policy updated')
actions.loadPolicies()
@@ -123,6 +126,7 @@ export const approvalPoliciesLogic = kea<approvalPoliciesLogicType>([
if (!teamId) {
throw new Error('No team selected')
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. approvalPoliciesDestroy() from 'products/platform_features/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
await api.delete(`api/projects/${teamId}/approval_policies/${id}/`)
lemonToast.success('Approval policy deleted')
actions.loadPolicies()
diff --git a/frontend/src/scenes/settings/organization/VerifiedDomains/verifiedDomainImpactLogic.ts b/frontend/src/scenes/settings/organization/VerifiedDomains/verifiedDomainImpactLogic.ts
index efadf0195685..646b262f0544 100644
--- a/frontend/src/scenes/settings/organization/VerifiedDomains/verifiedDomainImpactLogic.ts
+++ b/frontend/src/scenes/settings/organization/VerifiedDomains/verifiedDomainImpactLogic.ts
@@ -209,6 +209,7 @@ export const verifiedDomainImpactLogic = kea<verifiedDomainImpactLogicType>([
null as EnforcementRemovalResult | null,
{
confirmEnforceVerifiedDomains: async () => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use removeBlockedMembersAndEnforceVerifiedDomainsCreate() from 'products/platform_features/frontend/generated/api' instead.
return await api.create<EnforcementRemovalResult>(
`api/organizations/${values.currentOrganization?.id}/remove_blocked_members_and_enforce_verified_domains`
)
diff --git a/frontend/src/scenes/settings/organization/VerifiedDomains/verifiedDomainsLogic.ts b/frontend/src/scenes/settings/organization/VerifiedDomains/verifiedDomainsLogic.ts
index 452f568ab3ae..1f78a37250c0 100644
--- a/frontend/src/scenes/settings/organization/VerifiedDomains/verifiedDomainsLogic.ts
+++ b/frontend/src/scenes/settings/organization/VerifiedDomains/verifiedDomainsLogic.ts
@@ -67,6 +67,7 @@ async function refreshDomain(
domainId: string,
replaceDomain: (domain: OrganizationDomainType) => void
): Promise<OrganizationDomainType> {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use domainsRetrieve() from '~/generated/core/api' instead.
const domain = await api.get<OrganizationDomainType>(`api/organizations/${organizationId}/domains/${domainId}`)
replaceDomain(domain)
return domain
@@ -863,9 +864,11 @@ export const verifiedDomainsLogic = kea<verifiedDomainsLogicType>([
[] as OrganizationDomainType[],
{
loadVerifiedDomains: async () =>
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use domainsList() from '~/generated/core/api' instead.
(await api.get(`api/organizations/${values.currentOrganizationId}/domains`))
.results as OrganizationDomainType[],
addVerifiedDomain: async (domain: string) => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use domainsCreate() from '~/generated/core/api' instead.
const response = await api.create<OrganizationDomainType>(
`api/organizations/${values.currentOrganizationId}/domains`,
{
@@ -892,6 +895,7 @@ export const verifiedDomainsLogic = kea<verifiedDomainsLogicType>([
false,
{
updateDomain: async (payload: OrganizationDomainUpdatePayload) => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use domainsPartialUpdate() from '~/generated/core/api' instead.
const response = await api.update<OrganizationDomainType>(
`api/organizations/${values.currentOrganizationId}/domains/${payload.id}`,
{ ...payload, id: undefined }
@@ -901,6 +905,7 @@ export const verifiedDomainsLogic = kea<verifiedDomainsLogicType>([
return false
},
verifyDomain: async () => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. domainsVerifyCreate() from '~/generated/core/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
const response = await api.create<OrganizationDomainType>(
`api/organizations/${values.currentOrganizationId}/domains/${values.verifyModal}/verify`
)
diff --git a/frontend/src/scenes/settings/organization/inviteLogic.ts b/frontend/src/scenes/settings/organization/inviteLogic.ts
index 28a5d345cc22..ace24b36e416 100644
--- a/frontend/src/scenes/settings/organization/inviteLogic.ts
+++ b/frontend/src/scenes/settings/organization/inviteLogic.ts
@@ -224,6 +224,7 @@ export const inviteLogic = kea<inviteLogicType>([
// Inviting members is a sensitive action; if re-authentication is required,
// await its completion so the invite resumes once the user re-authenticates.
await timeSensitiveAuthenticationLogic.findMounted()?.asyncActions.checkReauthentication()
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. invitesBulkCreate() from '~/generated/core/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
return await api.create<OrganizationInviteType[]>(
`api/organizations/${organizationLogic.values.currentOrganizationId}/invites/bulk/`,
payload
@@ -236,6 +237,7 @@ export const inviteLogic = kea<inviteLogicType>([
{
loadProjectAccessControl: async (projectId: number) => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const accessControls = await api.get(`api/projects/${projectId}/access_controls`)
// Look for project-level access control (resource: "project", organization_member: null, role: null)
const projectAccessControl = accessControls.access_controls?.find(
@@ -262,13 +264,14 @@ export const inviteLogic = kea<inviteLogicType>([
loadInvites: async () => {
return organizationLogic.values.currentOrganization
? (
- await api.get<PaginatedResponse<OrganizationInviteType>>(
+ await api.get<PaginatedResponse<OrganizationInviteType>>( // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
`api/organizations/${organizationLogic.values.currentOrganizationId}/invites/`
)
).results
: []
},
deleteInvite: async (invite: OrganizationInviteType) => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. invitesDestroy() from '~/generated/core/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
await api.delete(
`api/organizations/${organizationLogic.values.currentOrganizationId}/invites/${invite.id}/`
)
diff --git a/frontend/src/scenes/settings/organization/organizationPersonalAPIKeysLogic.ts b/frontend/src/scenes/settings/organization/organizationPersonalAPIKeysLogic.ts
index 8ff7a37d9c68..9288b756402a 100644
--- a/frontend/src/scenes/settings/organization/organizationPersonalAPIKeysLogic.ts
+++ b/frontend/src/scenes/settings/organization/organizationPersonalAPIKeysLogic.ts
@@ -63,6 +63,7 @@ export const organizationPersonalAPIKeysLogic = kea<organizationPersonalAPIKeysL
loadKeys: async () => {
// Page through everything — an incomplete list would be a security-audit blind spot.
const url = getPersonalApiKeysListUrl(ApiConfig.getCurrentOrganizationId())
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
return await api.loadPaginatedResults<OrganizationPersonalAPIKeyApi>(url)
},
},
diff --git a/frontend/src/scenes/settings/user/changePasswordLogic.ts b/frontend/src/scenes/settings/user/changePasswordLogic.ts
index 5da10d085c29..50866c15101c 100644
--- a/frontend/src/scenes/settings/user/changePasswordLogic.ts
+++ b/frontend/src/scenes/settings/user/changePasswordLogic.ts
@@ -139,6 +139,7 @@ export const changePasswordLogic = kea<changePasswordLogicType>([
const hasPassword = values.user?.has_password ?? false
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use usersPartialUpdate() from '~/generated/core/api' instead.
await api.update('api/users/@me/', {
password,
...(hasPassword ? { current_password } : {}),
@@ -170,6 +171,7 @@ export const changePasswordLogic = kea<changePasswordLogicType>([
return false
}
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.create('api/reset/', { email })
return true
} catch (e: any) {
diff --git a/frontend/src/scenes/settings/user/connectedAppsLogic.ts b/frontend/src/scenes/settings/user/connectedAppsLogic.ts
index ad0267798ccb..7a51fa0cdbfc 100644
--- a/frontend/src/scenes/settings/user/connectedAppsLogic.ts
+++ b/frontend/src/scenes/settings/user/connectedAppsLogic.ts
@@ -74,10 +74,12 @@ export const connectedAppsLogic = kea<connectedAppsLogicType>([
[] as ConnectedApp[],
{
loadConnectedApps: async () => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
return await api.get('api/oauth/connected-apps/')
},
revokeApp: async ({ id }, breakpoint) => {
const remainingApps = values.connectedApps.filter((app) => app.id !== id)
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.create(`api/oauth/connected-apps/${id}/revoke/`)
breakpoint()
lemonToast.success('App access revoked')
diff --git a/frontend/src/scenes/settings/user/emailChangeVerificationLogic.ts b/frontend/src/scenes/settings/user/emailChangeVerificationLogic.ts
index b7c3fef7709d..849512926907 100644
--- a/frontend/src/scenes/settings/user/emailChangeVerificationLogic.ts
+++ b/frontend/src/scenes/settings/user/emailChangeVerificationLogic.ts
@@ -191,6 +191,7 @@ export const emailChangeVerificationLogic = kea<emailChangeVerificationLogicType
return null
}
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. usersVerifyEmailCreate() from '~/generated/core/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
await api.create(`api/users/verify_email/`, { uuid, code })
actions.closeModal()
lemonToast.success('Email address verified.')
@@ -212,6 +213,7 @@ export const emailChangeVerificationLogic = kea<emailChangeVerificationLogicType
return null
}
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. usersRequestEmailVerificationCreate() from '~/generated/core/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
await api.create(`api/users/request_email_verification/`, { uuid })
lemonToast.success('We sent a new code to the address pending verification.')
return true
diff --git a/frontend/src/scenes/settings/user/passkeySettingsLogic.ts b/frontend/src/scenes/settings/user/passkeySettingsLogic.ts
index 1e362eb846be..8b2927b18e2e 100644
--- a/frontend/src/scenes/settings/user/passkeySettingsLogic.ts
+++ b/frontend/src/scenes/settings/user/passkeySettingsLogic.ts
@@ -278,15 +278,18 @@ export const passkeySettingsLogic = kea<passkeySettingsLogicType>([
[] as PasskeyCredential[],
{
loadPasskeys: async () => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const response = await api.get<PasskeyCredential[]>('api/webauthn/credentials/')
return response
},
deletePasskey: async ({ id }) => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.delete(`api/webauthn/credentials/${id}/`)
lemonToast.success('Passkey deleted')
return values.passkeys.filter((p: PasskeyCredential) => p.id !== id)
},
renamePasskey: async ({ id, label }) => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const updated = await api.update<PasskeyCredential>(`api/webauthn/credentials/${id}/`, { label })
lemonToast.success('Passkey renamed')
return values.passkeys.map((p: PasskeyCredential) => (p.id === id ? updated : p))
@@ -294,6 +297,7 @@ export const passkeySettingsLogic = kea<passkeySettingsLogicType>([
verifyPasskey: async ({ id }) => {
try {
// Step 1: Begin verification
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const verifyResponse = await api.create<VerificationBeginResponse>(
`api/webauthn/credentials/${id}/verify`
)
@@ -310,6 +314,7 @@ export const passkeySettingsLogic = kea<passkeySettingsLogicType>([
})
// Step 3: Complete verification
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const updated = await api.create<PasskeyCredential>(
`api/webauthn/credentials/${id}/verify_complete`,
assertion
@@ -330,6 +335,7 @@ export const passkeySettingsLogic = kea<passkeySettingsLogicType>([
beginRegistration: async ({ label }) => {
try {
// Step 1: Get registration options
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const beginResponse = await api.create<RegistrationBeginResponse>('api/webauthn/register/begin')
// Step 2: Create credential with authenticator
@@ -348,6 +354,7 @@ export const passkeySettingsLogic = kea<passkeySettingsLogicType>([
})
// Step 3: Send attestation to server
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const { credential_id: credentialId } = await api.create<RegistrationCompleteResponse>(
'api/webauthn/register/complete',
{
@@ -362,6 +369,7 @@ export const passkeySettingsLogic = kea<passkeySettingsLogicType>([
// Step 4: Begin verification
actions.setRegistrationStep('verifying')
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const verifyResponse = await api.create<VerificationBeginResponse>(
`api/webauthn/credentials/${credentialId}/verify`
)
@@ -378,6 +386,7 @@ export const passkeySettingsLogic = kea<passkeySettingsLogicType>([
})
// Step 6: Complete verification
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.create(`api/webauthn/credentials/${credentialId}/verify_complete`, assertion)
actions.setRegistrationStep('complete')
diff --git a/frontend/src/scenes/settings/user/personalAPIKeysLogic.tsx b/frontend/src/scenes/settings/user/personalAPIKeysLogic.tsx
index b193943b41f5..aaa265d5c5e2 100644
--- a/frontend/src/scenes/settings/user/personalAPIKeysLogic.tsx
+++ b/frontend/src/scenes/settings/user/personalAPIKeysLogic.tsx
@@ -344,6 +344,7 @@ export const personalAPIKeysLogic = kea<personalAPIKeysLogicType>([
null as TeamBasicType[] | null,
{
loadAllTeams: async () => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
return await api.loadPaginatedResults('api/projects')
},
},
diff --git a/frontend/src/scenes/settings/user/personalIntegrationsLogic.ts b/frontend/src/scenes/settings/user/personalIntegrationsLogic.ts
index c4a96c7b0b9e..3fa8394f0721 100644
--- a/frontend/src/scenes/settings/user/personalIntegrationsLogic.ts
+++ b/frontend/src/scenes/settings/user/personalIntegrationsLogic.ts
@@ -261,6 +261,7 @@ export const personalIntegrationsLogic = kea<personalIntegrationsLogicType>([
// paginated schema, so the generated helper would mis-type the
// response — call `api.get` directly until the backend serializer
// is decorated to bypass pagination.
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use usersIntegrationsList() from '~/generated/core/api' instead.
const response = await api.get<{ results: PersonalGitHubIntegration[] }>(
'api/users/@me/integrations/'
)
@@ -272,6 +273,7 @@ export const personalIntegrationsLogic = kea<personalIntegrationsLogicType>([
[] as PersonalSlackIntegration[],
{
loadSlackIntegrations: async () => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use usersIntegrationsList() from '~/generated/core/api' instead.
const response = await api.get<{ results: PersonalSlackIntegration[] }>(
'api/users/@me/integrations/?kind=slack'
)
diff --git a/frontend/src/scenes/settings/user/pipelineNotificationsLogic.ts b/frontend/src/scenes/settings/user/pipelineNotificationsLogic.ts
index 1d55efb668c6..b32c5e17e367 100644
--- a/frontend/src/scenes/settings/user/pipelineNotificationsLogic.ts
+++ b/frontend/src/scenes/settings/user/pipelineNotificationsLogic.ts
@@ -121,6 +121,7 @@ export const pipelineNotificationsLogic = kea<pipelineNotificationsLogicType>([
)
const hfs: HogFunctionMinimalApi[] = [
...initial.results,
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
...(await api.loadPaginatedResults<HogFunctionMinimalApi>(initial.next ?? null)),
]
for (const hf of hfs) {
@@ -136,6 +137,7 @@ export const pipelineNotificationsLogic = kea<pipelineNotificationsLogicType>([
console.warn(`Failed to load hog functions for team ${team.id}`, e)
}
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const pcs = await api.loadPaginatedResults<PluginDestinationConfig>(
`api/projects/${team.id}/pipeline_destination_configs/?limit=100`
)
@@ -157,6 +159,7 @@ export const pipelineNotificationsLogic = kea<pipelineNotificationsLogicType>([
})
const bes: BatchExportApi[] = [
...initial.results,
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
...(await api.loadPaginatedResults<BatchExportApi>(initial.next ?? null)),
]
for (const be of bes) {
diff --git a/frontend/src/scenes/settings/user/userDangerZoneLogic.ts b/frontend/src/scenes/settings/user/userDangerZoneLogic.ts
index b753bf5a7d02..44bfe4b8b732 100644
--- a/frontend/src/scenes/settings/user/userDangerZoneLogic.ts
+++ b/frontend/src/scenes/settings/user/userDangerZoneLogic.ts
@@ -70,6 +70,7 @@ export const userDangerZoneLogic = kea<userDangerZoneLogicType>({
null,
{
leaveOrganization: async (organizationId: string) => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. membersDestroy() from 'products/platform_features/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
await api.delete(`api/organizations/${organizationId}/members/@me/`)
return null
diff --git a/frontend/src/scenes/startups/startupProgramLogic.ts b/frontend/src/scenes/startups/startupProgramLogic.ts
index 449e552e0bf5..a855009035e2 100644
--- a/frontend/src/scenes/startups/startupProgramLogic.ts
+++ b/frontend/src/scenes/startups/startupProgramLogic.ts
@@ -407,6 +407,7 @@ export const startupProgramLogic = kea<startupProgramLogicType>([
}
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. billingStartupsApplyCreate() from 'products/billing/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
await api.create('api/billing/startups/apply', valuesToSubmit)
actions.setFormSubmitted(true)
// The verification link is bearer proof of YC founder status, so it stays out of analytics
diff --git a/frontend/src/scenes/surveys/surveyLogic.tsx b/frontend/src/scenes/surveys/surveyLogic.tsx
index 73c316f26d89..6a4fc819e8f1 100644
--- a/frontend/src/scenes/surveys/surveyLogic.tsx
+++ b/frontend/src/scenes/surveys/surveyLogic.tsx
@@ -2119,6 +2119,7 @@ export const surveyLogic = kea<surveyLogicType>([
for (let i = 0; i < allIds.length; i += BATCH_SIZE) {
const batch = allIds.slice(i, i + BATCH_SIZE)
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. personsBatchByDistinctIdsCreate() from 'products/persons/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
const response = await api.create(`api/projects/${teamId}/persons/batch_by_distinct_ids/`, {
distinct_ids: batch,
})
diff --git a/frontend/src/scenes/teamLogic.tsx b/frontend/src/scenes/teamLogic.tsx
index 6658657a2f80..49f2c13aecad 100644
--- a/frontend/src/scenes/teamLogic.tsx
+++ b/frontend/src/scenes/teamLogic.tsx
@@ -94,6 +94,7 @@ export async function completeProductOnboarding(
teamId: TeamType['id'] | string,
{ product_type, intent_context }: ProductOnboardingCompleteProperties
): Promise<TeamType | null> {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. organizationsProjectsCompleteProductOnboardingPartialUpdate() from '~/generated/core/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
return await api.update(`api/projects/${teamId}/complete_product_onboarding`, {
product_type,
intent_context,
@@ -383,6 +384,7 @@ export const teamLogic = kea<teamLogicType>([
}
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
return await api.get('api/projects/@current')
} catch {
return values.currentTeam
@@ -390,6 +392,7 @@ export const teamLogic = kea<teamLogicType>([
},
refreshCurrentTeam: async () => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const team = await api.get('api/projects/@current')
return team?.id === values.currentTeam?.id ? team : values.currentTeam
} catch {
@@ -413,6 +416,7 @@ export const teamLogic = kea<teamLogicType>([
if (Object.keys(payload).length === 1 && payload.name && values.currentTeam.project_id) {
// Renames go through the project id, because that mirrors the name onto the
// passthrough team server-side. Every other patch goes through the team id.
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use organizationsProjectsPartialUpdate() from '~/generated/core/api' instead.
const patchedProject = await api.update<ProjectType>(
`api/projects/${values.currentTeam.project_id}`,
{ name: payload.name }
@@ -422,6 +426,7 @@ export const teamLogic = kea<teamLogicType>([
actions.loadCurrentProjectSuccess(patchedProject)
patchedTeam = { ...values.currentTeam, name: patchedProject.name }
} else {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use organizationsProjectsPartialUpdate() from '~/generated/core/api' instead.
patchedTeam = await api.update(`api/projects/${values.currentTeam.id}`, payload)
breakpoint()
}
@@ -496,14 +501,18 @@ export const teamLogic = kea<teamLogicType>([
'Environment could not be created, because the parent project has not been loaded yet!'
)
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
return await api.create(`api/projects/${values.currentProject.id}/environments/`, { name, is_demo })
},
// Project API Token
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. organizationsProjectsResetTokenPartialUpdate() from '~/generated/core/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
resetToken: async () => await api.update(`api/projects/${values.currentTeamId}/reset_token`, {}),
// Feature Flags Secure API Token
rotateSecretToken: async () =>
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. organizationsProjectsRotateSecretTokenPartialUpdate() from '~/generated/core/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
await api.update(`api/projects/${values.currentTeamId}/rotate_secret_token`, {}),
deleteSecretTokenBackup: async () =>
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. organizationsProjectsDeleteSecretTokenBackupPartialUpdate() from '~/generated/core/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
await api.update(`api/projects/${values.currentTeamId}/delete_secret_token_backup`, {}),
/**
* If adding a product intent that also represents regular product usage, see explainer in posthog.models.product_intent.product_intent.py.
@@ -674,6 +683,7 @@ export const teamLogic = kea<teamLogicType>([
},
deleteTeam: async ({ team }) => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. organizationsProjectsDestroy() from '~/generated/core/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
await api.delete(`api/projects/${team.id}`)
location.reload()
actions.deleteTeamSuccess()
diff --git a/frontend/src/scenes/trends/persons-modal/personsModalLogic.ts b/frontend/src/scenes/trends/persons-modal/personsModalLogic.ts
index d105c8a6e3e5..c72903ebbb8f 100644
--- a/frontend/src/scenes/trends/persons-modal/personsModalLogic.ts
+++ b/frontend/src/scenes/trends/persons-modal/personsModalLogic.ts
@@ -353,6 +353,7 @@ export const personsModalLogic = kea<personsModalLogicType>([
}
}
if (url && !values.actorsQuery) {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
const res = await api.get(url)
breakpoint()
@@ -541,6 +542,7 @@ export const personsModalLogic = kea<personsModalLogicType>([
is_static: true,
name: cohortName,
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use cohortsCreate() from 'products/cohorts/frontend/generated/api' instead.
const cohort = await api.create('api/cohort', { ...cohortParams, query: values.actorsQuery })
cohortsModel.actions.cohortCreated(cohort)
lemonToast.success('Cohort saved', {
diff --git a/frontend/src/scenes/userLogic.ts b/frontend/src/scenes/userLogic.ts
index 8f6966b29045..ed357060af3d 100644
--- a/frontend/src/scenes/userLogic.ts
+++ b/frontend/src/scenes/userLogic.ts
@@ -496,6 +496,7 @@ export const userLogic = kea<userLogicType>([
{
loadUser: async () => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use usersRetrieve() from '~/generated/core/api' instead.
return await api.get<UserType>('api/users/@me/')
} catch (error: any) {
console.error(error)
@@ -509,6 +510,7 @@ export const userLogic = kea<userLogicType>([
}
// Let failures throw so kea-loaders dispatches `updateUserFailure` — returning the old
// user here would be treated as a success, silently masking backend errors.
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use usersPartialUpdate() from '~/generated/core/api' instead.
const response = await api.update<UserType>('api/users/@me/', user)
successCallback?.()
return response
@@ -518,6 +520,7 @@ export const userLogic = kea<userLogicType>([
throw new Error('Current user has not been loaded yet, so it cannot be updated!')
}
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. usersCancelEmailChangeRequestPartialUpdate() from '~/generated/core/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
const response = await api.update<UserType>('api/users/cancel_email_change_request/', {})
lemonToast.success('The email change request was cancelled successfully.')
return response
@@ -530,6 +533,7 @@ export const userLogic = kea<userLogicType>([
}
},
deleteUser: async () => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. usersDestroy() from '~/generated/core/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
return await api.delete('api/users/@me/').then(() => {
return null
})
@@ -539,6 +543,7 @@ export const userLogic = kea<userLogicType>([
throw new Error('Current user has not been loaded yet, so it cannot be updated!')
}
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. usersScenePersonalisationCreate() from '~/generated/core/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
return await api.create<UserType>('api/users/@me/scene_personalisation', {
scene,
dashboard,
@@ -551,6 +556,7 @@ export const userLogic = kea<userLogicType>([
},
upgradeImpersonation: async ({ reason }) => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call to a route outside /api/, with an unchecked response type. No generated function can cover it until the route is in the OpenAPI schema.
await api.create('admin/impersonation/upgrade/', { reason })
actions.loadUser()
lemonToast.success('Upgraded to read-write impersonation')
@@ -757,6 +763,7 @@ export const userLogic = kea<userLogicType>([
return
}
await breakpoint(10)
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use usersPartialUpdate() from '~/generated/core/api' instead.
await api.update('api/users/@me/', { set_current_organization: organizationId })
sidePanelStateLogic.findMounted()?.actions.closeSidePanel()
@@ -769,6 +776,7 @@ export const userLogic = kea<userLogicType>([
// Its own endpoint rather than a field on the user PATCH: that one needs a recently
// authenticated session, so a risk step-up would answer a dismissal with the re-auth modal.
// It also merges the key server-side, so two tabs can't drop each other's write.
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use usersProductIntroSeenPartialUpdate() from '~/generated/core/api' instead.
await api.update('api/users/@me/product_intro_seen', { product_key: productKey, seen: value })
actions.loadUser()
} catch (error: any) {
diff --git a/frontend/src/scenes/web-analytics/health/webAnalyticsHealthLogic.ts b/frontend/src/scenes/web-analytics/health/webAnalyticsHealthLogic.ts
index 986f1517a95d..fe2e36325d17 100644
--- a/frontend/src/scenes/web-analytics/health/webAnalyticsHealthLogic.ts
+++ b/frontend/src/scenes/web-analytics/health/webAnalyticsHealthLogic.ts
@@ -372,6 +372,7 @@ export const webAnalyticsHealthLogic = kea<webAnalyticsHealthLogicType>([
healthIssues: {
__default: null as HealthIssuesResponse | null,
loadHealthIssues: async (): Promise<HealthIssuesResponse> => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
return await api.get<HealthIssuesResponse>(
`api/projects/${values.currentTeamIdStrict}/health_issues/?status=active&dismissed=false`
)
@@ -552,6 +553,7 @@ export const webAnalyticsHealthLogic = kea<webAnalyticsHealthLogicType>([
})
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const response = await api.create<{
scheduled_kinds: string[]
kinds_failed: string[]
diff --git a/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/logic/marketingAnalyticsSettingsLogic.ts b/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/logic/marketingAnalyticsSettingsLogic.ts
index a1615310e949..83d735758d58 100644
--- a/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/logic/marketingAnalyticsSettingsLogic.ts
+++ b/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/logic/marketingAnalyticsSettingsLogic.ts
@@ -638,6 +638,7 @@ export const marketingAnalyticsSettingsLogic = kea<marketingAnalyticsSettingsLog
updateCampaignFieldPreferences: () => trackSettingsUpdated('campaign_field_preferences'),
testMapping: async ({ tableId, sourceMap }) => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. marketingAnalyticsTestMappingCreate() from 'products/marketing_analytics/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
const response = await api.create(
`api/projects/${values.currentTeamId}/marketing_analytics/test_mapping/`,
{ table_id: tableId, source_map: sourceMap }
diff --git a/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/logic/setupPlanLogic.ts b/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/logic/setupPlanLogic.ts
index 9e1a850824f8..4985fb271772 100644
--- a/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/logic/setupPlanLogic.ts
+++ b/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/logic/setupPlanLogic.ts
@@ -281,6 +281,7 @@ export const setupPlanLogic = kea<setupPlanLogicType>([
* ClickHouse queries. An explicit Rescan click is a request for
* current data and has to mean it, or the button looks broken. */
loadSetupPlan: async ({ refresh } = { refresh: false }) => {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const response = await api.get(
`api/projects/${values.currentTeamId}/marketing_analytics/setup_plan${
refresh ? '?refresh=true' : ''
@@ -595,6 +596,7 @@ export const setupPlanLogic = kea<setupPlanLogicType>([
}
posthog.capture('marketing analytics setup change submitted', properties)
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use marketingAnalyticsApplySetupOpsCreate() from 'products/marketing_analytics/frontend/generated/api' instead.
const response: ApplyResponse = await api.create(
`api/projects/${values.currentTeamId}/marketing_analytics/apply_setup_ops`,
{ ops, source: options.source }
diff --git a/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/logic/utmAuditLogic.ts b/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/logic/utmAuditLogic.ts
index ed1e5a43c2bf..1edeaa332c26 100644
--- a/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/logic/utmAuditLogic.ts
+++ b/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/logic/utmAuditLogic.ts
@@ -257,6 +257,7 @@ export const utmAuditLogic = kea<utmAuditLogicType>([
const params: Record<string, string> = {
date_from: '-30d',
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use marketingAnalyticsUtmAuditRetrieve() from 'products/marketing_analytics/frontend/generated/api' instead.
const response = await api.get(
`api/projects/${values.currentTeamId}/marketing_analytics/utm_audit`,
params
diff --git a/frontend/src/scenes/welcome/welcomeDialogLogic.ts b/frontend/src/scenes/welcome/welcomeDialogLogic.ts
index ec31926498f7..d4d483f39283 100644
--- a/frontend/src/scenes/welcome/welcomeDialogLogic.ts
+++ b/frontend/src/scenes/welcome/welcomeDialogLogic.ts
@@ -308,6 +308,7 @@ export const welcomeDialogLogic = kea<welcomeDialogLogicType>([
{
loadWelcomeData: async () => {
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use welcomeCurrentRetrieve() from 'products/platform_features/frontend/generated/api' instead.
return await api.get<WelcomePayload>('api/organizations/@current/welcome/current/')
} catch (error) {
const status =
diff --git a/products/actions/frontend/logics/actionEditLogic.tsx b/products/actions/frontend/logics/actionEditLogic.tsx
index c6642ae49b5a..11431b4b4fcb 100644
--- a/products/actions/frontend/logics/actionEditLogic.tsx
+++ b/products/actions/frontend/logics/actionEditLogic.tsx
@@ -359,7 +359,7 @@ export const actionEditLogic = kea<actionEditLogicType>([
if (!props.id) {
return []
}
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use actionsReferencesList() from 'products/actions/frontend/generated/api' instead.
const response = await api.get(`api/projects/@current/actions/${props.id}/references`)
return response
},
diff --git a/products/actions/frontend/utils/deleteAction.tsx b/products/actions/frontend/utils/deleteAction.tsx
index 9749ad024720..1b5cf48a0370 100644
--- a/products/actions/frontend/utils/deleteAction.tsx
+++ b/products/actions/frontend/utils/deleteAction.tsx
@@ -13,7 +13,7 @@ import type { ActionReferenceApi } from '../generated/api.schemas'
export async function deleteActionWithWarning(action: ActionType, callback: (undo: boolean) => void): Promise<void> {
let references: ActionReferenceApi[] = []
try {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use actionsReferencesList() from 'products/actions/frontend/generated/api' instead.
references = await api.get(`api/projects/@current/actions/${action.id}/references`)
} catch {
// If we can't fetch references, proceed with delete anyway
diff --git a/products/ai_observability/frontend/clusters/clusteringConfigLogic.ts b/products/ai_observability/frontend/clusters/clusteringConfigLogic.ts
index 7a544a5d01cd..4dbd8fb3e735 100644
--- a/products/ai_observability/frontend/clusters/clusteringConfigLogic.ts
+++ b/products/ai_observability/frontend/clusters/clusteringConfigLogic.ts
@@ -87,14 +87,14 @@ export const clusteringConfigLogic = kea<clusteringConfigLogicType>([
{ event_filters: [], created_at: '', updated_at: '' } as ClusteringConfig,
{
loadConfig: async () => {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use llmAnalyticsClusteringConfigList() from 'products/ai_observability/frontend/generated/api' instead.
const response = await api.get(
`api/projects/${values.currentTeamIdStrict}/llm_analytics/clustering_config/`
)
return response as ClusteringConfig
},
saveEventFilters: async () => {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. llmAnalyticsClusteringConfigSetEventFiltersCreate() from 'products/ai_observability/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
const response = await api.create(
`api/projects/${values.currentTeamIdStrict}/llm_analytics/clustering_config/set_event_filters/`,
{
diff --git a/products/ai_observability/frontend/clusters/clusteringJobsLogic.ts b/products/ai_observability/frontend/clusters/clusteringJobsLogic.ts
index 3d9d3650482d..52741235c410 100644
--- a/products/ai_observability/frontend/clusters/clusteringJobsLogic.ts
+++ b/products/ai_observability/frontend/clusters/clusteringJobsLogic.ts
@@ -106,21 +106,21 @@ export const clusteringJobsLogic = kea<clusteringJobsLogicType>([
[] as ClusteringJob[],
{
loadJobs: async () => {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use llmAnalyticsClusteringJobsList() from 'products/ai_observability/frontend/generated/api' instead.
const response = await api.get(
`api/projects/${values.currentTeamIdStrict}/llm_analytics/clustering_jobs/`
)
return (response.results ?? response) as ClusteringJob[]
},
createJob: async (payload: Partial<ClusteringJob>) => {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use llmAnalyticsClusteringJobsCreate() from 'products/ai_observability/frontend/generated/api' instead.
await api.create(
`api/projects/${values.currentTeamIdStrict}/llm_analytics/clustering_jobs/`,
payload
)
lemonToast.success('Clustering job created')
// Reload to get server-assigned fields
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use llmAnalyticsClusteringJobsList() from 'products/ai_observability/frontend/generated/api' instead.
const response = await api.get(
`api/projects/${values.currentTeamIdStrict}/llm_analytics/clustering_jobs/`
)
@@ -128,13 +128,13 @@ export const clusteringJobsLogic = kea<clusteringJobsLogicType>([
},
updateJob: async (payload: Partial<ClusteringJob> & { id: number }) => {
const { id, ...data } = payload
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use llmAnalyticsClusteringJobsPartialUpdate() from 'products/ai_observability/frontend/generated/api' instead.
await api.update(
`api/projects/${values.currentTeamIdStrict}/llm_analytics/clustering_jobs/${id}/`,
data
)
lemonToast.success('Clustering job updated')
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use llmAnalyticsClusteringJobsList() from 'products/ai_observability/frontend/generated/api' instead.
const response = await api.get(
`api/projects/${values.currentTeamIdStrict}/llm_analytics/clustering_jobs/`
)
@@ -167,7 +167,7 @@ export const clusteringJobsLogic = kea<clusteringJobsLogicType>([
},
deleteJob: async ({ jobId }) => {
try {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. llmAnalyticsClusteringJobsDestroy() from 'products/ai_observability/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
await api.delete(`api/projects/${values.currentTeamIdStrict}/llm_analytics/clustering_jobs/${jobId}/`)
lemonToast.success('Clustering job deleted')
posthog.capture('llma clustering job deleted', { job_id: jobId })
diff --git a/products/ai_observability/frontend/clusters/clustersAdminLogic.ts b/products/ai_observability/frontend/clusters/clustersAdminLogic.ts
index 29de08f742e4..0e7c4d0d84f5 100644
--- a/products/ai_observability/frontend/clusters/clustersAdminLogic.ts
+++ b/products/ai_observability/frontend/clusters/clustersAdminLogic.ts
@@ -149,7 +149,7 @@ export const clustersAdminLogic = kea<clustersAdminLogicType>([
null as ClusteringRunResponse | null,
{
triggerClusteringRun: async () => {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use llmAnalyticsClusteringRunsCreate() from 'products/ai_observability/frontend/generated/api' instead.
const response = await api.create(
`api/projects/${values.currentTeamIdStrict}/llm_analytics/clustering_runs`,
values.params
diff --git a/products/ai_observability/frontend/llmPersonsLazyLoaderLogic.ts b/products/ai_observability/frontend/llmPersonsLazyLoaderLogic.ts
index c1380def8f53..2154206f23f9 100644
--- a/products/ai_observability/frontend/llmPersonsLazyLoaderLogic.ts
+++ b/products/ai_observability/frontend/llmPersonsLazyLoaderLogic.ts
@@ -178,7 +178,7 @@ export const llmPersonsLazyLoaderLogic = kea<llmPersonsLazyLoaderLogicType>([
}
try {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. personsBatchByDistinctIdsCreate() from 'products/persons/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
const response = await api.create<BatchByDistinctIdsResponse>(
`api/projects/${teamId}/persons/batch_by_distinct_ids/`,
{ distinct_ids: batch }
diff --git a/products/ai_observability/frontend/modelPickerLogic.ts b/products/ai_observability/frontend/modelPickerLogic.ts
index 841a7e9ef124..f953a54b9735 100644
--- a/products/ai_observability/frontend/modelPickerLogic.ts
+++ b/products/ai_observability/frontend/modelPickerLogic.ts
@@ -228,7 +228,7 @@ export const modelPickerLogic = kea<modelPickerLogicType>([
const results = await Promise.all(
validKeys.map(async (key: LLMProviderKey) => {
try {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const rawModels = (await api.get(
`/api/llm_proxy/models/?provider_key_id=${encodeURIComponent(key.id)}`
)) as (Omit<ModelOption, 'providerKeyId' | 'isRecommended'> & {
@@ -264,7 +264,7 @@ export const modelPickerLogic = kea<modelPickerLogicType>([
playgroundModels: {
__default: [] as ModelOption[],
loadPlaygroundModels: async (): Promise<ModelOption[]> => {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const rawModels = (await api.get('/api/llm_proxy/models/')) as (Omit<ModelOption, 'isRecommended'> & {
is_recommended?: boolean
})[]
diff --git a/products/ai_observability/frontend/playground/llmPlaygroundModelLogic.ts b/products/ai_observability/frontend/playground/llmPlaygroundModelLogic.ts
index 3453adc24a56..490e61bf3500 100644
--- a/products/ai_observability/frontend/playground/llmPlaygroundModelLogic.ts
+++ b/products/ai_observability/frontend/playground/llmPlaygroundModelLogic.ts
@@ -288,7 +288,7 @@ export const llmPlaygroundModelLogic = kea<llmPlaygroundModelLogicType>([
return null
}
try {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use llmAnalyticsEvaluationConfigRetrieve() from 'products/ai_observability/frontend/generated/api' instead.
return (await api.get(`/api/environments/${teamId}/llm_analytics/evaluation_config/`)) as {
active_provider_key: { id: string } | null
}
diff --git a/products/ai_observability/frontend/playground/llmPlaygroundPromptsLogic.ts b/products/ai_observability/frontend/playground/llmPlaygroundPromptsLogic.ts
index ed1cb65f36c2..50bca68f1c4c 100644
--- a/products/ai_observability/frontend/playground/llmPlaygroundPromptsLogic.ts
+++ b/products/ai_observability/frontend/playground/llmPlaygroundPromptsLogic.ts
@@ -1247,7 +1247,7 @@ export const llmPlaygroundPromptsLogic = kea<llmPlaygroundPromptsLogicType>([
lemonToast.error('Could not determine team')
return
}
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use evaluationsRetrieve() from 'products/ai_observability/frontend/generated/api' instead.
const fetchedEvaluation = await api.get<EvaluationConfig>(
`/api/environments/${teamId}/evaluations/${payload.sourceEvaluationId}/`
)
@@ -1441,7 +1441,7 @@ export const llmPlaygroundPromptsLogic = kea<llmPlaygroundPromptsLogicType>([
return
}
try {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use evaluationsPartialUpdate() from 'products/ai_observability/frontend/generated/api' instead.
await api.update(`/api/environments/${teamId}/evaluations/${linkedSource.evaluationId}/`, {
evaluation_config: { prompt: prompt.systemPrompt },
...(modelConfig ? { model_configuration: modelConfig } : {}),
@@ -1526,7 +1526,7 @@ export const llmPlaygroundPromptsLogic = kea<llmPlaygroundPromptsLogicType>([
? await evaluationsRetrieve(String(teamId), prompt.sourceEvaluationId)
: null
const compatibleSource = sourceEvaluation?.output_type === 'sentiment' ? null : sourceEvaluation
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use evaluationsCreate() from 'products/ai_observability/frontend/generated/api' instead.
const created = await api.create<EvaluationConfig>(`/api/environments/${teamId}/evaluations/`, {
name,
evaluation_type: 'llm_judge',
diff --git a/products/ai_observability/frontend/playground/llmPlaygroundRunLogic.ts b/products/ai_observability/frontend/playground/llmPlaygroundRunLogic.ts
index 39237ca9df8d..9bcc62c1e483 100644
--- a/products/ai_observability/frontend/playground/llmPlaygroundRunLogic.ts
+++ b/products/ai_observability/frontend/playground/llmPlaygroundRunLogic.ts
@@ -425,6 +425,7 @@ export const llmPlaygroundRunLogic = kea<llmPlaygroundRunLogicType>([
...(prompt.reasoningLevel ? { reasoning_level: prompt.reasoningLevel } : {}),
}
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.stream('/api/llm_proxy/completion', {
method: 'POST',
data: requestData,
diff --git a/products/ai_observability/frontend/settings/llmProviderKeysLogic.ts b/products/ai_observability/frontend/settings/llmProviderKeysLogic.ts
index 299adb970721..34693cfdce5c 100644
--- a/products/ai_observability/frontend/settings/llmProviderKeysLogic.ts
+++ b/products/ai_observability/frontend/settings/llmProviderKeysLogic.ts
@@ -481,7 +481,7 @@ export const llmProviderKeysLogic = kea<llmProviderKeysLogicType>([
if (!teamId) {
return null
}
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. llmAnalyticsProviderKeysDependentConfigsRetrieve() from 'products/ai_observability/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
return await api.get(
`/api/environments/${teamId}/llm_analytics/provider_keys/${keyId}/dependent_configs/`
)
@@ -514,7 +514,7 @@ export const llmProviderKeysLogic = kea<llmProviderKeysLogicType>([
if (api_version) {
body.api_version = api_version
}
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. llmAnalyticsProviderKeyValidationsCreate() from 'products/ai_observability/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
const response = await api.create(
`/api/environments/${teamId}/llm_analytics/provider_key_validations/`,
body
@@ -543,7 +543,7 @@ export const llmProviderKeysLogic = kea<llmProviderKeysLogicType>([
if (!teamId) {
return null
}
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use llmAnalyticsEvaluationConfigRetrieve() from 'products/ai_observability/frontend/generated/api' instead.
return await api.get(`/api/environments/${teamId}/llm_analytics/evaluation_config/`)
},
},
@@ -556,7 +556,7 @@ export const llmProviderKeysLogic = kea<llmProviderKeysLogicType>([
if (!teamId) {
return []
}
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use llmAnalyticsProviderKeysList() from 'products/ai_observability/frontend/generated/api' instead.
const response = await api.get(`/api/environments/${teamId}/llm_analytics/provider_keys/`)
return response.results
},
@@ -569,7 +569,7 @@ export const llmProviderKeysLogic = kea<llmProviderKeysLogicType>([
if (!teamId) {
return values.providerKeys
}
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use llmAnalyticsProviderKeysCreate() from 'products/ai_observability/frontend/generated/api' instead.
const response = await api.create(
`/api/environments/${teamId}/llm_analytics/provider_keys/`,
payload
@@ -589,7 +589,7 @@ export const llmProviderKeysLogic = kea<llmProviderKeysLogicType>([
if (!teamId) {
return values.providerKeys
}
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use llmAnalyticsProviderKeysPartialUpdate() from 'products/ai_observability/frontend/generated/api' instead.
const response = await api.update(
`/api/environments/${teamId}/llm_analytics/provider_keys/${id}/`,
payload
@@ -611,7 +611,7 @@ export const llmProviderKeysLogic = kea<llmProviderKeysLogicType>([
const url = replacementKeyId
? `/api/environments/${teamId}/llm_analytics/provider_keys/${id}/?replacement_key_id=${encodeURIComponent(replacementKeyId)}`
: `/api/environments/${teamId}/llm_analytics/provider_keys/${id}/`
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
await api.delete(url)
// If deleted key was active, reload config to reflect change
if (values.evaluationConfig?.active_provider_key?.id === id) {
@@ -624,7 +624,7 @@ export const llmProviderKeysLogic = kea<llmProviderKeysLogicType>([
if (!teamId) {
return values.providerKeys
}
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. llmAnalyticsProviderKeysValidateCreate() from 'products/ai_observability/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
const response = await api.create(
`/api/environments/${teamId}/llm_analytics/provider_keys/${id}/validate/`,
{}
diff --git a/products/ai_observability/frontend/tags/llmTaggerLogic.ts b/products/ai_observability/frontend/tags/llmTaggerLogic.ts
index aab73eaf3056..3f6cc7ad854c 100644
--- a/products/ai_observability/frontend/tags/llmTaggerLogic.ts
+++ b/products/ai_observability/frontend/tags/llmTaggerLogic.ts
@@ -430,11 +430,11 @@ export const llmTaggerLogic = kea<llmTaggerLogicType>([
}
if (props.id === 'new') {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use taggersCreate() from 'products/ai_observability/frontend/generated/api' instead.
await api.create(`api/projects/${teamLogic.values.currentTeamId}/taggers/`, payload)
lemonToast.success('Tagger created')
} else {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use taggersPartialUpdate() from 'products/ai_observability/frontend/generated/api' instead.
await api.update(`api/projects/${teamLogic.values.currentTeamId}/taggers/${props.id}/`, payload)
lemonToast.success('Tagger updated')
}
@@ -454,7 +454,7 @@ export const llmTaggerLogic = kea<llmTaggerLogicType>([
}
try {
const teamId = teamLogic.values.currentTeamId
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use taggersTestHogCreate() from 'products/ai_observability/frontend/generated/api' instead.
const response = await api.create(`/api/projects/${teamId}/taggers/test_hog/`, {
source,
sample_count: 5,
@@ -528,7 +528,7 @@ export const llmTaggerLogic = kea<llmTaggerLogicType>([
// Wrap in try/catch so a failed fetch clears taggerLoading — otherwise
// the UI is stuck on the skeleton indefinitely on any API error.
try {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use taggersRetrieve() from 'products/ai_observability/frontend/generated/api' instead.
const tagger = await api.get(`api/projects/${teamLogic.values.currentTeamId}/taggers/${props.id}/`)
actions.loadTaggerSuccess(tagger)
actions.setTaggerFormValues({
@@ -549,7 +549,7 @@ export const llmTaggerLogic = kea<llmTaggerLogicType>([
if (props.id === 'new') {
return
}
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use taggersPartialUpdate() from 'products/ai_observability/frontend/generated/api' instead.
await api.update(`api/projects/${teamLogic.values.currentTeamId}/taggers/${props.id}/`, { deleted: true })
lemonToast.success('Tagger deleted')
router.actions.push(urls.aiObservabilityTags())
diff --git a/products/ai_observability/frontend/tags/llmTaggersLogic.ts b/products/ai_observability/frontend/tags/llmTaggersLogic.ts
index 2a7c2962e12f..f0707d65c952 100644
--- a/products/ai_observability/frontend/tags/llmTaggersLogic.ts
+++ b/products/ai_observability/frontend/tags/llmTaggersLogic.ts
@@ -377,7 +377,7 @@ export const llmTaggersLogic = kea<llmTaggersLogicType>([
listeners(({ actions, values }) => ({
loadTaggers: async () => {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use taggersList() from 'products/ai_observability/frontend/generated/api' instead.
const response = await api.get(`api/projects/${teamLogic.values.currentTeamId}/taggers/`)
actions.loadTaggersSuccess(response.results)
},
@@ -390,7 +390,7 @@ export const llmTaggersLogic = kea<llmTaggersLogicType>([
if (!tagger) {
return
}
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use taggersPartialUpdate() from 'products/ai_observability/frontend/generated/api' instead.
await api.update(`api/projects/${teamLogic.values.currentTeamId}/taggers/${id}/`, {
enabled: !tagger.enabled,
})
diff --git a/products/ai_observability/frontend/text-view/textViewLogic.ts b/products/ai_observability/frontend/text-view/textViewLogic.ts
index d0708f8d6be6..7436700655be 100644
--- a/products/ai_observability/frontend/text-view/textViewLogic.ts
+++ b/products/ai_observability/frontend/text-view/textViewLogic.ts
@@ -192,7 +192,7 @@ export const textViewLogic = kea<textViewLogicType>([
try {
// Call Django API with timeout
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use llmAnalyticsTextReprCreate() from 'products/ai_observability/frontend/generated/api' instead.
const response = await api.create(
`api/projects/${props.teamId}/llm_analytics/text_repr/`,
requestData,
diff --git a/products/ai_observability/frontend/traceReviews/traceReviewsApi.ts b/products/ai_observability/frontend/traceReviews/traceReviewsApi.ts
index c37ee1997290..ae90fd11f004 100644
--- a/products/ai_observability/frontend/traceReviews/traceReviewsApi.ts
+++ b/products/ai_observability/frontend/traceReviews/traceReviewsApi.ts
@@ -81,7 +81,7 @@ export const traceReviewsApi = {
params?: TraceReviewListParams,
teamId: number = ApiConfig.getCurrentTeamId()
): Promise<CountedPaginatedResponse<TraceReview>> {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
return api
.get<CountedPaginatedResponse<TraceReview>>(buildTraceReviewsListUrl(teamId, params))
.then((response) => ({
@@ -96,7 +96,7 @@ export const traceReviewsApi = {
},
create(data: TraceReviewUpsertPayload, teamId: number = ApiConfig.getCurrentTeamId()): Promise<TraceReview> {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
return api
.create<TraceReview, TraceReviewUpsertPayload>(getTraceReviewsBaseUrl(teamId), data)
.then(normalizeTraceReview)
@@ -107,7 +107,7 @@ export const traceReviewsApi = {
data: Partial<Omit<TraceReviewUpsertPayload, 'trace_id'>>,
teamId: number = ApiConfig.getCurrentTeamId()
): Promise<TraceReview> {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
return api
.update<TraceReview, Partial<Omit<TraceReviewUpsertPayload, 'trace_id'>>>(
`${getTraceReviewsBaseUrl(teamId)}${id}/`,
@@ -117,7 +117,7 @@ export const traceReviewsApi = {
},
delete(id: string, teamId: number = ApiConfig.getCurrentTeamId()): Promise<void> {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
return api.delete(`${getTraceReviewsBaseUrl(teamId)}${id}/`)
},
diff --git a/products/cdp/frontend/emptyState/destinationsSetupLogic.ts b/products/cdp/frontend/emptyState/destinationsSetupLogic.ts
index aa542d25c281..b417a187ddef 100644
--- a/products/cdp/frontend/emptyState/destinationsSetupLogic.ts
+++ b/products/cdp/frontend/emptyState/destinationsSetupLogic.ts
@@ -25,7 +25,7 @@ export const destinationsSetupLogic = createSetupDetectionLogic({
}),
// The legacy plugin config endpoints are not in the OpenAPI spec, so there is
// no generated client to call here.
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
api.get<CountedPaginatedResponse<unknown>>(
`api/projects/${projectId}/pipeline_destination_configs/?limit=1`
),
diff --git a/products/conversations/frontend/components/ComposeTicket/composeTicketLogic.ts b/products/conversations/frontend/components/ComposeTicket/composeTicketLogic.ts
index c0c4c9a0424b..d3a3608f8fac 100644
--- a/products/conversations/frontend/components/ComposeTicket/composeTicketLogic.ts
+++ b/products/conversations/frontend/components/ComposeTicket/composeTicketLogic.ts
@@ -162,7 +162,7 @@ export const composeTicketLogic = kea<composeTicketLogicType>([
{
loadEmailConfigs: async (): Promise<EmailConfigStatus[]> => {
try {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const response = await api.get('api/conversations/v1/email/status')
return response.configs || []
} catch {
diff --git a/products/conversations/frontend/scenes/settings/supportSettingsLogic.ts b/products/conversations/frontend/scenes/settings/supportSettingsLogic.ts
index 145ea90e84df..4f83fcfc9045 100644
--- a/products/conversations/frontend/scenes/settings/supportSettingsLogic.ts
+++ b/products/conversations/frontend/scenes/settings/supportSettingsLogic.ts
@@ -1057,7 +1057,7 @@ export const supportSettingsLogic = kea<supportSettingsLogicType>([
{
loadGithubRepos: async () => {
try {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const response = await api.create('api/conversations/v1/github/repos', {})
return response.repos || []
} catch {
@@ -1107,7 +1107,7 @@ export const supportSettingsLogic = kea<supportSettingsLogicType>([
{
loadSlackChannelsWithToken: async () => {
try {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const response = await api.create(`api/conversations/v1/slack/channels`, {})
return response.channels || []
} catch {
@@ -1122,7 +1122,7 @@ export const supportSettingsLogic = kea<supportSettingsLogicType>([
{
loadTeamsTeamsWithToken: async () => {
try {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const response = await api.create('api/conversations/v1/teams/teams', {})
return response.teams || []
} catch {
@@ -1137,7 +1137,7 @@ export const supportSettingsLogic = kea<supportSettingsLogicType>([
{
loadTeamsChannelsForTeam: async ({ teamId }: { teamId: string }) => {
try {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const response = await api.create('api/conversations/v1/teams/channels', {
team_id: teamId,
})
@@ -1400,7 +1400,7 @@ export const supportSettingsLogic = kea<supportSettingsLogicType>([
listeners(({ values, actions, cache }) => ({
connectSlack: async ({ nextPath }) => {
const query = encodeURIComponent(nextPath)
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const response = await api.get(`api/conversations/v1/slack/authorize?next=${query}`)
window.location.href = response.url
},
@@ -1581,7 +1581,7 @@ export const supportSettingsLogic = kea<supportSettingsLogicType>([
// Email multi-config listeners
loadEmailConfigs: async () => {
try {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const response = await api.get('api/conversations/v1/email/status')
actions.loadEmailConfigsDone(response.configs || [])
} catch {
@@ -1596,7 +1596,7 @@ export const supportSettingsLogic = kea<supportSettingsLogicType>([
return
}
try {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const response = await api.create('api/conversations/v1/email/connect', {
from_email: newEmailFromEmail,
from_name: newEmailFromName,
@@ -1616,7 +1616,7 @@ export const supportSettingsLogic = kea<supportSettingsLogicType>([
},
disconnectEmail: async ({ configId }) => {
try {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.create('api/conversations/v1/email/disconnect', { config_id: configId })
} catch {
lemonToast.error('Failed to disconnect email')
@@ -1636,7 +1636,7 @@ export const supportSettingsLogic = kea<supportSettingsLogicType>([
},
setDefaultEmail: async ({ configId }) => {
try {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.create('api/conversations/v1/email/set-default', { config_id: configId })
} catch {
lemonToast.error('Failed to set default email address')
@@ -1648,7 +1648,7 @@ export const supportSettingsLogic = kea<supportSettingsLogicType>([
},
verifyEmailDomain: async ({ configId }) => {
try {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const response = await api.create('api/conversations/v1/email/verify-domain', {
config_id: configId,
})
@@ -1665,7 +1665,7 @@ export const supportSettingsLogic = kea<supportSettingsLogicType>([
},
sendTestEmail: async ({ configId }) => {
try {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const response = await api.create('api/conversations/v1/email/send-test', {
config_id: configId,
})
@@ -1678,7 +1678,7 @@ export const supportSettingsLogic = kea<supportSettingsLogicType>([
},
disconnectSlack: async () => {
try {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.create('api/conversations/v1/slack/disconnect', {})
} catch {
lemonToast.error('Failed to disconnect Slack')
@@ -1701,7 +1701,7 @@ export const supportSettingsLogic = kea<supportSettingsLogicType>([
connectTeams: async ({ nextPath }) => {
try {
const query = encodeURIComponent(nextPath)
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const response = await api.get(`api/conversations/v1/teams/authorize?next=${query}`)
window.location.href = response.url
} catch {
@@ -1710,7 +1710,7 @@ export const supportSettingsLogic = kea<supportSettingsLogicType>([
},
disconnectTeams: async () => {
try {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.create('api/conversations/v1/teams/disconnect', {})
} catch {
lemonToast.error('Failed to disconnect Microsoft Teams')
@@ -1722,7 +1722,7 @@ export const supportSettingsLogic = kea<supportSettingsLogicType>([
},
installTeamsApp: async ({ teamId }) => {
try {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const response = await api.create('api/conversations/v1/teams/install', {
team_id: teamId,
})
@@ -1752,7 +1752,7 @@ export const supportSettingsLogic = kea<supportSettingsLogicType>([
},
addTeamsChannelPair: async ({ teamId, channelId }) => {
try {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.create('api/conversations/v1/teams/select-channel', {
action: 'add',
team_id: teamId,
@@ -1775,7 +1775,7 @@ export const supportSettingsLogic = kea<supportSettingsLogicType>([
},
removeTeamsChannelPair: async ({ channelId }) => {
try {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.create('api/conversations/v1/teams/select-channel', {
action: 'remove',
channel_id: channelId,
@@ -1878,7 +1878,7 @@ export const supportSettingsLogic = kea<supportSettingsLogicType>([
},
connectGithub: async ({ integrationId }) => {
try {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.create('api/conversations/v1/github/connect', { integration_id: integrationId })
actions.loadCurrentTeam()
actions.loadGithubRepos()
@@ -1889,7 +1889,7 @@ export const supportSettingsLogic = kea<supportSettingsLogicType>([
},
disconnectGithub: async () => {
try {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.create('api/conversations/v1/github/disconnect', {})
actions.loadCurrentTeam()
lemonToast.success('GitHub disconnected')
@@ -1899,7 +1899,7 @@ export const supportSettingsLogic = kea<supportSettingsLogicType>([
},
setGithubRepos: async ({ repos }) => {
try {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.create('api/conversations/v1/github/select-repos', { repos })
actions.loadCurrentTeam()
} catch {
diff --git a/products/conversations/frontend/scenes/ticket/creationGroupLogic.ts b/products/conversations/frontend/scenes/ticket/creationGroupLogic.ts
index 0ec0fdee2da1..c5ade9cbc787 100644
--- a/products/conversations/frontend/scenes/ticket/creationGroupLogic.ts
+++ b/products/conversations/frontend/scenes/ticket/creationGroupLogic.ts
@@ -76,7 +76,7 @@ export const creationGroupLogic = kea<creationGroupLogicType>([
}
try {
// `groups/find` is a cross-product (groups) endpoint with no conversations-generated client.
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use groupsFindRetrieve() from 'products/groups/frontend/generated/api' instead.
return await api.get(`api/projects/${values.currentTeamId}/groups/find?${toParams(params)}`)
} catch {
// Group may no longer exist (stale snapshot) — degrade to no row rather than a broken link.
diff --git a/products/conversations/frontend/scenes/ticket/supportTicketSceneLogic.ts b/products/conversations/frontend/scenes/ticket/supportTicketSceneLogic.ts
index 9ea943637031..d3374c5cfabf 100644
--- a/products/conversations/frontend/scenes/ticket/supportTicketSceneLogic.ts
+++ b/products/conversations/frontend/scenes/ticket/supportTicketSceneLogic.ts
@@ -1472,6 +1472,7 @@ export const supportTicketSceneLogic = kea<supportTicketSceneLogicType>([
let alreadySent = false
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
const response = await api.createResponse(getCommentsCreateUrl(String(getCurrentTeamId())), {
content,
rich_content: richContent,
diff --git a/products/experiments/frontend/components/CopyExperimentToProjectModal.tsx b/products/experiments/frontend/components/CopyExperimentToProjectModal.tsx
index 0d8b6265cea7..f798e0078567 100644
--- a/products/experiments/frontend/components/CopyExperimentToProjectModal.tsx
+++ b/products/experiments/frontend/components/CopyExperimentToProjectModal.tsx
@@ -73,7 +73,7 @@ export function CopyExperimentToProjectModal({
offset: filters.page ? (filters.page - 1) * FLAGS_PER_PAGE : 0,
eligible_for_experiment: true,
}
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use featureFlagsList() from 'products/feature_flags/frontend/generated/api' instead.
const data = await api.get(`api/projects/${projectId}/feature_flags/?${toParams(params)}`)
setTargetFeatureFlags(data)
} finally {
diff --git a/products/experiments/frontend/modals/SelectExistingFeatureFlagModal/selectExistingFeatureFlagModalLogic.ts b/products/experiments/frontend/modals/SelectExistingFeatureFlagModal/selectExistingFeatureFlagModalLogic.ts
index cd16baf8f71c..b96600b1932f 100644
--- a/products/experiments/frontend/modals/SelectExistingFeatureFlagModal/selectExistingFeatureFlagModalLogic.ts
+++ b/products/experiments/frontend/modals/SelectExistingFeatureFlagModal/selectExistingFeatureFlagModalLogic.ts
@@ -205,7 +205,7 @@ export const selectExistingFeatureFlagModalLogic = kea<selectExistingFeatureFlag
...values.paramsFromFilters,
eligible_for_experiment: true,
})}`
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
const response = await api.get(url)
return response
},
diff --git a/products/experiments/frontend/modals/SharedMetricModal/sharedMetricModalLogic.ts b/products/experiments/frontend/modals/SharedMetricModal/sharedMetricModalLogic.ts
index ef7d6cf22254..ca6b537ecf54 100644
--- a/products/experiments/frontend/modals/SharedMetricModal/sharedMetricModalLogic.ts
+++ b/products/experiments/frontend/modals/SharedMetricModal/sharedMetricModalLogic.ts
@@ -248,7 +248,7 @@ export const sharedMetricModalLogic = kea<sharedMetricModalLogicType>([
offset: 0,
search: values.searchTerm || undefined,
})
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use experimentSavedMetricsList() from 'products/experiments/frontend/generated/api' instead.
let page = (await api.get(
`api/projects/${values.currentProjectId}/experiment_saved_metrics?${params}`
)) as CountedPaginatedResponse<SharedMetric>
@@ -257,7 +257,7 @@ export const sharedMetricModalLogic = kea<sharedMetricModalLogicType>([
// Keep paging so the tag filter and tag chips cover every shared metric, not only page 1.
const results = [...(page.results ?? [])]
while (page.next) {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
page = await api.get(page.next)
breakpoint()
results.push(...page.results)
diff --git a/products/experiments/frontend/scenes/experimentsLogic.ts b/products/experiments/frontend/scenes/experimentsLogic.ts
index a713eccbcf1f..9f67172e055d 100644
--- a/products/experiments/frontend/scenes/experimentsLogic.ts
+++ b/products/experiments/frontend/scenes/experimentsLogic.ts
@@ -617,7 +617,7 @@ export const experimentsLogic = kea<experimentsLogicType>([
{ results: [], count: 0, filters: DEFAULT_FILTERS, offset: 0 } as ExperimentsResult,
{
loadExperiments: async (_: void, breakpoint) => {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use experimentsList() from 'products/experiments/frontend/generated/api' instead.
const response = await api.get(
`api/projects/${values.currentProjectId}/experiments?${toParams(values.paramsFromFilters)}`
)
@@ -629,7 +629,7 @@ export const experimentsLogic = kea<experimentsLogicType>([
}
},
archiveExperiment: async ({ id, disableFeatureFlag }: { id: number; disableFeatureFlag: boolean }) => {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. experimentsArchiveCreate() from 'products/experiments/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
await api.create(`api/projects/${values.currentProjectId}/experiments/${id}/archive`, {
disable_feature_flag: disableFeatureFlag,
})
@@ -641,7 +641,7 @@ export const experimentsLogic = kea<experimentsLogicType>([
}
},
unarchiveExperiment: async (id: number) => {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. experimentsUnarchiveCreate() from 'products/experiments/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
await api.create(`api/projects/${values.currentProjectId}/experiments/${id}/unarchive`)
lemonToast.info('Experiment unarchived')
return {
@@ -658,7 +658,7 @@ export const experimentsLogic = kea<experimentsLogicType>([
if (payload.name) {
data.name = payload.name
}
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. experimentsDuplicateCreate() from 'products/experiments/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
const duplicatedExperiment = await api.create(
`api/projects/${values.currentProjectId}/experiments/${payload.id}/duplicate`,
data
@@ -688,7 +688,7 @@ export const experimentsLogic = kea<experimentsLogicType>([
if (payload.name) {
data.name = payload.name
}
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. experimentsCopyToProjectCreate() from 'products/experiments/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
const newExperiment = await api.create(
`api/projects/${values.currentProjectId}/experiments/${payload.id}/copy_to_project`,
data
@@ -727,7 +727,7 @@ export const experimentsLogic = kea<experimentsLogicType>([
{ results: [], count: 0 } as { results: FeatureFlagType[]; count: number },
{
loadFeatureFlagModalFeatureFlags: async (_: void, breakpoint) => {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use featureFlagsList() from 'products/feature_flags/frontend/generated/api' instead.
const response = await api.get(
`api/projects/${values.currentProjectId}/feature_flags/?${toParams({
...values.featureFlagModalParamsFromFilters,
@@ -750,7 +750,7 @@ export const experimentsLogic = kea<experimentsLogicType>([
} as ExperimentVelocityStats,
{
loadExperimentsStats: async () => {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. experimentsStatsRetrieve() from 'products/experiments/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
const response = await api.get(`api/projects/${values.currentProjectId}/experiments/stats/`)
return response
},
diff --git a/products/groups/frontend/logics/relatedGroupsLogic.ts b/products/groups/frontend/logics/relatedGroupsLogic.ts
index 7a4ea2c228bb..365e08b34954 100644
--- a/products/groups/frontend/logics/relatedGroupsLogic.ts
+++ b/products/groups/frontend/logics/relatedGroupsLogic.ts
@@ -93,7 +93,7 @@ export const relatedGroupsLogic = kea<relatedGroupsLogicType>([
})}`
// groupsRelatedList returns RelatedActorApi, which ActorType cannot hold:
// ~/types has is_identified non-nullable and distinct_ids optional.
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
return await api.get(url)
},
setGroup: () => [],
diff --git a/products/live_debugger/frontend/liveDebuggerLogic.ts b/products/live_debugger/frontend/liveDebuggerLogic.ts
index e0fc18359d59..73d9fb51d94c 100644
--- a/products/live_debugger/frontend/liveDebuggerLogic.ts
+++ b/products/live_debugger/frontend/liveDebuggerLogic.ts
@@ -206,7 +206,7 @@ export const liveDebuggerLogic = kea<liveDebuggerLogicType>([
const queryString = params.toString()
const url = `api/projects/${values.currentProjectId}/live_debugger_breakpoints/?${queryString}`
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
const response = await api.get(url)
return response.results || []
},
@@ -224,7 +224,7 @@ export const liveDebuggerLogic = kea<liveDebuggerLogicType>([
const queryString = params.toString()
const url = `api/projects/${values.currentProjectId}/live_debugger_breakpoints/breakpoint_hits/${queryString ? `?${queryString}` : ''}`
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
const response = await api.get(url)
return response.results || []
},
@@ -299,12 +299,12 @@ export const liveDebuggerLogic = kea<liveDebuggerLogicType>([
: undefined
if (existingBreakpoint) {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. liveDebuggerBreakpointsDestroy() from 'products/live_debugger/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
await api.delete(
`api/projects/${values.currentProjectId}/live_debugger_breakpoints/${existingBreakpoint.id}/`
)
} else {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use liveDebuggerBreakpointsCreate() from 'products/live_debugger/frontend/generated/api' instead.
await api.create(`api/projects/${values.currentProjectId}/live_debugger_breakpoints/`, {
repository,
filename,
@@ -324,12 +324,12 @@ export const liveDebuggerLogic = kea<liveDebuggerLogicType>([
: undefined
if (existingBreakpoint) {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. liveDebuggerBreakpointsDestroy() from 'products/live_debugger/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
await api.delete(
`api/projects/${values.currentProjectId}/live_debugger_breakpoints/${existingBreakpoint.id}/`
)
} else {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use liveDebuggerBreakpointsCreate() from 'products/live_debugger/frontend/generated/api' instead.
await api.create(`api/projects/${values.currentProjectId}/live_debugger_breakpoints/`, {
repository,
filename,
@@ -345,7 +345,7 @@ export const liveDebuggerLogic = kea<liveDebuggerLogicType>([
if (Array.isArray(values.breakpoints)) {
await Promise.all(
values.breakpoints.map((bp) =>
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. liveDebuggerBreakpointsDestroy() from 'products/live_debugger/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
api.delete(`api/projects/${values.currentProjectId}/live_debugger_breakpoints/${bp.id}/`)
)
)
diff --git a/products/logs/frontend/components/LogsViewer/Filters/serviceFilterLogic.ts b/products/logs/frontend/components/LogsViewer/Filters/serviceFilterLogic.ts
index 9cf5e1a5fa40..1722031a7f3d 100644
--- a/products/logs/frontend/components/LogsViewer/Filters/serviceFilterLogic.ts
+++ b/products/logs/frontend/components/LogsViewer/Filters/serviceFilterLogic.ts
@@ -108,7 +108,7 @@ export const serviceFilterLogic = kea<serviceFilterLogicType>([
limit: 1000,
...(logicProps.dateRange ? { dateRange: JSON.stringify(logicProps.dateRange) } : {}),
}).url
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
const response = await api.get(url)
return ((response.results ?? []) as { name: string }[]).map((r) => r.name)
},
diff --git a/products/logs/frontend/components/LogsViews/logsViewsLogic.ts b/products/logs/frontend/components/LogsViews/logsViewsLogic.ts
index 52f8e1fe923f..34f2898f649c 100644
--- a/products/logs/frontend/components/LogsViews/logsViewsLogic.ts
+++ b/products/logs/frontend/components/LogsViews/logsViewsLogic.ts
@@ -119,12 +119,12 @@ export const logsViewsLogic = kea<logsViewsLogicType>([
[] as LogsView[],
{
loadViews: async () => {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
const response = await api.get(`${logsViewsUrl(values.currentTeamId)}/`)
return response.results
},
createView: async ({ name, filters }: { name: string; filters: LogsViewApiFilters }) => {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
const created: LogsView = await api.create(`${logsViewsUrl(values.currentTeamId)}/`, {
name,
filters,
@@ -145,7 +145,7 @@ export const logsViewsLogic = kea<logsViewsLogicType>([
listeners(({ actions, values }) => ({
deleteView: async ({ shortId }) => {
try {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
await api.delete(`${logsViewsUrl(values.currentTeamId)}/${shortId}/`)
lemonToast.success('View deleted')
} catch {
diff --git a/products/logs/frontend/logsConfigLogic.ts b/products/logs/frontend/logsConfigLogic.ts
index 934a43c0e193..b77fff403076 100644
--- a/products/logs/frontend/logsConfigLogic.ts
+++ b/products/logs/frontend/logsConfigLogic.ts
@@ -23,7 +23,7 @@ export const DEFAULT_LOGS_SESSION_ID_ATTRIBUTE_KEYS = ['sessionId']
export const DEFAULT_LOGS_PATTERN_MESSAGE_KEYS = ['message', 'msg', 'event']
async function saveLogsConfig(teamId: number | null, patch: Partial<TeamLogsConfigApi>): Promise<TeamLogsConfigApi> {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use organizationsProjectsLogsConfigPartialUpdate() from 'products/logs/frontend/generated/api' instead.
return await api.update(`api/projects/${teamId}/logs_config/`, patch)
}
@@ -189,7 +189,7 @@ export const logsConfigLogic = kea<logsConfigLogicType>([
null as TeamLogsConfigApi | null,
{
loadLogsConfig: async (): Promise<TeamLogsConfigApi> => {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use organizationsProjectsLogsConfigRetrieve() from 'products/logs/frontend/generated/api' instead.
return await api.get(`api/projects/${values.currentTeamId}/logs_config/`)
},
updateLogsConfig: async (patch: Partial<TeamLogsConfigApi>): Promise<TeamLogsConfigApi> => {
diff --git a/products/managed_migrations/frontend/managedMigrationLogic.ts b/products/managed_migrations/frontend/managedMigrationLogic.ts
index 090a85ad7209..08759dc91fde 100644
--- a/products/managed_migrations/frontend/managedMigrationLogic.ts
+++ b/products/managed_migrations/frontend/managedMigrationLogic.ts
@@ -304,7 +304,7 @@ export const managedMigrationLogic = kea<managedMigrationLogicType>([
{
loadMigrations: async () => {
const projectId = ApiConfig.getCurrentProjectId()
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use managedMigrationsList() from 'products/managed_migrations/frontend/generated/api' instead.
const response = await api.get(`api/projects/${projectId}/managed_migrations`)
return response.results
},
@@ -474,7 +474,7 @@ export const managedMigrationLogic = kea<managedMigrationLogicType>([
}
}
try {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use managedMigrationsCreate() from 'products/managed_migrations/frontend/generated/api' instead.
const response = await api.create(`api/projects/${projectId}/managed_migrations`, payload)
return response
} catch (error: any) {
@@ -511,7 +511,7 @@ export const managedMigrationLogic = kea<managedMigrationLogicType>([
pauseMigration: async ({ id }) => {
try {
const projectId = ApiConfig.getCurrentProjectId()
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. managedMigrationsPauseCreate() from 'products/managed_migrations/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
await api.create(`api/projects/${projectId}/managed_migrations/${id}/pause/`)
lemonToast.success('Migration paused successfully')
actions.loadMigrations()
@@ -522,7 +522,7 @@ export const managedMigrationLogic = kea<managedMigrationLogicType>([
resumeMigration: async ({ id }) => {
try {
const projectId = ApiConfig.getCurrentProjectId()
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. managedMigrationsResumeCreate() from 'products/managed_migrations/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
await api.create(`api/projects/${projectId}/managed_migrations/${id}/resume/`)
lemonToast.success('Migration resumed successfully')
actions.loadMigrations()
diff --git a/products/metrics/frontend/components/metricsStarterDashboardLogic.tsx b/products/metrics/frontend/components/metricsStarterDashboardLogic.tsx
index 3808366479fa..ae632bb1d12f 100644
--- a/products/metrics/frontend/components/metricsStarterDashboardLogic.tsx
+++ b/products/metrics/frontend/components/metricsStarterDashboardLogic.tsx
@@ -206,7 +206,7 @@ export const metricsStarterDashboardLogic = kea<metricsStarterDashboardLogicType
// The core dashboards create endpoint has no generated client yet
// (only its sharing sub-resources are in the codegen surface), so this
// stays a manual call until the Dashboard viewset is tagged.
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use dashboardsCreate() from 'products/dashboards/frontend/generated/api' instead.
dashboard = await api.create<DashboardType>(`api/projects/${values.currentTeamId}/dashboards/`, {
name,
})
diff --git a/products/persons/frontend/logics/mergeSplitPersonLogic.ts b/products/persons/frontend/logics/mergeSplitPersonLogic.ts
index c05d2183bd0d..bcd7b12a43f3 100644
--- a/products/persons/frontend/logics/mergeSplitPersonLogic.ts
+++ b/products/persons/frontend/logics/mergeSplitPersonLogic.ts
@@ -118,7 +118,7 @@ export const mergeSplitPersonLogic = kea<mergeSplitPersonLogicType>([
? { main_distinct_id: values.selectedPersonToAssignSplit }
: {}
// personsSplitCreate needs a project id that this logic does not hold.
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const splitAction = await api.create('api/person/' + values.person.id + '/split/', payload)
if (splitAction.success) {
lemonToast.success(
diff --git a/products/persons/frontend/logics/personDeleteModalLogic.tsx b/products/persons/frontend/logics/personDeleteModalLogic.tsx
index 43267d2e2ebd..bdd8d74dff54 100644
--- a/products/persons/frontend/logics/personDeleteModalLogic.tsx
+++ b/products/persons/frontend/logics/personDeleteModalLogic.tsx
@@ -126,7 +126,7 @@ export const personDeleteModalLogic = kea<personDeleteModalLogicType>([
}
// The persons delete endpoint has no generated function.
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
await api.delete(`api/person/${person.id}?${toParams(params)}`)
posthog.capture('delete person', params)
diff --git a/products/persons/frontend/logics/personsLogic.tsx b/products/persons/frontend/logics/personsLogic.tsx
index 678b04c24dc2..f733a1b62e54 100644
--- a/products/persons/frontend/logics/personsLogic.tsx
+++ b/products/persons/frontend/logics/personsLogic.tsx
@@ -415,7 +415,7 @@ export const personsLogic = kea<personsLogicType>([
if (props.cohort) {
result = {
// This reads the cohorts API, whose generated client belongs to another product.
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use cohortsPersonsRetrieve() from 'products/cohorts/frontend/generated/api' instead.
...(await api.get(`api/cohort/${props.cohort}/persons/?${toParams(newFilters)}`)),
offset: 0,
}
@@ -424,7 +424,7 @@ export const personsLogic = kea<personsLogicType>([
}
} else {
// The URL is the pagination link from the previous response.
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
result = { ...(await api.get(url)), offset: parseInt(decodeParams(url).offset) || 0 }
}
return result
diff --git a/products/persons/frontend/logics/relatedFeatureFlagsLogic.ts b/products/persons/frontend/logics/relatedFeatureFlagsLogic.ts
index ae361658aee8..ab2a1ea6134c 100644
--- a/products/persons/frontend/logics/relatedFeatureFlagsLogic.ts
+++ b/products/persons/frontend/logics/relatedFeatureFlagsLogic.ts
@@ -183,7 +183,7 @@ export const relatedFeatureFlagsLogic = kea<relatedFeatureFlagsLogicType>([
type,
}
// This reads the feature flags API, whose generated client belongs to another product.
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use featureFlagsList() from 'products/feature_flags/frontend/generated/api' instead.
const response = await api.get(
`api/projects/${values.currentProjectId}/feature_flags/?${toParams(params)}`
)
@@ -199,7 +199,7 @@ export const relatedFeatureFlagsLogic = kea<relatedFeatureFlagsLogicType>([
loadRelatedFeatureFlags: async () => {
actions.loadFeatureFlags()
// This reads the feature flags API, whose generated client belongs to another product.
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. featureFlagsEvaluationReasonsRetrieve() from 'products/feature_flags/frontend/generated/api' serves this route, but its generated types do not describe this call yet, so fix the endpoint's OpenAPI schema first.
const response = await api.get(
`api/projects/${values.currentProjectId}/feature_flags/evaluation_reasons?${toParams({
...(props.distinctId ? { distinct_id: props.distinctId } : {}),
diff --git a/products/persons/frontend/pages/PersonScene.tsx b/products/persons/frontend/pages/PersonScene.tsx
index fd9d138f8a35..d6206ce19ebd 100644
--- a/products/persons/frontend/pages/PersonScene.tsx
+++ b/products/persons/frontend/pages/PersonScene.tsx
@@ -162,7 +162,7 @@ function LaunchToolbarButton({ distinctId }: LaunchToolbarButtonProps): JSX.Elem
try {
// Prepare toolbar flags on backend and get cache key
// This posts to the user API, which has no generated function.
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. No generated function covers this endpoint yet. Find out why the generated client skips it (no schema, no product tag, or excluded from the spec) and fix that first.
const response = await api.create('api/user/prepare_toolbar_preloaded_flags', {
distinct_id: distinctId,
})
diff --git a/products/posthog_ai/frontend/logics/tasksLogic.ts b/products/posthog_ai/frontend/logics/tasksLogic.ts
index 45e03d3e2686..8820f3f657da 100644
--- a/products/posthog_ai/frontend/logics/tasksLogic.ts
+++ b/products/posthog_ai/frontend/logics/tasksLogic.ts
@@ -243,7 +243,7 @@ export const tasksLogic = kea<tasksLogicType>([
}
// `next` is an opaque absolute cursor URL from the previous response, not a static
// endpoint — the generated `tasksList` takes structured params, not a raw URL.
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
const response = await api.get<PaginatedResponse<Task>>(next)
breakpoint()
// `breakpoint` only cancels a second `loadMoreTasks` call, not a `loadTasks` triggered
diff --git a/products/product_analytics/frontend/insights/retention/retentionModalLogic.ts b/products/product_analytics/frontend/insights/retention/retentionModalLogic.ts
index 922666dcf706..069a5f093d83 100644
--- a/products/product_analytics/frontend/insights/retention/retentionModalLogic.ts
+++ b/products/product_analytics/frontend/insights/retention/retentionModalLogic.ts
@@ -366,7 +366,7 @@ export const retentionModalLogic = kea<retentionModalLogicType>([
name: cohortName,
}
// The generated `cohortsCreate` posts to the project-scoped route, which all four callers must move to.
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use cohortsCreate() from 'products/cohorts/frontend/generated/api' instead.
const cohort = await api.create('api/cohort', { ...cohortParams, query: values.actorsQuery })
cohortsModel.actions.cohortCreated(cohort)
lemonToast.success('Cohort saved', {
diff --git a/products/product_analytics/frontend/insights/retention/retentionPeopleLogic.ts b/products/product_analytics/frontend/insights/retention/retentionPeopleLogic.ts
index f122aeb0b1d0..60324de16dd2 100644
--- a/products/product_analytics/frontend/insights/retention/retentionPeopleLogic.ts
+++ b/products/product_analytics/frontend/insights/retention/retentionPeopleLogic.ts
@@ -268,7 +268,7 @@ export const retentionPeopleLogic = kea<retentionPeopleLogicType>([
)
} else {
// `next` is a server-returned pagination URL, so no generated function can build it.
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
peopleResult = await api.get<RetentionTablePeoplePayload>(values.people.next as string)
}
const newPayload: RetentionTablePeoplePayload = {
diff --git a/products/skills/frontend/llmSkillsLogic.ts b/products/skills/frontend/llmSkillsLogic.ts
index 4292778dd538..b0b225fc5ea4 100644
--- a/products/skills/frontend/llmSkillsLogic.ts
+++ b/products/skills/frontend/llmSkillsLogic.ts
@@ -59,6 +59,7 @@ function errorDetail(error: unknown): string | undefined {
* binary response, so fetch the raw blob via the generated URL builder instead. */
export async function exportAndDownloadSkill(skillName: string): Promise<void> {
const url = getLlmSkillsNameExportRetrieveUrl(String(ApiConfig.getCurrentTeamId()), skillName, {})
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
const response = await api.getResponse(url)
if (!response.ok) {
let detail = 'Failed to export skill'
diff --git a/products/streamlit_apps/frontend/streamlitAppEditLogic.ts b/products/streamlit_apps/frontend/streamlitAppEditLogic.ts
index 33f94deeb834..1bbed3a63b18 100644
--- a/products/streamlit_apps/frontend/streamlitAppEditLogic.ts
+++ b/products/streamlit_apps/frontend/streamlitAppEditLogic.ts
@@ -31,7 +31,7 @@ export interface StreamlitAppEditLogicProps {
async function uploadAppVersion(projectId: string, shortId: string, file: File): Promise<AppVersionContractApi> {
const formData = new FormData()
formData.append('file', file)
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
return await api.create<AppVersionContractApi>(getStreamlitAppsUploadVersionCreateUrl(projectId, shortId), formData)
}
diff --git a/products/tracing/frontend/components/TracingRetention/tracingRetentionConfigLogic.ts b/products/tracing/frontend/components/TracingRetention/tracingRetentionConfigLogic.ts
index af1b6dd05590..642dfa9351d8 100644
--- a/products/tracing/frontend/components/TracingRetention/tracingRetentionConfigLogic.ts
+++ b/products/tracing/frontend/components/TracingRetention/tracingRetentionConfigLogic.ts
@@ -86,13 +86,13 @@ export const tracingRetentionConfigLogic = kea<tracingRetentionConfigLogicType>(
// every request, so these URLs are deliberately hand-built (same as
// tracingCorrelationConfigLogic).
loadTracingConfig: async (): Promise<TeamTracingConfigApi> => {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use organizationsProjectsTracingConfigRetrieve() from 'products/tracing/frontend/generated/api' instead.
return await api.get(`api/projects/${teamLogic.values.currentTeamId}/tracing_config/`)
},
updateRetentionDays: async (retentionDays: number): Promise<TeamTracingConfigApi> => {
const patch: PatchedTeamTracingConfigApi = { retention_days: retentionDays }
try {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use organizationsProjectsTracingConfigPartialUpdate() from 'products/tracing/frontend/generated/api' instead.
const updated: TeamTracingConfigApi = await api.update(
`api/projects/${teamLogic.values.currentTeamId}/tracing_config/`,
patch
diff --git a/products/tracing/frontend/savedViews/tracingViewsLogic.ts b/products/tracing/frontend/savedViews/tracingViewsLogic.ts
index 49efeec50b7c..b0dd42a9d0ff 100644
--- a/products/tracing/frontend/savedViews/tracingViewsLogic.ts
+++ b/products/tracing/frontend/savedViews/tracingViewsLogic.ts
@@ -112,12 +112,12 @@ export const tracingViewsLogic = kea<tracingViewsLogicType>([
[] as TracingView[],
{
loadViews: async () => {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
const response = await api.get(`${tracingViewsUrl(values.currentTeamId)}/`)
return response.results
},
createView: async ({ name, filters }: { name: string; filters: Partial<SavedTracingFilters> }) => {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
const created: TracingView = await api.create(`${tracingViewsUrl(values.currentTeamId)}/`, {
name,
filters,
@@ -138,7 +138,7 @@ export const tracingViewsLogic = kea<tracingViewsLogicType>([
listeners(({ actions, values }) => ({
deleteView: async ({ shortId }) => {
try {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
await api.delete(`${tracingViewsUrl(values.currentTeamId)}/${shortId}/`)
lemonToast.success('View deleted')
} catch {
diff --git a/products/tracing/frontend/tracingCorrelationConfigLogic.ts b/products/tracing/frontend/tracingCorrelationConfigLogic.ts
index 59e0abb6fa69..b4a352b82949 100644
--- a/products/tracing/frontend/tracingCorrelationConfigLogic.ts
+++ b/products/tracing/frontend/tracingCorrelationConfigLogic.ts
@@ -98,11 +98,11 @@ export const tracingCorrelationConfigLogic = kea<tracingCorrelationConfigLogicTy
// /api/projects/:pid/environments/:id/ variant, whose viewset rejects every
// request, so these URLs are deliberately hand-built.
loadTracingConfig: async (): Promise<TeamTracingConfigApi> => {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use organizationsProjectsTracingConfigRetrieve() from 'products/tracing/frontend/generated/api' instead.
return await api.get(`api/projects/${values.currentTeamId}/tracing_config/`)
},
updateTracingConfig: async (patch: PatchedTeamTracingConfigApi): Promise<TeamTracingConfigApi> => {
- // nosemgrep: prefer-codegen-api
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a hand-written URL and an unchecked response type. Use organizationsProjectsTracingConfigPartialUpdate() from 'products/tracing/frontend/generated/api' instead.
return await api.update(`api/projects/${values.currentTeamId}/tracing_config/`, patch)
},
},
diff --git a/products/user_interviews/frontend/userInterviewLogic.ts b/products/user_interviews/frontend/userInterviewLogic.ts
index 8ac53a1de3f8..67719550c21b 100644
--- a/products/user_interviews/frontend/userInterviewLogic.ts
+++ b/products/user_interviews/frontend/userInterviewLogic.ts
@@ -338,6 +338,7 @@ export const userInterviewLogic = kea<userInterviewLogicType>([
exportLinksCsv: async () => {
const projectId = String(teamLogic.values.currentTeamId)
try {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
const response = await api.createResponse(getUserInterviewTopicsLinksCsvCreateUrl(projectId, props.id))
if (!response.ok) {
throw new Error(`Export failed (${response.status})`)
diff --git a/products/wizard/frontend/wizardApi.ts b/products/wizard/frontend/wizardApi.ts
index 89c94030ab9c..0012358d793d 100644
--- a/products/wizard/frontend/wizardApi.ts
+++ b/products/wizard/frontend/wizardApi.ts
@@ -12,6 +12,7 @@ export async function loadWizardRunArtifactContent(
runId: string,
artifactId: string
): Promise<string> {
+ // nosemgrep: prefer-codegen-api -- Legacy raw API call with a URL built at runtime and an unchecked response type. Use a generated function if one covers this endpoint.
const response = await api.getResponse(getWizardRunsArtifactsContentRetrieveUrl(projectId, runId, artifactId))
return response.text()