@taxdao/fintax-mcp 0.2.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/README.md +220 -0
- package/dist/app/create-server.d.ts +18 -0
- package/dist/app/create-server.js +80 -0
- package/dist/app/create-server.js.map +1 -0
- package/dist/app/register-tools.d.ts +4 -0
- package/dist/app/register-tools.js +18 -0
- package/dist/app/register-tools.js.map +1 -0
- package/dist/audit/audit-context.d.ts +38 -0
- package/dist/audit/audit-context.js +167 -0
- package/dist/audit/audit-context.js.map +1 -0
- package/dist/audit/audit-sink.d.ts +20 -0
- package/dist/audit/audit-sink.js +6 -0
- package/dist/audit/audit-sink.js.map +1 -0
- package/dist/audit/file-audit-sink.d.ts +6 -0
- package/dist/audit/file-audit-sink.js +18 -0
- package/dist/audit/file-audit-sink.js.map +1 -0
- package/dist/auth/auth-session.d.ts +63 -0
- package/dist/auth/auth-session.js +226 -0
- package/dist/auth/auth-session.js.map +1 -0
- package/dist/auth/credentials.d.ts +6 -0
- package/dist/auth/credentials.js +12 -0
- package/dist/auth/credentials.js.map +1 -0
- package/dist/auth/org-token-provider.d.ts +15 -0
- package/dist/auth/org-token-provider.js +62 -0
- package/dist/auth/org-token-provider.js.map +1 -0
- package/dist/capabilities/capability.d.ts +100 -0
- package/dist/capabilities/capability.js +26 -0
- package/dist/capabilities/capability.js.map +1 -0
- package/dist/capabilities/create-capabilities.d.ts +2 -0
- package/dist/capabilities/create-capabilities.js +37 -0
- package/dist/capabilities/create-capabilities.js.map +1 -0
- package/dist/capabilities/define-capability.d.ts +39 -0
- package/dist/capabilities/define-capability.js +64 -0
- package/dist/capabilities/define-capability.js.map +1 -0
- package/dist/capabilities/definitions/accounting-balances.d.ts +4 -0
- package/dist/capabilities/definitions/accounting-balances.js +98 -0
- package/dist/capabilities/definitions/accounting-balances.js.map +1 -0
- package/dist/capabilities/definitions/accounting-context.d.ts +2 -0
- package/dist/capabilities/definitions/accounting-context.js +17 -0
- package/dist/capabilities/definitions/accounting-context.js.map +1 -0
- package/dist/capabilities/definitions/assets.d.ts +2 -0
- package/dist/capabilities/definitions/assets.js +367 -0
- package/dist/capabilities/definitions/assets.js.map +1 -0
- package/dist/capabilities/definitions/business-documents.d.ts +9 -0
- package/dist/capabilities/definitions/business-documents.js +386 -0
- package/dist/capabilities/definitions/business-documents.js.map +1 -0
- package/dist/capabilities/definitions/dashboard.d.ts +2 -0
- package/dist/capabilities/definitions/dashboard.js +153 -0
- package/dist/capabilities/definitions/dashboard.js.map +1 -0
- package/dist/capabilities/definitions/extended-operation-contracts.d.ts +597 -0
- package/dist/capabilities/definitions/extended-operation-contracts.js +1180 -0
- package/dist/capabilities/definitions/extended-operation-contracts.js.map +1 -0
- package/dist/capabilities/definitions/extended-operations.d.ts +2 -0
- package/dist/capabilities/definitions/extended-operations.js +699 -0
- package/dist/capabilities/definitions/extended-operations.js.map +1 -0
- package/dist/capabilities/definitions/financial-reports.d.ts +2 -0
- package/dist/capabilities/definitions/financial-reports.js +100 -0
- package/dist/capabilities/definitions/financial-reports.js.map +1 -0
- package/dist/capabilities/definitions/fnd-import.d.ts +34 -0
- package/dist/capabilities/definitions/fnd-import.js +282 -0
- package/dist/capabilities/definitions/fnd-import.js.map +1 -0
- package/dist/capabilities/definitions/fund-accounts.d.ts +2 -0
- package/dist/capabilities/definitions/fund-accounts.js +188 -0
- package/dist/capabilities/definitions/fund-accounts.js.map +1 -0
- package/dist/capabilities/definitions/fund-balances.d.ts +2 -0
- package/dist/capabilities/definitions/fund-balances.js +84 -0
- package/dist/capabilities/definitions/fund-balances.js.map +1 -0
- package/dist/capabilities/definitions/journals.d.ts +10 -0
- package/dist/capabilities/definitions/journals.js +224 -0
- package/dist/capabilities/definitions/journals.js.map +1 -0
- package/dist/capabilities/definitions/master-data.d.ts +2 -0
- package/dist/capabilities/definitions/master-data.js +451 -0
- package/dist/capabilities/definitions/master-data.js.map +1 -0
- package/dist/capabilities/definitions/pnl.d.ts +2 -0
- package/dist/capabilities/definitions/pnl.js +139 -0
- package/dist/capabilities/definitions/pnl.js.map +1 -0
- package/dist/capabilities/definitions/reference-data.d.ts +2 -0
- package/dist/capabilities/definitions/reference-data.js +169 -0
- package/dist/capabilities/definitions/reference-data.js.map +1 -0
- package/dist/capabilities/definitions/transaction-drafts.d.ts +2 -0
- package/dist/capabilities/definitions/transaction-drafts.js +157 -0
- package/dist/capabilities/definitions/transaction-drafts.js.map +1 -0
- package/dist/capabilities/definitions/transactions.d.ts +168 -0
- package/dist/capabilities/definitions/transactions.js +79 -0
- package/dist/capabilities/definitions/transactions.js.map +1 -0
- package/dist/capabilities/executor.d.ts +19 -0
- package/dist/capabilities/executor.js +134 -0
- package/dist/capabilities/executor.js.map +1 -0
- package/dist/capabilities/registry.d.ts +7 -0
- package/dist/capabilities/registry.js +51 -0
- package/dist/capabilities/registry.js.map +1 -0
- package/dist/clients/base-client.d.ts +5 -0
- package/dist/clients/base-client.js +13 -0
- package/dist/clients/base-client.js.map +1 -0
- package/dist/clients/http-client.d.ts +29 -0
- package/dist/clients/http-client.js +167 -0
- package/dist/clients/http-client.js.map +1 -0
- package/dist/clients/suite-client.d.ts +5 -0
- package/dist/clients/suite-client.js +5 -0
- package/dist/clients/suite-client.js.map +1 -0
- package/dist/concurrency/lock-manager.d.ts +4 -0
- package/dist/concurrency/lock-manager.js +23 -0
- package/dist/concurrency/lock-manager.js.map +1 -0
- package/dist/config/load-config.d.ts +2 -0
- package/dist/config/load-config.js +18 -0
- package/dist/config/load-config.js.map +1 -0
- package/dist/config/schema.d.ts +24 -0
- package/dist/config/schema.js +85 -0
- package/dist/config/schema.js.map +1 -0
- package/dist/errors/fintax-error.d.ts +24 -0
- package/dist/errors/fintax-error.js +21 -0
- package/dist/errors/fintax-error.js.map +1 -0
- package/dist/errors/normalize-error.d.ts +3 -0
- package/dist/errors/normalize-error.js +67 -0
- package/dist/errors/normalize-error.js.map +1 -0
- package/dist/files/artifact-store.d.ts +17 -0
- package/dist/files/artifact-store.js +74 -0
- package/dist/files/artifact-store.js.map +1 -0
- package/dist/files/input-policy.d.ts +28 -0
- package/dist/files/input-policy.js +109 -0
- package/dist/files/input-policy.js.map +1 -0
- package/dist/files/roots-provider.d.ts +14 -0
- package/dist/files/roots-provider.js +47 -0
- package/dist/files/roots-provider.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +49 -0
- package/dist/index.js.map +1 -0
- package/dist/logging/logger.d.ts +3 -0
- package/dist/logging/logger.js +13 -0
- package/dist/logging/logger.js.map +1 -0
- package/dist/policies/idempotency.d.ts +32 -0
- package/dist/policies/idempotency.js +155 -0
- package/dist/policies/idempotency.js.map +1 -0
- package/dist/policies/job-reference.d.ts +16 -0
- package/dist/policies/job-reference.js +62 -0
- package/dist/policies/job-reference.js.map +1 -0
- package/dist/policies/operation-plan.d.ts +27 -0
- package/dist/policies/operation-plan.js +99 -0
- package/dist/policies/operation-plan.js.map +1 -0
- package/dist/policies/redaction.d.ts +2 -0
- package/dist/policies/redaction.js +29 -0
- package/dist/policies/redaction.js.map +1 -0
- package/dist/policies/retry.d.ts +8 -0
- package/dist/policies/retry.js +19 -0
- package/dist/policies/retry.js.map +1 -0
- package/dist/responses/tool-response.d.ts +4 -0
- package/dist/responses/tool-response.js +24 -0
- package/dist/responses/tool-response.js.map +1 -0
- package/dist/schemas/common.d.ts +226 -0
- package/dist/schemas/common.js +133 -0
- package/dist/schemas/common.js.map +1 -0
- package/dist/schemas/domains/accounting-balances.d.ts +497 -0
- package/dist/schemas/domains/accounting-balances.js +226 -0
- package/dist/schemas/domains/accounting-balances.js.map +1 -0
- package/dist/schemas/domains/accounting-context.d.ts +118 -0
- package/dist/schemas/domains/accounting-context.js +54 -0
- package/dist/schemas/domains/accounting-context.js.map +1 -0
- package/dist/schemas/domains/assets.d.ts +2508 -0
- package/dist/schemas/domains/assets.js +960 -0
- package/dist/schemas/domains/assets.js.map +1 -0
- package/dist/schemas/domains/business-documents.d.ts +4406 -0
- package/dist/schemas/domains/business-documents.js +1153 -0
- package/dist/schemas/domains/business-documents.js.map +1 -0
- package/dist/schemas/domains/configuration.d.ts +518 -0
- package/dist/schemas/domains/configuration.js +504 -0
- package/dist/schemas/domains/configuration.js.map +1 -0
- package/dist/schemas/domains/dashboard.d.ts +339 -0
- package/dist/schemas/domains/dashboard.js +211 -0
- package/dist/schemas/domains/dashboard.js.map +1 -0
- package/dist/schemas/domains/extended-operation-results.d.ts +1588 -0
- package/dist/schemas/domains/extended-operation-results.js +275 -0
- package/dist/schemas/domains/extended-operation-results.js.map +1 -0
- package/dist/schemas/domains/extended-operations.d.ts +1061 -0
- package/dist/schemas/domains/extended-operations.js +567 -0
- package/dist/schemas/domains/extended-operations.js.map +1 -0
- package/dist/schemas/domains/extended-query-results.d.ts +1688 -0
- package/dist/schemas/domains/extended-query-results.js +337 -0
- package/dist/schemas/domains/extended-query-results.js.map +1 -0
- package/dist/schemas/domains/financial-reports.d.ts +540 -0
- package/dist/schemas/domains/financial-reports.js +206 -0
- package/dist/schemas/domains/financial-reports.js.map +1 -0
- package/dist/schemas/domains/fnd-import.d.ts +912 -0
- package/dist/schemas/domains/fnd-import.js +396 -0
- package/dist/schemas/domains/fnd-import.js.map +1 -0
- package/dist/schemas/domains/fund-accounts.d.ts +1092 -0
- package/dist/schemas/domains/fund-accounts.js +410 -0
- package/dist/schemas/domains/fund-accounts.js.map +1 -0
- package/dist/schemas/domains/fund-balances.d.ts +476 -0
- package/dist/schemas/domains/fund-balances.js +233 -0
- package/dist/schemas/domains/fund-balances.js.map +1 -0
- package/dist/schemas/domains/journals.d.ts +1619 -0
- package/dist/schemas/domains/journals.js +615 -0
- package/dist/schemas/domains/journals.js.map +1 -0
- package/dist/schemas/domains/master-data.d.ts +2010 -0
- package/dist/schemas/domains/master-data.js +799 -0
- package/dist/schemas/domains/master-data.js.map +1 -0
- package/dist/schemas/domains/pnl.d.ts +837 -0
- package/dist/schemas/domains/pnl.js +469 -0
- package/dist/schemas/domains/pnl.js.map +1 -0
- package/dist/schemas/domains/reference-data.d.ts +227 -0
- package/dist/schemas/domains/reference-data.js +144 -0
- package/dist/schemas/domains/reference-data.js.map +1 -0
- package/dist/schemas/domains/transaction-drafts.d.ts +903 -0
- package/dist/schemas/domains/transaction-drafts.js +242 -0
- package/dist/schemas/domains/transaction-drafts.js.map +1 -0
- package/dist/schemas/domains/transactions.d.ts +910 -0
- package/dist/schemas/domains/transactions.js +266 -0
- package/dist/schemas/domains/transactions.js.map +1 -0
- package/dist/schemas/primitives.d.ts +6 -0
- package/dist/schemas/primitives.js +11 -0
- package/dist/schemas/primitives.js.map +1 -0
- package/dist/schemas/public-input.d.ts +3 -0
- package/dist/schemas/public-input.js +524 -0
- package/dist/schemas/public-input.js.map +1 -0
- package/dist/tools/core-edit/idempotent-write.d.ts +23 -0
- package/dist/tools/core-edit/idempotent-write.js +58 -0
- package/dist/tools/core-edit/idempotent-write.js.map +1 -0
- package/dist/tools/core-edit/save-asset.d.ts +5 -0
- package/dist/tools/core-edit/save-asset.js +334 -0
- package/dist/tools/core-edit/save-asset.js.map +1 -0
- package/dist/tools/core-edit/save-business-document-draft.d.ts +2 -0
- package/dist/tools/core-edit/save-business-document-draft.js +128 -0
- package/dist/tools/core-edit/save-business-document-draft.js.map +1 -0
- package/dist/tools/core-edit/save-fund-account.d.ts +2 -0
- package/dist/tools/core-edit/save-fund-account.js +138 -0
- package/dist/tools/core-edit/save-fund-account.js.map +1 -0
- package/dist/tools/core-edit/save-journal-draft.d.ts +2 -0
- package/dist/tools/core-edit/save-journal-draft.js +122 -0
- package/dist/tools/core-edit/save-journal-draft.js.map +1 -0
- package/dist/tools/core-edit/save-master-data.d.ts +2 -0
- package/dist/tools/core-edit/save-master-data.js +153 -0
- package/dist/tools/core-edit/save-master-data.js.map +1 -0
- package/dist/tools/core-edit/save-transaction-draft.d.ts +2 -0
- package/dist/tools/core-edit/save-transaction-draft.js +128 -0
- package/dist/tools/core-edit/save-transaction-draft.js.map +1 -0
- package/dist/tools/core-read/export-business-documents.d.ts +2 -0
- package/dist/tools/core-read/export-business-documents.js +67 -0
- package/dist/tools/core-read/export-business-documents.js.map +1 -0
- package/dist/tools/core-read/export-journals.d.ts +2 -0
- package/dist/tools/core-read/export-journals.js +56 -0
- package/dist/tools/core-read/export-journals.js.map +1 -0
- package/dist/tools/core-read/export-transactions.d.ts +2 -0
- package/dist/tools/core-read/export-transactions.js +67 -0
- package/dist/tools/core-read/export-transactions.js.map +1 -0
- package/dist/tools/core-read/query-accounting-balances.d.ts +2 -0
- package/dist/tools/core-read/query-accounting-balances.js +135 -0
- package/dist/tools/core-read/query-accounting-balances.js.map +1 -0
- package/dist/tools/core-read/query-accounting-context.d.ts +2 -0
- package/dist/tools/core-read/query-accounting-context.js +76 -0
- package/dist/tools/core-read/query-accounting-context.js.map +1 -0
- package/dist/tools/core-read/query-assets.d.ts +2 -0
- package/dist/tools/core-read/query-assets.js +425 -0
- package/dist/tools/core-read/query-assets.js.map +1 -0
- package/dist/tools/core-read/query-business-documents.d.ts +9 -0
- package/dist/tools/core-read/query-business-documents.js +620 -0
- package/dist/tools/core-read/query-business-documents.js.map +1 -0
- package/dist/tools/core-read/query-dashboard.d.ts +2 -0
- package/dist/tools/core-read/query-dashboard.js +144 -0
- package/dist/tools/core-read/query-dashboard.js.map +1 -0
- package/dist/tools/core-read/query-financial-reports.d.ts +2 -0
- package/dist/tools/core-read/query-financial-reports.js +171 -0
- package/dist/tools/core-read/query-financial-reports.js.map +1 -0
- package/dist/tools/core-read/query-fund-accounts.d.ts +2 -0
- package/dist/tools/core-read/query-fund-accounts.js +140 -0
- package/dist/tools/core-read/query-fund-accounts.js.map +1 -0
- package/dist/tools/core-read/query-fund-balances.d.ts +2 -0
- package/dist/tools/core-read/query-fund-balances.js +150 -0
- package/dist/tools/core-read/query-fund-balances.js.map +1 -0
- package/dist/tools/core-read/query-journals.d.ts +2 -0
- package/dist/tools/core-read/query-journals.js +277 -0
- package/dist/tools/core-read/query-journals.js.map +1 -0
- package/dist/tools/core-read/query-master-data.d.ts +2 -0
- package/dist/tools/core-read/query-master-data.js +363 -0
- package/dist/tools/core-read/query-master-data.js.map +1 -0
- package/dist/tools/core-read/query-pnl.d.ts +2 -0
- package/dist/tools/core-read/query-pnl.js +244 -0
- package/dist/tools/core-read/query-pnl.js.map +1 -0
- package/dist/tools/core-read/query-reference-data.d.ts +2 -0
- package/dist/tools/core-read/query-reference-data.js +293 -0
- package/dist/tools/core-read/query-reference-data.js.map +1 -0
- package/dist/tools/core-read/query-transactions.d.ts +2 -0
- package/dist/tools/core-read/query-transactions.js +58 -0
- package/dist/tools/core-read/query-transactions.js.map +1 -0
- package/dist/tools/create-tools.d.ts +3 -0
- package/dist/tools/create-tools.js +88 -0
- package/dist/tools/create-tools.js.map +1 -0
- package/dist/tools/extended/asset-operation-tools.d.ts +9 -0
- package/dist/tools/extended/asset-operation-tools.js +419 -0
- package/dist/tools/extended/asset-operation-tools.js.map +1 -0
- package/dist/tools/extended/automation-tools.d.ts +7 -0
- package/dist/tools/extended/automation-tools.js +333 -0
- package/dist/tools/extended/automation-tools.js.map +1 -0
- package/dist/tools/extended/configuration-tools.d.ts +14 -0
- package/dist/tools/extended/configuration-tools.js +871 -0
- package/dist/tools/extended/configuration-tools.js.map +1 -0
- package/dist/tools/extended/period-end-tools.d.ts +11 -0
- package/dist/tools/extended/period-end-tools.js +480 -0
- package/dist/tools/extended/period-end-tools.js.map +1 -0
- package/dist/tools/extended/query-output.d.ts +2589 -0
- package/dist/tools/extended/query-output.js +610 -0
- package/dist/tools/extended/query-output.js.map +1 -0
- package/dist/tools/extended/tool-support.d.ts +56 -0
- package/dist/tools/extended/tool-support.js +198 -0
- package/dist/tools/extended/tool-support.js.map +1 -0
- package/dist/tools/extended/workflow-tools.d.ts +10 -0
- package/dist/tools/extended/workflow-tools.js +678 -0
- package/dist/tools/extended/workflow-tools.js.map +1 -0
- package/dist/tools/fnd-import/execute-import.d.ts +2 -0
- package/dist/tools/fnd-import/execute-import.js +201 -0
- package/dist/tools/fnd-import/execute-import.js.map +1 -0
- package/dist/tools/fnd-import/get-import-template.d.ts +2 -0
- package/dist/tools/fnd-import/get-import-template.js +66 -0
- package/dist/tools/fnd-import/get-import-template.js.map +1 -0
- package/dist/tools/fnd-import/get-job-status.d.ts +8 -0
- package/dist/tools/fnd-import/get-job-status.js +201 -0
- package/dist/tools/fnd-import/get-job-status.js.map +1 -0
- package/dist/tools/fnd-import/prepare-import.d.ts +31 -0
- package/dist/tools/fnd-import/prepare-import.js +214 -0
- package/dist/tools/fnd-import/prepare-import.js.map +1 -0
- package/dist/tools/fnd-import/public-import-result.d.ts +18 -0
- package/dist/tools/fnd-import/public-import-result.js +35 -0
- package/dist/tools/fnd-import/public-import-result.js.map +1 -0
- package/dist/tools/tool-definition.d.ts +45 -0
- package/dist/tools/tool-definition.js +11 -0
- package/dist/tools/tool-definition.js.map +1 -0
- package/dist/tools/tool-handler.d.ts +27 -0
- package/dist/tools/tool-handler.js +196 -0
- package/dist/tools/tool-handler.js.map +1 -0
- package/dist/tools/transaction-item.d.ts +225 -0
- package/dist/tools/transaction-item.js +109 -0
- package/dist/tools/transaction-item.js.map +1 -0
- package/dist/transport/draining-transport.d.ts +14 -0
- package/dist/transport/draining-transport.js +36 -0
- package/dist/transport/draining-transport.js.map +1 -0
- package/dist/transport/stdio.d.ts +2 -0
- package/dist/transport/stdio.js +5 -0
- package/dist/transport/stdio.js.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.js +3 -0
- package/dist/version.js.map +1 -0
- package/package.json +49 -0
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import type { z } from 'zod/v4';
|
|
2
|
+
import { type transactionTypeSchema } from '../schemas/domains/transactions.js';
|
|
3
|
+
type TransactionType = z.infer<typeof transactionTypeSchema>;
|
|
4
|
+
export declare function adaptTransactionItem(type: TransactionType, raw: unknown): {
|
|
5
|
+
type_specific: {
|
|
6
|
+
counterparty_name: string | null;
|
|
7
|
+
counterparty_account: string | null;
|
|
8
|
+
bank_ref: string | null;
|
|
9
|
+
swift_code: string | null;
|
|
10
|
+
remittance_info: string | null;
|
|
11
|
+
transaction_id?: never;
|
|
12
|
+
tx_hash?: never;
|
|
13
|
+
chain?: never;
|
|
14
|
+
from_address?: never;
|
|
15
|
+
to_address?: never;
|
|
16
|
+
block_number?: never;
|
|
17
|
+
confirmations?: never;
|
|
18
|
+
ticker?: never;
|
|
19
|
+
exchange?: never;
|
|
20
|
+
trade_id?: never;
|
|
21
|
+
settlement_date?: never;
|
|
22
|
+
instrument_id?: never;
|
|
23
|
+
product_type?: never;
|
|
24
|
+
side?: never;
|
|
25
|
+
position_side?: never;
|
|
26
|
+
open_close?: never;
|
|
27
|
+
leverage?: never;
|
|
28
|
+
contract_size?: never;
|
|
29
|
+
mark_price?: never;
|
|
30
|
+
funding_rate?: never;
|
|
31
|
+
liquidation_flag?: never;
|
|
32
|
+
};
|
|
33
|
+
id: string;
|
|
34
|
+
line_id: string;
|
|
35
|
+
event_id: string | null;
|
|
36
|
+
event_no: string | null;
|
|
37
|
+
event_time: string | null;
|
|
38
|
+
event_type: string | null;
|
|
39
|
+
business_type: string | null;
|
|
40
|
+
flow_type: string;
|
|
41
|
+
biz_date: string | null;
|
|
42
|
+
main_account_id: string | null;
|
|
43
|
+
main_account: string | null;
|
|
44
|
+
sub_account_id: string | null;
|
|
45
|
+
sub_account: string | null;
|
|
46
|
+
from_party_id: string | null;
|
|
47
|
+
from_party: string | null;
|
|
48
|
+
to_party_id: string | null;
|
|
49
|
+
to_party: string | null;
|
|
50
|
+
symbol: string | null;
|
|
51
|
+
quantity: string;
|
|
52
|
+
base_rate: string | null;
|
|
53
|
+
base_amount: string | null;
|
|
54
|
+
base_currency: string | null;
|
|
55
|
+
matched: boolean;
|
|
56
|
+
highlight: boolean;
|
|
57
|
+
version: number | null;
|
|
58
|
+
transaction_type: "fiat";
|
|
59
|
+
} | {
|
|
60
|
+
type_specific: {
|
|
61
|
+
transaction_id: string | null;
|
|
62
|
+
tx_hash: string | null;
|
|
63
|
+
chain: string | null;
|
|
64
|
+
from_address: string | null;
|
|
65
|
+
to_address: string | null;
|
|
66
|
+
block_number: number | null;
|
|
67
|
+
confirmations: number | null;
|
|
68
|
+
counterparty_name?: never;
|
|
69
|
+
counterparty_account?: never;
|
|
70
|
+
bank_ref?: never;
|
|
71
|
+
swift_code?: never;
|
|
72
|
+
remittance_info?: never;
|
|
73
|
+
ticker?: never;
|
|
74
|
+
exchange?: never;
|
|
75
|
+
trade_id?: never;
|
|
76
|
+
settlement_date?: never;
|
|
77
|
+
instrument_id?: never;
|
|
78
|
+
product_type?: never;
|
|
79
|
+
side?: never;
|
|
80
|
+
position_side?: never;
|
|
81
|
+
open_close?: never;
|
|
82
|
+
leverage?: never;
|
|
83
|
+
contract_size?: never;
|
|
84
|
+
mark_price?: never;
|
|
85
|
+
funding_rate?: never;
|
|
86
|
+
liquidation_flag?: never;
|
|
87
|
+
};
|
|
88
|
+
id: string;
|
|
89
|
+
line_id: string;
|
|
90
|
+
event_id: string | null;
|
|
91
|
+
event_no: string | null;
|
|
92
|
+
event_time: string | null;
|
|
93
|
+
event_type: string | null;
|
|
94
|
+
business_type: string | null;
|
|
95
|
+
flow_type: string;
|
|
96
|
+
biz_date: string | null;
|
|
97
|
+
main_account_id: string | null;
|
|
98
|
+
main_account: string | null;
|
|
99
|
+
sub_account_id: string | null;
|
|
100
|
+
sub_account: string | null;
|
|
101
|
+
from_party_id: string | null;
|
|
102
|
+
from_party: string | null;
|
|
103
|
+
to_party_id: string | null;
|
|
104
|
+
to_party: string | null;
|
|
105
|
+
symbol: string | null;
|
|
106
|
+
quantity: string;
|
|
107
|
+
base_rate: string | null;
|
|
108
|
+
base_amount: string | null;
|
|
109
|
+
base_currency: string | null;
|
|
110
|
+
matched: boolean;
|
|
111
|
+
highlight: boolean;
|
|
112
|
+
version: number | null;
|
|
113
|
+
transaction_type: "crypto";
|
|
114
|
+
} | {
|
|
115
|
+
type_specific: {
|
|
116
|
+
ticker: string | null;
|
|
117
|
+
exchange: string | null;
|
|
118
|
+
trade_id: string | null;
|
|
119
|
+
settlement_date: string | null;
|
|
120
|
+
counterparty_name?: never;
|
|
121
|
+
counterparty_account?: never;
|
|
122
|
+
bank_ref?: never;
|
|
123
|
+
swift_code?: never;
|
|
124
|
+
remittance_info?: never;
|
|
125
|
+
transaction_id?: never;
|
|
126
|
+
tx_hash?: never;
|
|
127
|
+
chain?: never;
|
|
128
|
+
from_address?: never;
|
|
129
|
+
to_address?: never;
|
|
130
|
+
block_number?: never;
|
|
131
|
+
confirmations?: never;
|
|
132
|
+
instrument_id?: never;
|
|
133
|
+
product_type?: never;
|
|
134
|
+
side?: never;
|
|
135
|
+
position_side?: never;
|
|
136
|
+
open_close?: never;
|
|
137
|
+
leverage?: never;
|
|
138
|
+
contract_size?: never;
|
|
139
|
+
mark_price?: never;
|
|
140
|
+
funding_rate?: never;
|
|
141
|
+
liquidation_flag?: never;
|
|
142
|
+
};
|
|
143
|
+
id: string;
|
|
144
|
+
line_id: string;
|
|
145
|
+
event_id: string | null;
|
|
146
|
+
event_no: string | null;
|
|
147
|
+
event_time: string | null;
|
|
148
|
+
event_type: string | null;
|
|
149
|
+
business_type: string | null;
|
|
150
|
+
flow_type: string;
|
|
151
|
+
biz_date: string | null;
|
|
152
|
+
main_account_id: string | null;
|
|
153
|
+
main_account: string | null;
|
|
154
|
+
sub_account_id: string | null;
|
|
155
|
+
sub_account: string | null;
|
|
156
|
+
from_party_id: string | null;
|
|
157
|
+
from_party: string | null;
|
|
158
|
+
to_party_id: string | null;
|
|
159
|
+
to_party: string | null;
|
|
160
|
+
symbol: string | null;
|
|
161
|
+
quantity: string;
|
|
162
|
+
base_rate: string | null;
|
|
163
|
+
base_amount: string | null;
|
|
164
|
+
base_currency: string | null;
|
|
165
|
+
matched: boolean;
|
|
166
|
+
highlight: boolean;
|
|
167
|
+
version: number | null;
|
|
168
|
+
transaction_type: "security";
|
|
169
|
+
} | {
|
|
170
|
+
type_specific: {
|
|
171
|
+
instrument_id: string | null;
|
|
172
|
+
product_type: string | null;
|
|
173
|
+
side: string | null;
|
|
174
|
+
position_side: string | null;
|
|
175
|
+
open_close: string | null;
|
|
176
|
+
leverage: string | null;
|
|
177
|
+
contract_size: string | null;
|
|
178
|
+
mark_price: string | null;
|
|
179
|
+
funding_rate: string | null;
|
|
180
|
+
liquidation_flag: boolean | null;
|
|
181
|
+
counterparty_name?: never;
|
|
182
|
+
counterparty_account?: never;
|
|
183
|
+
bank_ref?: never;
|
|
184
|
+
swift_code?: never;
|
|
185
|
+
remittance_info?: never;
|
|
186
|
+
transaction_id?: never;
|
|
187
|
+
tx_hash?: never;
|
|
188
|
+
chain?: never;
|
|
189
|
+
from_address?: never;
|
|
190
|
+
to_address?: never;
|
|
191
|
+
block_number?: never;
|
|
192
|
+
confirmations?: never;
|
|
193
|
+
ticker?: never;
|
|
194
|
+
exchange?: never;
|
|
195
|
+
trade_id?: never;
|
|
196
|
+
settlement_date?: never;
|
|
197
|
+
};
|
|
198
|
+
id: string;
|
|
199
|
+
line_id: string;
|
|
200
|
+
event_id: string | null;
|
|
201
|
+
event_no: string | null;
|
|
202
|
+
event_time: string | null;
|
|
203
|
+
event_type: string | null;
|
|
204
|
+
business_type: string | null;
|
|
205
|
+
flow_type: string;
|
|
206
|
+
biz_date: string | null;
|
|
207
|
+
main_account_id: string | null;
|
|
208
|
+
main_account: string | null;
|
|
209
|
+
sub_account_id: string | null;
|
|
210
|
+
sub_account: string | null;
|
|
211
|
+
from_party_id: string | null;
|
|
212
|
+
from_party: string | null;
|
|
213
|
+
to_party_id: string | null;
|
|
214
|
+
to_party: string | null;
|
|
215
|
+
symbol: string | null;
|
|
216
|
+
quantity: string;
|
|
217
|
+
base_rate: string | null;
|
|
218
|
+
base_amount: string | null;
|
|
219
|
+
base_currency: string | null;
|
|
220
|
+
matched: boolean;
|
|
221
|
+
highlight: boolean;
|
|
222
|
+
version: number | null;
|
|
223
|
+
transaction_type: "derivative";
|
|
224
|
+
};
|
|
225
|
+
export {};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { transactionUpstreamItemSchema, } from '../schemas/domains/transactions.js';
|
|
2
|
+
function nullableString(item, key) {
|
|
3
|
+
const value = item[key];
|
|
4
|
+
return typeof value === 'string' ? value : null;
|
|
5
|
+
}
|
|
6
|
+
function nullableInteger(item, key) {
|
|
7
|
+
const value = item[key];
|
|
8
|
+
return typeof value === 'number' && Number.isInteger(value) ? value : null;
|
|
9
|
+
}
|
|
10
|
+
function nullableDecimal(item, key) {
|
|
11
|
+
const value = item[key];
|
|
12
|
+
return typeof value === 'string' ? value : null;
|
|
13
|
+
}
|
|
14
|
+
function common(item) {
|
|
15
|
+
const stableId = item.id ?? item.line_id;
|
|
16
|
+
if (stableId === null || stableId === undefined) {
|
|
17
|
+
throw new Error('Validated transaction item has no stable id');
|
|
18
|
+
}
|
|
19
|
+
return {
|
|
20
|
+
id: stableId,
|
|
21
|
+
line_id: item.line_id ?? stableId,
|
|
22
|
+
event_id: item.event_id ?? null,
|
|
23
|
+
event_no: item.event_no ?? null,
|
|
24
|
+
event_time: item.event_time ?? null,
|
|
25
|
+
event_type: item.event_type ?? null,
|
|
26
|
+
business_type: item.business_type ?? null,
|
|
27
|
+
flow_type: item.flow_type,
|
|
28
|
+
biz_date: item.biz_date ?? null,
|
|
29
|
+
main_account_id: item.main_account_id ?? null,
|
|
30
|
+
main_account: item.main_account ?? null,
|
|
31
|
+
sub_account_id: item.sub_account_id ?? null,
|
|
32
|
+
sub_account: item.sub_account ?? null,
|
|
33
|
+
from_party_id: item.from_party_id ?? null,
|
|
34
|
+
from_party: item.from_party ?? null,
|
|
35
|
+
to_party_id: item.to_party_id ?? null,
|
|
36
|
+
to_party: item.to_party ?? null,
|
|
37
|
+
symbol: item.symbol ?? null,
|
|
38
|
+
quantity: item.quantity,
|
|
39
|
+
base_rate: item.base_rate ?? null,
|
|
40
|
+
base_amount: item.base_amount ?? null,
|
|
41
|
+
base_currency: item.base_currency ?? null,
|
|
42
|
+
matched: item.matched,
|
|
43
|
+
highlight: item.highlight,
|
|
44
|
+
version: item.version ?? null,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
export function adaptTransactionItem(type, raw) {
|
|
48
|
+
const item = transactionUpstreamItemSchema.parse(raw);
|
|
49
|
+
const base = common(item);
|
|
50
|
+
if (type === 'fiat') {
|
|
51
|
+
return {
|
|
52
|
+
transaction_type: type,
|
|
53
|
+
...base,
|
|
54
|
+
type_specific: {
|
|
55
|
+
counterparty_name: nullableString(item, 'counterparty_name'),
|
|
56
|
+
counterparty_account: nullableString(item, 'counterparty_account'),
|
|
57
|
+
bank_ref: nullableString(item, 'bank_ref'),
|
|
58
|
+
swift_code: nullableString(item, 'swift_code'),
|
|
59
|
+
remittance_info: nullableString(item, 'remittance_info'),
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
if (type === 'crypto') {
|
|
64
|
+
return {
|
|
65
|
+
transaction_type: type,
|
|
66
|
+
...base,
|
|
67
|
+
type_specific: {
|
|
68
|
+
transaction_id: nullableString(item, 'transaction_id'),
|
|
69
|
+
tx_hash: nullableString(item, 'tx_hash'),
|
|
70
|
+
chain: nullableString(item, 'chain'),
|
|
71
|
+
from_address: nullableString(item, 'from_address'),
|
|
72
|
+
to_address: nullableString(item, 'to_address'),
|
|
73
|
+
block_number: nullableInteger(item, 'block_number'),
|
|
74
|
+
confirmations: nullableInteger(item, 'confirmations'),
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
if (type === 'security') {
|
|
79
|
+
return {
|
|
80
|
+
transaction_type: type,
|
|
81
|
+
...base,
|
|
82
|
+
type_specific: {
|
|
83
|
+
ticker: nullableString(item, 'ticker'),
|
|
84
|
+
exchange: nullableString(item, 'exchange'),
|
|
85
|
+
trade_id: nullableString(item, 'trade_id'),
|
|
86
|
+
settlement_date: nullableString(item, 'settlement_date'),
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
return {
|
|
91
|
+
transaction_type: type,
|
|
92
|
+
...base,
|
|
93
|
+
type_specific: {
|
|
94
|
+
instrument_id: nullableString(item, 'instrument_id'),
|
|
95
|
+
product_type: nullableString(item, 'product_type'),
|
|
96
|
+
side: nullableString(item, 'side'),
|
|
97
|
+
position_side: nullableString(item, 'position_side'),
|
|
98
|
+
open_close: nullableString(item, 'open_close'),
|
|
99
|
+
leverage: nullableDecimal(item, 'leverage'),
|
|
100
|
+
contract_size: nullableDecimal(item, 'contract_size'),
|
|
101
|
+
mark_price: nullableDecimal(item, 'mark_price'),
|
|
102
|
+
funding_rate: nullableDecimal(item, 'funding_rate'),
|
|
103
|
+
liquidation_flag: typeof item.liquidation_flag === 'boolean'
|
|
104
|
+
? item.liquidation_flag
|
|
105
|
+
: null,
|
|
106
|
+
},
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=transaction-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transaction-item.js","sourceRoot":"","sources":["../../src/tools/transaction-item.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,6BAA6B,GAE9B,MAAM,oCAAoC,CAAC;AAK5C,SAAS,cAAc,CAAC,IAAkB,EAAE,GAAW;IACrD,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;IACxB,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;AAClD,CAAC;AAED,SAAS,eAAe,CAAC,IAAkB,EAAE,GAAW;IACtD,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;IACxB,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;AAC7E,CAAC;AAED,SAAS,eAA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B,EACd,OAAO,IAAI,CAAC,gBAAgB,KAAK,SAAS;gBACxC,CAAC,CAAC,IAAI,CAAC,gBAAgB;gBACvB,CAAC,CAAC,IAAI;SACX;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Transport, TransportSendOptions } from '@modelcontextprotocol/sdk/shared/transport.js';
|
|
2
|
+
import type { JSONRPCMessage, MessageExtraInfo } from '@modelcontextprotocol/sdk/types.js';
|
|
3
|
+
export declare class DrainingTransport implements Transport {
|
|
4
|
+
#private;
|
|
5
|
+
onclose?: () => void;
|
|
6
|
+
onerror?: (error: Error) => void;
|
|
7
|
+
onmessage?: <T extends JSONRPCMessage>(message: T, extra?: MessageExtraInfo) => void;
|
|
8
|
+
constructor(inner: Transport);
|
|
9
|
+
start(): Promise<void>;
|
|
10
|
+
send(message: JSONRPCMessage, options?: TransportSendOptions): Promise<void>;
|
|
11
|
+
close(): Promise<void>;
|
|
12
|
+
setProtocolVersion(version: string): void;
|
|
13
|
+
drain(): Promise<void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export class DrainingTransport {
|
|
2
|
+
#inner;
|
|
3
|
+
#pendingSends = new Set();
|
|
4
|
+
onclose;
|
|
5
|
+
onerror;
|
|
6
|
+
onmessage;
|
|
7
|
+
constructor(inner) {
|
|
8
|
+
this.#inner = inner;
|
|
9
|
+
}
|
|
10
|
+
async start() {
|
|
11
|
+
this.#inner.onclose = () => this.onclose?.();
|
|
12
|
+
this.#inner.onerror = (error) => this.onerror?.(error);
|
|
13
|
+
this.#inner.onmessage = (message, extra) => this.onmessage?.(message, extra);
|
|
14
|
+
await this.#inner.start();
|
|
15
|
+
}
|
|
16
|
+
send(message, options) {
|
|
17
|
+
const sending = this.#inner.send(message, options);
|
|
18
|
+
this.#pendingSends.add(sending);
|
|
19
|
+
void sending.then(() => this.#pendingSends.delete(sending), () => this.#pendingSends.delete(sending));
|
|
20
|
+
return sending;
|
|
21
|
+
}
|
|
22
|
+
close() {
|
|
23
|
+
return this.#inner.close();
|
|
24
|
+
}
|
|
25
|
+
setProtocolVersion(version) {
|
|
26
|
+
this.#inner.setProtocolVersion?.(version);
|
|
27
|
+
}
|
|
28
|
+
async drain() {
|
|
29
|
+
// Tool handlers settle before the SDK dispatches their JSON-RPC responses.
|
|
30
|
+
await new Promise((resolve) => setImmediate(resolve));
|
|
31
|
+
while (this.#pendingSends.size > 0) {
|
|
32
|
+
await Promise.allSettled([...this.#pendingSends]);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=draining-transport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"draining-transport.js","sourceRoot":"","sources":["../../src/transport/draining-transport.ts"],"names":[],"mappings":"AASA,MAAM,OAAO,iBAAiB;IACnB,MAAM,CAAY;IAClB,aAAa,GAAG,IAAI,GAAG,EAAiB,CAAC;IAElD,OAAO,CAAc;IACrB,OAAO,CAA0B;IACjC,SAAS,CAGC;IAEV,YAAY,KAAgB;QAC1B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IAED,KAAK,CAAC,KAAK;QACT,IAAI,CAAC,MAAM,CAAC,OAAO,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC;QAC7C,IAAI,CAAC,MAAM,CAAC,OAAO,GAAG,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC;QACvD,IAAI,CAAC,MAAM,CAAC,SAAS,GAAG,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,CACzC,IAAI,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QACnC,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IAC5B,CAAC;IAED,IAAI,CAAC,OAAuB,EAAE,OAA8B;QAC1D,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACnD,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAChC,KAAK,OAAO,CAAC,IAAI,CACf,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC,EACxC,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC,CACzC,CAAC;QACF,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,KAAK;QACH,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IAC7B,CAAC;IAED,kBAAkB,CAAC,OAAe;QAChC,IAAI,CAAC,MAAM,CAAC,kBAAkB,EAAE,CAAC,OAAO,CAAC,CAAC;IAC5C,CAAC;IAED,KAAK,CAAC,KAAK;QACT,2EAA2E;QAC3E,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC;QAC5D,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;YACnC,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;QACpD,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stdio.js","sourceRoot":"","sources":["../../src/transport/stdio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAEjF,MAAM,UAAU,oBAAoB;IAClC,OAAO,IAAI,oBAAoB,EAAE,CAAC;AACpC,CAAC"}
|
package/dist/version.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG,YAAY,CAAC;AACxC,MAAM,CAAC,MAAM,cAAc,GAAG,OAAO,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@taxdao/fintax-mcp",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "FinTax MCP stdio server",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"bin": {
|
|
8
|
+
"fintax-mcp": "dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"README.md"
|
|
13
|
+
],
|
|
14
|
+
"engines": {
|
|
15
|
+
"node": ">=24 <27"
|
|
16
|
+
},
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"@modelcontextprotocol/sdk": "1.30.0",
|
|
19
|
+
"fetch-cookie": "^3.2.0",
|
|
20
|
+
"lossless-json": "^4.3.1",
|
|
21
|
+
"pino": "^10.3.1",
|
|
22
|
+
"tough-cookie": "^6.0.2",
|
|
23
|
+
"zod": "4.4.3"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@eslint/js": "9.39.5",
|
|
27
|
+
"@types/node": "24.13.3",
|
|
28
|
+
"eslint": "9.39.5",
|
|
29
|
+
"prettier": "3.9.6",
|
|
30
|
+
"tsx": "4.23.12",
|
|
31
|
+
"typescript": "5.9.3",
|
|
32
|
+
"typescript-eslint": "8.67.0",
|
|
33
|
+
"vitest": "4.1.10"
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"build": "tsx scripts/build.ts",
|
|
37
|
+
"check": "pnpm typecheck && pnpm lint && pnpm test && pnpm build",
|
|
38
|
+
"dev": "tsx src/index.ts",
|
|
39
|
+
"format": "prettier --write .",
|
|
40
|
+
"format:check": "prettier --check .",
|
|
41
|
+
"lint": "eslint .",
|
|
42
|
+
"pack:prebuilt": "pnpm build && pnpm pack --pack-destination var/releases",
|
|
43
|
+
"start": "node dist/index.js",
|
|
44
|
+
"test": "vitest run",
|
|
45
|
+
"test:integration": "vitest run --config vitest.integration.config.ts",
|
|
46
|
+
"test:watch": "vitest",
|
|
47
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
48
|
+
}
|
|
49
|
+
}
|