@pulses/quickbooks-mcp 1.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/dist/client.d.ts +33 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +327 -0
- package/dist/client.js.map +1 -0
- package/dist/constants.d.ts +12 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +12 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +436 -0
- package/dist/index.js.map +1 -0
- package/dist/tools/accounts.d.ts +140 -0
- package/dist/tools/accounts.d.ts.map +1 -0
- package/dist/tools/accounts.js +115 -0
- package/dist/tools/accounts.js.map +1 -0
- package/dist/tools/bills.d.ts +386 -0
- package/dist/tools/bills.d.ts.map +1 -0
- package/dist/tools/bills.js +180 -0
- package/dist/tools/bills.js.map +1 -0
- package/dist/tools/company.d.ts +20 -0
- package/dist/tools/company.d.ts.map +1 -0
- package/dist/tools/company.js +37 -0
- package/dist/tools/company.js.map +1 -0
- package/dist/tools/customers.d.ts +218 -0
- package/dist/tools/customers.d.ts.map +1 -0
- package/dist/tools/customers.js +154 -0
- package/dist/tools/customers.js.map +1 -0
- package/dist/tools/employees.d.ts +182 -0
- package/dist/tools/employees.d.ts.map +1 -0
- package/dist/tools/employees.js +138 -0
- package/dist/tools/employees.js.map +1 -0
- package/dist/tools/estimates.d.ts +200 -0
- package/dist/tools/estimates.d.ts.map +1 -0
- package/dist/tools/estimates.js +131 -0
- package/dist/tools/estimates.js.map +1 -0
- package/dist/tools/invoices.d.ts +402 -0
- package/dist/tools/invoices.d.ts.map +1 -0
- package/dist/tools/invoices.js +203 -0
- package/dist/tools/invoices.js.map +1 -0
- package/dist/tools/items.d.ts +212 -0
- package/dist/tools/items.d.ts.map +1 -0
- package/dist/tools/items.js +153 -0
- package/dist/tools/items.js.map +1 -0
- package/dist/tools/journal-entries.d.ts +198 -0
- package/dist/tools/journal-entries.d.ts.map +1 -0
- package/dist/tools/journal-entries.js +135 -0
- package/dist/tools/journal-entries.js.map +1 -0
- package/dist/tools/payments.d.ts +174 -0
- package/dist/tools/payments.d.ts.map +1 -0
- package/dist/tools/payments.js +120 -0
- package/dist/tools/payments.js.map +1 -0
- package/dist/tools/purchases.d.ts +240 -0
- package/dist/tools/purchases.d.ts.map +1 -0
- package/dist/tools/purchases.js +149 -0
- package/dist/tools/purchases.js.map +1 -0
- package/dist/tools/query.d.ts +26 -0
- package/dist/tools/query.d.ts.map +1 -0
- package/dist/tools/query.js +27 -0
- package/dist/tools/query.js.map +1 -0
- package/dist/tools/reports.d.ts +178 -0
- package/dist/tools/reports.d.ts.map +1 -0
- package/dist/tools/reports.js +117 -0
- package/dist/tools/reports.js.map +1 -0
- package/dist/tools/tax.d.ts +116 -0
- package/dist/tools/tax.d.ts.map +1 -0
- package/dist/tools/tax.js +112 -0
- package/dist/tools/tax.js.map +1 -0
- package/dist/tools/time-activities.d.ts +228 -0
- package/dist/tools/time-activities.d.ts.map +1 -0
- package/dist/tools/time-activities.js +164 -0
- package/dist/tools/time-activities.js.map +1 -0
- package/dist/tools/vendors.d.ts +212 -0
- package/dist/tools/vendors.d.ts.map +1 -0
- package/dist/tools/vendors.js +152 -0
- package/dist/tools/vendors.js.map +1 -0
- package/dist/types.d.ts +295 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +11 -0
- package/dist/types.js.map +1 -0
- package/package.json +46 -0
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { QBOClient } from "../client.js";
|
|
3
|
+
declare const ListPurchasesInputSchema: z.ZodObject<{
|
|
4
|
+
where: z.ZodOptional<z.ZodString>;
|
|
5
|
+
order_by: z.ZodOptional<z.ZodString>;
|
|
6
|
+
start_position: z.ZodOptional<z.ZodNumber>;
|
|
7
|
+
max_results: z.ZodOptional<z.ZodNumber>;
|
|
8
|
+
response_format: z.ZodDefault<z.ZodEnum<["json", "markdown"]>>;
|
|
9
|
+
}, "strict", z.ZodTypeAny, {
|
|
10
|
+
response_format: "json" | "markdown";
|
|
11
|
+
where?: string | undefined;
|
|
12
|
+
order_by?: string | undefined;
|
|
13
|
+
start_position?: number | undefined;
|
|
14
|
+
max_results?: number | undefined;
|
|
15
|
+
}, {
|
|
16
|
+
response_format?: "json" | "markdown" | undefined;
|
|
17
|
+
where?: string | undefined;
|
|
18
|
+
order_by?: string | undefined;
|
|
19
|
+
start_position?: number | undefined;
|
|
20
|
+
max_results?: number | undefined;
|
|
21
|
+
}>;
|
|
22
|
+
declare const GetPurchaseInputSchema: z.ZodObject<{
|
|
23
|
+
purchase_id: z.ZodString;
|
|
24
|
+
response_format: z.ZodDefault<z.ZodEnum<["json", "markdown"]>>;
|
|
25
|
+
}, "strict", z.ZodTypeAny, {
|
|
26
|
+
response_format: "json" | "markdown";
|
|
27
|
+
purchase_id: string;
|
|
28
|
+
}, {
|
|
29
|
+
purchase_id: string;
|
|
30
|
+
response_format?: "json" | "markdown" | undefined;
|
|
31
|
+
}>;
|
|
32
|
+
declare const CreatePurchaseInputSchema: z.ZodObject<{
|
|
33
|
+
payment_type: z.ZodEnum<["Cash", "Check", "CreditCard"]>;
|
|
34
|
+
account_id: z.ZodString;
|
|
35
|
+
line_items: z.ZodArray<z.ZodObject<{
|
|
36
|
+
description: z.ZodOptional<z.ZodString>;
|
|
37
|
+
amount: z.ZodNumber;
|
|
38
|
+
detail_type: z.ZodDefault<z.ZodEnum<["AccountBasedExpenseLineDetail", "ItemBasedExpenseLineDetail"]>>;
|
|
39
|
+
account_id: z.ZodOptional<z.ZodString>;
|
|
40
|
+
item_id: z.ZodOptional<z.ZodString>;
|
|
41
|
+
qty: z.ZodOptional<z.ZodNumber>;
|
|
42
|
+
unit_price: z.ZodOptional<z.ZodNumber>;
|
|
43
|
+
customer_id: z.ZodOptional<z.ZodString>;
|
|
44
|
+
billable_status: z.ZodOptional<z.ZodEnum<["Billable", "NotBillable", "HasBeenBilled"]>>;
|
|
45
|
+
}, "strip", z.ZodTypeAny, {
|
|
46
|
+
amount: number;
|
|
47
|
+
detail_type: "AccountBasedExpenseLineDetail" | "ItemBasedExpenseLineDetail";
|
|
48
|
+
customer_id?: string | undefined;
|
|
49
|
+
description?: string | undefined;
|
|
50
|
+
item_id?: string | undefined;
|
|
51
|
+
qty?: number | undefined;
|
|
52
|
+
unit_price?: number | undefined;
|
|
53
|
+
account_id?: string | undefined;
|
|
54
|
+
billable_status?: "Billable" | "NotBillable" | "HasBeenBilled" | undefined;
|
|
55
|
+
}, {
|
|
56
|
+
amount: number;
|
|
57
|
+
customer_id?: string | undefined;
|
|
58
|
+
description?: string | undefined;
|
|
59
|
+
detail_type?: "AccountBasedExpenseLineDetail" | "ItemBasedExpenseLineDetail" | undefined;
|
|
60
|
+
item_id?: string | undefined;
|
|
61
|
+
qty?: number | undefined;
|
|
62
|
+
unit_price?: number | undefined;
|
|
63
|
+
account_id?: string | undefined;
|
|
64
|
+
billable_status?: "Billable" | "NotBillable" | "HasBeenBilled" | undefined;
|
|
65
|
+
}>, "many">;
|
|
66
|
+
txn_date: z.ZodOptional<z.ZodString>;
|
|
67
|
+
entity_id: z.ZodOptional<z.ZodString>;
|
|
68
|
+
entity_type: z.ZodOptional<z.ZodEnum<["Vendor", "Customer"]>>;
|
|
69
|
+
response_format: z.ZodDefault<z.ZodEnum<["json", "markdown"]>>;
|
|
70
|
+
}, "strict", z.ZodTypeAny, {
|
|
71
|
+
response_format: "json" | "markdown";
|
|
72
|
+
line_items: {
|
|
73
|
+
amount: number;
|
|
74
|
+
detail_type: "AccountBasedExpenseLineDetail" | "ItemBasedExpenseLineDetail";
|
|
75
|
+
customer_id?: string | undefined;
|
|
76
|
+
description?: string | undefined;
|
|
77
|
+
item_id?: string | undefined;
|
|
78
|
+
qty?: number | undefined;
|
|
79
|
+
unit_price?: number | undefined;
|
|
80
|
+
account_id?: string | undefined;
|
|
81
|
+
billable_status?: "Billable" | "NotBillable" | "HasBeenBilled" | undefined;
|
|
82
|
+
}[];
|
|
83
|
+
account_id: string;
|
|
84
|
+
payment_type: "Cash" | "Check" | "CreditCard";
|
|
85
|
+
txn_date?: string | undefined;
|
|
86
|
+
entity_id?: string | undefined;
|
|
87
|
+
entity_type?: "Vendor" | "Customer" | undefined;
|
|
88
|
+
}, {
|
|
89
|
+
line_items: {
|
|
90
|
+
amount: number;
|
|
91
|
+
customer_id?: string | undefined;
|
|
92
|
+
description?: string | undefined;
|
|
93
|
+
detail_type?: "AccountBasedExpenseLineDetail" | "ItemBasedExpenseLineDetail" | undefined;
|
|
94
|
+
item_id?: string | undefined;
|
|
95
|
+
qty?: number | undefined;
|
|
96
|
+
unit_price?: number | undefined;
|
|
97
|
+
account_id?: string | undefined;
|
|
98
|
+
billable_status?: "Billable" | "NotBillable" | "HasBeenBilled" | undefined;
|
|
99
|
+
}[];
|
|
100
|
+
account_id: string;
|
|
101
|
+
payment_type: "Cash" | "Check" | "CreditCard";
|
|
102
|
+
response_format?: "json" | "markdown" | undefined;
|
|
103
|
+
txn_date?: string | undefined;
|
|
104
|
+
entity_id?: string | undefined;
|
|
105
|
+
entity_type?: "Vendor" | "Customer" | undefined;
|
|
106
|
+
}>;
|
|
107
|
+
declare const DeletePurchaseInputSchema: z.ZodObject<{
|
|
108
|
+
purchase_id: z.ZodString;
|
|
109
|
+
sync_token: z.ZodString;
|
|
110
|
+
}, "strict", z.ZodTypeAny, {
|
|
111
|
+
sync_token: string;
|
|
112
|
+
purchase_id: string;
|
|
113
|
+
}, {
|
|
114
|
+
sync_token: string;
|
|
115
|
+
purchase_id: string;
|
|
116
|
+
}>;
|
|
117
|
+
export type ListPurchasesInput = z.infer<typeof ListPurchasesInputSchema>;
|
|
118
|
+
export type GetPurchaseInput = z.infer<typeof GetPurchaseInputSchema>;
|
|
119
|
+
export type CreatePurchaseInput = z.infer<typeof CreatePurchaseInputSchema>;
|
|
120
|
+
export type DeletePurchaseInput = z.infer<typeof DeletePurchaseInputSchema>;
|
|
121
|
+
export declare function qbo_list_purchases(client: QBOClient, input: ListPurchasesInput): Promise<string>;
|
|
122
|
+
export declare function qbo_get_purchase(client: QBOClient, input: GetPurchaseInput): Promise<string>;
|
|
123
|
+
export declare function qbo_create_purchase(client: QBOClient, input: CreatePurchaseInput): Promise<string>;
|
|
124
|
+
export declare function qbo_delete_purchase(client: QBOClient, input: DeletePurchaseInput): Promise<string>;
|
|
125
|
+
export declare const ListPurchasesInputSchemaExport: z.ZodObject<{
|
|
126
|
+
where: z.ZodOptional<z.ZodString>;
|
|
127
|
+
order_by: z.ZodOptional<z.ZodString>;
|
|
128
|
+
start_position: z.ZodOptional<z.ZodNumber>;
|
|
129
|
+
max_results: z.ZodOptional<z.ZodNumber>;
|
|
130
|
+
response_format: z.ZodDefault<z.ZodEnum<["json", "markdown"]>>;
|
|
131
|
+
}, "strict", z.ZodTypeAny, {
|
|
132
|
+
response_format: "json" | "markdown";
|
|
133
|
+
where?: string | undefined;
|
|
134
|
+
order_by?: string | undefined;
|
|
135
|
+
start_position?: number | undefined;
|
|
136
|
+
max_results?: number | undefined;
|
|
137
|
+
}, {
|
|
138
|
+
response_format?: "json" | "markdown" | undefined;
|
|
139
|
+
where?: string | undefined;
|
|
140
|
+
order_by?: string | undefined;
|
|
141
|
+
start_position?: number | undefined;
|
|
142
|
+
max_results?: number | undefined;
|
|
143
|
+
}>;
|
|
144
|
+
export declare const GetPurchaseInputSchemaExport: z.ZodObject<{
|
|
145
|
+
purchase_id: z.ZodString;
|
|
146
|
+
response_format: z.ZodDefault<z.ZodEnum<["json", "markdown"]>>;
|
|
147
|
+
}, "strict", z.ZodTypeAny, {
|
|
148
|
+
response_format: "json" | "markdown";
|
|
149
|
+
purchase_id: string;
|
|
150
|
+
}, {
|
|
151
|
+
purchase_id: string;
|
|
152
|
+
response_format?: "json" | "markdown" | undefined;
|
|
153
|
+
}>;
|
|
154
|
+
export declare const CreatePurchaseInputSchemaExport: z.ZodObject<{
|
|
155
|
+
payment_type: z.ZodEnum<["Cash", "Check", "CreditCard"]>;
|
|
156
|
+
account_id: z.ZodString;
|
|
157
|
+
line_items: z.ZodArray<z.ZodObject<{
|
|
158
|
+
description: z.ZodOptional<z.ZodString>;
|
|
159
|
+
amount: z.ZodNumber;
|
|
160
|
+
detail_type: z.ZodDefault<z.ZodEnum<["AccountBasedExpenseLineDetail", "ItemBasedExpenseLineDetail"]>>;
|
|
161
|
+
account_id: z.ZodOptional<z.ZodString>;
|
|
162
|
+
item_id: z.ZodOptional<z.ZodString>;
|
|
163
|
+
qty: z.ZodOptional<z.ZodNumber>;
|
|
164
|
+
unit_price: z.ZodOptional<z.ZodNumber>;
|
|
165
|
+
customer_id: z.ZodOptional<z.ZodString>;
|
|
166
|
+
billable_status: z.ZodOptional<z.ZodEnum<["Billable", "NotBillable", "HasBeenBilled"]>>;
|
|
167
|
+
}, "strip", z.ZodTypeAny, {
|
|
168
|
+
amount: number;
|
|
169
|
+
detail_type: "AccountBasedExpenseLineDetail" | "ItemBasedExpenseLineDetail";
|
|
170
|
+
customer_id?: string | undefined;
|
|
171
|
+
description?: string | undefined;
|
|
172
|
+
item_id?: string | undefined;
|
|
173
|
+
qty?: number | undefined;
|
|
174
|
+
unit_price?: number | undefined;
|
|
175
|
+
account_id?: string | undefined;
|
|
176
|
+
billable_status?: "Billable" | "NotBillable" | "HasBeenBilled" | undefined;
|
|
177
|
+
}, {
|
|
178
|
+
amount: number;
|
|
179
|
+
customer_id?: string | undefined;
|
|
180
|
+
description?: string | undefined;
|
|
181
|
+
detail_type?: "AccountBasedExpenseLineDetail" | "ItemBasedExpenseLineDetail" | undefined;
|
|
182
|
+
item_id?: string | undefined;
|
|
183
|
+
qty?: number | undefined;
|
|
184
|
+
unit_price?: number | undefined;
|
|
185
|
+
account_id?: string | undefined;
|
|
186
|
+
billable_status?: "Billable" | "NotBillable" | "HasBeenBilled" | undefined;
|
|
187
|
+
}>, "many">;
|
|
188
|
+
txn_date: z.ZodOptional<z.ZodString>;
|
|
189
|
+
entity_id: z.ZodOptional<z.ZodString>;
|
|
190
|
+
entity_type: z.ZodOptional<z.ZodEnum<["Vendor", "Customer"]>>;
|
|
191
|
+
response_format: z.ZodDefault<z.ZodEnum<["json", "markdown"]>>;
|
|
192
|
+
}, "strict", z.ZodTypeAny, {
|
|
193
|
+
response_format: "json" | "markdown";
|
|
194
|
+
line_items: {
|
|
195
|
+
amount: number;
|
|
196
|
+
detail_type: "AccountBasedExpenseLineDetail" | "ItemBasedExpenseLineDetail";
|
|
197
|
+
customer_id?: string | undefined;
|
|
198
|
+
description?: string | undefined;
|
|
199
|
+
item_id?: string | undefined;
|
|
200
|
+
qty?: number | undefined;
|
|
201
|
+
unit_price?: number | undefined;
|
|
202
|
+
account_id?: string | undefined;
|
|
203
|
+
billable_status?: "Billable" | "NotBillable" | "HasBeenBilled" | undefined;
|
|
204
|
+
}[];
|
|
205
|
+
account_id: string;
|
|
206
|
+
payment_type: "Cash" | "Check" | "CreditCard";
|
|
207
|
+
txn_date?: string | undefined;
|
|
208
|
+
entity_id?: string | undefined;
|
|
209
|
+
entity_type?: "Vendor" | "Customer" | undefined;
|
|
210
|
+
}, {
|
|
211
|
+
line_items: {
|
|
212
|
+
amount: number;
|
|
213
|
+
customer_id?: string | undefined;
|
|
214
|
+
description?: string | undefined;
|
|
215
|
+
detail_type?: "AccountBasedExpenseLineDetail" | "ItemBasedExpenseLineDetail" | undefined;
|
|
216
|
+
item_id?: string | undefined;
|
|
217
|
+
qty?: number | undefined;
|
|
218
|
+
unit_price?: number | undefined;
|
|
219
|
+
account_id?: string | undefined;
|
|
220
|
+
billable_status?: "Billable" | "NotBillable" | "HasBeenBilled" | undefined;
|
|
221
|
+
}[];
|
|
222
|
+
account_id: string;
|
|
223
|
+
payment_type: "Cash" | "Check" | "CreditCard";
|
|
224
|
+
response_format?: "json" | "markdown" | undefined;
|
|
225
|
+
txn_date?: string | undefined;
|
|
226
|
+
entity_id?: string | undefined;
|
|
227
|
+
entity_type?: "Vendor" | "Customer" | undefined;
|
|
228
|
+
}>;
|
|
229
|
+
export declare const DeletePurchaseInputSchemaExport: z.ZodObject<{
|
|
230
|
+
purchase_id: z.ZodString;
|
|
231
|
+
sync_token: z.ZodString;
|
|
232
|
+
}, "strict", z.ZodTypeAny, {
|
|
233
|
+
sync_token: string;
|
|
234
|
+
purchase_id: string;
|
|
235
|
+
}, {
|
|
236
|
+
sync_token: string;
|
|
237
|
+
purchase_id: string;
|
|
238
|
+
}>;
|
|
239
|
+
export {};
|
|
240
|
+
//# sourceMappingURL=purchases.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"purchases.d.ts","sourceRoot":"","sources":["../../src/tools/purchases.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAezC,QAAA,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;EAMnB,CAAC;AAEZ,QAAA,MAAM,sBAAsB;;;;;;;;;EAGjB,CAAC;AAEZ,QAAA,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQpB,CAAC;AAEZ,QAAA,MAAM,yBAAyB;;;;;;;;;EAGpB,CAAC;AAEZ,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAgB5E,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,SAAS,EACjB,KAAK,EAAE,kBAAkB,GACxB,OAAO,CAAC,MAAM,CAAC,CAuBjB;AAED,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,SAAS,EACjB,KAAK,EAAE,gBAAgB,GACtB,OAAO,CAAC,MAAM,CAAC,CASjB;AAED,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,SAAS,EACjB,KAAK,EAAE,mBAAmB,GACzB,OAAO,CAAC,MAAM,CAAC,CA0CjB;AAED,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,SAAS,EACjB,KAAK,EAAE,mBAAmB,GACzB,OAAO,CAAC,MAAM,CAAC,CAGjB;AAED,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;EAA2B,CAAC;AACvE,eAAO,MAAM,4BAA4B;;;;;;;;;EAAyB,CAAC;AACnE,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA4B,CAAC;AACzE,eAAO,MAAM,+BAA+B;;;;;;;;;EAA4B,CAAC"}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
const PurchaseLineSchema = z.object({
|
|
3
|
+
description: z.string().optional(),
|
|
4
|
+
amount: z.number(),
|
|
5
|
+
detail_type: z.enum(["AccountBasedExpenseLineDetail", "ItemBasedExpenseLineDetail"]).default("AccountBasedExpenseLineDetail"),
|
|
6
|
+
account_id: z.string().optional(),
|
|
7
|
+
item_id: z.string().optional(),
|
|
8
|
+
qty: z.number().optional(),
|
|
9
|
+
unit_price: z.number().optional(),
|
|
10
|
+
customer_id: z.string().optional(),
|
|
11
|
+
billable_status: z.enum(["Billable", "NotBillable", "HasBeenBilled"]).optional(),
|
|
12
|
+
});
|
|
13
|
+
const ListPurchasesInputSchema = z.object({
|
|
14
|
+
where: z.string().optional(),
|
|
15
|
+
order_by: z.string().optional(),
|
|
16
|
+
start_position: z.number().optional(),
|
|
17
|
+
max_results: z.number().optional(),
|
|
18
|
+
response_format: z.enum(["json", "markdown"]).default("markdown"),
|
|
19
|
+
}).strict();
|
|
20
|
+
const GetPurchaseInputSchema = z.object({
|
|
21
|
+
purchase_id: z.string().describe("The purchase ID"),
|
|
22
|
+
response_format: z.enum(["json", "markdown"]).default("markdown"),
|
|
23
|
+
}).strict();
|
|
24
|
+
const CreatePurchaseInputSchema = z.object({
|
|
25
|
+
payment_type: z.enum(["Cash", "Check", "CreditCard"]).describe("Payment type"),
|
|
26
|
+
account_id: z.string().describe("Bank/credit card account ref ID"),
|
|
27
|
+
line_items: z.array(PurchaseLineSchema).min(1),
|
|
28
|
+
txn_date: z.string().optional().describe("Transaction date (YYYY-MM-DD)"),
|
|
29
|
+
entity_id: z.string().optional().describe("Vendor/customer entity ref ID"),
|
|
30
|
+
entity_type: z.enum(["Vendor", "Customer"]).optional(),
|
|
31
|
+
response_format: z.enum(["json", "markdown"]).default("markdown"),
|
|
32
|
+
}).strict();
|
|
33
|
+
const DeletePurchaseInputSchema = z.object({
|
|
34
|
+
purchase_id: z.string(),
|
|
35
|
+
sync_token: z.string(),
|
|
36
|
+
}).strict();
|
|
37
|
+
function formatPurchase(p) {
|
|
38
|
+
let result = `## Purchase ${p.Id || ""}\n`;
|
|
39
|
+
if (p.Id)
|
|
40
|
+
result += `- **ID:** ${p.Id}\n`;
|
|
41
|
+
if (p.SyncToken)
|
|
42
|
+
result += `- **SyncToken:** ${p.SyncToken}\n`;
|
|
43
|
+
if (p.PaymentType)
|
|
44
|
+
result += `- **Payment Type:** ${p.PaymentType}\n`;
|
|
45
|
+
if (p.AccountRef)
|
|
46
|
+
result += `- **Account:** ${p.AccountRef.name || p.AccountRef.value}\n`;
|
|
47
|
+
if (p.EntityRef)
|
|
48
|
+
result += `- **Entity:** ${p.EntityRef.name || p.EntityRef.value}\n`;
|
|
49
|
+
if (p.TxnDate)
|
|
50
|
+
result += `- **Date:** ${p.TxnDate}\n`;
|
|
51
|
+
if (p.TotalAmt !== undefined)
|
|
52
|
+
result += `- **Total:** $${p.TotalAmt}\n`;
|
|
53
|
+
if (p.Credit !== undefined)
|
|
54
|
+
result += `- **Credit:** ${p.Credit}\n`;
|
|
55
|
+
if (p.MetaData?.CreateTime)
|
|
56
|
+
result += `- **Created:** ${p.MetaData.CreateTime}\n`;
|
|
57
|
+
return result;
|
|
58
|
+
}
|
|
59
|
+
export async function qbo_list_purchases(client, input) {
|
|
60
|
+
let query = "SELECT * FROM Purchase";
|
|
61
|
+
if (input.where)
|
|
62
|
+
query += ` WHERE ${input.where}`;
|
|
63
|
+
if (input.order_by)
|
|
64
|
+
query += ` ORDER BY ${input.order_by}`;
|
|
65
|
+
query += ` STARTPOSITION ${input.start_position || 1}`;
|
|
66
|
+
query += ` MAXRESULTS ${input.max_results || 100}`;
|
|
67
|
+
const response = await client.query(query);
|
|
68
|
+
const purchases = response.QueryResponse.Purchase || [];
|
|
69
|
+
if (input.response_format === "json") {
|
|
70
|
+
return JSON.stringify({ purchases, total: response.QueryResponse.totalCount }, null, 2);
|
|
71
|
+
}
|
|
72
|
+
let result = `# Purchases (${purchases.length} results)\n\n`;
|
|
73
|
+
if (purchases.length === 0) {
|
|
74
|
+
result += "No purchases found.";
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
for (const p of purchases) {
|
|
78
|
+
result += formatPurchase(p) + "\n";
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return result;
|
|
82
|
+
}
|
|
83
|
+
export async function qbo_get_purchase(client, input) {
|
|
84
|
+
const response = await client.get(`/purchase/${input.purchase_id}`);
|
|
85
|
+
const p = response.Purchase;
|
|
86
|
+
if (input.response_format === "json") {
|
|
87
|
+
return JSON.stringify(p, null, 2);
|
|
88
|
+
}
|
|
89
|
+
return `# Purchase\n\n` + formatPurchase(p);
|
|
90
|
+
}
|
|
91
|
+
export async function qbo_create_purchase(client, input) {
|
|
92
|
+
const body = {
|
|
93
|
+
PaymentType: input.payment_type,
|
|
94
|
+
AccountRef: { value: input.account_id },
|
|
95
|
+
Line: input.line_items.map(item => {
|
|
96
|
+
const line = {
|
|
97
|
+
Amount: item.amount,
|
|
98
|
+
DetailType: item.detail_type,
|
|
99
|
+
};
|
|
100
|
+
if (item.description)
|
|
101
|
+
line.Description = item.description;
|
|
102
|
+
if (item.detail_type === "AccountBasedExpenseLineDetail") {
|
|
103
|
+
const detail = {};
|
|
104
|
+
if (item.account_id)
|
|
105
|
+
detail.AccountRef = { value: item.account_id };
|
|
106
|
+
if (item.customer_id)
|
|
107
|
+
detail.CustomerRef = { value: item.customer_id };
|
|
108
|
+
if (item.billable_status)
|
|
109
|
+
detail.BillableStatus = item.billable_status;
|
|
110
|
+
line.AccountBasedExpenseLineDetail = detail;
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
const detail = {};
|
|
114
|
+
if (item.item_id)
|
|
115
|
+
detail.ItemRef = { value: item.item_id };
|
|
116
|
+
if (item.qty !== undefined)
|
|
117
|
+
detail.Qty = item.qty;
|
|
118
|
+
if (item.unit_price !== undefined)
|
|
119
|
+
detail.UnitPrice = item.unit_price;
|
|
120
|
+
if (item.customer_id)
|
|
121
|
+
detail.CustomerRef = { value: item.customer_id };
|
|
122
|
+
if (item.billable_status)
|
|
123
|
+
detail.BillableStatus = item.billable_status;
|
|
124
|
+
line.ItemBasedExpenseLineDetail = detail;
|
|
125
|
+
}
|
|
126
|
+
return line;
|
|
127
|
+
}),
|
|
128
|
+
};
|
|
129
|
+
if (input.txn_date)
|
|
130
|
+
body.TxnDate = input.txn_date;
|
|
131
|
+
if (input.entity_id && input.entity_type) {
|
|
132
|
+
body.EntityRef = { value: input.entity_id, type: input.entity_type };
|
|
133
|
+
}
|
|
134
|
+
const response = await client.post("/purchase", body);
|
|
135
|
+
const p = response.Purchase;
|
|
136
|
+
if (input.response_format === "json") {
|
|
137
|
+
return JSON.stringify(p, null, 2);
|
|
138
|
+
}
|
|
139
|
+
return `# Purchase Created\n\n` + formatPurchase(p);
|
|
140
|
+
}
|
|
141
|
+
export async function qbo_delete_purchase(client, input) {
|
|
142
|
+
await client.delete("purchase", input.purchase_id, input.sync_token);
|
|
143
|
+
return `Purchase ${input.purchase_id} deleted successfully.`;
|
|
144
|
+
}
|
|
145
|
+
export const ListPurchasesInputSchemaExport = ListPurchasesInputSchema;
|
|
146
|
+
export const GetPurchaseInputSchemaExport = GetPurchaseInputSchema;
|
|
147
|
+
export const CreatePurchaseInputSchemaExport = CreatePurchaseInputSchema;
|
|
148
|
+
export const DeletePurchaseInputSchemaExport = DeletePurchaseInputSchema;
|
|
149
|
+
//# sourceMappingURL=purchases.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"purchases.js","sourceRoot":"","sources":["../../src/tools/purchases.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,+BAA+B,EAAE,4BAA4B,CAAC,CAAC,CAAC,OAAO,CAAC,+BAA+B,CAAC;IAC7H,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,eAAe,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,aAAa,EAAE,eAAe,CAAC,CAAC,C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IACvE,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,IAAI,CAAyB,WAAW,EAAE,IAAI,CAAC,CAAC;IAC9E,MAAM,CAAC,GAAG,QAAQ,CAAC,QAAQ,CAAC;IAE5B,IAAI,KAAK,CAAC,eAAe,KAAK,MAAM,EAAE,CAAC;QACrC,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IACpC,CAAC;IAED,OAAO,wBAAwB,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC;AACtD,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,MAAiB,EACjB,KAA0B;IAE1B,MAAM,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,KAAK,CAAC,WAAW,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IACrE,OAAO,YAAY,KAAK,CAAC,WAAW,wBAAwB,CAAC;AAC/D,CAAC;AAED,MAAM,CAAC,MAAM,8BAA8B,GAAG,wBAAwB,CAAC;AACvE,MAAM,CAAC,MAAM,4BAA4B,GAAG,sBAAsB,CAAC;AACnE,MAAM,CAAC,MAAM,+BAA+B,GAAG,yBAAyB,CAAC;AACzE,MAAM,CAAC,MAAM,+BAA+B,GAAG,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { QBOClient } from "../client.js";
|
|
3
|
+
declare const QueryInputSchema: z.ZodObject<{
|
|
4
|
+
query: z.ZodString;
|
|
5
|
+
response_format: z.ZodDefault<z.ZodEnum<["json", "markdown"]>>;
|
|
6
|
+
}, "strict", z.ZodTypeAny, {
|
|
7
|
+
response_format: "json" | "markdown";
|
|
8
|
+
query: string;
|
|
9
|
+
}, {
|
|
10
|
+
query: string;
|
|
11
|
+
response_format?: "json" | "markdown" | undefined;
|
|
12
|
+
}>;
|
|
13
|
+
export type QueryInput = z.infer<typeof QueryInputSchema>;
|
|
14
|
+
export declare function qbo_query(client: QBOClient, input: QueryInput): Promise<string>;
|
|
15
|
+
export declare const QueryInputSchemaExport: z.ZodObject<{
|
|
16
|
+
query: z.ZodString;
|
|
17
|
+
response_format: z.ZodDefault<z.ZodEnum<["json", "markdown"]>>;
|
|
18
|
+
}, "strict", z.ZodTypeAny, {
|
|
19
|
+
response_format: "json" | "markdown";
|
|
20
|
+
query: string;
|
|
21
|
+
}, {
|
|
22
|
+
query: string;
|
|
23
|
+
response_format?: "json" | "markdown" | undefined;
|
|
24
|
+
}>;
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../src/tools/query.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,QAAA,MAAM,gBAAgB;;;;;;;;;EAGX,CAAC;AAEZ,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D,wBAAsB,SAAS,CAC7B,MAAM,EAAE,SAAS,EACjB,KAAK,EAAE,UAAU,GAChB,OAAO,CAAC,MAAM,CAAC,CAqBjB;AAED,eAAO,MAAM,sBAAsB;;;;;;;;;EAAmB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
const QueryInputSchema = z.object({
|
|
3
|
+
query: z.string().describe("SQL-like query string. Supported entities: Customer, Invoice, Payment, Item, Estimate, Bill, Vendor, Account, Employee, TimeActivity, Purchase, JournalEntry, TaxRate, TaxCode, CreditMemo, Deposit, SalesReceipt, Transfer, VendorCredit, Class, Department, PaymentMethod, Term. Example: SELECT * FROM Invoice WHERE TotalAmt > '100' AND CustomerRef = '5' ORDER BY MetaData.CreateTime DESC STARTPOSITION 1 MAXRESULTS 50"),
|
|
4
|
+
response_format: z.enum(["json", "markdown"]).default("json"),
|
|
5
|
+
}).strict();
|
|
6
|
+
export async function qbo_query(client, input) {
|
|
7
|
+
const response = await client.query(input.query);
|
|
8
|
+
if (input.response_format === "json") {
|
|
9
|
+
return JSON.stringify(response, null, 2);
|
|
10
|
+
}
|
|
11
|
+
const qr = response.QueryResponse;
|
|
12
|
+
if (!qr)
|
|
13
|
+
return "No results.";
|
|
14
|
+
let result = `# Query Results\n\n`;
|
|
15
|
+
for (const [key, value] of Object.entries(qr)) {
|
|
16
|
+
if (Array.isArray(value)) {
|
|
17
|
+
result += `**${key}:** ${value.length} results\n\n`;
|
|
18
|
+
result += "```json\n" + JSON.stringify(value, null, 2) + "\n```\n";
|
|
19
|
+
}
|
|
20
|
+
else if (key === "totalCount" || key === "startPosition" || key === "maxResults") {
|
|
21
|
+
result += `- **${key}:** ${value}\n`;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return result;
|
|
25
|
+
}
|
|
26
|
+
export const QueryInputSchemaExport = QueryInputSchema;
|
|
27
|
+
//# sourceMappingURL=query.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.js","sourceRoot":"","sources":["../../src/tools/query.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gaAAga,CAAC;IAC5b,eAAe,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;CAC9D,CAAC,CAAC,MAAM,EAAE,CAAC;AAIZ,MAAM,CAAC,KAAK,UAAU,SAAS,CAC7B,MAAiB,EACjB,KAAiB;IAEjB,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAA0B,KAAK,CAAC,KAAK,CAAC,CAAC;IAE1E,IAAI,KAAK,CAAC,eAAe,KAAK,MAAM,EAAE,CAAC;QACrC,OAAO,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAC3C,CAAC;IAED,MAAM,EAAE,GAAG,QAAQ,CAAC,aAAoD,CAAC;IACzE,IAAI,CAAC,EAAE;QAAE,OAAO,aAAa,CAAC;IAE9B,IAAI,MAAM,GAAG,qBAAqB,CAAC;IACnC,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC;QAC9C,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YACzB,MAAM,IAAI,KAAK,GAAG,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;YACpD,MAAM,IAAI,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,SAAS,CAAC;QACrE,CAAC;aAAM,IAAI,GAAG,KAAK,YAAY,IAAI,GAAG,KAAK,eAAe,IAAI,GAAG,KAAK,YAAY,EAAE,CAAC;YACnF,MAAM,IAAI,OAAO,GAAG,OAAO,KAAK,IAAI,CAAC;QACvC,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,CAAC,MAAM,sBAAsB,GAAG,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { QBOClient } from "../client.js";
|
|
3
|
+
declare const ProfitAndLossInputSchema: z.ZodObject<{
|
|
4
|
+
start_date: z.ZodOptional<z.ZodString>;
|
|
5
|
+
end_date: z.ZodOptional<z.ZodString>;
|
|
6
|
+
date_macro: z.ZodOptional<z.ZodString>;
|
|
7
|
+
accounting_method: z.ZodOptional<z.ZodEnum<["Cash", "Accrual"]>>;
|
|
8
|
+
summarize_column_by: z.ZodOptional<z.ZodString>;
|
|
9
|
+
customer: z.ZodOptional<z.ZodString>;
|
|
10
|
+
department: z.ZodOptional<z.ZodString>;
|
|
11
|
+
response_format: z.ZodDefault<z.ZodEnum<["json", "markdown"]>>;
|
|
12
|
+
}, "strict", z.ZodTypeAny, {
|
|
13
|
+
response_format: "json" | "markdown";
|
|
14
|
+
start_date?: string | undefined;
|
|
15
|
+
end_date?: string | undefined;
|
|
16
|
+
date_macro?: string | undefined;
|
|
17
|
+
accounting_method?: "Cash" | "Accrual" | undefined;
|
|
18
|
+
summarize_column_by?: string | undefined;
|
|
19
|
+
customer?: string | undefined;
|
|
20
|
+
department?: string | undefined;
|
|
21
|
+
}, {
|
|
22
|
+
response_format?: "json" | "markdown" | undefined;
|
|
23
|
+
start_date?: string | undefined;
|
|
24
|
+
end_date?: string | undefined;
|
|
25
|
+
date_macro?: string | undefined;
|
|
26
|
+
accounting_method?: "Cash" | "Accrual" | undefined;
|
|
27
|
+
summarize_column_by?: string | undefined;
|
|
28
|
+
customer?: string | undefined;
|
|
29
|
+
department?: string | undefined;
|
|
30
|
+
}>;
|
|
31
|
+
declare const BalanceSheetInputSchema: z.ZodObject<{
|
|
32
|
+
start_date: z.ZodOptional<z.ZodString>;
|
|
33
|
+
end_date: z.ZodOptional<z.ZodString>;
|
|
34
|
+
date_macro: z.ZodOptional<z.ZodString>;
|
|
35
|
+
accounting_method: z.ZodOptional<z.ZodEnum<["Cash", "Accrual"]>>;
|
|
36
|
+
summarize_column_by: z.ZodOptional<z.ZodString>;
|
|
37
|
+
response_format: z.ZodDefault<z.ZodEnum<["json", "markdown"]>>;
|
|
38
|
+
}, "strict", z.ZodTypeAny, {
|
|
39
|
+
response_format: "json" | "markdown";
|
|
40
|
+
start_date?: string | undefined;
|
|
41
|
+
end_date?: string | undefined;
|
|
42
|
+
date_macro?: string | undefined;
|
|
43
|
+
accounting_method?: "Cash" | "Accrual" | undefined;
|
|
44
|
+
summarize_column_by?: string | undefined;
|
|
45
|
+
}, {
|
|
46
|
+
response_format?: "json" | "markdown" | undefined;
|
|
47
|
+
start_date?: string | undefined;
|
|
48
|
+
end_date?: string | undefined;
|
|
49
|
+
date_macro?: string | undefined;
|
|
50
|
+
accounting_method?: "Cash" | "Accrual" | undefined;
|
|
51
|
+
summarize_column_by?: string | undefined;
|
|
52
|
+
}>;
|
|
53
|
+
declare const GeneralReportInputSchema: z.ZodObject<{
|
|
54
|
+
report_name: z.ZodString;
|
|
55
|
+
start_date: z.ZodOptional<z.ZodString>;
|
|
56
|
+
end_date: z.ZodOptional<z.ZodString>;
|
|
57
|
+
date_macro: z.ZodOptional<z.ZodString>;
|
|
58
|
+
accounting_method: z.ZodOptional<z.ZodEnum<["Cash", "Accrual"]>>;
|
|
59
|
+
summarize_column_by: z.ZodOptional<z.ZodString>;
|
|
60
|
+
customer: z.ZodOptional<z.ZodString>;
|
|
61
|
+
vendor: z.ZodOptional<z.ZodString>;
|
|
62
|
+
department: z.ZodOptional<z.ZodString>;
|
|
63
|
+
response_format: z.ZodDefault<z.ZodEnum<["json", "markdown"]>>;
|
|
64
|
+
}, "strict", z.ZodTypeAny, {
|
|
65
|
+
response_format: "json" | "markdown";
|
|
66
|
+
report_name: string;
|
|
67
|
+
start_date?: string | undefined;
|
|
68
|
+
end_date?: string | undefined;
|
|
69
|
+
date_macro?: string | undefined;
|
|
70
|
+
accounting_method?: "Cash" | "Accrual" | undefined;
|
|
71
|
+
summarize_column_by?: string | undefined;
|
|
72
|
+
customer?: string | undefined;
|
|
73
|
+
department?: string | undefined;
|
|
74
|
+
vendor?: string | undefined;
|
|
75
|
+
}, {
|
|
76
|
+
report_name: string;
|
|
77
|
+
response_format?: "json" | "markdown" | undefined;
|
|
78
|
+
start_date?: string | undefined;
|
|
79
|
+
end_date?: string | undefined;
|
|
80
|
+
date_macro?: string | undefined;
|
|
81
|
+
accounting_method?: "Cash" | "Accrual" | undefined;
|
|
82
|
+
summarize_column_by?: string | undefined;
|
|
83
|
+
customer?: string | undefined;
|
|
84
|
+
department?: string | undefined;
|
|
85
|
+
vendor?: string | undefined;
|
|
86
|
+
}>;
|
|
87
|
+
export type ProfitAndLossInput = z.infer<typeof ProfitAndLossInputSchema>;
|
|
88
|
+
export type BalanceSheetInput = z.infer<typeof BalanceSheetInputSchema>;
|
|
89
|
+
export type GeneralReportInput = z.infer<typeof GeneralReportInputSchema>;
|
|
90
|
+
export declare function qbo_profit_and_loss(client: QBOClient, input: ProfitAndLossInput): Promise<string>;
|
|
91
|
+
export declare function qbo_balance_sheet(client: QBOClient, input: BalanceSheetInput): Promise<string>;
|
|
92
|
+
export declare function qbo_report(client: QBOClient, input: GeneralReportInput): Promise<string>;
|
|
93
|
+
export declare const ProfitAndLossInputSchemaExport: z.ZodObject<{
|
|
94
|
+
start_date: z.ZodOptional<z.ZodString>;
|
|
95
|
+
end_date: z.ZodOptional<z.ZodString>;
|
|
96
|
+
date_macro: z.ZodOptional<z.ZodString>;
|
|
97
|
+
accounting_method: z.ZodOptional<z.ZodEnum<["Cash", "Accrual"]>>;
|
|
98
|
+
summarize_column_by: z.ZodOptional<z.ZodString>;
|
|
99
|
+
customer: z.ZodOptional<z.ZodString>;
|
|
100
|
+
department: z.ZodOptional<z.ZodString>;
|
|
101
|
+
response_format: z.ZodDefault<z.ZodEnum<["json", "markdown"]>>;
|
|
102
|
+
}, "strict", z.ZodTypeAny, {
|
|
103
|
+
response_format: "json" | "markdown";
|
|
104
|
+
start_date?: string | undefined;
|
|
105
|
+
end_date?: string | undefined;
|
|
106
|
+
date_macro?: string | undefined;
|
|
107
|
+
accounting_method?: "Cash" | "Accrual" | undefined;
|
|
108
|
+
summarize_column_by?: string | undefined;
|
|
109
|
+
customer?: string | undefined;
|
|
110
|
+
department?: string | undefined;
|
|
111
|
+
}, {
|
|
112
|
+
response_format?: "json" | "markdown" | undefined;
|
|
113
|
+
start_date?: string | undefined;
|
|
114
|
+
end_date?: string | undefined;
|
|
115
|
+
date_macro?: string | undefined;
|
|
116
|
+
accounting_method?: "Cash" | "Accrual" | undefined;
|
|
117
|
+
summarize_column_by?: string | undefined;
|
|
118
|
+
customer?: string | undefined;
|
|
119
|
+
department?: string | undefined;
|
|
120
|
+
}>;
|
|
121
|
+
export declare const BalanceSheetInputSchemaExport: z.ZodObject<{
|
|
122
|
+
start_date: z.ZodOptional<z.ZodString>;
|
|
123
|
+
end_date: z.ZodOptional<z.ZodString>;
|
|
124
|
+
date_macro: z.ZodOptional<z.ZodString>;
|
|
125
|
+
accounting_method: z.ZodOptional<z.ZodEnum<["Cash", "Accrual"]>>;
|
|
126
|
+
summarize_column_by: z.ZodOptional<z.ZodString>;
|
|
127
|
+
response_format: z.ZodDefault<z.ZodEnum<["json", "markdown"]>>;
|
|
128
|
+
}, "strict", z.ZodTypeAny, {
|
|
129
|
+
response_format: "json" | "markdown";
|
|
130
|
+
start_date?: string | undefined;
|
|
131
|
+
end_date?: string | undefined;
|
|
132
|
+
date_macro?: string | undefined;
|
|
133
|
+
accounting_method?: "Cash" | "Accrual" | undefined;
|
|
134
|
+
summarize_column_by?: string | undefined;
|
|
135
|
+
}, {
|
|
136
|
+
response_format?: "json" | "markdown" | undefined;
|
|
137
|
+
start_date?: string | undefined;
|
|
138
|
+
end_date?: string | undefined;
|
|
139
|
+
date_macro?: string | undefined;
|
|
140
|
+
accounting_method?: "Cash" | "Accrual" | undefined;
|
|
141
|
+
summarize_column_by?: string | undefined;
|
|
142
|
+
}>;
|
|
143
|
+
export declare const GeneralReportInputSchemaExport: z.ZodObject<{
|
|
144
|
+
report_name: z.ZodString;
|
|
145
|
+
start_date: z.ZodOptional<z.ZodString>;
|
|
146
|
+
end_date: z.ZodOptional<z.ZodString>;
|
|
147
|
+
date_macro: z.ZodOptional<z.ZodString>;
|
|
148
|
+
accounting_method: z.ZodOptional<z.ZodEnum<["Cash", "Accrual"]>>;
|
|
149
|
+
summarize_column_by: z.ZodOptional<z.ZodString>;
|
|
150
|
+
customer: z.ZodOptional<z.ZodString>;
|
|
151
|
+
vendor: z.ZodOptional<z.ZodString>;
|
|
152
|
+
department: z.ZodOptional<z.ZodString>;
|
|
153
|
+
response_format: z.ZodDefault<z.ZodEnum<["json", "markdown"]>>;
|
|
154
|
+
}, "strict", z.ZodTypeAny, {
|
|
155
|
+
response_format: "json" | "markdown";
|
|
156
|
+
report_name: string;
|
|
157
|
+
start_date?: string | undefined;
|
|
158
|
+
end_date?: string | undefined;
|
|
159
|
+
date_macro?: string | undefined;
|
|
160
|
+
accounting_method?: "Cash" | "Accrual" | undefined;
|
|
161
|
+
summarize_column_by?: string | undefined;
|
|
162
|
+
customer?: string | undefined;
|
|
163
|
+
department?: string | undefined;
|
|
164
|
+
vendor?: string | undefined;
|
|
165
|
+
}, {
|
|
166
|
+
report_name: string;
|
|
167
|
+
response_format?: "json" | "markdown" | undefined;
|
|
168
|
+
start_date?: string | undefined;
|
|
169
|
+
end_date?: string | undefined;
|
|
170
|
+
date_macro?: string | undefined;
|
|
171
|
+
accounting_method?: "Cash" | "Accrual" | undefined;
|
|
172
|
+
summarize_column_by?: string | undefined;
|
|
173
|
+
customer?: string | undefined;
|
|
174
|
+
department?: string | undefined;
|
|
175
|
+
vendor?: string | undefined;
|
|
176
|
+
}>;
|
|
177
|
+
export {};
|
|
178
|
+
//# sourceMappingURL=reports.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reports.d.ts","sourceRoot":"","sources":["../../src/tools/reports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AA2BzC,QAAA,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;EASnB,CAAC;AAEZ,QAAA,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;EAOlB,CAAC;AAEZ,QAAA,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWnB,CAA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