- Created operation models and OpenAPI specs for Features (Create, Update, List, Get, Delete) - Created operation models and OpenAPI specs for Entities (Create, List, Get, Delete) - Created operation models and OpenAPI specs for Core endpoints (Cancel, Track, Query) - Created operation models and OpenAPI specs for Customers (Create, Update, List, Get, Delete) - Fixed bug: Added 'archived' field to UpdateProductV2Params - Fixed enum usage: Changed z.enum() to z.nativeEnum() for TypeScript enums - Updated all OpenAPI specs to use requestParams format (path/query with zod schemas) - Created shared SuccessResponseSchema in common/commonResponses.ts - Updated models.ts to export all new schemas and OpenAPI operations - Changed OpenAPI export to JSON format (YAML export has serialization issues with zod schemas) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
107 lines
2.0 KiB
TypeScript
107 lines
2.0 KiB
TypeScript
import { APIFeatureSchema } from "./apiFeature.js";
|
|
import {
|
|
CreateFeatureParamsSchema,
|
|
UpdateFeatureParamsSchema,
|
|
} from "./featureOpModels.js";
|
|
import { z } from "zod/v4";
|
|
import { SuccessResponseSchema } from "../common/commonResponses.js";
|
|
|
|
const FeatureListResponseSchema = z
|
|
.object({
|
|
list: z.array(APIFeatureSchema),
|
|
})
|
|
.meta({
|
|
id: "FeatureListResponse",
|
|
});
|
|
|
|
export const featureOps = {
|
|
"/features": {
|
|
get: {
|
|
summary: "List Features",
|
|
tags: ["features"],
|
|
requestParams: {
|
|
query: z.object({
|
|
include_archived: z.boolean().optional(),
|
|
}),
|
|
},
|
|
responses: {
|
|
"200": {
|
|
description: "200 OK",
|
|
content: { "application/json": { schema: FeatureListResponseSchema } },
|
|
},
|
|
},
|
|
},
|
|
post: {
|
|
summary: "Create Feature",
|
|
tags: ["features"],
|
|
requestBody: {
|
|
content: {
|
|
"application/json": { schema: CreateFeatureParamsSchema },
|
|
},
|
|
},
|
|
responses: {
|
|
"200": {
|
|
description: "200 OK",
|
|
content: { "application/json": { schema: APIFeatureSchema } },
|
|
},
|
|
},
|
|
},
|
|
},
|
|
"/features/{featureId}": {
|
|
get: {
|
|
summary: "Get Feature",
|
|
tags: ["features"],
|
|
requestParams: {
|
|
path: z.object({
|
|
featureId: z.string(),
|
|
}),
|
|
},
|
|
responses: {
|
|
"200": {
|
|
description: "200 OK",
|
|
content: { "application/json": { schema: APIFeatureSchema } },
|
|
},
|
|
},
|
|
},
|
|
post: {
|
|
summary: "Update Feature",
|
|
tags: ["features"],
|
|
requestParams: {
|
|
path: z.object({
|
|
featureId: z.string(),
|
|
}),
|
|
},
|
|
requestBody: {
|
|
content: {
|
|
"application/json": { schema: UpdateFeatureParamsSchema },
|
|
},
|
|
},
|
|
responses: {
|
|
"200": {
|
|
description: "200 OK",
|
|
content: { "application/json": { schema: APIFeatureSchema } },
|
|
},
|
|
},
|
|
},
|
|
delete: {
|
|
summary: "Delete Feature",
|
|
tags: ["features"],
|
|
requestParams: {
|
|
path: z.object({
|
|
featureId: z.string(),
|
|
}),
|
|
},
|
|
responses: {
|
|
"200": {
|
|
description: "200 OK",
|
|
content: {
|
|
"application/json": {
|
|
schema: SuccessResponseSchema,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
};
|