@cgalaviz/easysell-mcp 0.4.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/LICENSE +21 -0
- package/README.md +256 -0
- package/dist/client.d.ts +53 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +372 -0
- package/dist/client.js.map +1 -0
- package/dist/main.d.ts +3 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +49 -0
- package/dist/main.js.map +1 -0
- package/dist/registry/audit.d.ts +3 -0
- package/dist/registry/audit.d.ts.map +1 -0
- package/dist/registry/audit.js +23 -0
- package/dist/registry/audit.js.map +1 -0
- package/dist/registry/binary-downloads.d.ts +3 -0
- package/dist/registry/binary-downloads.d.ts.map +1 -0
- package/dist/registry/binary-downloads.js +80 -0
- package/dist/registry/binary-downloads.js.map +1 -0
- package/dist/registry/canned-responses.d.ts +11 -0
- package/dist/registry/canned-responses.d.ts.map +1 -0
- package/dist/registry/canned-responses.js +54 -0
- package/dist/registry/canned-responses.js.map +1 -0
- package/dist/registry/catalog-images.d.ts +3 -0
- package/dist/registry/catalog-images.d.ts.map +1 -0
- package/dist/registry/catalog-images.js +48 -0
- package/dist/registry/catalog-images.js.map +1 -0
- package/dist/registry/catalog.d.ts +3 -0
- package/dist/registry/catalog.d.ts.map +1 -0
- package/dist/registry/catalog.js +156 -0
- package/dist/registry/catalog.js.map +1 -0
- package/dist/registry/conversations.d.ts +9 -0
- package/dist/registry/conversations.d.ts.map +1 -0
- package/dist/registry/conversations.js +246 -0
- package/dist/registry/conversations.js.map +1 -0
- package/dist/registry/customers.d.ts +3 -0
- package/dist/registry/customers.d.ts.map +1 -0
- package/dist/registry/customers.js +242 -0
- package/dist/registry/customers.js.map +1 -0
- package/dist/registry/iam.d.ts +3 -0
- package/dist/registry/iam.d.ts.map +1 -0
- package/dist/registry/iam.js +116 -0
- package/dist/registry/iam.js.map +1 -0
- package/dist/registry/index.d.ts +3 -0
- package/dist/registry/index.d.ts.map +1 -0
- package/dist/registry/index.js +37 -0
- package/dist/registry/index.js.map +1 -0
- package/dist/registry/integrations.d.ts +3 -0
- package/dist/registry/integrations.d.ts.map +1 -0
- package/dist/registry/integrations.js +65 -0
- package/dist/registry/integrations.js.map +1 -0
- package/dist/registry/notifications.d.ts +3 -0
- package/dist/registry/notifications.d.ts.map +1 -0
- package/dist/registry/notifications.js +44 -0
- package/dist/registry/notifications.js.map +1 -0
- package/dist/registry/orders.d.ts +3 -0
- package/dist/registry/orders.d.ts.map +1 -0
- package/dist/registry/orders.js +134 -0
- package/dist/registry/orders.js.map +1 -0
- package/dist/registry/payments.d.ts +3 -0
- package/dist/registry/payments.d.ts.map +1 -0
- package/dist/registry/payments.js +39 -0
- package/dist/registry/payments.js.map +1 -0
- package/dist/registry/pricing.d.ts +3 -0
- package/dist/registry/pricing.d.ts.map +1 -0
- package/dist/registry/pricing.js +20 -0
- package/dist/registry/pricing.js.map +1 -0
- package/dist/registry/quotes.d.ts +19 -0
- package/dist/registry/quotes.d.ts.map +1 -0
- package/dist/registry/quotes.js +81 -0
- package/dist/registry/quotes.js.map +1 -0
- package/dist/registry/reports.d.ts +3 -0
- package/dist/registry/reports.d.ts.map +1 -0
- package/dist/registry/reports.js +33 -0
- package/dist/registry/reports.js.map +1 -0
- package/dist/registry/shipping.d.ts +3 -0
- package/dist/registry/shipping.d.ts.map +1 -0
- package/dist/registry/shipping.js +85 -0
- package/dist/registry/shipping.js.map +1 -0
- package/dist/registry/super-admin.d.ts +11 -0
- package/dist/registry/super-admin.d.ts.map +1 -0
- package/dist/registry/super-admin.js +222 -0
- package/dist/registry/super-admin.js.map +1 -0
- package/dist/registry/tenants.d.ts +13 -0
- package/dist/registry/tenants.d.ts.map +1 -0
- package/dist/registry/tenants.js +78 -0
- package/dist/registry/tenants.js.map +1 -0
- package/dist/registry/types.d.ts +67 -0
- package/dist/registry/types.d.ts.map +1 -0
- package/dist/registry/types.js +10 -0
- package/dist/registry/types.js.map +1 -0
- package/dist/registry/uploads.d.ts +3 -0
- package/dist/registry/uploads.d.ts.map +1 -0
- package/dist/registry/uploads.js +86 -0
- package/dist/registry/uploads.js.map +1 -0
- package/dist/registry/usage.d.ts +9 -0
- package/dist/registry/usage.d.ts.map +1 -0
- package/dist/registry/usage.js +33 -0
- package/dist/registry/usage.js.map +1 -0
- package/dist/tools.d.ts +8 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/tools.js +150 -0
- package/dist/tools.js.map +1 -0
- package/package.json +41 -0
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
const orderLineFields = {
|
|
2
|
+
variantId: { type: "string", required: true, description: "id de la variante de catálogo (UUID)." },
|
|
3
|
+
quantity: { type: "string", required: true, description: "Decimal de hasta 3 posiciones, p. ej. \"2\" o \"2.000\"." },
|
|
4
|
+
discountPct: { type: "number", description: "0 a 100." },
|
|
5
|
+
};
|
|
6
|
+
export const orderRoutes = [
|
|
7
|
+
{
|
|
8
|
+
name: "orders_list",
|
|
9
|
+
method: "GET",
|
|
10
|
+
path: "/orders",
|
|
11
|
+
description: "Lista pedidos del tenant, opcionalmente filtrados por status.",
|
|
12
|
+
scopes: ["orders.read"],
|
|
13
|
+
query: { status: { type: "string" } },
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
name: "orders_get",
|
|
17
|
+
method: "GET",
|
|
18
|
+
path: "/orders/:id",
|
|
19
|
+
description: "Detalle de un pedido: líneas, totales, estado, revisiones.",
|
|
20
|
+
scopes: ["orders.read"],
|
|
21
|
+
pathParams: { id: { type: "string" } },
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: "orders_create",
|
|
25
|
+
method: "POST",
|
|
26
|
+
path: "/orders",
|
|
27
|
+
description: "Crea un pedido directo (sin cotización previa) para un cliente existente.",
|
|
28
|
+
scopes: ["orders.write"],
|
|
29
|
+
body: {
|
|
30
|
+
customerId: { type: "string", required: true },
|
|
31
|
+
lines: { type: "array", required: true, description: "1 a 200 líneas.", items: { type: "object", fields: orderLineFields } },
|
|
32
|
+
notes: { type: "string" },
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: "orders_quick_charge",
|
|
37
|
+
method: "POST",
|
|
38
|
+
path: "/orders/quick-charge",
|
|
39
|
+
description: "Cobro rápido: crea un pedido con un solo concepto libre (sin ir por catálogo) y abre su checkout. " +
|
|
40
|
+
"idempotencyKey evita duplicar el cargo si se reintenta la misma llamada. La respuesta trae " +
|
|
41
|
+
"checkoutLink, el link de pago completo y listo para mandar al cliente (no solo el token).",
|
|
42
|
+
scopes: ["orders.write"],
|
|
43
|
+
destructiveHint: true,
|
|
44
|
+
body: {
|
|
45
|
+
customerId: { type: "string", description: "Opcional: sin cliente, el pedido queda sin ligar a uno." },
|
|
46
|
+
description: { type: "string", required: true, description: "Concepto del cobro." },
|
|
47
|
+
amountTotal: { type: "string", required: true, description: "Monto total, p. ej. \"350.00\"." },
|
|
48
|
+
idempotencyKey: { type: "string", description: "Identificador opaco de 8-128 caracteres para evitar cobros duplicados en reintentos." },
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: "orders_from_quote",
|
|
53
|
+
method: "POST",
|
|
54
|
+
path: "/orders/from-quote/:quoteId",
|
|
55
|
+
description: "Crea un pedido a partir de una cotización aceptada. Sin sesión de usuario detrás, no notifica al cliente (evita duplicar el aviso que ya le dio el agente de chat).",
|
|
56
|
+
scopes: ["orders.write"],
|
|
57
|
+
pathParams: { quoteId: { type: "string" } },
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: "orders_start_checkout",
|
|
61
|
+
method: "POST",
|
|
62
|
+
path: "/orders/:id/checkout",
|
|
63
|
+
description: "Abre el checkout de un pedido con las líneas y modo de entrega dados, y emite un link de pago " +
|
|
64
|
+
"público (checkoutLink en la respuesta, ya armado — listo para mandar al cliente).",
|
|
65
|
+
scopes: ["orders.write"],
|
|
66
|
+
pathParams: { id: { type: "string" } },
|
|
67
|
+
body: {
|
|
68
|
+
lines: { type: "array", required: true, items: { type: "object", fields: orderLineFields } },
|
|
69
|
+
deliveryMode: { type: "string", required: true, enum: ["PICKUP", "LOCAL_DELIVERY"] },
|
|
70
|
+
addressId: { type: "string", description: "Requerida si deliveryMode es LOCAL_DELIVERY." },
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
name: "orders_resume_checkout",
|
|
75
|
+
method: "POST",
|
|
76
|
+
path: "/orders/:id/checkout/resume",
|
|
77
|
+
description: "Reemite el link de pago (checkoutLink) de un pedido cuyo checkout ya está abierto, sin recalcular " +
|
|
78
|
+
"líneas ni total.",
|
|
79
|
+
scopes: ["orders.write"],
|
|
80
|
+
pathParams: { id: { type: "string" } },
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: "orders_request_invoice",
|
|
84
|
+
method: "PATCH",
|
|
85
|
+
path: "/orders/:id/invoice-request",
|
|
86
|
+
description: "Registra los datos fiscales para facturar el pedido. rfc/legalName/postalCode/regimenFiscal son " +
|
|
87
|
+
"OPCIONALES si mandas constanciaUrl (un link público a la constancia de situación fiscal en PDF del " +
|
|
88
|
+
"cliente): el backend la descarga y lee esos 4 datos de ahí — no hace falta que el cliente los dicte. " +
|
|
89
|
+
"Solo cfdiUse es siempre obligatorio (el documento no lo trae). Si la constancia no se pudo leer bien, " +
|
|
90
|
+
"la respuesta trae parseWarnings con lo que faltó.",
|
|
91
|
+
scopes: ["orders.write"],
|
|
92
|
+
pathParams: { id: { type: "string" } },
|
|
93
|
+
body: {
|
|
94
|
+
cfdiUse: { type: "string", required: true, description: "p. ej. G03, P01." },
|
|
95
|
+
rfc: { type: "string" },
|
|
96
|
+
legalName: { type: "string" },
|
|
97
|
+
postalCode: { type: "string", description: "5 dígitos." },
|
|
98
|
+
regimenFiscal: { type: "string", description: "Clave c_RegimenFiscal del SAT, 3 dígitos (ej. 626)." },
|
|
99
|
+
constanciaUrl: {
|
|
100
|
+
type: "string",
|
|
101
|
+
description: "Link público a la constancia de situación fiscal (PDF); llena los datos que falten arriba.",
|
|
102
|
+
},
|
|
103
|
+
notes: { type: "string" },
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
name: "orders_cancel",
|
|
108
|
+
method: "PATCH",
|
|
109
|
+
path: "/orders/:id/cancel",
|
|
110
|
+
description: "Cancela un pedido. Requiere orders.cancel_own; sin orders.cancel_any además, la API key solo puede " +
|
|
111
|
+
"cancelar pedidos que ella misma originó (el backend lo exige, no esta tool).",
|
|
112
|
+
scopes: ["orders.cancel_own"],
|
|
113
|
+
destructiveHint: true,
|
|
114
|
+
pathParams: { id: { type: "string" } },
|
|
115
|
+
body: { reason: { type: "string", description: "Máx. 500 caracteres, libre." } },
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
name: "orders_fulfill",
|
|
119
|
+
method: "POST",
|
|
120
|
+
path: "/orders/:id/fulfill",
|
|
121
|
+
description: "Marca un pedido pagado como entregado/completado y le genera (si no existe) su link de seguimiento.",
|
|
122
|
+
scopes: ["orders.write"],
|
|
123
|
+
pathParams: { id: { type: "string" } },
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
name: "orders_tracking_link",
|
|
127
|
+
method: "GET",
|
|
128
|
+
path: "/orders/:id/tracking-link",
|
|
129
|
+
description: "Devuelve (generándolo si hace falta) el link público de seguimiento del pedido.",
|
|
130
|
+
scopes: ["orders.read"],
|
|
131
|
+
pathParams: { id: { type: "string" } },
|
|
132
|
+
},
|
|
133
|
+
];
|
|
134
|
+
//# sourceMappingURL=orders.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orders.js","sourceRoot":"","sources":["../../src/registry/orders.ts"],"names":[],"mappings":"AAEA,MAAM,eAAe,GAAG;IACtB,SAAS,EAAE,EAAE,IAAI,EAAE,QAAiB,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,uCAAuC,EAAE;IAC5G,QAAQ,EAA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QAC7B,eAAe,EAAE,IAAI;QACrB,UAAU,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;QACtC,IAAI,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,6BAA6B,EAAE,EAAE;KACjF;IACD;QACE,IAAI,EAAE,gBAAgB;QACtB,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,qBAAqB;QAC3B,WAAW,EAAE,qGAAqG;QAClH,MAAM,EAAE,CAAC,cAAc,CAAC;QACxB,UAAU,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;KACvC;IACD;QACE,IAAI,EAAE,sBAAsB;QAC5B,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,2BAA2B;QACjC,WAAW,EAAE,iFAAiF;QAC9F,MAAM,EAAE,CAAC,aAAa,CAAC;QACvB,UAAU,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;KACvC;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payments.d.ts","sourceRoot":"","sources":["../../src/registry/payments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,eAAO,MAAM,aAAa,EAAE,QAAQ,EAqCnC,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export const paymentRoutes = [
|
|
2
|
+
{
|
|
3
|
+
name: "payments_list_sessions",
|
|
4
|
+
method: "GET",
|
|
5
|
+
path: "/payments/sessions",
|
|
6
|
+
description: "Lista las sesiones de pago (checkouts) del tenant.",
|
|
7
|
+
scopes: ["payments.read"],
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
name: "payments_get_session",
|
|
11
|
+
method: "GET",
|
|
12
|
+
path: "/payments/sessions/:id",
|
|
13
|
+
description: "Detalle de una sesión de pago: estado, monto, pedido asociado.",
|
|
14
|
+
scopes: ["payments.read"],
|
|
15
|
+
pathParams: { id: { type: "string" } },
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: "payments_ledger",
|
|
19
|
+
method: "GET",
|
|
20
|
+
path: "/payments/ledger",
|
|
21
|
+
description: "Movimientos del libro de pagos (cargos, reembolsos), opcionalmente filtrados por sesión.",
|
|
22
|
+
scopes: ["payments.read"],
|
|
23
|
+
query: { sessionId: { type: "string" } },
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: "payments_refund",
|
|
27
|
+
method: "POST",
|
|
28
|
+
path: "/payments/refunds",
|
|
29
|
+
description: "Reembolsa (total o parcialmente) una sesión de pago capturada.",
|
|
30
|
+
scopes: ["payments.refund"],
|
|
31
|
+
destructiveHint: true,
|
|
32
|
+
body: {
|
|
33
|
+
sessionId: { type: "string", required: true },
|
|
34
|
+
amount: { type: "string", required: true, description: "Monto a reembolsar; no puede exceder lo capturado." },
|
|
35
|
+
reason: { type: "string", description: "Máx. 500 caracteres." },
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
];
|
|
39
|
+
//# sourceMappingURL=payments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payments.js","sourceRoot":"","sources":["../../src/registry/payments.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,aAAa,GAAe;IACvC;QACE,IAAI,EAAE,wBAAwB;QAC9B,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,oBAAoB;QAC1B,WAAW,EAAE,oDAAoD;QACjE,MAAM,EAAE,CAAC,eAAe,CAAC;KAC1B;IACD;QACE,IAAI,EAAE,sBAAsB;QAC5B,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,wBAAwB;QAC9B,WAAW,EAAE,gEAAgE;QAC7E,MAAM,EAAE,CAAC,eAAe,CAAC;QACzB,UAAU,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;KACvC;IACD;QACE,IAAI,EAAE,iBAAiB;QACvB,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,kBAAkB;QACxB,WAAW,EAAE,0FAA0F;QACvG,MAAM,EAAE,CAAC,eAAe,CAAC;QACzB,KAAK,EAAE,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;KACzC;IACD;QACE,IAAI,EAAE,iBAAiB;QACvB,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,mBAAmB;QACzB,WAAW,EAAE,gEAAgE;QAC7E,MAAM,EAAE,CAAC,iBAAiB,CAAC;QAC3B,eAAe,EAAE,IAAI;QACrB,IAAI,EAAE;YACJ,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;YAC7C,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,oDAAoD,EAAE;YAC7G,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,sBAAsB,EAAE;SAChE;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pricing.d.ts","sourceRoot":"","sources":["../../src/registry/pricing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAG3C,eAAO,MAAM,aAAa,EAAE,QAAQ,EAkBnC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { quoteLineFields } from "./quotes.js";
|
|
2
|
+
export const pricingRoutes = [
|
|
3
|
+
{
|
|
4
|
+
name: "pricing_preview",
|
|
5
|
+
method: "POST",
|
|
6
|
+
path: "/pricing/preview",
|
|
7
|
+
description: "Calcula precios y totales de un carrito sin crear nada (fuente oficial de totales, la misma que usa el " +
|
|
8
|
+
"agente antes de cotizar). Para LOCAL_DELIVERY, con postalCode/city/state resuelve la zona de envío del " +
|
|
9
|
+
"tenant y ajusta el envío; sin esos datos usa la tarifa plana del tenant.",
|
|
10
|
+
scopes: ["quotes.read"],
|
|
11
|
+
body: {
|
|
12
|
+
lines: { type: "array", required: true, items: { type: "object", fields: quoteLineFields } },
|
|
13
|
+
deliveryMode: { type: "string", enum: ["PICKUP", "LOCAL_DELIVERY"], description: "Default PICKUP." },
|
|
14
|
+
postalCode: { type: "string" },
|
|
15
|
+
city: { type: "string" },
|
|
16
|
+
state: { type: "string" },
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
];
|
|
20
|
+
//# sourceMappingURL=pricing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pricing.js","sourceRoot":"","sources":["../../src/registry/pricing.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,MAAM,CAAC,MAAM,aAAa,GAAe;IACvC;QACE,IAAI,EAAE,iBAAiB;QACvB,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,kBAAkB;QACxB,WAAW,EACT,yGAAyG;YACzG,yGAAyG;YACzG,0EAA0E;QAC5E,MAAM,EAAE,CAAC,aAAa,CAAC;QACvB,IAAI,EAAE;YACJ,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,eAAe,EAAE,EAAE;YAC5F,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,QAAQ,EAAE,gBAAgB,CAAC,EAAE,WAAW,EAAE,iBAAiB,EAAE;YACpG,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC9B,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACxB,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;SAC1B;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { RouteDef } from "./types.js";
|
|
2
|
+
export declare const quoteLineFields: {
|
|
3
|
+
variantId: {
|
|
4
|
+
type: "string";
|
|
5
|
+
required: boolean;
|
|
6
|
+
description: string;
|
|
7
|
+
};
|
|
8
|
+
quantity: {
|
|
9
|
+
type: "string";
|
|
10
|
+
required: boolean;
|
|
11
|
+
description: string;
|
|
12
|
+
};
|
|
13
|
+
discountPct: {
|
|
14
|
+
type: "number";
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export declare const quoteRoutes: RouteDef[];
|
|
19
|
+
//# sourceMappingURL=quotes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quotes.d.ts","sourceRoot":"","sources":["../../src/registry/quotes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;CAI3B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,QAAQ,EA2EjC,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
export const quoteLineFields = {
|
|
2
|
+
variantId: { type: "string", required: true, description: "id de la variante de catálogo (UUID)." },
|
|
3
|
+
quantity: { type: "string", required: true, description: "Formato NN.NNN (3 decimales), p. ej. \"2.000\"." },
|
|
4
|
+
discountPct: { type: "number", description: "0 a 100." },
|
|
5
|
+
};
|
|
6
|
+
export const quoteRoutes = [
|
|
7
|
+
{
|
|
8
|
+
name: "quotes_list",
|
|
9
|
+
method: "GET",
|
|
10
|
+
path: "/quotes",
|
|
11
|
+
description: "Lista cotizaciones del tenant, opcionalmente filtradas por status.",
|
|
12
|
+
scopes: ["quotes.read"],
|
|
13
|
+
query: {
|
|
14
|
+
status: { type: "string", enum: ["DRAFT", "ISSUED", "ACCEPTED", "CANCELLED", "EXPIRED"] },
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: "quotes_get",
|
|
19
|
+
method: "GET",
|
|
20
|
+
path: "/quotes/:id",
|
|
21
|
+
description: "Detalle de una cotización: líneas, totales, cliente, estado.",
|
|
22
|
+
scopes: ["quotes.read"],
|
|
23
|
+
pathParams: { id: { type: "string" } },
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: "quotes_create",
|
|
27
|
+
method: "POST",
|
|
28
|
+
path: "/quotes",
|
|
29
|
+
description: "Crea una cotización en DRAFT (o directo ISSUED si issue:true) para un cliente existente.",
|
|
30
|
+
scopes: ["quotes.write"],
|
|
31
|
+
body: {
|
|
32
|
+
customerId: { type: "string", required: true, description: "id del cliente (UUID)." },
|
|
33
|
+
lines: { type: "array", required: true, description: "Al menos una línea.", items: { type: "object", fields: quoteLineFields } },
|
|
34
|
+
notes: { type: "string", description: "Máx. 1000 caracteres." },
|
|
35
|
+
issue: { type: "boolean", description: "true = emitirla de una vez (equivalente a create + issue)." },
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: "quotes_update",
|
|
40
|
+
method: "PATCH",
|
|
41
|
+
path: "/quotes/:id",
|
|
42
|
+
description: "Reemplaza las líneas y/o notas de una cotización (solo mientras sigue en DRAFT).",
|
|
43
|
+
scopes: ["quotes.write"],
|
|
44
|
+
pathParams: { id: { type: "string" } },
|
|
45
|
+
body: {
|
|
46
|
+
lines: { type: "array", items: { type: "object", fields: quoteLineFields } },
|
|
47
|
+
notes: { type: "string" },
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: "quotes_issue",
|
|
52
|
+
method: "PATCH",
|
|
53
|
+
path: "/quotes/:id/issue",
|
|
54
|
+
description: "Emite una cotización DRAFT: fija precios y le pone fecha de vencimiento.",
|
|
55
|
+
scopes: ["quotes.write"],
|
|
56
|
+
pathParams: { id: { type: "string" } },
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: "quotes_cancel",
|
|
60
|
+
method: "PATCH",
|
|
61
|
+
path: "/quotes/:id/cancel",
|
|
62
|
+
description: "Cancela una cotización; ya no se puede aceptar ni pagar.",
|
|
63
|
+
scopes: ["quotes.write"],
|
|
64
|
+
destructiveHint: true,
|
|
65
|
+
pathParams: { id: { type: "string" } },
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: "quotes_share",
|
|
69
|
+
method: "POST",
|
|
70
|
+
path: "/quotes/:id/share",
|
|
71
|
+
description: "Genera (o renueva) el link público de la cotización. La respuesta trae shareLink, el link ya " +
|
|
72
|
+
"completo y listo para mandar (no solo el token). notify:false si el enlace ya se lo mandaste tú " +
|
|
73
|
+
"al cliente por otro medio, para que el dispatcher no lo duplique.",
|
|
74
|
+
scopes: ["quotes.write"],
|
|
75
|
+
pathParams: { id: { type: "string" } },
|
|
76
|
+
body: {
|
|
77
|
+
notify: { type: "boolean", description: "Default true: encola notificación WhatsApp/email al cliente." },
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
];
|
|
81
|
+
//# sourceMappingURL=quotes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quotes.js","sourceRoot":"","sources":["../../src/registry/quotes.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,SAAS,EAAE,EAAE,IAAI,EAAE,QAAiB,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,uCAAuC,EAAE;IAC5G,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAiB,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,iDAAiD,EAAE;IACrH,WAAW,EAAE,EAAE,IAAI,EAAE,QAAiB,EAAE,WAAW,EAAE,UAAU,EAAE;CAClE,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAe;IACrC;QACE,IAAI,EAAE,aAAa;QACnB,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,oEAAoE;QACjF,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 +1,33 @@
|
|
|
1
|
+
export const reportRoutes = [
|
|
2
|
+
{
|
|
3
|
+
name: "reports_summary",
|
|
4
|
+
method: "GET",
|
|
5
|
+
path: "/reports/summary",
|
|
6
|
+
description: "Resumen de ventas/cobros del tenant. Requiere payments.read (mismo scope que /payments/sessions).",
|
|
7
|
+
scopes: ["payments.read"],
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
name: "reports_dashboard",
|
|
11
|
+
method: "GET",
|
|
12
|
+
path: "/reports/dashboard",
|
|
13
|
+
description: "Dashboard operativo: KPIs unificados, actividad reciente (pedidos, conversaciones, bitácora) y serie de " +
|
|
14
|
+
"ventas de 7 días. Requiere payments.read.",
|
|
15
|
+
scopes: ["payments.read"],
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: "reports_attention",
|
|
19
|
+
method: "GET",
|
|
20
|
+
path: "/reports/attention",
|
|
21
|
+
description: "Reporte operativo de atención al cliente de WhatsApp: volumen de conversaciones, " +
|
|
22
|
+
"tiempos de primera respuesta, carga por agente. Útil para decidir staffing y SLA. " +
|
|
23
|
+
"Requiere chat.read.",
|
|
24
|
+
scopes: ["chat.read"],
|
|
25
|
+
query: {
|
|
26
|
+
from: { type: "string", description: "Fecha ISO, inclusive." },
|
|
27
|
+
to: { type: "string", description: "Fecha ISO, inclusive." },
|
|
28
|
+
agentId: { type: "string", description: "UUID de un agente humano; sin él, agrega a todos." },
|
|
29
|
+
provider: { type: "string", enum: ["META", "EVOLUTION"], description: "Filtra por proveedor de WhatsApp." },
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
];
|
|
33
|
+
//# sourceMappingURL=reports.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reports.js","sourceRoot":"","sources":["../../src/registry/reports.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,YAAY,GAAe;IACtC;QACE,IAAI,EAAE,iBAAiB;QACvB,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,kBAAkB;QACxB,WAAW,EAAE,mGAAmG;QAChH,MAAM,EAAE,CAAC,eAAe,CAAC;KAC1B;IACD;QACE,IAAI,EAAE,mBAAmB;QACzB,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,oBAAoB;QAC1B,WAAW,EACT,0GAA0G;YAC1G,2CAA2C;QAC7C,MAAM,EAAE,CAAC,eAAe,CAAC;KAC1B;IACD;QACE,IAAI,EAAE,mBAAmB;QACzB,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,oBAAoB;QAC1B,WAAW,EACT,mFAAmF;YACnF,oFAAoF;YACpF,qBAAqB;QACvB,MAAM,EAAE,CAAC,WAAW,CAAC;QACrB,KAAK,EAAE;YACL,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,uBAAuB,EAAE;YAC9D,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,uBAAuB,EAAE;YAC5D,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,mDAAmD,EAAE;YAC7F,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,MAAM,EAAE,WAAW,CAAC,EAAE,WAAW,EAAE,mCAAmC,EAAE;SAC5G;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shipping.d.ts","sourceRoot":"","sources":["../../src/registry/shipping.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,eAAO,MAAM,cAAc,EAAE,QAAQ,EAsFpC,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
export const shippingRoutes = [
|
|
2
|
+
{
|
|
3
|
+
name: "shipping_list_zones",
|
|
4
|
+
method: "GET",
|
|
5
|
+
path: "/tenants/me/delivery-zones",
|
|
6
|
+
description: "Lista las zonas de envío a domicilio configuradas por el tenant.",
|
|
7
|
+
scopes: ["catalog.read"],
|
|
8
|
+
query: { activeOnly: { type: "string", enum: ["true", "false"] } },
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
name: "shipping_create_zone",
|
|
12
|
+
method: "POST",
|
|
13
|
+
path: "/tenants/me/delivery-zones",
|
|
14
|
+
description: "Crea una zona de envío (por polígono en el mapa, CPs, patrón de ciudad o estado). Sin ninguno de los " +
|
|
15
|
+
"criterios queda como zona catch-all (solo puede haber una por tenant). Requiere tenant.admin: solo lo " +
|
|
16
|
+
"tiene el rol OWNER, así que una API key solo puede usar esto si la emitió un OWNER.",
|
|
17
|
+
scopes: ["tenant.admin"],
|
|
18
|
+
body: {
|
|
19
|
+
name: { type: "string", required: true },
|
|
20
|
+
postalCodes: { type: "array", items: { type: "string" }, description: "1 a 500 códigos postales de 4-5 dígitos." },
|
|
21
|
+
cityPattern: { type: "string" },
|
|
22
|
+
state: { type: "string" },
|
|
23
|
+
polygon: {
|
|
24
|
+
type: "any",
|
|
25
|
+
description: "GeoJSON Polygon o MultiPolygon con coordenadas [lng, lat], anillos cerrados, máximo 2000 vértices. " +
|
|
26
|
+
"Se evalúa antes que el CP cuando el cliente comparte lat/lng.",
|
|
27
|
+
},
|
|
28
|
+
color: { type: "string", description: "Color de la zona en el mapa del panel, formato #rrggbb." },
|
|
29
|
+
price: { type: "number", required: true, description: "0 a 999999.99, hasta 2 decimales." },
|
|
30
|
+
minOrder: { type: "number", description: "Pedido mínimo para esta zona." },
|
|
31
|
+
sortOrder: { type: "number" },
|
|
32
|
+
active: { type: "boolean", description: "Default true." },
|
|
33
|
+
notes: { type: "string" },
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: "shipping_update_zone",
|
|
38
|
+
method: "PATCH",
|
|
39
|
+
path: "/tenants/me/delivery-zones/:id",
|
|
40
|
+
description: "Actualiza una zona de envío existente. Requiere tenant.admin (solo OWNER).",
|
|
41
|
+
scopes: ["tenant.admin"],
|
|
42
|
+
pathParams: { id: { type: "string" } },
|
|
43
|
+
body: {
|
|
44
|
+
name: { type: "string" },
|
|
45
|
+
postalCodes: { type: "array", items: { type: "string" } },
|
|
46
|
+
cityPattern: { type: "string" },
|
|
47
|
+
state: { type: "string" },
|
|
48
|
+
polygon: {
|
|
49
|
+
type: "any",
|
|
50
|
+
description: "GeoJSON Polygon/MultiPolygon [lng, lat]. Manda null para quitar el polígono.",
|
|
51
|
+
},
|
|
52
|
+
color: { type: "string", description: "#rrggbb. Manda null para quitar el color." },
|
|
53
|
+
price: { type: "number" },
|
|
54
|
+
minOrder: { type: "number" },
|
|
55
|
+
sortOrder: { type: "number" },
|
|
56
|
+
active: { type: "boolean" },
|
|
57
|
+
notes: { type: "string" },
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: "shipping_delete_zone",
|
|
62
|
+
method: "DELETE",
|
|
63
|
+
path: "/tenants/me/delivery-zones/:id",
|
|
64
|
+
description: "Borra una zona de envío. Requiere tenant.admin (solo OWNER).",
|
|
65
|
+
scopes: ["tenant.admin"],
|
|
66
|
+
pathParams: { id: { type: "string" } },
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: "shipping_lookup",
|
|
70
|
+
method: "GET",
|
|
71
|
+
path: "/shipping/lookup",
|
|
72
|
+
description: "Dado un CP/ciudad/estado y/o lat/lng, resuelve qué zona de envío aplica y su precio (o la tarifa plana si " +
|
|
73
|
+
"no hay match). Orden: polígono que contenga lat/lng > CP > estado+ciudad > catch-all > tarifa plana. " +
|
|
74
|
+
"La respuesta trae `matchedBy` (polygon | postalCode | city | catchAll | fallback).",
|
|
75
|
+
scopes: ["catalog.read"],
|
|
76
|
+
query: {
|
|
77
|
+
postalCode: { type: "string", description: "4 o 5 dígitos." },
|
|
78
|
+
city: { type: "string" },
|
|
79
|
+
state: { type: "string" },
|
|
80
|
+
lat: { type: "number", description: "Latitud WGS84 (-90..90). Va junto con lng." },
|
|
81
|
+
lng: { type: "number", description: "Longitud WGS84 (-180..180). Va junto con lat." },
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
];
|
|
85
|
+
//# sourceMappingURL=shipping.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shipping.js","sourceRoot":"","sources":["../../src/registry/shipping.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,cAAc,GAAe;IACxC;QACE,IAAI,EAAE,qBAAqB;QAC3B,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,4BAA4B;QAClC,WAAW,EAAE,kEAAkE;QAC/E,MAAM,EAAE,CAAC,cAAc,CAAC;QACxB,KAAK,EAAE,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EAAE;KACnE;IACD;QACE,IAAI,EAAE,sBAAsB;QAC5B,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,4BAA4B;QAClC,WAAW,EACT,uGAAuG;YACvG,wGAAwG;YACxG,qFAAqF;QACvF,MAAM,EAAE,CAAC,cAAc,CAAC;QACxB,IAAI,EAAE;YACJ,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;YACxC,WAAW,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,WAAW,EAAE,0CAA0C,EAAE;YAClH,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC/B,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACzB,OAAO,EAAE;gBACP,IAAI,EAAE,KAAK;gBACX,WAAW,EACT,qGAAqG;oBACrG,+DAA+D;aAClE;YACD,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,yDAAyD,EAAE;YACjG,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE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sBAAsB;QAC5B,MAAM,EAAE,QAAQ;QAChB,IAAI,EAAE,gCAAgC;QACtC,WAAW,EAAE,8DAA8D;QAC3E,MAAM,EAAE,CAAC,cAAc,CAAC;QACxB,UAAU,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;KACvC;IACD;QACE,IAAI,EAAE,iBAAiB;QACvB,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,kBAAkB;QACxB,WAAW,EACT,4GAA4G;YAC5G,uGAAuG;YACvG,oFAAoF;QACtF,MAAM,EAAE,CAAC,cAAc,CAAC;QACxB,KAAK,EAAE;YACL,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,gBAAgB,EAAE;YAC7D,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACxB,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACzB,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,4CAA4C,EAAE;YAClF,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,+CAA+C,EAAE;SACtF;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { RouteDef } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Path del endpoint que `client.ts` usa como probe para detectar si la API
|
|
4
|
+
* key es GLOBAL (ver `probeKeyKind`). Exportado desde el registry para que
|
|
5
|
+
* un rename o mudanza aquí no rompa el probe silenciosamente (antes estaba
|
|
6
|
+
* hardcodeado en client.ts y eso significaba que el aviso de "key global"
|
|
7
|
+
* en main.ts dejaba de aparecer si esto se renombraba).
|
|
8
|
+
*/
|
|
9
|
+
export declare const SUPER_ADMIN_OVERVIEW_PATH = "/super-admin/overview";
|
|
10
|
+
export declare const superAdminRoutes: RouteDef[];
|
|
11
|
+
//# sourceMappingURL=super-admin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"super-admin.d.ts","sourceRoot":"","sources":["../../src/registry/super-admin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAc3C;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,0BAA0B,CAAC;AAEjE,eAAO,MAAM,gBAAgB,EAAE,QAAQ,EA6MtC,CAAC"}
|