@asteby/storefront 0.11.0 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -3
- package/dist/cli.js +65 -30
- package/dist/fiscal-document.d.cts +2 -2
- package/dist/fiscal-document.d.ts +2 -2
- package/dist/index.cjs +5 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/mock.cjs +3 -3
- package/dist/mock.cjs.map +1 -1
- package/dist/mock.d.cts +1 -1
- package/dist/mock.d.ts +1 -1
- package/dist/mock.js +3 -3
- package/dist/mock.js.map +1 -1
- package/dist/mockup.d.cts +1 -1
- package/dist/mockup.d.ts +1 -1
- package/dist/node.cjs +85 -31
- package/dist/node.cjs.map +1 -1
- package/dist/node.d.cts +59 -25
- package/dist/node.d.ts +59 -25
- package/dist/node.js +82 -31
- package/dist/node.js.map +1 -1
- package/dist/{types-D7UJxrba.d.ts → types-B1E3GySa.d.ts} +1 -1
- package/dist/{types-C-Ley-Mt.d.cts → types-bsdlAumU.d.cts} +1 -1
- package/package.json +1 -1
package/dist/mock.cjs
CHANGED
|
@@ -959,7 +959,7 @@ function validateInvoiceRequest(region, input, prefix = "invoice") {
|
|
|
959
959
|
const taxId = text(input.tax_id, input.rfc).toUpperCase();
|
|
960
960
|
const name = text(input.legal_name, input.razon_social);
|
|
961
961
|
const regime = text(input.tax_regime, input.regimen);
|
|
962
|
-
const use = text(input.use, input.uso_cfdi);
|
|
962
|
+
const use = text(input.use, input.uso_cfdi, input.invoice_use);
|
|
963
963
|
const postal = text(input.postal_code, input.cp);
|
|
964
964
|
const bad = (field, message) => ({ field: `${prefix}.${field}`, message });
|
|
965
965
|
if (!taxId) return bad("tax_id", "The tax id is required");
|
|
@@ -2314,7 +2314,7 @@ function createMockStorefront(options = {}) {
|
|
|
2314
2314
|
legal_name: String(fiscal.legal_name ?? fiscal.razon_social),
|
|
2315
2315
|
tax_regime: String(fiscal.tax_regime ?? fiscal.regimen),
|
|
2316
2316
|
postal_code: String(fiscal.postal_code ?? fiscal.cp),
|
|
2317
|
-
invoice_use: String(fiscal.use ?? fiscal.uso_cfdi ?? "") || null,
|
|
2317
|
+
invoice_use: String(fiscal.use ?? fiscal.uso_cfdi ?? fiscal.invoice_use ?? "") || null,
|
|
2318
2318
|
document: fiscal.document ?? null,
|
|
2319
2319
|
verification: { status: "reviewed", checked_at: now() }
|
|
2320
2320
|
};
|
|
@@ -2428,7 +2428,7 @@ function createMockStorefront(options = {}) {
|
|
|
2428
2428
|
const tok = request.headers.get("authorization")?.match(/^Bearer\s+(.+)$/i)?.[1] ?? null;
|
|
2429
2429
|
const granted = scopesFor(tok);
|
|
2430
2430
|
if (!tok || !granted) return errorResponse(new HttpError(401, "unauthorized", "Missing or invalid storefront token"));
|
|
2431
|
-
return json(200, { kind: tok.startsWith("pk_") ? "publishable" : "secret", environment: "sandbox", scopes: [...granted], missing_scopes: missingScopes, connection_id: "conn_mock", expires_at: null }, { "Cache-Control": PRIVATE_CACHE });
|
|
2431
|
+
return json(200, { success: true, data: { kind: tok.startsWith("pk_") ? "publishable" : "secret", environment: "sandbox", scopes: [...granted], missing_scopes: missingScopes, connection_id: "conn_mock", expires_at: null } }, { "Cache-Control": PRIVATE_CACHE });
|
|
2432
2432
|
}
|
|
2433
2433
|
const idx = url.pathname.indexOf("/storefront/");
|
|
2434
2434
|
if (idx < 0) return errorResponse(new HttpError(404, "not_found", `No route for ${url.pathname}`));
|