- 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>
103 lines
2.0 KiB
TypeScript
103 lines
2.0 KiB
TypeScript
import {
|
|
AttachResultSchema,
|
|
CheckoutResponseSchema,
|
|
ExtAttachBodySchema,
|
|
ExtCheckoutParamsSchema,
|
|
} from "@api/models.js";
|
|
import {
|
|
CancelBodySchema,
|
|
CancelResultSchema,
|
|
QueryParamsSchema,
|
|
QueryResultSchema,
|
|
TrackParamsSchema,
|
|
TrackResultSchema,
|
|
} from "./coreOpModels.js";
|
|
|
|
export const coreOps = {
|
|
"/core": {
|
|
"/attach": {
|
|
post: {
|
|
summary: "Attach Product",
|
|
tags: ["core"],
|
|
requestBody: {
|
|
content: {
|
|
"application/json": { schema: ExtAttachBodySchema },
|
|
},
|
|
},
|
|
responses: {
|
|
"200": {
|
|
description: "200 OK",
|
|
content: { "application/json": { schema: AttachResultSchema } },
|
|
},
|
|
},
|
|
},
|
|
},
|
|
"/checkout": {
|
|
post: {
|
|
summary: "Checkout",
|
|
tags: ["core"],
|
|
requestBody: {
|
|
content: { "application/json": { schema: ExtCheckoutParamsSchema } },
|
|
},
|
|
responses: {
|
|
"200": {
|
|
description: "200 OK",
|
|
content: { "application/json": { schema: CheckoutResponseSchema } },
|
|
},
|
|
},
|
|
},
|
|
},
|
|
"/cancel": {
|
|
post: {
|
|
summary: "Cancel Product",
|
|
tags: ["core"],
|
|
requestBody: {
|
|
content: {
|
|
"application/json": { schema: CancelBodySchema },
|
|
},
|
|
},
|
|
responses: {
|
|
"200": {
|
|
description: "200 OK",
|
|
content: { "application/json": { schema: CancelResultSchema } },
|
|
},
|
|
},
|
|
},
|
|
},
|
|
"/track": {
|
|
post: {
|
|
summary: "Track Event",
|
|
tags: ["core"],
|
|
requestBody: {
|
|
content: {
|
|
"application/json": { schema: TrackParamsSchema },
|
|
},
|
|
},
|
|
responses: {
|
|
"200": {
|
|
description: "200 OK",
|
|
content: { "application/json": { schema: TrackResultSchema } },
|
|
},
|
|
},
|
|
},
|
|
},
|
|
"/query": {
|
|
post: {
|
|
summary: "Query Analytics",
|
|
tags: ["core"],
|
|
requestBody: {
|
|
content: {
|
|
"application/json": { schema: QueryParamsSchema },
|
|
},
|
|
},
|
|
responses: {
|
|
"200": {
|
|
description: "200 OK",
|
|
content: { "application/json": { schema: QueryResultSchema } },
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
};
|