feat(api): generate models for patched products, refunds, site configurations, payments, and user registration
- Added PatchedProduct, PatchedProductImage, PatchedRefund, and related models. - Introduced Payment, PaymentBody, PaymentCreate, and PaymentRead models. - Created enums for payment methods, reasons for refunds, roles, and shipping methods. - Implemented models for site configurations and their opening hours. - Added ZasilkovnaPacket and ZasilkovnaShipment models for handling shipping data. - Generated user registration model with validation rules. - Updated public API functions to support new models and queries.
This commit is contained in:
@@ -12,55 +12,63 @@ if (SKIP_ORVAL) {
|
||||
}
|
||||
|
||||
export default defineConfig({
|
||||
// Public endpoints (all endpoints tagged with "public")
|
||||
public: {
|
||||
input: {
|
||||
target: `${backendUrl}/api/schema/`,
|
||||
|
||||
filters: {
|
||||
mode: "include",
|
||||
tags: ["public"],
|
||||
},
|
||||
},
|
||||
output: {
|
||||
target: "api/generated/public.ts",
|
||||
target: "api/generated/public/index.ts",
|
||||
schemas: "api/generated/public/models",
|
||||
|
||||
mode: "tags",
|
||||
clean: true,
|
||||
|
||||
client: "react-query",
|
||||
httpClient: "axios",
|
||||
|
||||
override: {
|
||||
mutator: {
|
||||
path: "api/publicClient.ts", //IMPORTANTE
|
||||
path: "api/publicClient.ts",
|
||||
name: "publicMutator",
|
||||
},
|
||||
formUrlEncoded: true,
|
||||
useDates: true,
|
||||
},
|
||||
},
|
||||
hooks: {
|
||||
afterAllFilesWrite: 'prettier --write',
|
||||
}
|
||||
},
|
||||
|
||||
// All private endpoints (organized by tags, shared models folder)
|
||||
private: {
|
||||
input: {
|
||||
target: `${backendUrl}/api/schema/`,
|
||||
filters: {
|
||||
mode: "exclude",
|
||||
tags: ["public"], // Exclude public endpoints, include everything else
|
||||
},
|
||||
},
|
||||
output: {
|
||||
target: "api/generated/private.ts", //IMPORTANTE
|
||||
target: "api/generated/private",
|
||||
schemas: "api/generated/private/models",
|
||||
|
||||
mode: "tags",
|
||||
mode: "tags-split", // Split by tag into separate files
|
||||
clean: true,
|
||||
|
||||
client: "react-query",
|
||||
httpClient: "axios",
|
||||
|
||||
override: {
|
||||
mutator: {
|
||||
path: "api/privateClient.ts",
|
||||
name: "privateMutator",
|
||||
},
|
||||
formUrlEncoded: true,
|
||||
useDates: true,
|
||||
query: {
|
||||
useQuery: true,
|
||||
useInfinite: false, // Disable infinite queries to avoid page param errors
|
||||
},
|
||||
},
|
||||
},
|
||||
hooks: {
|
||||
|
||||
Reference in New Issue
Block a user