Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "anythingmcp",
"version": "0.55.22",
"version": "0.55.23",
"description": "Turn any REST/OpenAPI, SOAP/WSDL, GraphQL, OData or SQL API into MCP tools for Claude, ChatGPT and Copilot, no code. 977 pre-built adapters for ERP, e-commerce and more (SAP S/4HANA, SAP Business One, Odoo, Xentral, JTL-Wawi, Shopware, WooCommerce, Amazon Seller). Self-hosted, open source (AGPL-3.0).",
"private": true,
"license": "AGPL-3.0-only",
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@anythingmcp/backend",
"version": "0.55.22",
"version": "0.55.23",
"description": "AnythingMCP — NestJS Backend + Dynamic MCP Server",
"private": true,
"license": "AGPL-3.0-only",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,26 @@ describe('followDownload', () => {
).rejects.toThrow(/Columns not in this file: nope/);
});

it('filters a tab-separated report that quotes every field', async () => {
// The FBA inventory ledger wraps each field in double quotes.
const quoted =
'"Date"\t"FNSKU"\t"Title"\t"Quantity"\n' +
'"12/01/2026"\t"X001"\t"Mug ""XL"""\t"4"\n' +
'"12/01/2026"\t"X002"\t"Cup"\t"2"\n';
const out = await followDownload(
{ url: LINK },
config,
{ filterColumn: 'FNSKU', filterValue: 'X001' },
fakeFetch(Buffer.from(quoted)) as any,
);
expect(out).toMatchObject({
format: 'tsv',
columns: ['Date', 'FNSKU', 'Title', 'Quantity'],
matchedRows: 1,
rows: [{ Date: '12/01/2026', FNSKU: 'X001', Title: 'Mug "XL"', Quantity: '4' }],
});
});

it('caps the page size', async () => {
const out = await followDownload({ url: LINK }, config, { limit: 100000 }, fakeFetch(Buffer.from(TSV)) as any);
expect(out.returned).toBe(3);
Expand Down Expand Up @@ -126,6 +146,11 @@ describe('download helpers', () => {
]);
});

it('strips the quotes around tab-separated fields only when a field is wrapped', () => {
expect(parseDelimited('"a"\tb\t"say ""hi"""\t"\t""\n', '\t')).toEqual([['a', 'b', 'say "hi"', '"', '']]);
expect(parseDelimited('12" pipe\tx\n', '\t')).toEqual([['12" pipe', 'x']]);
});

it('validates the stored block', () => {
expect(validateDownloadConfig(config)).toBeNull();
expect(validateDownloadConfig({ urlField: 'url' })).toMatch(/allowedHosts/);
Expand Down
18 changes: 15 additions & 3 deletions packages/backend/src/connectors/engines/download-follow.util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,27 @@ export function decodeText(buf: Buffer, contentType: string | undefined): string
}

/**
* Split delimited text into records. Tabs: Amazon flat files, no quoting.
* Commas: RFC 4180 quoting ("" inside quotes, line breaks in quoted fields).
* A tab-separated field wrapped in double quotes loses them, and "" inside
* becomes ". Some Amazon reports (FBA inventory ledger) quote every field.
*/
function unquoteTabField(field: string): string {
if (field.length >= 2 && field.startsWith('"') && field.endsWith('"')) {
return field.slice(1, -1).replace(/""/g, '"');
}
return field;
}

/**
* Split delimited text into records. Tabs: Amazon flat files, one record per
* line; a field may be wrapped in double quotes. Commas: RFC 4180 quoting
* ("" inside quotes, line breaks in quoted fields).
*/
export function parseDelimited(text: string, delimiter: '\t' | ','): string[][] {
const out: string[][] = [];
if (delimiter === '\t') {
for (const line of text.split(/\r?\n/)) {
if (line.length === 0) continue;
out.push(line.split('\t'));
out.push(line.split('\t').map(unquoteTabField));
}
return out;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@anythingmcp/frontend",
"version": "0.55.22",
"version": "0.55.23",
"description": "AnythingMCP — Next.js Admin UI",
"private": true,
"license": "AGPL-3.0-only",
Expand Down
2 changes: 1 addition & 1 deletion server.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/HelpCode-ai/anythingmcp",
"source": "github"
},
"version": "0.55.22",
"version": "0.55.23",
"websiteUrl": "https://anythingmcp.com",
"icons": [
{
Expand Down
Loading