@yoryoboy/bi-mcp 1.2.0 → 1.3.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.
Files changed (61) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/index.js +302 -2
  3. package/dist/index.js.map +2 -2
  4. package/dist/mcp-use.json +2 -2
  5. package/dist/src/services/vtex/vtex-catalog-write.js +233 -0
  6. package/dist/src/services/vtex/vtex-catalog-write.js.map +7 -0
  7. package/dist/src/services/vtex/vtex-orders-write.js +152 -0
  8. package/dist/src/services/vtex/vtex-orders-write.js.map +7 -0
  9. package/dist/src/services/vtex/vtex-pricing-write.js +24 -0
  10. package/dist/src/services/vtex/vtex-pricing-write.js.map +7 -0
  11. package/dist/src/services/vtex/vtex-write.js +38 -0
  12. package/dist/src/services/vtex/vtex-write.js.map +7 -0
  13. package/dist/src/tools/vtex/activate-sku.js +53 -0
  14. package/dist/src/tools/vtex/activate-sku.js.map +7 -0
  15. package/dist/src/tools/vtex/add-order-tracking.js +103 -0
  16. package/dist/src/tools/vtex/add-order-tracking.js.map +7 -0
  17. package/dist/src/tools/vtex/associate-specification.js +60 -0
  18. package/dist/src/tools/vtex/associate-specification.js.map +7 -0
  19. package/dist/src/tools/vtex/attach-catalog-image.js +63 -0
  20. package/dist/src/tools/vtex/attach-catalog-image.js.map +7 -0
  21. package/dist/src/tools/vtex/cancel-order.js +67 -0
  22. package/dist/src/tools/vtex/cancel-order.js.map +7 -0
  23. package/dist/src/tools/vtex/create-brand.js +69 -0
  24. package/dist/src/tools/vtex/create-brand.js.map +7 -0
  25. package/dist/src/tools/vtex/create-category.js +81 -0
  26. package/dist/src/tools/vtex/create-category.js.map +7 -0
  27. package/dist/src/tools/vtex/create-product-with-sku.js +120 -0
  28. package/dist/src/tools/vtex/create-product-with-sku.js.map +7 -0
  29. package/dist/src/tools/vtex/create-product.js +111 -0
  30. package/dist/src/tools/vtex/create-product.js.map +7 -0
  31. package/dist/src/tools/vtex/create-sku.js +103 -0
  32. package/dist/src/tools/vtex/create-sku.js.map +7 -0
  33. package/dist/src/tools/vtex/create-specification-value.js +53 -0
  34. package/dist/src/tools/vtex/create-specification-value.js.map +7 -0
  35. package/dist/src/tools/vtex/create-specification.js +85 -0
  36. package/dist/src/tools/vtex/create-specification.js.map +7 -0
  37. package/dist/src/tools/vtex/deactivate-sku.js +53 -0
  38. package/dist/src/tools/vtex/deactivate-sku.js.map +7 -0
  39. package/dist/src/tools/vtex/delete-fixed-price.js +53 -0
  40. package/dist/src/tools/vtex/delete-fixed-price.js.map +7 -0
  41. package/dist/src/tools/vtex/index.js +20 -0
  42. package/dist/src/tools/vtex/index.js.map +2 -2
  43. package/dist/src/tools/vtex/invoice-order.js +84 -0
  44. package/dist/src/tools/vtex/invoice-order.js.map +7 -0
  45. package/dist/src/tools/vtex/toggle-unlimited-quantity.js +65 -0
  46. package/dist/src/tools/vtex/toggle-unlimited-quantity.js.map +7 -0
  47. package/dist/src/tools/vtex/update-inventory.js +34 -19
  48. package/dist/src/tools/vtex/update-inventory.js.map +2 -2
  49. package/dist/src/tools/vtex/update-lead-time.js +34 -17
  50. package/dist/src/tools/vtex/update-lead-time.js.map +2 -2
  51. package/dist/src/tools/vtex/update-product-basic-fields.js +71 -0
  52. package/dist/src/tools/vtex/update-product-basic-fields.js.map +7 -0
  53. package/dist/src/tools/vtex/update-sku-basic-fields.js +92 -0
  54. package/dist/src/tools/vtex/update-sku-basic-fields.js.map +7 -0
  55. package/dist/src/tools/vtex/update-sku-price.js +81 -0
  56. package/dist/src/tools/vtex/update-sku-price.js.map +7 -0
  57. package/dist/src/tools/vtex/upsert-fixed-price.js +69 -0
  58. package/dist/src/tools/vtex/upsert-fixed-price.js.map +7 -0
  59. package/dist/src/tools/vtex/write-helpers.js +73 -0
  60. package/dist/src/tools/vtex/write-helpers.js.map +7 -0
  61. package/package.json +1 -1
@@ -0,0 +1,84 @@
1
+ import { z } from "zod";
2
+ import {
3
+ getOrderStateSnapshot,
4
+ invoiceOrder,
5
+ validateOrderForInvoice
6
+ } from "../../services/vtex/vtex-orders-write.js";
7
+ import {
8
+ buildWriteSuccessResponse,
9
+ confirmationNoteSchemaField,
10
+ confirmationSchemaField,
11
+ handleVtexWriteError,
12
+ requireExplicitConfirmation,
13
+ resolveVtexWriteProfile,
14
+ vtexProfileIdSchemaField
15
+ } from "./write-helpers.js";
16
+ const invoiceItemSchema = z.object({
17
+ id: z.string().min(1).describe("SKU ID being invoiced."),
18
+ price: z.number().int().positive().describe("Unit price in cents, without decimal separator."),
19
+ quantity: z.number().int().positive().describe("Quantity being invoiced."),
20
+ description: z.string().optional().describe("Optional extra description for this line.")
21
+ });
22
+ const invoiceOrderSchema = z.object({
23
+ profileId: vtexProfileIdSchemaField,
24
+ orderId: z.string().min(1).describe("VTEX order identifier to invoice."),
25
+ confirmed: confirmationSchemaField,
26
+ confirmationNote: confirmationNoteSchemaField,
27
+ type: z.enum(["Output", "Input"]).describe("Invoice type."),
28
+ issuanceDate: z.string().min(1).describe("Invoice issuance timestamp."),
29
+ invoiceNumber: z.string().min(1).describe("Invoice number."),
30
+ invoiceValue: z.string().min(1).describe("Invoice total in cents, represented as a string without decimal separator."),
31
+ items: z.array(invoiceItemSchema).min(1).describe("Items being invoiced."),
32
+ invoiceKey: z.string().optional().describe("Optional invoice key."),
33
+ invoiceUrl: z.string().url().optional().describe("Optional invoice URL."),
34
+ invoiceOrderNumber: z.string().optional().describe("Optional order number from merchant ERP."),
35
+ courier: z.string().optional().describe("Optional carrier name."),
36
+ trackingNumber: z.string().optional().describe("Optional tracking number."),
37
+ trackingUrl: z.string().url().optional().describe("Optional tracking URL.")
38
+ });
39
+ async function invoiceOrderHandler({
40
+ profileId,
41
+ orderId,
42
+ confirmed,
43
+ confirmationNote,
44
+ ...payload
45
+ }) {
46
+ const confirmationResponse = requireExplicitConfirmation(confirmed, "invoice_order", {
47
+ order_id: orderId
48
+ });
49
+ if (confirmationResponse) {
50
+ return confirmationResponse;
51
+ }
52
+ try {
53
+ const profileResolution = await resolveVtexWriteProfile(profileId);
54
+ if (!profileResolution.ok) {
55
+ return profileResolution.response;
56
+ }
57
+ const resolvedProfileId = profileResolution.value.profileId;
58
+ const beforeOrder = await validateOrderForInvoice(resolvedProfileId, orderId);
59
+ await invoiceOrder(resolvedProfileId, orderId, payload);
60
+ const afterOrder = await getOrderStateSnapshot(resolvedProfileId, orderId);
61
+ return buildWriteSuccessResponse({
62
+ profileId: resolvedProfileId,
63
+ operation: "invoice_order",
64
+ resourceId: orderId,
65
+ riskLevel: "high",
66
+ confirmed: true,
67
+ confirmationNote,
68
+ message: "Order invoiced successfully.",
69
+ before: beforeOrder,
70
+ after: afterOrder,
71
+ details: {
72
+ order_id: orderId,
73
+ invoice_number: payload.invoiceNumber
74
+ }
75
+ });
76
+ } catch (err) {
77
+ return handleVtexWriteError(err, `Failed to invoice order ${orderId}`);
78
+ }
79
+ }
80
+ export {
81
+ invoiceOrderHandler,
82
+ invoiceOrderSchema
83
+ };
84
+ //# sourceMappingURL=invoice-order.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/tools/vtex/invoice-order.ts"],
4
+ "sourcesContent": ["import { z } from \"zod\";\n\nimport {\n getOrderStateSnapshot,\n invoiceOrder,\n validateOrderForInvoice,\n} from \"../../services/vtex/vtex-orders-write.js\";\nimport {\n buildWriteSuccessResponse,\n confirmationNoteSchemaField,\n confirmationSchemaField,\n handleVtexWriteError,\n requireExplicitConfirmation,\n resolveVtexWriteProfile,\n vtexProfileIdSchemaField,\n} from \"./write-helpers.js\";\n\nconst invoiceItemSchema = z.object({\n id: z.string().min(1).describe(\"SKU ID being invoiced.\"),\n price: z\n .number()\n .int()\n .positive()\n .describe(\"Unit price in cents, without decimal separator.\"),\n quantity: z.number().int().positive().describe(\"Quantity being invoiced.\"),\n description: z.string().optional().describe(\"Optional extra description for this line.\"),\n});\n\nexport const invoiceOrderSchema = z.object({\n profileId: vtexProfileIdSchemaField,\n orderId: z.string().min(1).describe(\"VTEX order identifier to invoice.\"),\n confirmed: confirmationSchemaField,\n confirmationNote: confirmationNoteSchemaField,\n type: z.enum([\"Output\", \"Input\"]).describe(\"Invoice type.\"),\n issuanceDate: z.string().min(1).describe(\"Invoice issuance timestamp.\"),\n invoiceNumber: z.string().min(1).describe(\"Invoice number.\"),\n invoiceValue: z\n .string()\n .min(1)\n .describe(\"Invoice total in cents, represented as a string without decimal separator.\"),\n items: z.array(invoiceItemSchema).min(1).describe(\"Items being invoiced.\"),\n invoiceKey: z.string().optional().describe(\"Optional invoice key.\"),\n invoiceUrl: z.string().url().optional().describe(\"Optional invoice URL.\"),\n invoiceOrderNumber: z.string().optional().describe(\"Optional order number from merchant ERP.\"),\n courier: z.string().optional().describe(\"Optional carrier name.\"),\n trackingNumber: z.string().optional().describe(\"Optional tracking number.\"),\n trackingUrl: z.string().url().optional().describe(\"Optional tracking URL.\"),\n});\n\nexport async function invoiceOrderHandler({\n profileId,\n orderId,\n confirmed,\n confirmationNote,\n ...payload\n}: z.infer<typeof invoiceOrderSchema>) {\n const confirmationResponse = requireExplicitConfirmation(confirmed, \"invoice_order\", {\n order_id: orderId,\n });\n if (confirmationResponse) {\n return confirmationResponse;\n }\n\n try {\n const profileResolution = await resolveVtexWriteProfile(profileId);\n if (!profileResolution.ok) {\n return profileResolution.response;\n }\n\n const resolvedProfileId = profileResolution.value.profileId;\n const beforeOrder = await validateOrderForInvoice(resolvedProfileId, orderId);\n await invoiceOrder(resolvedProfileId, orderId, payload);\n const afterOrder = await getOrderStateSnapshot(resolvedProfileId, orderId);\n\n return buildWriteSuccessResponse({\n profileId: resolvedProfileId,\n operation: \"invoice_order\",\n resourceId: orderId,\n riskLevel: \"high\",\n confirmed: true,\n confirmationNote,\n message: \"Order invoiced successfully.\",\n before: beforeOrder as unknown as Record<string, unknown>,\n after: afterOrder as unknown as Record<string, unknown>,\n details: {\n order_id: orderId,\n invoice_number: payload.invoiceNumber,\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vtex-logistics.js";
6
+ import {
7
+ buildWriteSuccessResponse,
8
+ handleVtexWriteError,
9
+ resolveVtexWriteProfile,
10
+ vtexProfileIdSchemaField
11
+ } from "./write-helpers.js";
12
+ const toggleUnlimitedQuantitySchema = z.object({
13
+ profileId: vtexProfileIdSchemaField,
14
+ skuId: z.string().min(1).describe("SKU identifier."),
15
+ warehouseId: z.string().min(1).describe("Warehouse identifier."),
16
+ unlimitedQuantity: z.boolean().describe("New unlimited availability mode for this SKU in the selected warehouse.")
17
+ });
18
+ async function toggleUnlimitedQuantityHandler({
19
+ profileId,
20
+ skuId,
21
+ warehouseId,
22
+ unlimitedQuantity
23
+ }) {
24
+ try {
25
+ const profileResolution = await resolveVtexWriteProfile(profileId);
26
+ if (!profileResolution.ok) {
27
+ return profileResolution.response;
28
+ }
29
+ const resolvedProfileId = profileResolution.value.profileId;
30
+ const beforeInventory = await getInventoryByWarehouse(resolvedProfileId, skuId, warehouseId);
31
+ const currentInventory = beforeInventory[0];
32
+ if (!currentInventory) {
33
+ throw new Error(`Inventory record not found for SKU ${skuId} in warehouse ${warehouseId}`);
34
+ }
35
+ await updateInventoryQuantity(resolvedProfileId, skuId, warehouseId, {
36
+ quantity: Number(currentInventory.totalQuantity ?? 0),
37
+ unlimitedQuantity
38
+ });
39
+ const afterInventory = await getInventoryByWarehouse(resolvedProfileId, skuId, warehouseId);
40
+ return buildWriteSuccessResponse({
41
+ profileId: resolvedProfileId,
42
+ operation: "toggle_unlimited_quantity",
43
+ resourceId: skuId,
44
+ riskLevel: "low",
45
+ message: "Unlimited quantity mode updated successfully.",
46
+ before: currentInventory,
47
+ after: afterInventory[0] ?? null,
48
+ details: {
49
+ sku_id: skuId,
50
+ warehouse_id: warehouseId,
51
+ unlimited_quantity: unlimitedQuantity
52
+ }
53
+ });
54
+ } catch (err) {
55
+ return handleVtexWriteError(
56
+ err,
57
+ `Failed to update unlimited quantity mode for SKU ${skuId} in ${warehouseId}`
58
+ );
59
+ }
60
+ }
61
+ export {
62
+ toggleUnlimitedQuantityHandler,
63
+ toggleUnlimitedQuantitySchema
64
+ };
65
+ //# sourceMappingURL=toggle-unlimited-quantity.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/tools/vtex/toggle-unlimited-quantity.ts"],
4
+ "sourcesContent": ["import { z } from \"zod\";\n\nimport {\n getInventoryByWarehouse,\n updateInventoryQuantity,\n} from \"../../services/vtex/vtex-logistics.js\";\nimport {\n buildWriteSuccessResponse,\n handleVtexWriteError,\n resolveVtexWriteProfile,\n vtexProfileIdSchemaField,\n} from \"./write-helpers.js\";\n\nexport const toggleUnlimitedQuantitySchema = z.object({\n profileId: vtexProfileIdSchemaField,\n skuId: z.string().min(1).describe(\"SKU identifier.\"),\n warehouseId: z.string().min(1).describe(\"Warehouse identifier.\"),\n unlimitedQuantity: z\n .boolean()\n .describe(\"New unlimited availability mode for this SKU in the selected warehouse.\"),\n});\n\nexport async function toggleUnlimitedQuantityHandler({\n profileId,\n skuId,\n warehouseId,\n unlimitedQuantity,\n}: z.infer<typeof toggleUnlimitedQuantitySchema>) {\n try {\n const profileResolution = await resolveVtexWriteProfile(profileId);\n if (!profileResolution.ok) {\n return profileResolution.response;\n }\n\n const resolvedProfileId = profileResolution.value.profileId;\n const beforeInventory = await getInventoryByWarehouse(resolvedProfileId, skuId, warehouseId);\n const currentInventory = beforeInventory[0];\n\n if (!currentInventory) {\n throw new Error(`Inventory record not found for SKU ${skuId} in warehouse ${warehouseId}`);\n }\n\n await updateInventoryQuantity(resolvedProfileId, skuId, warehouseId, {\n quantity: Number(currentInventory.totalQuantity ?? 0),\n unlimitedQuantity,\n });\n\n const afterInventory = await getInventoryByWarehouse(resolvedProfileId, skuId, warehouseId);\n\n return buildWriteSuccessResponse({\n profileId: resolvedProfileId,\n operation: \"toggle_unlimited_quantity\",\n resourceId: skuId,\n riskLevel: \"low\",\n message: \"Unlimited quantity mode updated successfully.\",\n before: currentInventory as Record<string, unknown>,\n after: (afterInventory[0] as Record<string, unknown> | undefined) ?? null,\n details: {\n sku_id: skuId,\n warehouse_id: warehouseId,\n unlimited_quantity: unlimitedQuantity,\n },\n });\n } catch (err) {\n return handleVtexWriteError(\n err,\n `Failed to update unlimited quantity mode for SKU ${skuId} in ${warehouseId}`\n );\n }\n}\n"],
5
+ "mappings": "AAAA,SAAS,SAAS;AAElB;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEA,MAAM,gCAAgC,EAAE,OAAO;AAAA,EACpD,WAAW;AAAA,EACX,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS,iBAAiB;AAAA,EACnD,aAAa,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS,uBAAuB;AAAA,EAC/D,mBAAmB,EAChB,QAAQ,EACR,SAAS,yEAAyE;AACvF,CAAC;AAED,eAAsB,+BAA+B;AAAA,EACnD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAkD;AAChD,MAAI;AACF,UAAM,oBAAoB,MAAM,wBAAwB,SAAS;AACjE,QAAI,CAAC,kBAAkB,IAAI;AACzB,aAAO,kBAAkB;AAAA,IAC3B;AAEA,UAAM,oBAAoB,kBAAkB,MAAM;AAClD,UAAM,kBAAkB,MAAM,wBAAwB,mBAAmB,OAAO,WAAW;AAC3F,UAAM,mBAAmB,gBAAgB,CAAC;AAE1C,QAAI,CAAC,kBAAkB;AACrB,YAAM,IAAI,MAAM,sCAAsC,KAAK,iBAAiB,WAAW,EAAE;AAAA,IAC3F;AAEA,UAAM,wBAAwB,mBAAmB,OAAO,aAAa;AAAA,MACnE,UAAU,OAAO,iBAAiB,iBAAiB,CAAC;AAAA,MACpD;AAAA,IACF,CAAC;AAED,UAAM,iBAAiB,MAAM,wBAAwB,mBAAmB,OAAO,WAAW;AAE1F,WAAO,0BAA0B;AAAA,MAC/B,WAAW;AAAA,MACX,WAAW;AAAA,MACX,YAAY;AAAA,MACZ,WAAW;AAAA,MACX,SAAS;AAAA,MACT,QAAQ;AAAA,MACR,OAAQ,eAAe,CAAC,KAA6C;AAAA,MACrE,SAAS;AAAA,QACP,QAAQ;AAAA,QACR,cAAc;AAAA,QACd,oBAAoB;AAAA,MACtB;AAAA,IACF,CAAC;AAAA,EACH,SAAS,KAAK;AACZ,WAAO;AAAA,MACL;AAAA,MACA,oDAAoD,KAAK,OAAO,WAAW;AAAA,IAC7E;AAAA,EACF;AACF;",
6
+ "names": []
7
+ }
@@ -1,16 +1,22 @@
1
- import { error, object } from "mcp-use/server";
2
1
  import { z } from "zod";
3
- import { formatVtexError } from "../../services/vtex/vtex-api.js";
4
- import { updateInventoryQuantity } from "../../services/vtex/vtex-logistics.js";
5
- import { resolveVtexProfileOrSelection } from "./profile-resolution.js";
2
+ import {
3
+ getInventoryByWarehouse,
4
+ updateInventoryQuantity
5
+ } from "../../services/vtex/vtex-logistics.js";
6
+ import {
7
+ buildWriteSuccessResponse,
8
+ handleVtexWriteError,
9
+ resolveVtexWriteProfile,
10
+ vtexProfileIdSchemaField
11
+ } from "./write-helpers.js";
6
12
  const updateInventorySchema = z.object({
7
- profileId: z.string().trim().min(1).optional().describe(
8
- "Explicit VTEX profile id to use. If omitted, the tool returns a guided selection payload with available active profiles."
9
- ),
13
+ profileId: vtexProfileIdSchemaField,
10
14
  skuId: z.string().min(1).describe("SKU identifier"),
11
15
  warehouseId: z.string().min(1).describe("Warehouse identifier"),
12
16
  quantity: z.number().int().min(0).describe("Inventory quantity to set"),
13
- unlimitedQuantity: z.boolean().describe("When true, SKU remains available regardless of stock quantity"),
17
+ unlimitedQuantity: z.boolean().describe(
18
+ "When true, VTEX keeps the SKU available regardless of stock. This overwrites the current unlimited mode for the SKU in the selected warehouse."
19
+ ),
14
20
  dateUtcOnBalanceSystem: z.string().optional().describe("Optional UTC timestamp for inventory update synchronization")
15
21
  });
16
22
  async function updateInventoryHandler({
@@ -22,28 +28,37 @@ async function updateInventoryHandler({
22
28
  dateUtcOnBalanceSystem
23
29
  }) {
24
30
  try {
25
- const profileResolution = await resolveVtexProfileOrSelection(profileId);
31
+ const profileResolution = await resolveVtexWriteProfile(profileId);
26
32
  if (!profileResolution.ok) {
27
33
  return profileResolution.response;
28
34
  }
29
35
  const resolvedProfileId = profileResolution.value.profileId;
36
+ const beforeInventory = await getInventoryByWarehouse(resolvedProfileId, skuId, warehouseId);
30
37
  await updateInventoryQuantity(resolvedProfileId, skuId, warehouseId, {
31
38
  quantity,
32
39
  unlimitedQuantity,
33
40
  dateUtcOnBalanceSystem
34
41
  });
35
- return object({
36
- success: true,
37
- profile_id: resolvedProfileId,
38
- sku_id: skuId,
39
- warehouse_id: warehouseId,
40
- quantity,
41
- unlimited_quantity: unlimitedQuantity,
42
- message: "Inventory quantity updated successfully"
42
+ const afterInventory = await getInventoryByWarehouse(resolvedProfileId, skuId, warehouseId);
43
+ return buildWriteSuccessResponse({
44
+ profileId: resolvedProfileId,
45
+ operation: "update_inventory",
46
+ resourceId: skuId,
47
+ riskLevel: "low",
48
+ message: "Inventory quantity updated successfully.",
49
+ before: beforeInventory[0] ?? null,
50
+ after: afterInventory[0] ?? null,
51
+ details: {
52
+ sku_id: skuId,
53
+ warehouse_id: warehouseId,
54
+ quantity,
55
+ unlimited_quantity: unlimitedQuantity
56
+ }
43
57
  });
44
58
  } catch (err) {
45
- return error(
46
- formatVtexError(err, `Failed to update inventory quantity for SKU ${skuId} in ${warehouseId}`)
59
+ return handleVtexWriteError(
60
+ err,
61
+ `Failed to update inventory quantity for SKU ${skuId} in ${warehouseId}`
47
62
  );
48
63
  }
49
64
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/tools/vtex/update-inventory.ts"],
4
- "sourcesContent": ["import { error, object } from \"mcp-use/server\";\nimport { z } from \"zod\";\n\nimport { formatVtexError } from \"../../services/vtex/vtex-api.js\";\nimport { updateInventoryQuantity } from \"../../services/vtex/vtex-logistics.js\";\nimport { resolveVtexProfileOrSelection } from \"./profile-resolution.js\";\n\nexport const updateInventorySchema = z.object({\n profileId: z\n .string()\n .trim()\n .min(1)\n .optional()\n .describe(\n \"Explicit VTEX profile id to use. If omitted, the tool returns a guided selection payload with available active profiles.\"\n ),\n skuId: z.string().min(1).describe(\"SKU identifier\"),\n warehouseId: z.string().min(1).describe(\"Warehouse identifier\"),\n quantity: z.number().int().min(0).describe(\"Inventory quantity to set\"),\n unlimitedQuantity: z\n .boolean()\n .describe(\"When true, SKU remains available regardless of stock quantity\"),\n dateUtcOnBalanceSystem: z\n .string()\n .optional()\n .describe(\"Optional UTC timestamp for inventory update synchronization\"),\n});\n\nexport async function updateInventoryHandler({\n profileId,\n skuId,\n warehouseId,\n quantity,\n unlimitedQuantity,\n dateUtcOnBalanceSystem,\n}: z.infer<typeof updateInventorySchema>) {\n try {\n const profileResolution = await resolveVtexProfileOrSelection(profileId);\n if (!profileResolution.ok) {\n return profileResolution.response;\n }\n\n const resolvedProfileId = profileResolution.value.profileId;\n\n await updateInventoryQuantity(resolvedProfileId, skuId, warehouseId, {\n quantity,\n unlimitedQuantity,\n dateUtcOnBalanceSystem,\n });\n\n return object({\n success: true,\n profile_id: resolvedProfileId,\n sku_id: skuId,\n warehouse_id: warehouseId,\n quantity,\n unlimited_quantity: unlimitedQuantity,\n message: \"Inventory quantity updated successfully\",\n });\n } catch (err) {\n return error(\n formatVtexError(err, `Failed to update inventory quantity for SKU ${skuId} in ${warehouseId}`)\n );\n }\n}\n"],
5
- "mappings": "AAAA,SAAS,OAAO,cAAc;AAC9B,SAAS,SAAS;AAElB,SAAS,uBAAuB;AAChC,SAAS,+BAA+B;AACxC,SAAS,qCAAqC;AAEvC,MAAM,wBAAwB,EAAE,OAAO;AAAA,EAC5C,WAAW,EACR,OAAO,EACP,KAAK,EACL,IAAI,CAAC,EACL,SAAS,EACT;AAAA,IACC;AAAA,EACF;AAAA,EACF,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS,gBAAgB;AAAA,EAClD,aAAa,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS,sBAAsB;AAAA,EAC9D,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,SAAS,2BAA2B;AAAA,EACtE,mBAAmB,EAChB,QAAQ,EACR,SAAS,+DAA+D;AAAA,EAC3E,wBAAwB,EACrB,OAAO,EACP,SAAS,EACT,SAAS,6DAA6D;AAC3E,CAAC;AAED,eAAsB,uBAAuB;AAAA,EAC3C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAA0C;AACxC,MAAI;AACF,UAAM,oBAAoB,MAAM,8BAA8B,SAAS;AACvE,QAAI,CAAC,kBAAkB,IAAI;AACzB,aAAO,kBAAkB;AAAA,IAC3B;AAEA,UAAM,oBAAoB,kBAAkB,MAAM;AAElD,UAAM,wBAAwB,mBAAmB,OAAO,aAAa;AAAA,MACnE;AAAA,MACA;AAAA,MACA;AAAA,IACF,CAAC;AAED,WAAO,OAAO;AAAA,MACZ,SAAS;AAAA,MACT,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,cAAc;AAAA,MACd;AAAA,MACA,oBAAoB;AAAA,MACpB,SAAS;AAAA,IACX,CAAC;AAAA,EACH,SAAS,KAAK;AACZ,WAAO;AAAA,MACL,gBAAgB,KAAK,+CAA+C,KAAK,OAAO,WAAW,EAAE;AAAA,IAC/F;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["import { z } from \"zod\";\n\nimport {\n getInventoryByWarehouse,\n updateInventoryQuantity,\n} from \"../../services/vtex/vtex-logistics.js\";\nimport {\n buildWriteSuccessResponse,\n handleVtexWriteError,\n resolveVtexWriteProfile,\n vtexProfileIdSchemaField,\n} from \"./write-helpers.js\";\n\nexport const updateInventorySchema = z.object({\n profileId: vtexProfileIdSchemaField,\n skuId: z.string().min(1).describe(\"SKU identifier\"),\n warehouseId: z.string().min(1).describe(\"Warehouse identifier\"),\n quantity: z.number().int().min(0).describe(\"Inventory quantity to set\"),\n unlimitedQuantity: z\n .boolean()\n .describe(\n \"When true, VTEX keeps the SKU available regardless of stock. This overwrites the current unlimited mode for the SKU in the selected warehouse.\"\n ),\n dateUtcOnBalanceSystem: z\n .string()\n .optional()\n .describe(\"Optional UTC timestamp for inventory update synchronization\"),\n});\n\nexport async function updateInventoryHandler({\n profileId,\n skuId,\n warehouseId,\n quantity,\n unlimitedQuantity,\n dateUtcOnBalanceSystem,\n}: z.infer<typeof updateInventorySchema>) {\n try {\n const profileResolution = await resolveVtexWriteProfile(profileId);\n if (!profileResolution.ok) {\n return profileResolution.response;\n }\n\n const resolvedProfileId = profileResolution.value.profileId;\n const beforeInventory = await getInventoryByWarehouse(resolvedProfileId, skuId, warehouseId);\n\n await updateInventoryQuantity(resolvedProfileId, skuId, warehouseId, {\n quantity,\n unlimitedQuantity,\n dateUtcOnBalanceSystem,\n });\n\n const afterInventory = await getInventoryByWarehouse(resolvedProfileId, skuId, warehouseId);\n\n return buildWriteSuccessResponse({\n profileId: resolvedProfileId,\n operation: \"update_inventory\",\n resourceId: skuId,\n riskLevel: \"low\",\n message: \"Inventory quantity updated successfully.\",\n before: (beforeInventory[0] as Record<string, unknown> | undefined) ?? null,\n after: (afterInventory[0] as Record<string, unknown> | undefined) ?? null,\n details: {\n sku_id: skuId,\n warehouse_id: warehouseId,\n quantity,\n unlimited_quantity: unlimitedQuantity,\n },\n });\n } catch (err) {\n return handleVtexWriteError(\n err,\n `Failed to update inventory quantity for SKU ${skuId} in ${warehouseId}`\n );\n }\n}\n"],
5
+ "mappings": "AAAA,SAAS,SAAS;AAElB;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEA,MAAM,wBAAwB,EAAE,OAAO;AAAA,EAC5C,WAAW;AAAA,EACX,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,EAA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2
1
  import { z } from "zod";
3
- import { formatVtexError } from "../../services/vtex/vtex-api.js";
4
- import { updateInventoryLeadTime } from "../../services/vtex/vtex-logistics.js";
5
- import { resolveVtexProfileOrSelection } from "./profile-resolution.js";
2
+ import {
3
+ getInventoryByWarehouse,
4
+ updateInventoryLeadTime
5
+ } from "../../services/vtex/vtex-logistics.js";
6
+ import {
7
+ buildWriteSuccessResponse,
8
+ handleVtexWriteError,
9
+ resolveVtexWriteProfile,
10
+ vtexProfileIdSchemaField
11
+ } from "./write-helpers.js";
6
12
  const updateLeadTimeSchema = z.object({
7
- profileId: z.string().trim().min(1).optional().describe(
8
- "Explicit VTEX profile id to use. If omitted, the tool returns a guided selection payload with available active profiles."
9
- ),
13
+ profileId: vtexProfileIdSchemaField,
10
14
  skuId: z.string().min(1).describe("SKU identifier"),
11
15
  warehouseId: z.string().min(1).describe("Warehouse identifier"),
12
- leadTime: z.string().min(1).describe("Lead time value for the SKU in VTEX expected format (e.g. 1.00:00:00)")
16
+ leadTime: z.string().min(1).describe(
17
+ "Lead time value for the SKU in VTEX expected format (for example `1.00:00:00`). This overwrites the current lead time for the selected warehouse."
18
+ )
13
19
  });
14
20
  async function updateLeadTimeHandler({
15
21
  profileId,
@@ -18,22 +24,33 @@ async function updateLeadTimeHandler({
18
24
  leadTime
19
25
  }) {
20
26
  try {
21
- const profileResolution = await resolveVtexProfileOrSelection(profileId);
27
+ const profileResolution = await resolveVtexWriteProfile(profileId);
22
28
  if (!profileResolution.ok) {
23
29
  return profileResolution.response;
24
30
  }
25
31
  const resolvedProfileId = profileResolution.value.profileId;
32
+ const beforeInventory = await getInventoryByWarehouse(resolvedProfileId, skuId, warehouseId);
26
33
  await updateInventoryLeadTime(resolvedProfileId, skuId, warehouseId, { leadTime });
27
- return object({
28
- success: true,
29
- profile_id: resolvedProfileId,
30
- sku_id: skuId,
31
- warehouse_id: warehouseId,
32
- lead_time: leadTime,
33
- message: "Lead time updated successfully"
34
+ const afterInventory = await getInventoryByWarehouse(resolvedProfileId, skuId, warehouseId);
35
+ return buildWriteSuccessResponse({
36
+ profileId: resolvedProfileId,
37
+ operation: "update_lead_time",
38
+ resourceId: skuId,
39
+ riskLevel: "low",
40
+ message: "Lead time updated successfully.",
41
+ before: beforeInventory[0] ?? null,
42
+ after: afterInventory[0] ?? null,
43
+ details: {
44
+ sku_id: skuId,
45
+ warehouse_id: warehouseId,
46
+ lead_time: leadTime
47
+ }
34
48
  });
35
49
  } catch (err) {
36
- return error(formatVtexError(err, `Failed to update lead time for SKU ${skuId} in ${warehouseId}`));
50
+ return handleVtexWriteError(
51
+ err,
52
+ `Failed to update lead time for SKU ${skuId} in ${warehouseId}`
53
+ );
37
54
  }
38
55
  }
39
56
  export {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/tools/vtex/update-lead-time.ts"],
4
- "sourcesContent": ["import { error, object } from \"mcp-use/server\";\nimport { z } from \"zod\";\n\nimport { formatVtexError } from \"../../services/vtex/vtex-api.js\";\nimport { updateInventoryLeadTime } from \"../../services/vtex/vtex-logistics.js\";\nimport { resolveVtexProfileOrSelection } from \"./profile-resolution.js\";\n\nexport const updateLeadTimeSchema = z.object({\n profileId: z\n .string()\n .trim()\n .min(1)\n .optional()\n .describe(\n \"Explicit VTEX profile id to use. If omitted, the tool returns a guided selection payload with available active profiles.\"\n ),\n skuId: z.string().min(1).describe(\"SKU identifier\"),\n warehouseId: z.string().min(1).describe(\"Warehouse identifier\"),\n leadTime: z\n .string()\n .min(1)\n .describe(\"Lead time value for the SKU in VTEX expected format (e.g. 1.00:00:00)\"),\n});\n\nexport async function updateLeadTimeHandler({\n profileId,\n skuId,\n warehouseId,\n leadTime,\n}: z.infer<typeof updateLeadTimeSchema>) {\n try {\n const profileResolution = await resolveVtexProfileOrSelection(profileId);\n if (!profileResolution.ok) {\n return profileResolution.response;\n }\n\n const resolvedProfileId = profileResolution.value.profileId;\n await updateInventoryLeadTime(resolvedProfileId, skuId, warehouseId, { leadTime });\n\n return object({\n success: true,\n profile_id: resolvedProfileId,\n sku_id: skuId,\n warehouse_id: warehouseId,\n lead_time: leadTime,\n message: \"Lead time updated successfully\",\n });\n } catch (err) {\n return error(formatVtexError(err, `Failed to update lead time for SKU ${skuId} in ${warehouseId}`));\n }\n}\n"],
5
- "mappings": "AAAA,SAAS,OAAO,cAAc;AAC9B,SAAS,SAAS;AAElB,SAAS,uBAAuB;AAChC,SAAS,+BAA+B;AACxC,SAAS,qCAAqC;AAEvC,MAAM,uBAAuB,EAAE,OAAO;AAAA,EAC3C,WAAW,EACR,OAAO,EACP,KAAK,EACL,IAAI,CAAC,EACL,SAAS,EACT;AAAA,IACC;AAAA,EACF;AAAA,EACF,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS,gBAAgB;AAAA,EAClD,aAAa,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS,sBAAsB;AAAA,EAC9D,UAAU,EACP,OAAO,EACP,IAAI,CAAC,EACL,SAAS,uEAAuE;AACrF,CAAC;AAED,eAAsB,sBAAsB;AAAA,EAC1C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAyC;AACvC,MAAI;AACF,UAAM,oBAAoB,MAAM,8BAA8B,SAAS;AACvE,QAAI,CAAC,kBAAkB,IAAI;AACzB,aAAO,kBAAkB;AAAA,IAC3B;AAEA,UAAM,oBAAoB,kBAAkB,MAAM;AAClD,UAAM,wBAAwB,mBAAmB,OAAO,aAAa,EAAE,SAAS,CAAC;AAEjF,WAAO,OAAO;AAAA,MACZ,SAAS;AAAA,MACT,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,cAAc;AAAA,MACd,WAAW;AAAA,MACX,SAAS;AAAA,IACX,CAAC;AAAA,EACH,SAAS,KAAK;AACZ,WAAO,MAAM,gBAAgB,KAAK,sCAAsC,KAAK,OAAO,WAAW,EAAE,CAAC;AAAA,EACpG;AACF;",
4
+ "sourcesContent": ["import { z } from \"zod\";\n\nimport {\n getInventoryByWarehouse,\n updateInventoryLeadTime,\n} from \"../../services/vtex/vtex-logistics.js\";\nimport {\n buildWriteSuccessResponse,\n handleVtexWriteError,\n resolveVtexWriteProfile,\n vtexProfileIdSchemaField,\n} from \"./write-helpers.js\";\n\nexport const updateLeadTimeSchema = z.object({\n profileId: vtexProfileIdSchemaField,\n skuId: z.string().min(1).describe(\"SKU identifier\"),\n warehouseId: z.string().min(1).describe(\"Warehouse identifier\"),\n leadTime: z\n .string()\n .min(1)\n .describe(\n \"Lead time value for the SKU in VTEX expected format (for example `1.00:00:00`). This overwrites the current lead time for the selected warehouse.\"\n ),\n});\n\nexport async function updateLeadTimeHandler({\n profileId,\n skuId,\n warehouseId,\n leadTime,\n}: z.infer<typeof updateLeadTimeSchema>) {\n try {\n const profileResolution = await resolveVtexWriteProfile(profileId);\n if (!profileResolution.ok) {\n return profileResolution.response;\n }\n\n const resolvedProfileId = profileResolution.value.profileId;\n const beforeInventory = await getInventoryByWarehouse(resolvedProfileId, skuId, warehouseId);\n await updateInventoryLeadTime(resolvedProfileId, skuId, warehouseId, { leadTime });\n const afterInventory = await getInventoryByWarehouse(resolvedProfileId, skuId, warehouseId);\n\n return buildWriteSuccessResponse({\n profileId: resolvedProfileId,\n operation: \"update_lead_time\",\n resourceId: skuId,\n riskLevel: \"low\",\n message: \"Lead time updated successfully.\",\n before: (beforeInventory[0] as Record<string, unknown> | undefined) ?? null,\n after: (afterInventory[0] as Record<string, unknown> | undefined) ?? null,\n details: {\n sku_id: skuId,\n warehouse_id: warehouseId,\n lead_time: leadTime,\n },\n });\n } catch (err) {\n return handleVtexWriteError(\n err,\n `Failed to update lead time for SKU ${skuId} in ${warehouseId}`\n );\n }\n}\n"],
5
+ "mappings": "AAAA,SAAS,SAAS;AAElB;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEA,MAAM,uBAAuB,EAAE,OAAO;AAAA,EAC3C,WAAW;AAAA,EACX,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS,gBAAgB;AAAA,EAClD,aAAa,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS,sBAAsB;AAAA,EAC9D,UAAU,EACP,OAAO,EACP,IAAI,CAAC,EACL;AAAA,IACC;AAAA,EACF;AACJ,CAAC;AAED,eAAsB,sBAAsB;AAAA,EAC1C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAyC;AACvC,MAAI;AACF,UAAM,oBAAoB,MAAM,wBAAwB,SAAS;AACjE,QAAI,CAAC,kBAAkB,IAAI;AACzB,aAAO,kBAAkB;AAAA,IAC3B;AAEA,UAAM,oBAAoB,kBAAkB,MAAM;AAClD,UAAM,kBAAkB,MAAM,wBAAwB,mBAAmB,OAAO,WAAW;AAC3F,UAAM,wBAAwB,mBAAmB,OAAO,aAAa,EAAE,SAAS,CAAC;AACjF,UAAM,iBAAiB,MAAM,wBAAwB,mBAAmB,OAAO,WAAW;AAE1F,WAAO,0BAA0B;AAAA,MAC/B,WAAW;AAAA,MACX,WAAW;AAAA,MACX,YAAY;AAAA,MACZ,WAAW;AAAA,MACX,SAAS;AAAA,MACT,QAAS,gBAAgB,CAAC,KAA6C;AAAA,MACvE,OAAQ,eAAe,CAAC,KAA6C;AAAA,MACrE,SAAS;AAAA,QACP,QAAQ;AAAA,QACR,cAAc;AAAA,QACd,WAAW;AAAA,MACb;AAAA,IACF,CAAC;AAAA,EACH,SAAS,KAAK;AACZ,WAAO;AAAA,MACL;AAAA,MACA,sCAAsC,KAAK,OAAO,WAAW;AAAA,IAC/D;AAAA,EACF;AACF;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,71 @@
1
+ import { z } from "zod";
2
+ import {
3
+ buildProductUpdatePayload,
4
+ getProduct,
5
+ updateProduct
6
+ } from "../../services/vtex/vtex-catalog-write.js";
7
+ import {
8
+ buildWriteSuccessResponse,
9
+ handleVtexWriteError,
10
+ resolveVtexWriteProfile,
11
+ vtexProfileIdSchemaField
12
+ } from "./write-helpers.js";
13
+ const updateProductBasicFieldsSchema = z.object({
14
+ profileId: vtexProfileIdSchemaField,
15
+ productId: z.string().min(1).describe("VTEX product identifier."),
16
+ name: z.string().min(1).optional().describe("New product name."),
17
+ categoryId: z.number().int().positive().optional().describe("New category identifier."),
18
+ brandId: z.number().int().positive().optional().describe("New brand identifier."),
19
+ description: z.string().optional().describe("New product description."),
20
+ descriptionShort: z.string().optional().describe("New short description."),
21
+ title: z.string().optional().describe("New SEO title."),
22
+ linkId: z.string().optional().describe("New product slug."),
23
+ refId: z.string().optional().describe("New internal reference code."),
24
+ isVisible: z.boolean().optional().describe("Whether the product should remain visible in listings."),
25
+ isActive: z.boolean().optional().describe("Whether the product should remain active."),
26
+ keyWords: z.string().optional().describe("New keywords string."),
27
+ releaseDate: z.string().optional().describe("New release date in ISO format."),
28
+ metaTagDescription: z.string().optional().describe("New meta description."),
29
+ showWithoutStock: z.boolean().optional().describe("Whether the product can stay visible without stock.")
30
+ }).refine(
31
+ (value) => value.name !== void 0 || value.categoryId !== void 0 || value.brandId !== void 0 || value.description !== void 0 || value.descriptionShort !== void 0 || value.title !== void 0 || value.linkId !== void 0 || value.refId !== void 0 || value.isVisible !== void 0 || value.isActive !== void 0 || value.keyWords !== void 0 || value.releaseDate !== void 0 || value.metaTagDescription !== void 0 || value.showWithoutStock !== void 0,
32
+ {
33
+ message: "At least one product field must be provided.",
34
+ path: ["name"]
35
+ }
36
+ );
37
+ async function updateProductBasicFieldsHandler({
38
+ profileId,
39
+ productId,
40
+ ...updates
41
+ }) {
42
+ try {
43
+ const profileResolution = await resolveVtexWriteProfile(profileId);
44
+ if (!profileResolution.ok) {
45
+ return profileResolution.response;
46
+ }
47
+ const resolvedProfileId = profileResolution.value.profileId;
48
+ const beforeProduct = await getProduct(resolvedProfileId, productId);
49
+ const payload = buildProductUpdatePayload(beforeProduct, updates);
50
+ const afterProduct = await updateProduct(resolvedProfileId, productId, payload);
51
+ return buildWriteSuccessResponse({
52
+ profileId: resolvedProfileId,
53
+ operation: "update_product_basic_fields",
54
+ resourceId: productId,
55
+ riskLevel: "low",
56
+ message: "Product fields updated successfully.",
57
+ before: beforeProduct,
58
+ after: afterProduct,
59
+ details: {
60
+ product_id: productId
61
+ }
62
+ });
63
+ } catch (err) {
64
+ return handleVtexWriteError(err, `Failed to update product ${productId}`);
65
+ }
66
+ }
67
+ export {
68
+ updateProductBasicFieldsHandler,
69
+ updateProductBasicFieldsSchema
70
+ };
71
+ //# sourceMappingURL=update-product-basic-fields.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/tools/vtex/update-product-basic-fields.ts"],
4
+ "sourcesContent": ["import { z } from \"zod\";\n\nimport {\n buildProductUpdatePayload,\n getProduct,\n updateProduct,\n} from \"../../services/vtex/vtex-catalog-write.js\";\nimport {\n buildWriteSuccessResponse,\n handleVtexWriteError,\n resolveVtexWriteProfile,\n vtexProfileIdSchemaField,\n} from \"./write-helpers.js\";\n\nexport const updateProductBasicFieldsSchema = z\n .object({\n profileId: vtexProfileIdSchemaField,\n productId: z.string().min(1).describe(\"VTEX product identifier.\"),\n name: z.string().min(1).optional().describe(\"New product name.\"),\n categoryId: z.number().int().positive().optional().describe(\"New category identifier.\"),\n brandId: z.number().int().positive().optional().describe(\"New brand identifier.\"),\n description: z.string().optional().describe(\"New product description.\"),\n descriptionShort: z.string().optional().describe(\"New short description.\"),\n title: z.string().optional().describe(\"New SEO title.\"),\n linkId: z.string().optional().describe(\"New product slug.\"),\n refId: z.string().optional().describe(\"New internal reference code.\"),\n isVisible: z.boolean().optional().describe(\"Whether the product should remain visible in listings.\"),\n isActive: z.boolean().optional().describe(\"Whether the product should remain active.\"),\n keyWords: z.string().optional().describe(\"New keywords string.\"),\n releaseDate: z.string().optional().describe(\"New release date in ISO format.\"),\n metaTagDescription: z.string().optional().describe(\"New meta description.\"),\n showWithoutStock: z\n .boolean()\n .optional()\n .describe(\"Whether the product can stay visible without stock.\"),\n })\n .refine(\n (value) =>\n value.name !== undefined ||\n value.categoryId !== undefined ||\n value.brandId !== undefined ||\n value.description !== undefined ||\n value.descriptionShort !== undefined ||\n value.title !== undefined ||\n value.linkId !== undefined ||\n value.refId !== undefined ||\n value.isVisible !== undefined ||\n value.isActive !== undefined ||\n value.keyWords !== undefined ||\n value.releaseDate !== undefined ||\n value.metaTagDescription !== undefined ||\n value.showWithoutStock !== undefined,\n {\n message: \"At least one product field must be provided.\",\n path: [\"name\"],\n }\n );\n\nexport async function updateProductBasicFieldsHandler({\n profileId,\n productId,\n ...updates\n}: z.infer<typeof updateProductBasicFieldsSchema>) {\n try {\n const profileResolution = await resolveVtexWriteProfile(profileId);\n if (!profileResolution.ok) {\n return profileResolution.response;\n }\n\n const resolvedProfileId = profileResolution.value.profileId;\n const beforeProduct = await getProduct(resolvedProfileId, productId);\n const payload = buildProductUpdatePayload(beforeProduct, updates);\n const afterProduct = await updateProduct(resolvedProfileId, productId, payload);\n\n return buildWriteSuccessResponse({\n profileId: resolvedProfileId,\n operation: \"update_product_basic_fields\",\n resourceId: productId,\n riskLevel: \"low\",\n message: \"Product fields updated successfully.\",\n before: beforeProduct,\n after: afterProduct,\n details: {\n product_id: productId,\n },\n });\n } catch (err) {\n return handleVtexWriteError(err, `Failed to update product ${productId}`);\n }\n}\n"],
5
+ "mappings": "AAAA,SAAS,SAAS;AAElB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEA,MAAM,iCAAiC,EAC3C,OAAO;AAAA,EACN,WAAW;AAAA,EACX,WAAW,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS,0BAA0B;AAAA,EAChE,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS,EAAE,SAAS,mBAAmB;AAAA,EAC/D,YAAY,EAAE,OAAO,EAAE,IAAI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A,EACpD;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAmD;AACjD,MAAI;AACF,UAAM,oBAAoB,MAAM,wBAAwB,SAAS;AACjE,QAAI,CAAC,kBAAkB,IAAI;AACzB,aAAO,kBAAkB;AAAA,IAC3B;AAEA,UAAM,oBAAoB,kBAAkB,MAAM;AAClD,UAAM,gBAAgB,MAAM,WAAW,mBAAmB,SAAS;AACnE,UAAM,UAAU,0BAA0B,eAAe,OAAO;AAChE,UAAM,eAAe,MAAM,cAAc,mBAAmB,WAAW,OAAO;AAE9E,WAAO,0BAA0B;AAAA,MAC/B,WAAW;AAAA,MACX,WAAW;AAAA,MACX,YAAY;AAAA,MACZ,WAAW;AAAA,MACX,SAAS;AAAA,MACT,QAAQ;AAAA,MACR,OAAO;AAAA,MACP,SAAS;AAAA,QACP,YAAY;AAAA,MACd;AAAA,IACF,CAAC;AAAA,EACH,SAAS,KAAK;AACZ,WAAO,qBAAqB,KAAK,4BAA4B,SAAS,EAAE;AAAA,EAC1E;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,92 @@
1
+ import { z } from "zod";
2
+ import {
3
+ buildSkuUpdatePayload,
4
+ createSkuEan,
5
+ deleteAllSkuEans,
6
+ getSku,
7
+ getSkuEans,
8
+ updateSku
9
+ } from "../../services/vtex/vtex-catalog-write.js";
10
+ import {
11
+ buildWriteSuccessResponse,
12
+ handleVtexWriteError,
13
+ resolveVtexWriteProfile,
14
+ vtexProfileIdSchemaField
15
+ } from "./write-helpers.js";
16
+ const updateSkuBasicFieldsSchema = z.object({
17
+ profileId: vtexProfileIdSchemaField,
18
+ skuId: z.string().min(1).describe("VTEX SKU identifier."),
19
+ name: z.string().min(1).optional().describe("New SKU name."),
20
+ refId: z.string().optional().describe("New SKU reference code."),
21
+ ean: z.string().optional().describe("New EAN. When informed, existing EAN values are replaced with this one."),
22
+ packagedHeight: z.number().nonnegative().optional().describe("Packaged height."),
23
+ packagedLength: z.number().nonnegative().optional().describe("Packaged length."),
24
+ packagedWidth: z.number().nonnegative().optional().describe("Packaged width."),
25
+ packagedWeightKg: z.number().nonnegative().optional().describe("Packaged weight in kg."),
26
+ height: z.number().nonnegative().optional().describe("Physical height."),
27
+ length: z.number().nonnegative().optional().describe("Physical length."),
28
+ width: z.number().nonnegative().optional().describe("Physical width."),
29
+ weightKg: z.number().nonnegative().optional().describe("Physical weight in kg."),
30
+ measurementUnit: z.string().optional().describe("Measurement unit."),
31
+ unitMultiplier: z.number().positive().optional().describe("Unit multiplier."),
32
+ manufacturerCode: z.string().optional().describe("Manufacturer code."),
33
+ commercialConditionId: z.number().int().positive().optional().describe("Commercial condition ID."),
34
+ isActive: z.boolean().optional().describe("Whether the SKU should remain active."),
35
+ activateIfPossible: z.boolean().optional().describe("Whether VTEX should auto-activate the SKU when possible.")
36
+ }).refine(
37
+ (value) => value.name !== void 0 || value.refId !== void 0 || value.ean !== void 0 || value.packagedHeight !== void 0 || value.packagedLength !== void 0 || value.packagedWidth !== void 0 || value.packagedWeightKg !== void 0 || value.height !== void 0 || value.length !== void 0 || value.width !== void 0 || value.weightKg !== void 0 || value.measurementUnit !== void 0 || value.unitMultiplier !== void 0 || value.manufacturerCode !== void 0 || value.commercialConditionId !== void 0 || value.isActive !== void 0 || value.activateIfPossible !== void 0,
38
+ {
39
+ message: "At least one SKU field must be provided.",
40
+ path: ["name"]
41
+ }
42
+ );
43
+ async function updateSkuBasicFieldsHandler({
44
+ profileId,
45
+ skuId,
46
+ ean,
47
+ ...updates
48
+ }) {
49
+ try {
50
+ const profileResolution = await resolveVtexWriteProfile(profileId);
51
+ if (!profileResolution.ok) {
52
+ return profileResolution.response;
53
+ }
54
+ const resolvedProfileId = profileResolution.value.profileId;
55
+ const beforeSku = await getSku(resolvedProfileId, skuId);
56
+ const beforeEans = await getSkuEans(resolvedProfileId, skuId);
57
+ const payload = buildSkuUpdatePayload(beforeSku, updates);
58
+ const afterSku = await updateSku(resolvedProfileId, skuId, payload);
59
+ if (ean !== void 0) {
60
+ await deleteAllSkuEans(resolvedProfileId, skuId);
61
+ if (ean.trim()) {
62
+ await createSkuEan(resolvedProfileId, skuId, ean.trim());
63
+ }
64
+ }
65
+ const afterEans = await getSkuEans(resolvedProfileId, skuId);
66
+ return buildWriteSuccessResponse({
67
+ profileId: resolvedProfileId,
68
+ operation: "update_sku_basic_fields",
69
+ resourceId: skuId,
70
+ riskLevel: "low",
71
+ message: "SKU fields updated successfully.",
72
+ before: {
73
+ ...beforeSku,
74
+ Eans: beforeEans
75
+ },
76
+ after: {
77
+ ...afterSku,
78
+ Eans: afterEans
79
+ },
80
+ details: {
81
+ sku_id: skuId
82
+ }
83
+ });
84
+ } catch (err) {
85
+ return handleVtexWriteError(err, `Failed to update SKU ${skuId}`);
86
+ }
87
+ }
88
+ export {
89
+ updateSkuBasicFieldsHandler,
90
+ updateSkuBasicFieldsSchema
91
+ };
92
+ //# sourceMappingURL=update-sku-basic-fields.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/tools/vtex/update-sku-basic-fields.ts"],
4
+ "sourcesContent": ["import { z } from \"zod\";\n\nimport {\n buildSkuUpdatePayload,\n createSkuEan,\n deleteAllSkuEans,\n getSku,\n getSkuEans,\n updateSku,\n} from \"../../services/vtex/vtex-catalog-write.js\";\nimport {\n buildWriteSuccessResponse,\n handleVtexWriteError,\n resolveVtexWriteProfile,\n vtexProfileIdSchemaField,\n} from \"./write-helpers.js\";\n\nexport const updateSkuBasicFieldsSchema = z\n .object({\n profileId: vtexProfileIdSchemaField,\n skuId: z.string().min(1).describe(\"VTEX SKU identifier.\"),\n name: z.string().min(1).optional().describe(\"New SKU name.\"),\n refId: z.string().optional().describe(\"New SKU reference code.\"),\n ean: z\n .string()\n .optional()\n .describe(\"New EAN. When informed, existing EAN values are replaced with this one.\"),\n packagedHeight: z.number().nonnegative().optional().describe(\"Packaged height.\"),\n packagedLength: z.number().nonnegative().optional().describe(\"Packaged length.\"),\n packagedWidth: z.number().nonnegative().optional().describe(\"Packaged width.\"),\n packagedWeightKg: z.number().nonnegative().optional().describe(\"Packaged weight in kg.\"),\n height: z.number().nonnegative().optional().describe(\"Physical height.\"),\n length: z.number().nonnegative().optional().describe(\"Physical length.\"),\n width: z.number().nonnegative().optional().describe(\"Physical width.\"),\n weightKg: z.number().nonnegative().optional().describe(\"Physical weight in kg.\"),\n measurementUnit: z.string().optional().describe(\"Measurement unit.\"),\n unitMultiplier: z.number().positive().optional().describe(\"Unit multiplier.\"),\n manufacturerCode: z.string().optional().describe(\"Manufacturer code.\"),\n commercialConditionId: z.number().int().positive().optional().describe(\"Commercial condition ID.\"),\n isActive: z.boolean().optional().describe(\"Whether the SKU should remain active.\"),\n activateIfPossible: z\n .boolean()\n .optional()\n .describe(\"Whether VTEX should auto-activate the SKU when possible.\"),\n })\n .refine(\n (value) =>\n value.name !== undefined ||\n value.refId !== undefined ||\n value.ean !== undefined ||\n value.packagedHeight !== undefined ||\n value.packagedLength !== undefined ||\n value.packagedWidth !== undefined ||\n value.packagedWeightKg !== undefined ||\n value.height !== undefined ||\n value.length !== undefined ||\n value.width !== undefined ||\n value.weightKg !== undefined ||\n value.measurementUnit !== undefined ||\n value.unitMultiplier !== undefined ||\n value.manufacturerCode !== undefined ||\n value.commercialConditionId !== undefined ||\n value.isActive !== undefined ||\n value.activateIfPossible !== undefined,\n {\n message: \"At least one SKU field must be provided.\",\n path: [\"name\"],\n }\n );\n\nexport async function updateSkuBasicFieldsHandler({\n profileId,\n skuId,\n ean,\n ...updates\n}: z.infer<typeof updateSkuBasicFieldsSchema>) {\n try {\n const profileResolution = await resolveVtexWriteProfile(profileId);\n if (!profileResolution.ok) {\n return profileResolution.response;\n }\n\n const resolvedProfileId = profileResolution.value.profileId;\n const beforeSku = await getSku(resolvedProfileId, skuId);\n const beforeEans = await getSkuEans(resolvedProfileId, skuId);\n const payload = buildSkuUpdatePayload(beforeSku, updates);\n const afterSku = await updateSku(resolvedProfileId, skuId, payload);\n\n if (ean !== undefined) {\n await deleteAllSkuEans(resolvedProfileId, skuId);\n if (ean.trim()) {\n await createSkuEan(resolvedProfileId, skuId, ean.trim());\n }\n }\n\n const afterEans = await getSkuEans(resolvedProfileId, skuId);\n\n return buildWriteSuccessResponse({\n profileId: resolvedProfileId,\n operation: \"update_sku_basic_fields\",\n resourceId: skuId,\n riskLevel: \"low\",\n message: \"SKU fields updated successfully.\",\n before: {\n ...beforeSku,\n Eans: beforeEans,\n },\n after: {\n ...afterSku,\n Eans: afterEans,\n },\n details: {\n sku_id: skuId,\n },\n });\n } catch (err) {\n return handleVtexWriteError(err, `Failed to update SKU ${skuId}`);\n }\n}\n"],
5
+ "mappings": "AAAA,SAAS,SAAS;AAElB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEA,MAAM,6BAA6B,EACvC,OAAO;AAAA,EACN,WAAW;AAAA,EACX,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS,sBAAsB;AAAA,EACxD,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS,EAAE,SAAS,eAAe;AAAA,EAC3D,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,yBAAyB;AAAA,EAC/D,KAAK,EACF,OAAO,EACP,SAAS,EACT,SAAS,yEAAyE;AAAA,EACrF,gBAAgB,EAAE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,kBAAkB;AAAA,EAC/E,gBAAgB,EAAE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,kBAAkB;AAAA,EAC/E,eAAe,EAAE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,iBAAiB;AAAA,EAC7E,kBAAkB,EAAE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,wBAAwB;AAAA,EACvF,QAAQ,EAAE,OAA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