@solumflow-app/crm-mcp-server 0.7.0 → 0.8.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/index.js CHANGED
@@ -6,7 +6,7 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
6
6
  import { createClient } from "@solumflow-app/crm-client";
7
7
 
8
8
  // package.json
9
- var version = "0.7.0";
9
+ var version = "0.8.0";
10
10
 
11
11
  // src/catalog-migration-tools.ts
12
12
  import { z as z4 } from "zod";
@@ -509,6 +509,13 @@ function more(nextCursor) {
509
509
  function money(cents2, currency2) {
510
510
  return `${(cents2 / 100).toFixed(2)} ${currency2.toUpperCase()}`;
511
511
  }
512
+ function fieldsNotOnPageNote(slugs) {
513
+ if (!slugs?.length) {
514
+ return "";
515
+ }
516
+ const count = slugs.length === 1 ? "1 public field has" : `${slugs.length} public fields have`;
517
+ return ` ${count} a value but ${slugs.length === 1 ? "is" : "are"} not on this product's page: ${slugs.join(", ")}; send them in publicFields to show them.`;
518
+ }
512
519
 
513
520
  // src/catalog-tools.ts
514
521
  var objectInput = {
@@ -865,7 +872,7 @@ function registerCatalogMigrationTools(server, client) {
865
872
  (file) => file.status === "pending"
866
873
  );
867
874
  return answer(
868
- `${product.name} (${product.slug || "no address"}), ${product.status} (${product.availability}); ${Object.keys(product.fields).length} fields, ${product.categories.length} categories, ${product.images.length} pictures; files: ${pending.length} pending, ${refused.length} refused${refused.length ? ` (${refused.map((file) => `${file.ref}: ${file.reason}`).join("; ")})` : ""}.`,
875
+ `${product.name} (${product.slug || "no address"}), ${product.status} (${product.availability}); ${Object.keys(product.fields).length} fields, ${product.categories.length} categories, ${product.images.length} pictures; files: ${pending.length} pending, ${refused.length} refused${refused.length ? ` (${refused.map((file) => `${file.ref}: ${file.reason}`).join("; ")})` : ""}.` + fieldsNotOnPageNote(product.fieldsNotOnPage),
869
876
  product
870
877
  );
871
878
  } catch (error) {
@@ -899,12 +906,15 @@ function registerCatalogMigrationTools(server, client) {
899
906
  target(object2)
900
907
  );
901
908
  const count = (kind) => outcomes.filter((outcome) => outcome.outcome === kind).length;
909
+ const offPage = new Set(
910
+ outcomes.flatMap((outcome) => outcome.product?.fieldsNotOnPage ?? [])
911
+ );
902
912
  const refusals = outcomes.filter((outcome) => outcome.outcome === "refused").map(
903
913
  (outcome) => `- ${outcome.externalRef}: ${outcome.error?.message ?? "refused"}` + (outcome.error?.fields.length ? ` (${outcome.error.fields.map((field) => `${field.path}: ${field.message}`).join("; ")})` : "")
904
914
  );
905
915
  return answer(
906
916
  [
907
- `${count("created")} made, ${count("changed")} changed, ${count("refused")} refused, ${count("skipped")} skipped.`,
917
+ `${count("created")} made, ${count("changed")} changed, ${count("refused")} refused, ${count("skipped")} skipped.` + (offPage.size ? ` Some products hold public fields that are not on their page (${[...offPage].join(", ")}); send them in publicFields to show them.` : ""),
908
918
  ...refusals
909
919
  ].join("\n"),
910
920
  outcomes
@@ -1074,7 +1084,7 @@ function registerCatalogWriteTools(server, client) {
1074
1084
  );
1075
1085
  const verb = product.created ? "Made" : "Changed";
1076
1086
  return answer(
1077
- `${verb} ${product.name} (${product.slug ?? "no address"}), ${product.availability}; ${product.variants.length} variants; pictures ${product.images}.`,
1087
+ `${verb} ${product.name} (${product.slug ?? "no address"}), ${product.availability}; ${product.variants.length} variants; pictures ${product.images}.` + fieldsNotOnPageNote(product.fieldsNotOnPage),
1078
1088
  product
1079
1089
  );
1080
1090
  } catch (error) {