@promptpartner/bexio-mcp-server 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +161 -0
- package/dist/bexio-client.d.ts +350 -0
- package/dist/bexio-client.js +1045 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +80 -0
- package/dist/logger.d.ts +17 -0
- package/dist/logger.js +28 -0
- package/dist/server.d.ts +18 -0
- package/dist/server.js +81 -0
- package/dist/shared/errors.d.ts +21 -0
- package/dist/shared/errors.js +54 -0
- package/dist/shared/index.d.ts +5 -0
- package/dist/shared/index.js +5 -0
- package/dist/shared/response.d.ts +24 -0
- package/dist/shared/response.js +92 -0
- package/dist/tools/accounting/definitions.d.ts +9 -0
- package/dist/tools/accounting/definitions.js +345 -0
- package/dist/tools/accounting/handlers.d.ts +10 -0
- package/dist/tools/accounting/handlers.js +121 -0
- package/dist/tools/accounting/index.d.ts +16 -0
- package/dist/tools/accounting/index.js +16 -0
- package/dist/tools/banking/definitions.d.ts +11 -0
- package/dist/tools/banking/definitions.js +349 -0
- package/dist/tools/banking/handlers.d.ts +9 -0
- package/dist/tools/banking/handlers.js +123 -0
- package/dist/tools/banking/index.d.ts +6 -0
- package/dist/tools/banking/index.js +6 -0
- package/dist/tools/company/definitions.d.ts +7 -0
- package/dist/tools/company/definitions.js +87 -0
- package/dist/tools/company/handlers.d.ts +7 -0
- package/dist/tools/company/handlers.js +31 -0
- package/dist/tools/company/index.d.ts +6 -0
- package/dist/tools/company/index.js +6 -0
- package/dist/tools/contacts/definitions.d.ts +6 -0
- package/dist/tools/contacts/definitions.js +150 -0
- package/dist/tools/contacts/handlers.d.ts +7 -0
- package/dist/tools/contacts/handlers.js +40 -0
- package/dist/tools/contacts/index.d.ts +6 -0
- package/dist/tools/contacts/index.js +5 -0
- package/dist/tools/deliveries/definitions.d.ts +6 -0
- package/dist/tools/deliveries/definitions.js +67 -0
- package/dist/tools/deliveries/handlers.d.ts +7 -0
- package/dist/tools/deliveries/handlers.js +28 -0
- package/dist/tools/deliveries/index.d.ts +6 -0
- package/dist/tools/deliveries/index.js +5 -0
- package/dist/tools/files/definitions.d.ts +6 -0
- package/dist/tools/files/definitions.js +217 -0
- package/dist/tools/files/handlers.d.ts +7 -0
- package/dist/tools/files/handlers.js +63 -0
- package/dist/tools/files/index.d.ts +6 -0
- package/dist/tools/files/index.js +5 -0
- package/dist/tools/index.d.ts +19 -0
- package/dist/tools/index.js +93 -0
- package/dist/tools/invoices/definitions.d.ts +6 -0
- package/dist/tools/invoices/definitions.js +147 -0
- package/dist/tools/invoices/handlers.d.ts +7 -0
- package/dist/tools/invoices/handlers.js +119 -0
- package/dist/tools/invoices/index.d.ts +6 -0
- package/dist/tools/invoices/index.js +5 -0
- package/dist/tools/items/definitions.d.ts +6 -0
- package/dist/tools/items/definitions.js +100 -0
- package/dist/tools/items/handlers.d.ts +7 -0
- package/dist/tools/items/handlers.js +36 -0
- package/dist/tools/items/index.d.ts +6 -0
- package/dist/tools/items/index.js +5 -0
- package/dist/tools/misc/definitions.d.ts +6 -0
- package/dist/tools/misc/definitions.js +126 -0
- package/dist/tools/misc/handlers.d.ts +7 -0
- package/dist/tools/misc/handlers.js +52 -0
- package/dist/tools/misc/index.d.ts +6 -0
- package/dist/tools/misc/index.js +5 -0
- package/dist/tools/orders/definitions.d.ts +6 -0
- package/dist/tools/orders/definitions.js +114 -0
- package/dist/tools/orders/handlers.d.ts +7 -0
- package/dist/tools/orders/handlers.js +62 -0
- package/dist/tools/orders/index.d.ts +6 -0
- package/dist/tools/orders/index.js +5 -0
- package/dist/tools/payments/definitions.d.ts +6 -0
- package/dist/tools/payments/definitions.js +74 -0
- package/dist/tools/payments/handlers.d.ts +7 -0
- package/dist/tools/payments/handlers.js +28 -0
- package/dist/tools/payments/index.d.ts +6 -0
- package/dist/tools/payments/index.js +5 -0
- package/dist/tools/payroll/definitions.d.ts +15 -0
- package/dist/tools/payroll/definitions.js +239 -0
- package/dist/tools/payroll/handlers.d.ts +14 -0
- package/dist/tools/payroll/handlers.js +152 -0
- package/dist/tools/payroll/index.d.ts +16 -0
- package/dist/tools/payroll/index.js +16 -0
- package/dist/tools/projects/definitions.d.ts +7 -0
- package/dist/tools/projects/definitions.js +430 -0
- package/dist/tools/projects/handlers.d.ts +7 -0
- package/dist/tools/projects/handlers.js +127 -0
- package/dist/tools/projects/index.d.ts +6 -0
- package/dist/tools/projects/index.js +6 -0
- package/dist/tools/purchase/definitions.d.ts +6 -0
- package/dist/tools/purchase/definitions.js +381 -0
- package/dist/tools/purchase/handlers.d.ts +7 -0
- package/dist/tools/purchase/handlers.js +120 -0
- package/dist/tools/purchase/index.d.ts +7 -0
- package/dist/tools/purchase/index.js +6 -0
- package/dist/tools/quotes/definitions.d.ts +6 -0
- package/dist/tools/quotes/definitions.js +174 -0
- package/dist/tools/quotes/handlers.d.ts +7 -0
- package/dist/tools/quotes/handlers.js +79 -0
- package/dist/tools/quotes/index.d.ts +6 -0
- package/dist/tools/quotes/index.js +5 -0
- package/dist/tools/reference/definitions.d.ts +7 -0
- package/dist/tools/reference/definitions.js +421 -0
- package/dist/tools/reference/handlers.d.ts +7 -0
- package/dist/tools/reference/handlers.js +161 -0
- package/dist/tools/reference/index.d.ts +6 -0
- package/dist/tools/reference/index.js +6 -0
- package/dist/tools/reminders/definitions.d.ts +6 -0
- package/dist/tools/reminders/definitions.js +132 -0
- package/dist/tools/reminders/handlers.d.ts +7 -0
- package/dist/tools/reminders/handlers.js +43 -0
- package/dist/tools/reminders/index.d.ts +6 -0
- package/dist/tools/reminders/index.js +5 -0
- package/dist/tools/reports/definitions.d.ts +6 -0
- package/dist/tools/reports/definitions.js +133 -0
- package/dist/tools/reports/handlers.d.ts +7 -0
- package/dist/tools/reports/handlers.js +33 -0
- package/dist/tools/reports/index.d.ts +6 -0
- package/dist/tools/reports/index.js +5 -0
- package/dist/tools/timetracking/definitions.d.ts +9 -0
- package/dist/tools/timetracking/definitions.js +226 -0
- package/dist/tools/timetracking/handlers.d.ts +9 -0
- package/dist/tools/timetracking/handlers.js +88 -0
- package/dist/tools/timetracking/index.d.ts +6 -0
- package/dist/tools/timetracking/index.js +6 -0
- package/dist/tools/users/definitions.d.ts +6 -0
- package/dist/tools/users/definitions.js +93 -0
- package/dist/tools/users/handlers.d.ts +7 -0
- package/dist/tools/users/handlers.js +35 -0
- package/dist/tools/users/index.d.ts +6 -0
- package/dist/tools/users/index.js +5 -0
- package/dist/transports/http.d.ts +17 -0
- package/dist/transports/http.js +203 -0
- package/dist/transports/index.d.ts +4 -0
- package/dist/transports/index.js +4 -0
- package/dist/types/common.d.ts +32 -0
- package/dist/types/common.js +11 -0
- package/dist/types/index.d.ts +9 -0
- package/dist/types/index.js +11 -0
- package/dist/types/schemas/accounting.d.ts +225 -0
- package/dist/types/schemas/accounting.js +96 -0
- package/dist/types/schemas/banking.d.ts +207 -0
- package/dist/types/schemas/banking.js +86 -0
- package/dist/types/schemas/company.d.ts +44 -0
- package/dist/types/schemas/company.js +23 -0
- package/dist/types/schemas/contacts.d.ts +104 -0
- package/dist/types/schemas/contacts.js +42 -0
- package/dist/types/schemas/deliveries.d.ts +40 -0
- package/dist/types/schemas/deliveries.js +22 -0
- package/dist/types/schemas/files.d.ts +152 -0
- package/dist/types/schemas/files.js +64 -0
- package/dist/types/schemas/index.d.ts +24 -0
- package/dist/types/schemas/index.js +44 -0
- package/dist/types/schemas/invoices.d.ts +594 -0
- package/dist/types/schemas/invoices.js +109 -0
- package/dist/types/schemas/items.d.ts +153 -0
- package/dist/types/schemas/items.js +43 -0
- package/dist/types/schemas/misc.d.ts +64 -0
- package/dist/types/schemas/misc.js +36 -0
- package/dist/types/schemas/orders.d.ts +657 -0
- package/dist/types/schemas/orders.js +101 -0
- package/dist/types/schemas/payments.d.ts +46 -0
- package/dist/types/schemas/payments.js +24 -0
- package/dist/types/schemas/payroll.d.ts +146 -0
- package/dist/types/schemas/payroll.js +65 -0
- package/dist/types/schemas/projects.d.ts +268 -0
- package/dist/types/schemas/projects.js +102 -0
- package/dist/types/schemas/purchase.d.ts +228 -0
- package/dist/types/schemas/purchase.js +114 -0
- package/dist/types/schemas/quotes.d.ts +102 -0
- package/dist/types/schemas/quotes.js +49 -0
- package/dist/types/schemas/reference.d.ts +240 -0
- package/dist/types/schemas/reference.js +99 -0
- package/dist/types/schemas/reminders.d.ts +76 -0
- package/dist/types/schemas/reminders.js +38 -0
- package/dist/types/schemas/reports.d.ts +69 -0
- package/dist/types/schemas/reports.js +36 -0
- package/dist/types/schemas/timetracking.d.ts +150 -0
- package/dist/types/schemas/timetracking.js +68 -0
- package/dist/types/schemas/users.d.ts +51 -0
- package/dist/types/schemas/users.js +27 -0
- package/dist/ui/contact-card/mcp-app.d.ts +1 -0
- package/dist/ui/contact-card/mcp-app.js +108 -0
- package/dist/ui/dashboard/mcp-app.d.ts +1 -0
- package/dist/ui/dashboard/mcp-app.js +81 -0
- package/dist/ui/invoice-preview/mcp-app.d.ts +1 -0
- package/dist/ui/invoice-preview/mcp-app.js +96 -0
- package/dist/ui-resources.d.ts +17 -0
- package/dist/ui-resources.js +124 -0
- package/dist/vite.config.d.ts +2 -0
- package/dist/vite.config.js +46 -0
- package/package.json +78 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Invoice-related Zod schemas and types.
|
|
3
|
+
* Domain: Invoices (kb_invoice)
|
|
4
|
+
*/
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
// Invoice position (line item)
|
|
7
|
+
export const InvoicePositionSchema = z
|
|
8
|
+
.object({
|
|
9
|
+
type: z.string().min(1, "Position type is required"),
|
|
10
|
+
text: z.string().min(1, "Description is required"),
|
|
11
|
+
amount: z.number().positive("Amount must be positive"),
|
|
12
|
+
unit_price: z.number().positive("Unit price must be positive"),
|
|
13
|
+
discount_in_percent: z.number().min(0).max(100).optional(),
|
|
14
|
+
position_total: z.number().optional(),
|
|
15
|
+
unit_id: z.number().int().positive().optional(),
|
|
16
|
+
account_id: z.number().int().positive().optional(),
|
|
17
|
+
tax_id: z.number().int().positive().optional(),
|
|
18
|
+
tax_value: z.number().optional(),
|
|
19
|
+
mwst_type: z.number().int().optional(),
|
|
20
|
+
mwst_is_net: z.boolean().optional(),
|
|
21
|
+
map_all: z.boolean().optional(),
|
|
22
|
+
})
|
|
23
|
+
.passthrough();
|
|
24
|
+
// Invoice creation payload
|
|
25
|
+
export const InvoiceCreateSchema = z
|
|
26
|
+
.object({
|
|
27
|
+
title: z.string().min(1, "Invoice title is required"),
|
|
28
|
+
contact_id: z.number().int().positive("Contact ID must be positive"),
|
|
29
|
+
currency_id: z.number().int().positive().optional(),
|
|
30
|
+
language_id: z.number().int().positive().optional(),
|
|
31
|
+
user_id: z.number().int().positive().optional(),
|
|
32
|
+
bank_account_id: z.number().int().positive().optional(),
|
|
33
|
+
payment_type_id: z.number().int().positive().optional(),
|
|
34
|
+
mwst_type: z.number().int().optional(),
|
|
35
|
+
mwst_is_net: z.boolean().optional(),
|
|
36
|
+
show_position_taxes: z.boolean().optional(),
|
|
37
|
+
is_valid_from: z
|
|
38
|
+
.string()
|
|
39
|
+
.regex(/^\d{4}-\d{2}-\d{2}$/, "Date must be in YYYY-MM-DD format")
|
|
40
|
+
.optional(),
|
|
41
|
+
is_valid_until: z
|
|
42
|
+
.string()
|
|
43
|
+
.regex(/^\d{4}-\d{2}-\d{2}$/, "Date must be in YYYY-MM-DD format")
|
|
44
|
+
.optional(),
|
|
45
|
+
positions: z
|
|
46
|
+
.array(InvoicePositionSchema)
|
|
47
|
+
.min(1, "At least one position is required"),
|
|
48
|
+
})
|
|
49
|
+
.passthrough();
|
|
50
|
+
// List invoices
|
|
51
|
+
export const ListInvoicesParamsSchema = z.object({
|
|
52
|
+
limit: z.number().int().positive().default(50),
|
|
53
|
+
offset: z.number().int().min(0).default(0),
|
|
54
|
+
});
|
|
55
|
+
// List all invoices (auto-pagination)
|
|
56
|
+
export const ListAllInvoicesParamsSchema = z.object({
|
|
57
|
+
chunk_size: z.number().int().positive().default(100),
|
|
58
|
+
});
|
|
59
|
+
// Get single invoice
|
|
60
|
+
export const GetInvoiceParamsSchema = z.object({
|
|
61
|
+
invoice_id: z.number().int().positive(),
|
|
62
|
+
});
|
|
63
|
+
// Search invoices
|
|
64
|
+
export const SearchInvoicesParamsSchema = z.object({
|
|
65
|
+
query: z.string().optional(),
|
|
66
|
+
field: z.string().default("title"),
|
|
67
|
+
operator: z.string().default("LIKE"),
|
|
68
|
+
filters: z
|
|
69
|
+
.array(z.object({
|
|
70
|
+
field: z.string(),
|
|
71
|
+
operator: z.string(),
|
|
72
|
+
value: z.unknown(),
|
|
73
|
+
}))
|
|
74
|
+
.optional(),
|
|
75
|
+
limit: z.number().int().positive().optional(),
|
|
76
|
+
});
|
|
77
|
+
// Search by customer name
|
|
78
|
+
export const SearchInvoicesByCustomerParamsSchema = z.object({
|
|
79
|
+
customer_name: z.string().min(1),
|
|
80
|
+
limit: z.number().int().positive().default(50),
|
|
81
|
+
});
|
|
82
|
+
// Create invoice
|
|
83
|
+
export const CreateInvoiceParamsSchema = z.object({
|
|
84
|
+
invoice_data: InvoiceCreateSchema,
|
|
85
|
+
});
|
|
86
|
+
// List invoice statuses
|
|
87
|
+
export const ListInvoiceStatusesParamsSchema = z.object({});
|
|
88
|
+
// List all document statuses
|
|
89
|
+
export const ListAllStatusesParamsSchema = z.object({
|
|
90
|
+
document_type: z
|
|
91
|
+
.enum(["all", "invoices", "quotes", "orders"])
|
|
92
|
+
.default("all"),
|
|
93
|
+
});
|
|
94
|
+
// Invoice actions
|
|
95
|
+
export const IssueInvoiceParamsSchema = z.object({
|
|
96
|
+
invoice_id: z.number().int().positive(),
|
|
97
|
+
});
|
|
98
|
+
export const CancelInvoiceParamsSchema = z.object({
|
|
99
|
+
invoice_id: z.number().int().positive(),
|
|
100
|
+
});
|
|
101
|
+
export const MarkInvoiceAsSentParamsSchema = z.object({
|
|
102
|
+
invoice_id: z.number().int().positive(),
|
|
103
|
+
});
|
|
104
|
+
export const SendInvoiceParamsSchema = z.object({
|
|
105
|
+
invoice_id: z.number().int().positive(),
|
|
106
|
+
});
|
|
107
|
+
export const CopyInvoiceParamsSchema = z.object({
|
|
108
|
+
invoice_id: z.number().int().positive(),
|
|
109
|
+
});
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Item-related Zod schemas and types.
|
|
3
|
+
* Domain: Items (Articles) and Taxes
|
|
4
|
+
*/
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
export declare const ItemCreateSchema: z.ZodObject<{
|
|
7
|
+
name_1: z.ZodString;
|
|
8
|
+
name_2: z.ZodOptional<z.ZodString>;
|
|
9
|
+
description: z.ZodOptional<z.ZodString>;
|
|
10
|
+
internal_pos: z.ZodOptional<z.ZodString>;
|
|
11
|
+
unit_id: z.ZodOptional<z.ZodNumber>;
|
|
12
|
+
purchase_price: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
sale_price: z.ZodOptional<z.ZodNumber>;
|
|
14
|
+
article_type_id: z.ZodOptional<z.ZodNumber>;
|
|
15
|
+
tax_income_id: z.ZodOptional<z.ZodNumber>;
|
|
16
|
+
tax_id: z.ZodOptional<z.ZodNumber>;
|
|
17
|
+
account_id: z.ZodOptional<z.ZodNumber>;
|
|
18
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
19
|
+
name_1: z.ZodString;
|
|
20
|
+
name_2: z.ZodOptional<z.ZodString>;
|
|
21
|
+
description: z.ZodOptional<z.ZodString>;
|
|
22
|
+
internal_pos: z.ZodOptional<z.ZodString>;
|
|
23
|
+
unit_id: z.ZodOptional<z.ZodNumber>;
|
|
24
|
+
purchase_price: z.ZodOptional<z.ZodNumber>;
|
|
25
|
+
sale_price: z.ZodOptional<z.ZodNumber>;
|
|
26
|
+
article_type_id: z.ZodOptional<z.ZodNumber>;
|
|
27
|
+
tax_income_id: z.ZodOptional<z.ZodNumber>;
|
|
28
|
+
tax_id: z.ZodOptional<z.ZodNumber>;
|
|
29
|
+
account_id: z.ZodOptional<z.ZodNumber>;
|
|
30
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
31
|
+
name_1: z.ZodString;
|
|
32
|
+
name_2: z.ZodOptional<z.ZodString>;
|
|
33
|
+
description: z.ZodOptional<z.ZodString>;
|
|
34
|
+
internal_pos: z.ZodOptional<z.ZodString>;
|
|
35
|
+
unit_id: z.ZodOptional<z.ZodNumber>;
|
|
36
|
+
purchase_price: z.ZodOptional<z.ZodNumber>;
|
|
37
|
+
sale_price: z.ZodOptional<z.ZodNumber>;
|
|
38
|
+
article_type_id: z.ZodOptional<z.ZodNumber>;
|
|
39
|
+
tax_income_id: z.ZodOptional<z.ZodNumber>;
|
|
40
|
+
tax_id: z.ZodOptional<z.ZodNumber>;
|
|
41
|
+
account_id: z.ZodOptional<z.ZodNumber>;
|
|
42
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
43
|
+
export type ItemCreate = z.infer<typeof ItemCreateSchema>;
|
|
44
|
+
export declare const ListItemsParamsSchema: z.ZodObject<{
|
|
45
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
46
|
+
offset: z.ZodDefault<z.ZodNumber>;
|
|
47
|
+
}, "strip", z.ZodTypeAny, {
|
|
48
|
+
limit: number;
|
|
49
|
+
offset: number;
|
|
50
|
+
}, {
|
|
51
|
+
limit?: number | undefined;
|
|
52
|
+
offset?: number | undefined;
|
|
53
|
+
}>;
|
|
54
|
+
export type ListItemsParams = z.infer<typeof ListItemsParamsSchema>;
|
|
55
|
+
export declare const GetItemParamsSchema: z.ZodObject<{
|
|
56
|
+
item_id: z.ZodNumber;
|
|
57
|
+
}, "strip", z.ZodTypeAny, {
|
|
58
|
+
item_id: number;
|
|
59
|
+
}, {
|
|
60
|
+
item_id: number;
|
|
61
|
+
}>;
|
|
62
|
+
export type GetItemParams = z.infer<typeof GetItemParamsSchema>;
|
|
63
|
+
export declare const CreateItemParamsSchema: z.ZodObject<{
|
|
64
|
+
item_data: z.ZodObject<{
|
|
65
|
+
name_1: z.ZodString;
|
|
66
|
+
name_2: z.ZodOptional<z.ZodString>;
|
|
67
|
+
description: z.ZodOptional<z.ZodString>;
|
|
68
|
+
internal_pos: z.ZodOptional<z.ZodString>;
|
|
69
|
+
unit_id: z.ZodOptional<z.ZodNumber>;
|
|
70
|
+
purchase_price: z.ZodOptional<z.ZodNumber>;
|
|
71
|
+
sale_price: z.ZodOptional<z.ZodNumber>;
|
|
72
|
+
article_type_id: z.ZodOptional<z.ZodNumber>;
|
|
73
|
+
tax_income_id: z.ZodOptional<z.ZodNumber>;
|
|
74
|
+
tax_id: z.ZodOptional<z.ZodNumber>;
|
|
75
|
+
account_id: z.ZodOptional<z.ZodNumber>;
|
|
76
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
77
|
+
name_1: z.ZodString;
|
|
78
|
+
name_2: z.ZodOptional<z.ZodString>;
|
|
79
|
+
description: z.ZodOptional<z.ZodString>;
|
|
80
|
+
internal_pos: z.ZodOptional<z.ZodString>;
|
|
81
|
+
unit_id: z.ZodOptional<z.ZodNumber>;
|
|
82
|
+
purchase_price: z.ZodOptional<z.ZodNumber>;
|
|
83
|
+
sale_price: z.ZodOptional<z.ZodNumber>;
|
|
84
|
+
article_type_id: z.ZodOptional<z.ZodNumber>;
|
|
85
|
+
tax_income_id: z.ZodOptional<z.ZodNumber>;
|
|
86
|
+
tax_id: z.ZodOptional<z.ZodNumber>;
|
|
87
|
+
account_id: z.ZodOptional<z.ZodNumber>;
|
|
88
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
89
|
+
name_1: z.ZodString;
|
|
90
|
+
name_2: z.ZodOptional<z.ZodString>;
|
|
91
|
+
description: z.ZodOptional<z.ZodString>;
|
|
92
|
+
internal_pos: z.ZodOptional<z.ZodString>;
|
|
93
|
+
unit_id: z.ZodOptional<z.ZodNumber>;
|
|
94
|
+
purchase_price: z.ZodOptional<z.ZodNumber>;
|
|
95
|
+
sale_price: z.ZodOptional<z.ZodNumber>;
|
|
96
|
+
article_type_id: z.ZodOptional<z.ZodNumber>;
|
|
97
|
+
tax_income_id: z.ZodOptional<z.ZodNumber>;
|
|
98
|
+
tax_id: z.ZodOptional<z.ZodNumber>;
|
|
99
|
+
account_id: z.ZodOptional<z.ZodNumber>;
|
|
100
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
101
|
+
}, "strip", z.ZodTypeAny, {
|
|
102
|
+
item_data: {
|
|
103
|
+
name_1: string;
|
|
104
|
+
unit_id?: number | undefined;
|
|
105
|
+
account_id?: number | undefined;
|
|
106
|
+
tax_id?: number | undefined;
|
|
107
|
+
name_2?: string | undefined;
|
|
108
|
+
description?: string | undefined;
|
|
109
|
+
internal_pos?: string | undefined;
|
|
110
|
+
purchase_price?: number | undefined;
|
|
111
|
+
sale_price?: number | undefined;
|
|
112
|
+
article_type_id?: number | undefined;
|
|
113
|
+
tax_income_id?: number | undefined;
|
|
114
|
+
} & {
|
|
115
|
+
[k: string]: unknown;
|
|
116
|
+
};
|
|
117
|
+
}, {
|
|
118
|
+
item_data: {
|
|
119
|
+
name_1: string;
|
|
120
|
+
unit_id?: number | undefined;
|
|
121
|
+
account_id?: number | undefined;
|
|
122
|
+
tax_id?: number | undefined;
|
|
123
|
+
name_2?: string | undefined;
|
|
124
|
+
description?: string | undefined;
|
|
125
|
+
internal_pos?: string | undefined;
|
|
126
|
+
purchase_price?: number | undefined;
|
|
127
|
+
sale_price?: number | undefined;
|
|
128
|
+
article_type_id?: number | undefined;
|
|
129
|
+
tax_income_id?: number | undefined;
|
|
130
|
+
} & {
|
|
131
|
+
[k: string]: unknown;
|
|
132
|
+
};
|
|
133
|
+
}>;
|
|
134
|
+
export type CreateItemParams = z.infer<typeof CreateItemParamsSchema>;
|
|
135
|
+
export declare const ListTaxesParamsSchema: z.ZodObject<{
|
|
136
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
137
|
+
offset: z.ZodDefault<z.ZodNumber>;
|
|
138
|
+
}, "strip", z.ZodTypeAny, {
|
|
139
|
+
limit: number;
|
|
140
|
+
offset: number;
|
|
141
|
+
}, {
|
|
142
|
+
limit?: number | undefined;
|
|
143
|
+
offset?: number | undefined;
|
|
144
|
+
}>;
|
|
145
|
+
export type ListTaxesParams = z.infer<typeof ListTaxesParamsSchema>;
|
|
146
|
+
export declare const GetTaxParamsSchema: z.ZodObject<{
|
|
147
|
+
tax_id: z.ZodNumber;
|
|
148
|
+
}, "strip", z.ZodTypeAny, {
|
|
149
|
+
tax_id: number;
|
|
150
|
+
}, {
|
|
151
|
+
tax_id: number;
|
|
152
|
+
}>;
|
|
153
|
+
export type GetTaxParams = z.infer<typeof GetTaxParamsSchema>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Item-related Zod schemas and types.
|
|
3
|
+
* Domain: Items (Articles) and Taxes
|
|
4
|
+
*/
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
// Item creation payload
|
|
7
|
+
export const ItemCreateSchema = z
|
|
8
|
+
.object({
|
|
9
|
+
name_1: z.string().min(1, "Item name is required"),
|
|
10
|
+
name_2: z.string().optional(),
|
|
11
|
+
description: z.string().optional(),
|
|
12
|
+
internal_pos: z.string().optional(),
|
|
13
|
+
unit_id: z.number().int().positive().optional(),
|
|
14
|
+
purchase_price: z.number().optional(),
|
|
15
|
+
sale_price: z.number().optional(),
|
|
16
|
+
article_type_id: z.number().int().positive().optional(),
|
|
17
|
+
tax_income_id: z.number().int().positive().optional(),
|
|
18
|
+
tax_id: z.number().int().positive().optional(),
|
|
19
|
+
account_id: z.number().int().positive().optional(),
|
|
20
|
+
})
|
|
21
|
+
.passthrough();
|
|
22
|
+
// List items
|
|
23
|
+
export const ListItemsParamsSchema = z.object({
|
|
24
|
+
limit: z.number().int().positive().default(50),
|
|
25
|
+
offset: z.number().int().min(0).default(0),
|
|
26
|
+
});
|
|
27
|
+
// Get single item
|
|
28
|
+
export const GetItemParamsSchema = z.object({
|
|
29
|
+
item_id: z.number().int().positive(),
|
|
30
|
+
});
|
|
31
|
+
// Create item
|
|
32
|
+
export const CreateItemParamsSchema = z.object({
|
|
33
|
+
item_data: ItemCreateSchema,
|
|
34
|
+
});
|
|
35
|
+
// List taxes
|
|
36
|
+
export const ListTaxesParamsSchema = z.object({
|
|
37
|
+
limit: z.number().int().positive().default(50),
|
|
38
|
+
offset: z.number().int().min(0).default(0),
|
|
39
|
+
});
|
|
40
|
+
// Get single tax
|
|
41
|
+
export const GetTaxParamsSchema = z.object({
|
|
42
|
+
tax_id: z.number().int().positive(),
|
|
43
|
+
});
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Misc-related Zod schemas and types.
|
|
3
|
+
* Domain: Comments and Contact Relations
|
|
4
|
+
*/
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
export declare const GetCommentParamsSchema: z.ZodObject<{
|
|
7
|
+
comment_id: z.ZodNumber;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
comment_id: number;
|
|
10
|
+
}, {
|
|
11
|
+
comment_id: number;
|
|
12
|
+
}>;
|
|
13
|
+
export type GetCommentParams = z.infer<typeof GetCommentParamsSchema>;
|
|
14
|
+
export declare const CreateCommentParamsSchema: z.ZodObject<{
|
|
15
|
+
comment_data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
16
|
+
}, "strip", z.ZodTypeAny, {
|
|
17
|
+
comment_data: Record<string, unknown>;
|
|
18
|
+
}, {
|
|
19
|
+
comment_data: Record<string, unknown>;
|
|
20
|
+
}>;
|
|
21
|
+
export type CreateCommentParams = z.infer<typeof CreateCommentParamsSchema>;
|
|
22
|
+
export declare const GetContactRelationParamsSchema: z.ZodObject<{
|
|
23
|
+
relation_id: z.ZodNumber;
|
|
24
|
+
}, "strip", z.ZodTypeAny, {
|
|
25
|
+
relation_id: number;
|
|
26
|
+
}, {
|
|
27
|
+
relation_id: number;
|
|
28
|
+
}>;
|
|
29
|
+
export type GetContactRelationParams = z.infer<typeof GetContactRelationParamsSchema>;
|
|
30
|
+
export declare const CreateContactRelationParamsSchema: z.ZodObject<{
|
|
31
|
+
relation_data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
32
|
+
}, "strip", z.ZodTypeAny, {
|
|
33
|
+
relation_data: Record<string, unknown>;
|
|
34
|
+
}, {
|
|
35
|
+
relation_data: Record<string, unknown>;
|
|
36
|
+
}>;
|
|
37
|
+
export type CreateContactRelationParams = z.infer<typeof CreateContactRelationParamsSchema>;
|
|
38
|
+
export declare const UpdateContactRelationParamsSchema: z.ZodObject<{
|
|
39
|
+
relation_id: z.ZodNumber;
|
|
40
|
+
relation_data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
41
|
+
}, "strip", z.ZodTypeAny, {
|
|
42
|
+
relation_id: number;
|
|
43
|
+
relation_data: Record<string, unknown>;
|
|
44
|
+
}, {
|
|
45
|
+
relation_id: number;
|
|
46
|
+
relation_data: Record<string, unknown>;
|
|
47
|
+
}>;
|
|
48
|
+
export type UpdateContactRelationParams = z.infer<typeof UpdateContactRelationParamsSchema>;
|
|
49
|
+
export declare const DeleteContactRelationParamsSchema: z.ZodObject<{
|
|
50
|
+
relation_id: z.ZodNumber;
|
|
51
|
+
}, "strip", z.ZodTypeAny, {
|
|
52
|
+
relation_id: number;
|
|
53
|
+
}, {
|
|
54
|
+
relation_id: number;
|
|
55
|
+
}>;
|
|
56
|
+
export type DeleteContactRelationParams = z.infer<typeof DeleteContactRelationParamsSchema>;
|
|
57
|
+
export declare const SearchContactRelationsParamsSchema: z.ZodObject<{
|
|
58
|
+
search_params: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
59
|
+
}, "strip", z.ZodTypeAny, {
|
|
60
|
+
search_params: Record<string, unknown>;
|
|
61
|
+
}, {
|
|
62
|
+
search_params: Record<string, unknown>;
|
|
63
|
+
}>;
|
|
64
|
+
export type SearchContactRelationsParams = z.infer<typeof SearchContactRelationsParamsSchema>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Misc-related Zod schemas and types.
|
|
3
|
+
* Domain: Comments and Contact Relations
|
|
4
|
+
*/
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
// ===== COMMENTS =====
|
|
7
|
+
// Get comment
|
|
8
|
+
export const GetCommentParamsSchema = z.object({
|
|
9
|
+
comment_id: z.number().int().positive(),
|
|
10
|
+
});
|
|
11
|
+
// Create comment
|
|
12
|
+
export const CreateCommentParamsSchema = z.object({
|
|
13
|
+
comment_data: z.record(z.unknown()),
|
|
14
|
+
});
|
|
15
|
+
// ===== CONTACT RELATIONS =====
|
|
16
|
+
// Get contact relation
|
|
17
|
+
export const GetContactRelationParamsSchema = z.object({
|
|
18
|
+
relation_id: z.number().int().positive(),
|
|
19
|
+
});
|
|
20
|
+
// Create contact relation
|
|
21
|
+
export const CreateContactRelationParamsSchema = z.object({
|
|
22
|
+
relation_data: z.record(z.unknown()),
|
|
23
|
+
});
|
|
24
|
+
// Update contact relation
|
|
25
|
+
export const UpdateContactRelationParamsSchema = z.object({
|
|
26
|
+
relation_id: z.number().int().positive(),
|
|
27
|
+
relation_data: z.record(z.unknown()),
|
|
28
|
+
});
|
|
29
|
+
// Delete contact relation
|
|
30
|
+
export const DeleteContactRelationParamsSchema = z.object({
|
|
31
|
+
relation_id: z.number().int().positive(),
|
|
32
|
+
});
|
|
33
|
+
// Search contact relations
|
|
34
|
+
export const SearchContactRelationsParamsSchema = z.object({
|
|
35
|
+
search_params: z.record(z.unknown()),
|
|
36
|
+
});
|