quantix-mcp 0.5.0 → 0.5.3
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/README.md +12 -1
- package/dist/tools/subscriptions.d.ts.map +1 -1
- package/dist/tools/subscriptions.js +46 -1
- package/dist/tools/subscriptions.js.map +1 -1
- package/dist/tools/transactions.d.ts.map +1 -1
- package/dist/tools/transactions.js +5 -5
- package/dist/tools/transactions.js.map +1 -1
- package/dist/types/schemas.d.ts +17 -0
- package/dist/types/schemas.d.ts.map +1 -1
- package/dist/types/schemas.js +21 -4
- package/dist/types/schemas.js.map +1 -1
- package/package.json +9 -4
- package/.claude/commands/opsx/apply.md +0 -152
- package/.claude/commands/opsx/archive.md +0 -157
- package/.claude/commands/opsx/bulk-archive.md +0 -242
- package/.claude/commands/opsx/continue.md +0 -114
- package/.claude/commands/opsx/explore.md +0 -174
- package/.claude/commands/opsx/ff.md +0 -94
- package/.claude/commands/opsx/new.md +0 -69
- package/.claude/commands/opsx/onboard.md +0 -525
- package/.claude/commands/opsx/sync.md +0 -134
- package/.claude/commands/opsx/verify.md +0 -164
- package/.claude/settings.local.json +0 -9
- package/.claude/skills/openspec-apply-change/SKILL.md +0 -156
- package/.claude/skills/openspec-archive-change/SKILL.md +0 -114
- package/.claude/skills/openspec-bulk-archive-change/SKILL.md +0 -246
- package/.claude/skills/openspec-continue-change/SKILL.md +0 -118
- package/.claude/skills/openspec-explore/SKILL.md +0 -290
- package/.claude/skills/openspec-ff-change/SKILL.md +0 -101
- package/.claude/skills/openspec-new-change/SKILL.md +0 -74
- package/.claude/skills/openspec-onboard/SKILL.md +0 -529
- package/.claude/skills/openspec-sync-specs/SKILL.md +0 -138
- package/.claude/skills/openspec-verify-change/SKILL.md +0 -168
- package/.dockerignore +0 -8
- package/.gemini/commands/opsx/apply.toml +0 -149
- package/.gemini/commands/opsx/archive.toml +0 -154
- package/.gemini/commands/opsx/bulk-archive.toml +0 -239
- package/.gemini/commands/opsx/continue.toml +0 -111
- package/.gemini/commands/opsx/explore.toml +0 -171
- package/.gemini/commands/opsx/ff.toml +0 -91
- package/.gemini/commands/opsx/new.toml +0 -66
- package/.gemini/commands/opsx/onboard.toml +0 -522
- package/.gemini/commands/opsx/sync.toml +0 -131
- package/.gemini/commands/opsx/verify.toml +0 -161
- package/.gemini/skills/openspec-apply-change/SKILL.md +0 -156
- package/.gemini/skills/openspec-archive-change/SKILL.md +0 -114
- package/.gemini/skills/openspec-bulk-archive-change/SKILL.md +0 -246
- package/.gemini/skills/openspec-continue-change/SKILL.md +0 -118
- package/.gemini/skills/openspec-explore/SKILL.md +0 -290
- package/.gemini/skills/openspec-ff-change/SKILL.md +0 -101
- package/.gemini/skills/openspec-new-change/SKILL.md +0 -74
- package/.gemini/skills/openspec-onboard/SKILL.md +0 -529
- package/.gemini/skills/openspec-sync-specs/SKILL.md +0 -138
- package/.gemini/skills/openspec-verify-change/SKILL.md +0 -168
- package/.github/agents/copilot-instructions.md +0 -32
- package/.github/agents/speckit.analyze.agent.md +0 -184
- package/.github/agents/speckit.checklist.agent.md +0 -294
- package/.github/agents/speckit.clarify.agent.md +0 -181
- package/.github/agents/speckit.constitution.agent.md +0 -82
- package/.github/agents/speckit.implement.agent.md +0 -135
- package/.github/agents/speckit.plan.agent.md +0 -89
- package/.github/agents/speckit.specify.agent.md +0 -258
- package/.github/agents/speckit.tasks.agent.md +0 -137
- package/.github/agents/speckit.taskstoissues.agent.md +0 -30
- package/.github/copilot-instructions.md +0 -17
- package/.github/prompts/speckit.analyze.prompt.md +0 -3
- package/.github/prompts/speckit.checklist.prompt.md +0 -3
- package/.github/prompts/speckit.clarify.prompt.md +0 -3
- package/.github/prompts/speckit.constitution.prompt.md +0 -3
- package/.github/prompts/speckit.implement.prompt.md +0 -3
- package/.github/prompts/speckit.plan.prompt.md +0 -3
- package/.github/prompts/speckit.specify.prompt.md +0 -3
- package/.github/prompts/speckit.tasks.prompt.md +0 -3
- package/.github/prompts/speckit.taskstoissues.prompt.md +0 -3
- package/.github/workflows/publish.yaml +0 -29
- package/.opencode/command/speckit.analyze.md +0 -184
- package/.opencode/command/speckit.checklist.md +0 -294
- package/.opencode/command/speckit.clarify.md +0 -181
- package/.opencode/command/speckit.constitution.md +0 -84
- package/.opencode/command/speckit.implement.md +0 -135
- package/.opencode/command/speckit.plan.md +0 -89
- package/.opencode/command/speckit.specify.md +0 -258
- package/.opencode/command/speckit.tasks.md +0 -137
- package/.opencode/command/speckit.taskstoissues.md +0 -30
- package/.qwen/commands/opsx-apply.toml +0 -149
- package/.qwen/commands/opsx-archive.toml +0 -154
- package/.qwen/commands/opsx-bulk-archive.toml +0 -239
- package/.qwen/commands/opsx-continue.toml +0 -111
- package/.qwen/commands/opsx-explore.toml +0 -171
- package/.qwen/commands/opsx-ff.toml +0 -91
- package/.qwen/commands/opsx-new.toml +0 -66
- package/.qwen/commands/opsx-onboard.toml +0 -522
- package/.qwen/commands/opsx-sync.toml +0 -131
- package/.qwen/commands/opsx-verify.toml +0 -161
- package/.qwen/skills/openspec-apply-change/SKILL.md +0 -156
- package/.qwen/skills/openspec-archive-change/SKILL.md +0 -114
- package/.qwen/skills/openspec-bulk-archive-change/SKILL.md +0 -246
- package/.qwen/skills/openspec-continue-change/SKILL.md +0 -118
- package/.qwen/skills/openspec-explore/SKILL.md +0 -290
- package/.qwen/skills/openspec-ff-change/SKILL.md +0 -101
- package/.qwen/skills/openspec-new-change/SKILL.md +0 -74
- package/.qwen/skills/openspec-onboard/SKILL.md +0 -529
- package/.qwen/skills/openspec-sync-specs/SKILL.md +0 -138
- package/.qwen/skills/openspec-verify-change/SKILL.md +0 -168
- package/.specify/memory/constitution.md +0 -58
- package/.specify/scripts/powershell/check-prerequisites.ps1 +0 -148
- package/.specify/scripts/powershell/common.ps1 +0 -137
- package/.specify/scripts/powershell/create-new-feature.ps1 +0 -283
- package/.specify/scripts/powershell/setup-plan.ps1 +0 -61
- package/.specify/scripts/powershell/update-agent-context.ps1 +0 -448
- package/.specify/templates/agent-file-template.md +0 -28
- package/.specify/templates/checklist-template.md +0 -40
- package/.specify/templates/constitution-template.md +0 -50
- package/.specify/templates/plan-template.md +0 -104
- package/.specify/templates/spec-template.md +0 -115
- package/.specify/templates/tasks-template.md +0 -251
- package/.vscode/launch.json +0 -14
- package/.vscode/settings.json +0 -14
- package/.vscode/tasks.json +0 -15
- package/AGENTS.md +0 -117
- package/CLAUDE.md +0 -70
- package/Dockerfile +0 -30
- package/GEMINI.md +0 -117
- package/QWEN.md +0 -117
- package/docker-compose.yml +0 -17
- package/openapi.yaml +0 -3127
- package/openspec/README.md +0 -33
- package/openspec/changes/archive/2026-04-03-separate-credit-card-transaction-tools/.openspec.yaml +0 -2
- package/openspec/changes/archive/2026-04-03-separate-credit-card-transaction-tools/design.md +0 -60
- package/openspec/changes/archive/2026-04-03-separate-credit-card-transaction-tools/proposal.md +0 -25
- package/openspec/changes/archive/2026-04-03-separate-credit-card-transaction-tools/specs/credit-card-transactions/spec.md +0 -46
- package/openspec/changes/archive/2026-04-03-separate-credit-card-transaction-tools/specs/transactions/spec.md +0 -42
- package/openspec/changes/archive/2026-04-03-separate-credit-card-transaction-tools/tasks.md +0 -22
- package/openspec/config.yaml +0 -20
- package/openspec/specs/accounts/spec.md +0 -86
- package/openspec/specs/categories/spec.md +0 -78
- package/openspec/specs/credit-card-transactions/spec.md +0 -64
- package/openspec/specs/credit-cards/spec.md +0 -109
- package/openspec/specs/data/spec.md +0 -49
- package/openspec/specs/settings/spec.md +0 -48
- package/openspec/specs/subscriptions/spec.md +0 -85
- package/openspec/specs/summary/spec.md +0 -49
- package/openspec/specs/transactions/spec.md +0 -113
- package/openspec/specs/transfers/spec.md +0 -74
- package/specs/001-mcp-api-integration/checklists/requirements.md +0 -34
- package/specs/001-mcp-api-integration/contracts/openapi.yaml +0 -636
- package/specs/001-mcp-api-integration/data-model.md +0 -106
- package/specs/001-mcp-api-integration/plan.md +0 -73
- package/specs/001-mcp-api-integration/quickstart.md +0 -74
- package/specs/001-mcp-api-integration/research.md +0 -58
- package/specs/001-mcp-api-integration/spec.md +0 -119
- package/specs/001-mcp-api-integration/tasks.md +0 -64
- package/src/config.ts +0 -39
- package/src/index.ts +0 -116
- package/src/services/apiClient.ts +0 -55
- package/src/services/requestContext.ts +0 -11
- package/src/tools/accounts.ts +0 -122
- package/src/tools/categories.ts +0 -102
- package/src/tools/credit-cards.ts +0 -203
- package/src/tools/data.ts +0 -45
- package/src/tools/settings.ts +0 -64
- package/src/tools/subscriptions.ts +0 -159
- package/src/tools/summary.ts +0 -29
- package/src/tools/transactions.ts +0 -200
- package/src/tools/transfers.ts +0 -122
- package/src/types/schemas.ts +0 -333
- package/src/utils/toolHelpers.ts +0 -11
- package/tests/benchmark.test.d.ts +0 -2
- package/tests/benchmark.test.d.ts.map +0 -1
- package/tests/benchmark.test.js +0 -33
- package/tests/benchmark.test.js.map +0 -1
- package/tests/benchmark.test.ts +0 -38
- package/tests/server.test.d.ts +0 -2
- package/tests/server.test.d.ts.map +0 -1
- package/tests/server.test.js +0 -13
- package/tests/server.test.js.map +0 -1
- package/tests/server.test.ts +0 -14
- package/tests/setup.d.ts +0 -4
- package/tests/setup.d.ts.map +0 -1
- package/tests/setup.js +0 -17
- package/tests/setup.js.map +0 -1
- package/tests/setup.ts +0 -20
- package/tests/tools/accounts.test.ts +0 -159
- package/tests/tools/categories.test.d.ts +0 -2
- package/tests/tools/categories.test.d.ts.map +0 -1
- package/tests/tools/categories.test.js +0 -63
- package/tests/tools/categories.test.js.map +0 -1
- package/tests/tools/categories.test.ts +0 -120
- package/tests/tools/credit-cards.test.d.ts +0 -2
- package/tests/tools/credit-cards.test.d.ts.map +0 -1
- package/tests/tools/credit-cards.test.js +0 -71
- package/tests/tools/credit-cards.test.js.map +0 -1
- package/tests/tools/credit-cards.test.ts +0 -131
- package/tests/tools/data.test.ts +0 -100
- package/tests/tools/settings.test.ts +0 -116
- package/tests/tools/subscriptions.test.ts +0 -173
- package/tests/tools/summary.test.d.ts +0 -2
- package/tests/tools/summary.test.d.ts.map +0 -1
- package/tests/tools/summary.test.js +0 -36
- package/tests/tools/summary.test.js.map +0 -1
- package/tests/tools/summary.test.ts +0 -63
- package/tests/tools/transactions.test.d.ts +0 -2
- package/tests/tools/transactions.test.d.ts.map +0 -1
- package/tests/tools/transactions.test.js +0 -67
- package/tests/tools/transactions.test.js.map +0 -1
- package/tests/tools/transactions.test.ts +0 -133
- package/tests/tools/transfers.test.ts +0 -141
- package/tsconfig.json +0 -52
- package/vitest.config.d.ts +0 -3
- package/vitest.config.d.ts.map +0 -1
- package/vitest.config.js +0 -14
- package/vitest.config.js.map +0 -1
- package/vitest.config.ts +0 -14
package/src/types/schemas.ts
DELETED
|
@@ -1,333 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
|
|
3
|
-
// --- Transfer Entities ---
|
|
4
|
-
export const TransferSchema = z.object({
|
|
5
|
-
id: z.string(),
|
|
6
|
-
sourceAccountId: z.string(),
|
|
7
|
-
destinationAccountId: z.string(),
|
|
8
|
-
amount: z.number().min(0.01),
|
|
9
|
-
date: z.string().regex(/^\d{4}-\d{2}-\d{2}$/),
|
|
10
|
-
createdAt: z.string().datetime().optional(),
|
|
11
|
-
updatedAt: z.string().datetime().optional(),
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
export const CreateTransferRequestSchema = z.object({
|
|
15
|
-
sourceAccountId: z.string().describe("Source account ID (required — must ask the user if not provided, do not assume or default)"),
|
|
16
|
-
destinationAccountId: z.string().describe("Destination account ID (required — must ask the user if not provided, do not assume or default)"),
|
|
17
|
-
amount: z.number().min(0.01).describe("Transfer amount (required — must ask the user if not provided, do not assume or default)"),
|
|
18
|
-
date: z.string().regex(/^\d{4}-\d{2}-\d{2}$/).describe("Transfer date (required — must ask the user if not provided, do not assume or default)"),
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
export const UpdateTransferRequestSchema = z.object({
|
|
22
|
-
sourceAccountId: z.string().optional(),
|
|
23
|
-
destinationAccountId: z.string().optional(),
|
|
24
|
-
amount: z.number().min(0.01).optional(),
|
|
25
|
-
date: z.string().regex(/^\d{4}-\d{2}-\d{2}$/).optional(),
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
// --- Domain Entities ---
|
|
29
|
-
|
|
30
|
-
export const CategorySchema = z.object({
|
|
31
|
-
id: z.string(),
|
|
32
|
-
name: z.string(),
|
|
33
|
-
type: z.enum(["INCOME", "EXPENSE"]),
|
|
34
|
-
color: z.string().optional(),
|
|
35
|
-
createdAt: z.string().datetime().optional()
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
export const TransactionSchema = z.object({
|
|
39
|
-
id: z.string(),
|
|
40
|
-
type: z.enum(["INCOME", "EXPENSE"]),
|
|
41
|
-
name: z.string(),
|
|
42
|
-
amount: z.number().min(0),
|
|
43
|
-
date: z.string().regex(/^\d{4}-\d{2}-\d{2}$/, "Invalid date format YYYY-MM-DD"),
|
|
44
|
-
categoryId: z.string().describe("ID da categoria associada (use a ferramenta get_categories para encontrar o ID correto)").optional(),
|
|
45
|
-
paymentMethod: z.enum(["CASH", "PIX", "DEBIT", "CREDIT"]).optional(),
|
|
46
|
-
creditCardId: z.string().describe("ID do cartão de crédito (obrigatório se o método de pagamento for CREDIT; use get_credit_cards para encontrar o ID)").optional(),
|
|
47
|
-
installmentGroupId: z.string().optional(),
|
|
48
|
-
installmentNumber: z.number().int().optional(),
|
|
49
|
-
installmentTotal: z.number().int().optional(),
|
|
50
|
-
recurrenceRuleId: z.string().optional(),
|
|
51
|
-
accountId: z.string().describe("ID da conta bancária (obrigatório se o método de pagamento NÃO for CREDIT; use get_accounts para encontrar o ID)").optional(),
|
|
52
|
-
paid: z.boolean().default(false),
|
|
53
|
-
createdAt: z.string().datetime().optional()
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
export const CreditCardSchema = z.object({
|
|
57
|
-
id: z.string(),
|
|
58
|
-
name: z.string(),
|
|
59
|
-
brand: z.string().optional(),
|
|
60
|
-
limitAmount: z.number().min(0),
|
|
61
|
-
closingDay: z.number().int().min(1).max(31),
|
|
62
|
-
dueDay: z.number().int().min(1).max(31),
|
|
63
|
-
createdAt: z.string().datetime().optional()
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
export const AccountSchema = z.object({
|
|
67
|
-
id: z.string(),
|
|
68
|
-
name: z.string(),
|
|
69
|
-
type: z.enum(["BANK_ACCOUNT", "WALLET", "SAVINGS_ACCOUNT", "INVESTMENT_ACCOUNT", "OTHER"]),
|
|
70
|
-
initialBalance: z.number(),
|
|
71
|
-
currentBalance: z.number().optional(),
|
|
72
|
-
createdAt: z.string().datetime().optional(),
|
|
73
|
-
updatedAt: z.string().datetime().optional()
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
export const AccountBalanceSchema = z.object({
|
|
77
|
-
accountId: z.string(),
|
|
78
|
-
currentBalance: z.number(),
|
|
79
|
-
calculatedAt: z.string().datetime()
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
export const StatementSchema = z.object({
|
|
83
|
-
cardId: z.string(),
|
|
84
|
-
periodStart: z.string(),
|
|
85
|
-
periodEnd: z.string(),
|
|
86
|
-
dueDate: z.string(),
|
|
87
|
-
transactions: z.array(TransactionSchema).optional(),
|
|
88
|
-
total: z.number(),
|
|
89
|
-
availableLimit: z.number()
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
export const StatementStatusSchema = z.object({
|
|
93
|
-
cardId: z.string(),
|
|
94
|
-
month: z.string(),
|
|
95
|
-
isPaid: z.boolean()
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
export const SummarySchema = z.object({
|
|
99
|
-
period: z.object({
|
|
100
|
-
month: z.string().optional(),
|
|
101
|
-
startDate: z.string().optional(),
|
|
102
|
-
endDate: z.string().optional()
|
|
103
|
-
}).optional(),
|
|
104
|
-
income: z.number(),
|
|
105
|
-
expenses: z.number(),
|
|
106
|
-
pendingIncome: z.number().optional(),
|
|
107
|
-
pendingExpenses: z.number().optional(),
|
|
108
|
-
balance: z.number(),
|
|
109
|
-
creditCardExpenses: z.array(z.any()).optional(),
|
|
110
|
-
expensesByCategory: z.array(z.any()).optional(),
|
|
111
|
-
incomeByCategory: z.array(z.any()).optional(),
|
|
112
|
-
accounts: z.array(z.any()).optional(),
|
|
113
|
-
totalBalance: z.number().optional()
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
export const SettingsSchema = z.object({
|
|
117
|
-
userName: z.string(),
|
|
118
|
-
language: z.enum(["pt-BR", "en-US"]),
|
|
119
|
-
currency: z.enum(["BRL", "USD", "EUR", "GBP", "JPY", "CAD", "AUD", "CHF"]),
|
|
120
|
-
createdAt: z.string().datetime().optional(),
|
|
121
|
-
updatedAt: z.string().datetime().optional()
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
// --- Tool Inputs ---
|
|
125
|
-
|
|
126
|
-
export const CreateCategoryInput = z.object({
|
|
127
|
-
name: z.string(),
|
|
128
|
-
type: z.enum(["INCOME", "EXPENSE"]),
|
|
129
|
-
color: z.string().regex(/^#[0-9A-Fa-f]{6}$/, "Invalid hex color").optional()
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
export const UpdateCategoryInput = z.object({
|
|
133
|
-
id: z.string(),
|
|
134
|
-
name: z.string().optional(),
|
|
135
|
-
color: z.string().regex(/^#[0-9A-Fa-f]{6}$/, "Invalid hex color").optional()
|
|
136
|
-
});
|
|
137
|
-
|
|
138
|
-
export const CreateCreditCardInput = z.object({
|
|
139
|
-
name: z.string(),
|
|
140
|
-
brand: z.string().optional(),
|
|
141
|
-
limitAmount: z.number().min(0),
|
|
142
|
-
closingDay: z.number().int().min(1).max(31),
|
|
143
|
-
dueDay: z.number().int().min(1).max(31)
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
export const UpdateCreditCardInput = z.object({
|
|
147
|
-
id: z.string(),
|
|
148
|
-
name: z.string().optional(),
|
|
149
|
-
brand: z.string().optional(),
|
|
150
|
-
limitAmount: z.number().min(0).optional(),
|
|
151
|
-
closingDay: z.number().int().min(1).max(31).optional(),
|
|
152
|
-
dueDay: z.number().int().min(1).max(31).optional()
|
|
153
|
-
});
|
|
154
|
-
|
|
155
|
-
export const CreateTransactionInput = z.object({
|
|
156
|
-
type: z.enum(["INCOME", "EXPENSE"]),
|
|
157
|
-
name: z.string(),
|
|
158
|
-
amount: z.number().nonnegative().describe("Transaction amount (required — must ask the user if not provided, do not assume or default)"),
|
|
159
|
-
date: z.string().describe("ISO date string YYYY-MM-DD"),
|
|
160
|
-
categoryId: z.string().describe("ID da categoria associada (use a ferramenta get_categories para encontrar o ID correto)").optional(),
|
|
161
|
-
paymentMethod: z.enum(["CASH", "PIX", "DEBIT"]).describe("Método de pagamento direto (CASH, PIX ou DEBIT — para cartão de crédito, use create_credit_transaction)").optional(),
|
|
162
|
-
accountId: z.string().describe("ID da conta bancária (use get_accounts para encontrar o ID)").optional(),
|
|
163
|
-
installments: z.number().int().min(1).optional(),
|
|
164
|
-
isPaid: z.boolean().describe("Indica se a transação já foi paga ou recebida (use este campo em vez de 'paid')").optional(),
|
|
165
|
-
recurrence: z.object({
|
|
166
|
-
frequency: z.enum(["MONTHLY", "WEEKLY", "YEARLY"]),
|
|
167
|
-
interval: z.number().int().min(1).optional(),
|
|
168
|
-
endDate: z.string().optional(),
|
|
169
|
-
occurrences: z.number().int().min(2).describe("Number of occurrences (mutually exclusive with endDate)").optional()
|
|
170
|
-
}).optional()
|
|
171
|
-
});
|
|
172
|
-
|
|
173
|
-
export const UpdateTransactionInput = z.object({
|
|
174
|
-
id: z.string(),
|
|
175
|
-
mode: z.enum(["SINGLE", "PENDING", "ALL"]).default("SINGLE").optional(),
|
|
176
|
-
type: z.enum(["INCOME", "EXPENSE"]).optional(),
|
|
177
|
-
name: z.string().optional(),
|
|
178
|
-
amount: z.number().nonnegative().optional(),
|
|
179
|
-
date: z.string().describe("ISO date string YYYY-MM-DD").optional(),
|
|
180
|
-
categoryId: z.string().describe("ID da categoria associada (use a ferramenta get_categories para encontrar o ID correto)").optional(),
|
|
181
|
-
paymentMethod: z.enum(["CASH", "PIX", "DEBIT"]).describe("Método de pagamento direto (CASH, PIX ou DEBIT — para cartão de crédito, use update_credit_transaction)").optional(),
|
|
182
|
-
accountId: z.string().describe("ID da conta bancária (use get_accounts para encontrar o ID)").optional(),
|
|
183
|
-
installments: z.number().int().min(1).optional(),
|
|
184
|
-
isPaid: z.boolean().optional(),
|
|
185
|
-
recurrence: z.object({
|
|
186
|
-
frequency: z.enum(["MONTHLY", "WEEKLY", "YEARLY"]).optional(),
|
|
187
|
-
interval: z.number().int().min(1).optional(),
|
|
188
|
-
endDate: z.string().optional(),
|
|
189
|
-
occurrences: z.number().int().min(2).describe("Number of occurrences (mutually exclusive with endDate)").optional()
|
|
190
|
-
}).optional()
|
|
191
|
-
});
|
|
192
|
-
|
|
193
|
-
// --- Credit Card Transaction Tool Inputs ---
|
|
194
|
-
|
|
195
|
-
export const CreditCardRecurrenceSchema = z.object({
|
|
196
|
-
frequency: z.enum(["WEEKLY", "BIWEEKLY", "MONTHLY", "BIMONTHLY", "QUARTERLY", "SEMIANNUALLY", "ANNUALLY"]),
|
|
197
|
-
interval: z.number().int().min(1).default(1).optional(),
|
|
198
|
-
startDate: z.string().regex(/^\d{4}-\d{2}-\d{2}$/).describe("Start date for recurrence (defaults to purchase date)").optional(),
|
|
199
|
-
endDate: z.string().optional(),
|
|
200
|
-
occurrences: z.number().int().min(2).describe("Number of occurrences (optional)").optional()
|
|
201
|
-
});
|
|
202
|
-
|
|
203
|
-
export const CreateCreditCardTransactionInput = z.object({
|
|
204
|
-
name: z.string().describe("Name or description of the transaction"),
|
|
205
|
-
amount: z.number().min(0).describe("Total amount of the transaction (required — must ask the user if not provided, do not assume or default)"),
|
|
206
|
-
purchaseDate: z.string().regex(/^\d{4}-\d{2}-\d{2}$/, "Purchase date in YYYY-MM-DD format").describe("Actual purchase date (the day you bought the item)"),
|
|
207
|
-
creditCardId: z.string().describe("ID of the credit card to charge (use get_credit_cards to find the ID)"),
|
|
208
|
-
categoryId: z.string().describe("ID of the associated category (use get_categories to find the ID)").optional(),
|
|
209
|
-
installments: z.number().int().min(1).describe("Number of installments (optional)").optional(),
|
|
210
|
-
targetDueMonth: z.string().regex(/^\d{4}-\d{2}$/, "Target month in YYYY-MM format").describe("Target month for due date (optional)").optional(),
|
|
211
|
-
isPaid: z.boolean().describe("Whether the transaction has been paid").optional(),
|
|
212
|
-
recurrence: CreditCardRecurrenceSchema.optional()
|
|
213
|
-
});
|
|
214
|
-
|
|
215
|
-
export const UpdateCreditCardTransactionInput = z.object({
|
|
216
|
-
id: z.string().describe("Credit card transaction ID"),
|
|
217
|
-
name: z.string().describe("Name or description of the transaction").optional(),
|
|
218
|
-
amount: z.number().min(0).describe("Total amount of the transaction").optional(),
|
|
219
|
-
purchaseDate: z.string().regex(/^\d{4}-\d{2}-\d{2}$/, "Purchase date in YYYY-MM-DD format").describe("Actual purchase date").optional(),
|
|
220
|
-
creditCardId: z.string().describe("ID of the credit card").optional(),
|
|
221
|
-
categoryId: z.string().describe("ID of the associated category").optional(),
|
|
222
|
-
installments: z.number().int().min(1).describe("Number of installments").optional(),
|
|
223
|
-
targetDueMonth: z.string().regex(/^\d{4}-\d{2}$/, "Target month in YYYY-MM format").describe("Target month for due date").optional(),
|
|
224
|
-
isPaid: z.boolean().optional(),
|
|
225
|
-
recurrence: CreditCardRecurrenceSchema.optional()
|
|
226
|
-
});
|
|
227
|
-
|
|
228
|
-
export const CreateAccountInput = z.object({
|
|
229
|
-
name: z.string(),
|
|
230
|
-
type: z.enum(["BANK_ACCOUNT", "WALLET", "SAVINGS_ACCOUNT", "INVESTMENT_ACCOUNT", "OTHER"]),
|
|
231
|
-
initialBalance: z.number().optional()
|
|
232
|
-
});
|
|
233
|
-
|
|
234
|
-
export const UpdateAccountInput = z.object({
|
|
235
|
-
id: z.string(),
|
|
236
|
-
name: z.string().optional(),
|
|
237
|
-
type: z.enum(["BANK_ACCOUNT", "WALLET", "SAVINGS_ACCOUNT", "INVESTMENT_ACCOUNT", "OTHER"]).optional(),
|
|
238
|
-
initialBalance: z.number().optional()
|
|
239
|
-
});
|
|
240
|
-
|
|
241
|
-
export const GetTransactionsInput = z.object({
|
|
242
|
-
month: z.string().regex(/^\d{4}-\d{2}$/, "Format: YYYY-MM").describe("Filter by month, format: YYYY-MM").optional(),
|
|
243
|
-
accountId: z.string().describe("Filter by account ID").optional(),
|
|
244
|
-
categoryId: z.string().describe("Filter by category ID").optional(),
|
|
245
|
-
creditCardId: z.string().describe("Filter by credit card ID").optional(),
|
|
246
|
-
type: z.enum(["INCOME", "EXPENSE"]).describe("Filter by transaction type").optional(),
|
|
247
|
-
startDate: z.string().regex(/^\d{4}-\d{2}-\d{2}$/).describe("Filter from this date (inclusive), YYYY-MM-DD").optional(),
|
|
248
|
-
endDate: z.string().regex(/^\d{4}-\d{2}-\d{2}$/).describe("Filter up to this date (inclusive), YYYY-MM-DD").optional(),
|
|
249
|
-
paid: z.boolean().describe("Filter by payment status (true = paid, false = unpaid)").optional()
|
|
250
|
-
});
|
|
251
|
-
|
|
252
|
-
export const PayStatementInput = z.object({
|
|
253
|
-
cardId: z.string(),
|
|
254
|
-
month: z.string().regex(/^\d{4}-\d{2}$/, "Format: YYYY-MM"),
|
|
255
|
-
paymentAccountId: z.string()
|
|
256
|
-
});
|
|
257
|
-
|
|
258
|
-
export const ReopenStatementInput = z.object({
|
|
259
|
-
cardId: z.string().describe('Credit card ID'),
|
|
260
|
-
month: z.string().regex(/^\d{4}-\d{2}$/, "Format: YYYY-MM").describe('Month in YYYY-MM format')
|
|
261
|
-
});
|
|
262
|
-
|
|
263
|
-
export const GetSummaryInput = z.object({
|
|
264
|
-
month: z.string().regex(/^\d{4}-\d{2}$/, "Format: YYYY-MM").describe("Month in YYYY-MM format (use this OR startDate+endDate)").optional(),
|
|
265
|
-
startDate: z.string().regex(/^\d{4}-\d{2}-\d{2}$/).describe("Start date for custom range, YYYY-MM-DD (use with endDate)").optional(),
|
|
266
|
-
endDate: z.string().regex(/^\d{4}-\d{2}-\d{2}$/).describe("End date for custom range, YYYY-MM-DD (use with startDate)").optional()
|
|
267
|
-
});
|
|
268
|
-
|
|
269
|
-
export const CreateSettingsInput = z.object({
|
|
270
|
-
userName: z.string(),
|
|
271
|
-
language: z.enum(["pt-BR", "en-US"]),
|
|
272
|
-
currency: z.enum(["BRL", "USD", "EUR", "GBP", "JPY", "CAD", "AUD", "CHF"])
|
|
273
|
-
});
|
|
274
|
-
|
|
275
|
-
export const UpdateSettingsInput = z.object({
|
|
276
|
-
userName: z.string().optional(),
|
|
277
|
-
language: z.enum(["pt-BR", "en-US"]).optional(),
|
|
278
|
-
currency: z.enum(["BRL", "USD", "EUR", "GBP", "JPY", "CAD", "AUD", "CHF"]).optional()
|
|
279
|
-
});
|
|
280
|
-
|
|
281
|
-
export const CreateAnticipationInput = z.object({
|
|
282
|
-
cardId: z.string().describe('Credit card ID'),
|
|
283
|
-
name: z.string().describe('Name/description of the anticipation'),
|
|
284
|
-
amount: z.number().min(0.01).describe('Amount to anticipate'),
|
|
285
|
-
purchaseDate: z.string().regex(/^\d{4}-\d{2}-\d{2}$/).describe('Date the money leaves the account (YYYY-MM-DD)'),
|
|
286
|
-
targetDueMonth: z.string().regex(/^\d{4}-\d{2}$/).describe('Target statement due month (YYYY-MM)'),
|
|
287
|
-
accountId: z.string().describe('Account ID from which money will be debited'),
|
|
288
|
-
categoryId: z.string().optional().describe('Category ID for both transactions')
|
|
289
|
-
});
|
|
290
|
-
|
|
291
|
-
export const ImportDataInput = z.object({
|
|
292
|
-
mode: z.enum(["reset", "increment"]).describe("reset: clears all data before import; increment: adds new records, skipping existing IDs"),
|
|
293
|
-
version: z.string().describe('Export format version, must be "1.0"'),
|
|
294
|
-
exportedAt: z.string().datetime().describe("ISO timestamp of when the data was exported"),
|
|
295
|
-
data: z.object({
|
|
296
|
-
settings: z.any().nullable().optional(),
|
|
297
|
-
categories: z.array(z.any()).optional(),
|
|
298
|
-
accounts: z.array(z.any()).optional(),
|
|
299
|
-
creditCards: z.array(z.any()).optional(),
|
|
300
|
-
recurrenceRules: z.array(z.any()).optional(),
|
|
301
|
-
transactions: z.array(z.any()).optional()
|
|
302
|
-
})
|
|
303
|
-
});
|
|
304
|
-
|
|
305
|
-
export const SubscriptionSchema = z.object({
|
|
306
|
-
id: z.string(),
|
|
307
|
-
name: z.string(),
|
|
308
|
-
amount: z.number().min(0.01),
|
|
309
|
-
billingDay: z.number().int().min(1).max(31),
|
|
310
|
-
creditCardId: z.string(),
|
|
311
|
-
categoryId: z.string().describe("ID da categoria associada (use a ferramenta get_categories para encontrar o ID correto)").optional(),
|
|
312
|
-
active: z.boolean(),
|
|
313
|
-
createdAt: z.string().datetime().optional(),
|
|
314
|
-
updatedAt: z.string().datetime().optional()
|
|
315
|
-
});
|
|
316
|
-
|
|
317
|
-
export const CreateSubscriptionInput = z.object({
|
|
318
|
-
name: z.string().describe("Name of the subscription (e.g., Netflix, Spotify)"),
|
|
319
|
-
amount: z.number().min(0.01).describe("Monthly amount charged"),
|
|
320
|
-
billingDay: z.number().int().min(1).max(31).describe("Day of the month when the subscription is charged (1-31)"),
|
|
321
|
-
creditCardId: z.string().describe("ID of the credit card used for this subscription"),
|
|
322
|
-
categoryId: z.string().describe("ID of the expense category").optional()
|
|
323
|
-
});
|
|
324
|
-
|
|
325
|
-
export const UpdateSubscriptionInput = z.object({
|
|
326
|
-
id: z.string(),
|
|
327
|
-
name: z.string().optional(),
|
|
328
|
-
amount: z.number().min(0.01).optional(),
|
|
329
|
-
billingDay: z.number().int().min(1).max(31).optional(),
|
|
330
|
-
creditCardId: z.string().describe("ID do cartão de crédito (obrigatório se o método de pagamento for CREDIT; use get_credit_cards para encontrar o ID)").optional(),
|
|
331
|
-
categoryId: z.string().describe("ID da categoria associada (use a ferramenta get_categories para encontrar o ID correto)").optional(),
|
|
332
|
-
active: z.boolean().optional()
|
|
333
|
-
});
|
package/src/utils/toolHelpers.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ApiClientError } from '../services/apiClient.js';
|
|
2
|
-
|
|
3
|
-
export function handleToolError(error: unknown): { content: [{ type: 'text'; text: string }] } {
|
|
4
|
-
if (error instanceof ApiClientError) {
|
|
5
|
-
return { content: [{ type: 'text', text: `API error ${error.status}: ${error.statusText}` }] };
|
|
6
|
-
}
|
|
7
|
-
if (error instanceof Error) {
|
|
8
|
-
return { content: [{ type: 'text', text: `Error: ${error.message}` }] };
|
|
9
|
-
}
|
|
10
|
-
return { content: [{ type: 'text', text: 'An unexpected error occurred.' }] };
|
|
11
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"benchmark.test.d.ts","sourceRoot":"","sources":["benchmark.test.ts"],"names":[],"mappings":""}
|
package/tests/benchmark.test.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, vi } from 'vitest';
|
|
2
|
-
import { registerCategoryTools } from '../src/tools/categories.js';
|
|
3
|
-
import { apiClient } from '../src/services/apiClient.js';
|
|
4
|
-
vi.mock('../src/services/apiClient.js', () => ({
|
|
5
|
-
apiClient: {
|
|
6
|
-
get: vi.fn(),
|
|
7
|
-
}
|
|
8
|
-
}));
|
|
9
|
-
describe('Performance Benchmark', () => {
|
|
10
|
-
// This is a rough benchmark, mostly verifying it's not super slow due to overhead
|
|
11
|
-
it('should execute tool handler with low overhead (<20ms)', async () => {
|
|
12
|
-
const registeredTools = {};
|
|
13
|
-
const mockServer = {
|
|
14
|
-
registerTool: (name, def, handler) => {
|
|
15
|
-
registeredTools[name] = handler;
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
// Setup
|
|
19
|
-
registerCategoryTools(mockServer);
|
|
20
|
-
const handler = registeredTools['get_categories'];
|
|
21
|
-
apiClient.get.mockResolvedValue([]);
|
|
22
|
-
// Warmup
|
|
23
|
-
await handler({});
|
|
24
|
-
// Measure
|
|
25
|
-
const start = performance.now();
|
|
26
|
-
await handler({});
|
|
27
|
-
const end = performance.now();
|
|
28
|
-
const duration = end - start;
|
|
29
|
-
console.log(`Tool execution overhead: ${duration.toFixed(3)}ms`);
|
|
30
|
-
expect(duration).toBeLessThan(20);
|
|
31
|
-
});
|
|
32
|
-
});
|
|
33
|
-
//# sourceMappingURL=benchmark.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"benchmark.test.js","sourceRoot":"","sources":["benchmark.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAEzD,EAAE,CAAC,IAAI,CAAC,8BAA8B,EAAE,GAAG,EAAE,CAAC,CAAC;IAC7C,SAAS,EAAE;QACT,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE;KACb;CACF,CAAC,CAAC,CAAC;AAEJ,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;IACnC,kFAAkF;IAClF,EAAE,CAAC,uDAAuD,EAAE,KAAK,IAAI,EAAE;QACnE,MAAM,eAAe,GAA6B,EAAE,CAAC;QACrD,MAAM,UAAU,GAAG;YACf,YAAY,EAAE,CAAC,IAAY,EAAE,GAAQ,EAAE,OAAiB,EAAE,EAAE;gBACxD,eAAe,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC;YACpC,CAAC;SACJ,CAAC;QAEF,QAAQ;QACR,qBAAqB,CAAC,UAAiB,CAAC,CAAC;QACzC,MAAM,OAAO,GAAG,eAAe,CAAC,gBAAgB,CAAC,CAAC;QACjD,SAAS,CAAC,GAAW,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC;QAE7C,SAAS;QACT,MAAM,OAAO,CAAC,EAAE,CAAC,CAAC;QAElB,UAAU;QACV,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;QAChC,MAAM,OAAO,CAAC,EAAE,CAAC,CAAC;QAClB,MAAM,GAAG,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;QAC9B,MAAM,QAAQ,GAAG,GAAG,GAAG,KAAK,CAAC;QAE7B,OAAO,CAAC,GAAG,CAAC,4BAA4B,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QACjE,MAAM,CAAC,QAAQ,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
package/tests/benchmark.test.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, vi } from 'vitest';
|
|
2
|
-
import { registerCategoryTools } from '../src/tools/categories.js';
|
|
3
|
-
import { apiClient } from '../src/services/apiClient.js';
|
|
4
|
-
|
|
5
|
-
vi.mock('../src/services/apiClient.js', () => ({
|
|
6
|
-
apiClient: {
|
|
7
|
-
get: vi.fn(),
|
|
8
|
-
}
|
|
9
|
-
}));
|
|
10
|
-
|
|
11
|
-
describe('Performance Benchmark', () => {
|
|
12
|
-
// This is a rough benchmark, mostly verifying it's not super slow due to overhead
|
|
13
|
-
it('should execute tool handler with low overhead (<20ms)', async () => {
|
|
14
|
-
const registeredTools: Record<string, Function> = {};
|
|
15
|
-
const mockServer = {
|
|
16
|
-
registerTool: (name: string, def: any, handler: Function) => {
|
|
17
|
-
registeredTools[name] = handler;
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
// Setup
|
|
22
|
-
registerCategoryTools(mockServer as any);
|
|
23
|
-
const handler = registeredTools['get_categories'];
|
|
24
|
-
(apiClient.get as any).mockResolvedValue([]);
|
|
25
|
-
|
|
26
|
-
// Warmup
|
|
27
|
-
await handler({});
|
|
28
|
-
|
|
29
|
-
// Measure
|
|
30
|
-
const start = performance.now();
|
|
31
|
-
await handler({});
|
|
32
|
-
const end = performance.now();
|
|
33
|
-
const duration = end - start;
|
|
34
|
-
|
|
35
|
-
console.log(`Tool execution overhead: ${duration.toFixed(3)}ms`);
|
|
36
|
-
expect(duration).toBeLessThan(20);
|
|
37
|
-
});
|
|
38
|
-
});
|
package/tests/server.test.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server.test.d.ts","sourceRoot":"","sources":["server.test.ts"],"names":[],"mappings":""}
|
package/tests/server.test.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, vi } from 'vitest';
|
|
2
|
-
import { getServer } from '../src/index.js';
|
|
3
|
-
describe('Server Startup', () => {
|
|
4
|
-
it('should initialize McpServer', () => {
|
|
5
|
-
const server = getServer();
|
|
6
|
-
expect(server).toBeDefined();
|
|
7
|
-
// expect(server.server.name).toBe('quantix_mcp_server');
|
|
8
|
-
});
|
|
9
|
-
// Since we can't easily inspect registered tools without private access or running it,
|
|
10
|
-
// we'll mainly check it doesn't crash on init.
|
|
11
|
-
// With McpServer from SDK, we might be able to check capabilities or similar if exposed.
|
|
12
|
-
});
|
|
13
|
-
//# sourceMappingURL=server.test.js.map
|
package/tests/server.test.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server.test.js","sourceRoot":"","sources":["server.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,EAAE,CAAC,6BAA6B,EAAE,GAAG,EAAE;QACrC,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,MAAM,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,CAAC;QAC7B,0DAA0D;IAC5D,CAAC,CAAC,CAAC;IAEH,wFAAwF;IACxF,+CAA+C;IAC/C,yFAAyF;AAC3F,CAAC,CAAC,CAAC"}
|
package/tests/server.test.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, vi } from 'vitest';
|
|
2
|
-
import { getServer } from '../src/index.js';
|
|
3
|
-
|
|
4
|
-
describe('Server Startup', () => {
|
|
5
|
-
it('should initialize McpServer', () => {
|
|
6
|
-
const server = getServer();
|
|
7
|
-
expect(server).toBeDefined();
|
|
8
|
-
// expect(server.server.name).toBe('quantix_mcp_server');
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
// Since we can't easily inspect registered tools without private access or running it,
|
|
12
|
-
// we'll mainly check it doesn't crash on init.
|
|
13
|
-
// With McpServer from SDK, we might be able to check capabilities or similar if exposed.
|
|
14
|
-
});
|
package/tests/setup.d.ts
DELETED
package/tests/setup.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["setup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAK5B,eAAO,MAAM,SAAS,EAA8B,UAAU,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC;AAE7E,wBAAgB,UAAU,SAEzB"}
|
package/tests/setup.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { vi } from 'vitest';
|
|
2
|
-
// Define the global fetch if not already (Vitest/Node should have it, but for explicit typing)
|
|
3
|
-
global.fetch = vi.fn();
|
|
4
|
-
export const mockFetch = global.fetch;
|
|
5
|
-
export function resetMocks() {
|
|
6
|
-
mockFetch.mockReset();
|
|
7
|
-
}
|
|
8
|
-
// Basic mocks for config to ensure tests don't fail on missing env
|
|
9
|
-
vi.mock('../src/config.js', () => ({
|
|
10
|
-
config: {
|
|
11
|
-
QUANTIX_API_URL: 'https://test-api.quantix.com',
|
|
12
|
-
QUANTIX_API_KEY: 'test-key',
|
|
13
|
-
MCPPORT: '3000',
|
|
14
|
-
NODE_ENV: 'test'
|
|
15
|
-
}
|
|
16
|
-
}));
|
|
17
|
-
//# sourceMappingURL=setup.js.map
|
package/tests/setup.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setup.js","sourceRoot":"","sources":["setup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE5B,+FAA+F;AAC/F,MAAM,CAAC,KAAK,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;AAEvB,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,KAA4C,CAAC;AAE7E,MAAM,UAAU,UAAU;IACxB,SAAS,CAAC,SAAS,EAAE,CAAC;AACxB,CAAC;AAED,mEAAmE;AACnE,EAAE,CAAC,IAAI,CAAC,kBAAkB,EAAE,GAAG,EAAE,CAAC,CAAC;IACjC,MAAM,EAAE;QACN,eAAe,EAAE,8BAA8B;QAC/C,eAAe,EAAE,UAAU;QAC3B,OAAO,EAAE,MAAM;QACf,QAAQ,EAAE,MAAM;KACjB;CACF,CAAC,CAAC,CAAC"}
|
package/tests/setup.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { vi } from 'vitest';
|
|
2
|
-
|
|
3
|
-
// Define the global fetch if not already (Vitest/Node should have it, but for explicit typing)
|
|
4
|
-
global.fetch = vi.fn();
|
|
5
|
-
|
|
6
|
-
export const mockFetch = global.fetch as unknown as ReturnType<typeof vi.fn>;
|
|
7
|
-
|
|
8
|
-
export function resetMocks() {
|
|
9
|
-
mockFetch.mockReset();
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
// Basic mocks for config to ensure tests don't fail on missing env
|
|
13
|
-
vi.mock('../src/config.js', () => ({
|
|
14
|
-
config: {
|
|
15
|
-
QUANTIX_API_URL: 'https://test-api.quantix.com',
|
|
16
|
-
QUANTIX_API_KEY: 'test-key',
|
|
17
|
-
MCPPORT: '3000',
|
|
18
|
-
NODE_ENV: 'test'
|
|
19
|
-
}
|
|
20
|
-
}));
|