Skip to content

Commit 68e5836

Browse files
feat: Cleanup all feature schemas (#515)
* feat: add v2 feature status update endpoint - Add /v2/projects/:project/features/:feature/status PATCH endpoint to zodClient.ts - Export UpdateFeatureStatusDto schema from zodClientV2.ts - Remove duplicate UpdateFeatureStatusDto from schemas.ts and import from zodClientV2.ts - Maintain single source of truth for UpdateFeatureStatusDto schema * test: fix features update command test request body mismatches - Remove extra properties (headless, whichFields, listPromptOption) from HTTP mock expectations - These properties were filtered out by Zod validation in the actual command - All tests now pass with correct request body matching * feat: cleanup all feature schemas, rename -> * fix: add renamed files
1 parent 46fe458 commit 68e5836

File tree

9 files changed

+1627
-6761
lines changed

9 files changed

+1627
-6761
lines changed

src/api/apiClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import axios, { AxiosError } from 'axios'
22
import { BASE_URL } from './common'
3-
import { createApiClient, createV2ApiClient } from './zodClient'
3+
import { createApiClient, createV2ApiClient } from './zodClientAPI'
44
import { ZodIssueCode, ZodIssueOptionalMessage, ErrorMapCtx } from 'zod'
55

66
export const axiosClient = axios.create({

src/api/schemas.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ import {
3535
UpdateUserOverrideDto,
3636
UserOverride,
3737
FeatureOverride,
38-
} from './zodClient'
38+
} from './zodClientAPI'
39+
import { UpdateFeatureStatusDto } from './zodSchemas'
3940

4041
export type Project = z.infer<typeof Project>
4142
export type Environment = z.infer<typeof Environment>
@@ -69,12 +70,8 @@ export { CreateFeatureDto }
6970
export type UpdateFeatureParams = z.infer<typeof UpdateFeatureDto>
7071
export { UpdateFeatureDto }
7172

72-
export const UpdateFeatureStatusDto = z.object({
73-
status: z.enum(['active', 'complete', 'archived']),
74-
staticVariation: z.string().optional(),
75-
})
76-
7773
export type UpdateFeatureStatusParams = z.infer<typeof UpdateFeatureStatusDto>
74+
export { UpdateFeatureStatusDto }
7875

7976
export type CreateVariableParams = z.infer<typeof CreateVariableDto>
8077
export { CreateVariableDto }

0 commit comments

Comments
 (0)