@ecomiq/storefront 1.1.5 → 2.0.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/README.md +26 -417
- package/bin/ecomiq.mjs +154 -0
- package/package.json +72 -84
- package/src/api-proxy.ts +194 -0
- package/src/auth/create-storefront-auth.ts +35 -0
- package/src/auth/ecomiq-oauth-password-client.ts +26 -0
- package/src/auth/ecomiq-oauth-password-constants.ts +26 -0
- package/src/auth/ecomiq-oauth-password-plugin.ts +299 -0
- package/src/auth/ecomiq-oauth-password-types.ts +25 -0
- package/src/auth/ecomiq-storefront-sign-in.ts +47 -0
- package/src/auth/env.ts +7 -0
- package/src/cart-session.ts +241 -0
- package/src/client.ts +48 -0
- package/src/codegen.mjs +603 -0
- package/src/components/checkout/cart-sync.ts +143 -0
- package/src/components/checkout/checkout-external-update-banner.tsx +15 -0
- package/src/components/checkout/checkout-form-controls.tsx +139 -0
- package/src/components/checkout/checkout-line-items.tsx +43 -0
- package/src/components/checkout/checkout-order-summary.tsx +156 -0
- package/src/components/checkout/checkout-payment-section.tsx +215 -0
- package/src/components/checkout/checkout-session-view.tsx +240 -0
- package/src/components/checkout/checkout-shipping-address-section.tsx +266 -0
- package/src/components/checkout/checkout-shipping-section.tsx +90 -0
- package/src/components/checkout/checkout-states.tsx +73 -0
- package/src/components/checkout/form-schema.ts +229 -0
- package/src/components/checkout/format.ts +27 -0
- package/src/components/checkout/index.ts +51 -0
- package/src/components/checkout/types.ts +43 -0
- package/src/components/checkout/use-checkout-geo.ts +50 -0
- package/src/components/checkout/use-checkout-session.ts +583 -0
- package/src/components/hero.tsx +291 -0
- package/src/config.d.ts +69 -0
- package/src/config.mjs +165 -0
- package/src/index.ts +274 -0
- package/src/link.tsx +2 -0
- package/src/pages/checkout.$checkoutId.tsx +60 -0
- package/src/pages/checkout.tsx +31 -0
- package/src/pages/thank-you.tsx +53 -0
- package/src/providers/auth.tsx +69 -0
- package/src/providers/cart.tsx +275 -0
- package/src/providers/ecomiq.ts +137 -0
- package/src/providers/index.ts +26 -0
- package/src/public-config.ts +44 -0
- package/src/review-submission.ts +89 -0
- package/src/runtime/context.ts +1 -0
- package/src/runtime/default-layout.tsx +80 -0
- package/src/runtime/head.ts +126 -0
- package/src/runtime/page.tsx +82 -0
- package/src/runtime/postcss-browser-stub.mjs +5 -0
- package/src/server-config-store.ts +26 -0
- package/src/server.ts +279 -0
- package/src/styles.css +76 -0
- package/src/ui/badge.tsx +32 -0
- package/src/ui/button.tsx +31 -0
- package/src/ui/card.tsx +31 -0
- package/src/ui/carousel.tsx +218 -0
- package/src/ui/cn.ts +6 -0
- package/src/ui/index.ts +8 -0
- package/src/ui/separator.tsx +6 -0
- package/src/ui/skeleton.tsx +6 -0
- package/src/ui/storefront-error.tsx +49 -0
- package/src/utils.ts +36 -0
- package/src/vite-inline.mjs +95 -0
- package/templates/__root.tsx +77 -0
- package/templates/router.tsx +19 -0
- package/dist/chunk-3QGB55R6.js +0 -157
- package/dist/chunk-3QGB55R6.js.map +0 -1
- package/dist/chunk-64GLOWMJ.js +0 -216
- package/dist/chunk-64GLOWMJ.js.map +0 -1
- package/dist/chunk-ASFU32ZM.js +0 -236
- package/dist/chunk-ASFU32ZM.js.map +0 -1
- package/dist/chunk-Q4U5OEUT.js +0 -21
- package/dist/chunk-Q4U5OEUT.js.map +0 -1
- package/dist/chunk-QRR7EPCH.js +0 -176
- package/dist/chunk-QRR7EPCH.js.map +0 -1
- package/dist/chunk-S7CPZ4UE.js +0 -6
- package/dist/chunk-S7CPZ4UE.js.map +0 -1
- package/dist/chunk-ZG2XUYGZ.js +0 -1281
- package/dist/chunk-ZG2XUYGZ.js.map +0 -1
- package/dist/chunks/client.css +0 -984
- package/dist/chunks/client.css.map +0 -1
- package/dist/chunks/client.d.ts +0 -10041
- package/dist/chunks/client.js +0 -5363
- package/dist/chunks/client.js.map +0 -1
- package/dist/chunks/config.d.ts +0 -31
- package/dist/chunks/config.js +0 -5
- package/dist/chunks/config.js.map +0 -1
- package/dist/chunks/core-public.d.ts +0 -130
- package/dist/chunks/core-public.js +0 -92
- package/dist/chunks/core-public.js.map +0 -1
- package/dist/chunks/server-nextjs.d.ts +0 -33
- package/dist/chunks/server-nextjs.js +0 -47
- package/dist/chunks/server-nextjs.js.map +0 -1
- package/dist/chunks/server-tanstack.d.ts +0 -22
- package/dist/chunks/server-tanstack.js +0 -34
- package/dist/chunks/server-tanstack.js.map +0 -1
- package/dist/collection-C6bWDLiw.d.ts +0 -3926
- package/dist/ecomiq-oauth-password-plugin-J5wDFqzL.d.ts +0 -3629
- package/dist/ecomiq-shell-ui-SWIFLQVM.js +0 -8
- package/dist/ecomiq-shell-ui-SWIFLQVM.js.map +0 -1
- package/dist/index.d.ts +0 -9
- package/dist/index.js +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index.server.d.ts +0 -9
- package/dist/index.server.js +0 -8
- package/dist/index.server.js.map +0 -1
- package/dist/nextjs/api.d.ts +0 -45
- package/dist/nextjs/api.js +0 -32
- package/dist/nextjs/api.js.map +0 -1
- package/dist/nextjs/globals.css +0 -13
- package/dist/nextjs.d.ts +0 -2
- package/dist/nextjs.js +0 -2
- package/dist/nextjs.js.map +0 -1
- package/dist/nextjs.server.d.ts +0 -1
- package/dist/nextjs.server.js +0 -1
- package/dist/nextjs.server.js.map +0 -1
- package/dist/postcss.config.mjs +0 -6
- package/dist/react/checkout-page.css +0 -855
- package/dist/react/client.css +0 -984
- package/dist/react/payment-provider.css +0 -91
- package/dist/react/thank-you-page.css +0 -105
- package/dist/react.d.ts +0 -1
- package/dist/react.js +0 -2
- package/dist/react.js.map +0 -1
- package/dist/store-proxy-handler-CNzKlTFA.d.ts +0 -10
- package/dist/tanstack/api.d.ts +0 -41
- package/dist/tanstack/api.js +0 -30
- package/dist/tanstack/api.js.map +0 -1
- package/dist/tanstack.d.ts +0 -2
- package/dist/tanstack.js +0 -2
- package/dist/tanstack.js.map +0 -1
- package/dist/tanstack.server.d.ts +0 -1
- package/dist/tanstack.server.js +0 -1
- package/dist/tanstack.server.js.map +0 -1
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
/* Estilos headless para proveedores de pago (sin @ecomiq/ui). */
|
|
2
|
-
|
|
3
|
-
.ecomiq-payment-provider__panel {
|
|
4
|
-
border: 1px solid #d9d9d9;
|
|
5
|
-
border-radius: 5px;
|
|
6
|
-
padding: 1rem;
|
|
7
|
-
display: flex;
|
|
8
|
-
flex-direction: column;
|
|
9
|
-
gap: 0.75rem;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.ecomiq-payment-provider__title {
|
|
13
|
-
margin: 0;
|
|
14
|
-
font-size: 0.875rem;
|
|
15
|
-
font-weight: 600;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.ecomiq-payment-provider__hint {
|
|
19
|
-
margin: 0;
|
|
20
|
-
font-size: 0.875rem;
|
|
21
|
-
color: #6d6d6d;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.ecomiq-payment-provider__hint--sm {
|
|
25
|
-
font-size: 0.75rem;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.ecomiq-payment-provider__redirect {
|
|
29
|
-
display: inline-flex;
|
|
30
|
-
align-items: center;
|
|
31
|
-
justify-content: center;
|
|
32
|
-
width: 100%;
|
|
33
|
-
max-width: 100%;
|
|
34
|
-
padding: 0.65rem 1.25rem;
|
|
35
|
-
border: none;
|
|
36
|
-
border-radius: 5px;
|
|
37
|
-
background: #121212;
|
|
38
|
-
color: #fff;
|
|
39
|
-
font-size: 0.875rem;
|
|
40
|
-
font-weight: 600;
|
|
41
|
-
text-decoration: none;
|
|
42
|
-
cursor: pointer;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.ecomiq-payment-provider__redirect:hover {
|
|
46
|
-
opacity: 0.9;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.ecomiq-payment-provider__qr-wrap {
|
|
50
|
-
display: flex;
|
|
51
|
-
justify-content: center;
|
|
52
|
-
padding-top: 0.5rem;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.ecomiq-payment-provider__qr {
|
|
56
|
-
max-width: 220px;
|
|
57
|
-
border: 1px solid #d9d9d9;
|
|
58
|
-
border-radius: 5px;
|
|
59
|
-
background: #fff;
|
|
60
|
-
padding: 0.5rem;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.ecomiq-payment-provider__mono {
|
|
64
|
-
font-family: ui-monospace, monospace;
|
|
65
|
-
font-size: 0.75rem;
|
|
66
|
-
word-break: break-all;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.ecomiq-payment-provider__details {
|
|
70
|
-
border: 1px dashed #d9d9d9;
|
|
71
|
-
border-radius: 5px;
|
|
72
|
-
padding: 0.5rem;
|
|
73
|
-
font-size: 0.75rem;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.ecomiq-payment-provider__details summary {
|
|
77
|
-
cursor: pointer;
|
|
78
|
-
font-weight: 500;
|
|
79
|
-
color: #6d6d6d;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.ecomiq-payment-provider__details pre {
|
|
83
|
-
margin: 0.5rem 0 0;
|
|
84
|
-
max-height: 12rem;
|
|
85
|
-
overflow: auto;
|
|
86
|
-
border-radius: 4px;
|
|
87
|
-
background: #f5f5f5;
|
|
88
|
-
padding: 0.5rem;
|
|
89
|
-
font-size: 0.6875rem;
|
|
90
|
-
line-height: 1.35;
|
|
91
|
-
}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
.ecomiq-thank-you-page {
|
|
2
|
-
--ty-bg: #ffffff;
|
|
3
|
-
--ty-border: #d9d9d9;
|
|
4
|
-
--ty-text: #121212;
|
|
5
|
-
--ty-muted: #6d6d6d;
|
|
6
|
-
--ty-success: #177245;
|
|
7
|
-
min-height: 100dvh;
|
|
8
|
-
background: #f6f6f6;
|
|
9
|
-
color: var(--ty-text);
|
|
10
|
-
font-family:
|
|
11
|
-
-apple-system,
|
|
12
|
-
BlinkMacSystemFont,
|
|
13
|
-
"Segoe UI",
|
|
14
|
-
Roboto,
|
|
15
|
-
Helvetica,
|
|
16
|
-
Arial,
|
|
17
|
-
sans-serif;
|
|
18
|
-
font-size: 14px;
|
|
19
|
-
line-height: 1.5;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.ecomiq-thank-you-page__top {
|
|
23
|
-
border-bottom: 1px solid var(--ty-border);
|
|
24
|
-
padding: 1.25rem 1.5rem;
|
|
25
|
-
text-align: center;
|
|
26
|
-
background: var(--ty-bg);
|
|
27
|
-
display: flex;
|
|
28
|
-
justify-content: center;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.ecomiq-thank-you-page__logo {
|
|
32
|
-
font-size: 1.5rem;
|
|
33
|
-
font-weight: 700;
|
|
34
|
-
letter-spacing: 0.2em;
|
|
35
|
-
text-transform: uppercase;
|
|
36
|
-
text-decoration: none;
|
|
37
|
-
color: inherit;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.ecomiq-thank-you-page__logo img {
|
|
41
|
-
max-height: 2.5rem;
|
|
42
|
-
width: auto;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.ecomiq-thank-you-page__main {
|
|
46
|
-
display: flex;
|
|
47
|
-
justify-content: center;
|
|
48
|
-
padding: 3rem 1.5rem 4rem;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.ecomiq-thank-you-page__card {
|
|
52
|
-
width: 100%;
|
|
53
|
-
max-width: 32rem;
|
|
54
|
-
text-align: center;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.ecomiq-thank-you-page__icon {
|
|
58
|
-
display: inline-flex;
|
|
59
|
-
align-items: center;
|
|
60
|
-
justify-content: center;
|
|
61
|
-
width: 3.25rem;
|
|
62
|
-
height: 3.25rem;
|
|
63
|
-
margin: 0 auto 1.5rem;
|
|
64
|
-
border-radius: 50%;
|
|
65
|
-
background: var(--ty-success);
|
|
66
|
-
color: #fff;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.ecomiq-thank-you-page__icon svg {
|
|
70
|
-
width: 1.65rem;
|
|
71
|
-
height: 1.65rem;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.ecomiq-thank-you-page__title {
|
|
75
|
-
margin: 0 0 1.25rem;
|
|
76
|
-
font-size: clamp(1.5rem, 4vw, 1.875rem);
|
|
77
|
-
font-weight: 600;
|
|
78
|
-
letter-spacing: -0.02em;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
.ecomiq-thank-you-page__text {
|
|
82
|
-
margin: 0 0 0.75rem;
|
|
83
|
-
font-size: 0.9375rem;
|
|
84
|
-
color: var(--ty-text);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.ecomiq-thank-you-page__text strong {
|
|
88
|
-
font-weight: 600;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.ecomiq-thank-you-page__text--muted {
|
|
92
|
-
color: var(--ty-muted);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.ecomiq-thank-you-page__actions {
|
|
96
|
-
margin-top: 2rem;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.ecomiq-thank-you-page__link {
|
|
100
|
-
display: inline-block;
|
|
101
|
-
font-size: 0.875rem;
|
|
102
|
-
color: var(--ty-text);
|
|
103
|
-
text-decoration: underline;
|
|
104
|
-
text-underline-offset: 2px;
|
|
105
|
-
}
|
package/dist/react.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./chunks/client";
|
package/dist/react.js
DELETED
package/dist/react.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
type StoreProxyHandlerConfig = {
|
|
2
|
-
/** Base URL del API de storefront. Default: `https://storefront.ecomiq.pe` */
|
|
3
|
-
apiBaseUrl?: string;
|
|
4
|
-
};
|
|
5
|
-
/**
|
|
6
|
-
* Proxy BFF `/api/store/*` → upstream Ecomiq. Usa Web Fetch API (`Request` / `Response`).
|
|
7
|
-
*/
|
|
8
|
-
declare function handleStoreProxyRequest(request: Request, pathSegments: string[], config?: StoreProxyHandlerConfig): Promise<Response>;
|
|
9
|
-
|
|
10
|
-
export { type StoreProxyHandlerConfig as S, handleStoreProxyRequest as h };
|
package/dist/tanstack/api.d.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { S as StoreProxyHandlerConfig } from '../store-proxy-handler-CNzKlTFA.js';
|
|
2
|
-
export { h as handleStoreProxyRequest } from '../store-proxy-handler-CNzKlTFA.js';
|
|
3
|
-
|
|
4
|
-
type TanStackStoreApiHandlerConfig = StoreProxyHandlerConfig;
|
|
5
|
-
type TanStackStoreRouteParams = {
|
|
6
|
-
/** Splat de ruta `routes/api/store/$.ts` → `/api/store/products` → `"products"` */
|
|
7
|
-
_splat?: string;
|
|
8
|
-
/** Alternativa si pasas segmentos como string unido */
|
|
9
|
-
path?: string;
|
|
10
|
-
};
|
|
11
|
-
/** Convierte params de TanStack Start a segmentos de path del proxy. */
|
|
12
|
-
declare function tanStackStorePathSegments(params: TanStackStoreRouteParams): string[];
|
|
13
|
-
type TanStackHandlerContext = {
|
|
14
|
-
request: Request;
|
|
15
|
-
params: TanStackStoreRouteParams;
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* Handlers para server routes de TanStack Start (`routes/api/store/$.ts`).
|
|
19
|
-
*
|
|
20
|
-
* ```ts
|
|
21
|
-
* import { createFileRoute } from "@tanstack/react-router";
|
|
22
|
-
* import { createTanStackStoreApiHandler } from "@ecomiq/storefront/tanstack/api";
|
|
23
|
-
*
|
|
24
|
-
* const storeApi = createTanStackStoreApiHandler({
|
|
25
|
-
* apiBaseUrl: process.env.STOREFRONT_API_URL,
|
|
26
|
-
* });
|
|
27
|
-
*
|
|
28
|
-
* export const Route = createFileRoute("/api/store/$")({
|
|
29
|
-
* server: { handlers: storeApi },
|
|
30
|
-
* });
|
|
31
|
-
* ```
|
|
32
|
-
*/
|
|
33
|
-
declare function createTanStackStoreApiHandler(config?: TanStackStoreApiHandlerConfig): {
|
|
34
|
-
GET: ({ request, params }: TanStackHandlerContext) => Promise<Response>;
|
|
35
|
-
POST: ({ request, params }: TanStackHandlerContext) => Promise<Response>;
|
|
36
|
-
PUT: ({ request, params }: TanStackHandlerContext) => Promise<Response>;
|
|
37
|
-
PATCH: ({ request, params }: TanStackHandlerContext) => Promise<Response>;
|
|
38
|
-
DELETE: ({ request, params }: TanStackHandlerContext) => Promise<Response>;
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export { type TanStackStoreApiHandlerConfig, type TanStackStoreRouteParams, createTanStackStoreApiHandler, tanStackStorePathSegments };
|
package/dist/tanstack/api.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { handleStoreProxyRequest } from '../chunk-QRR7EPCH.js';
|
|
2
|
-
export { handleStoreProxyRequest } from '../chunk-QRR7EPCH.js';
|
|
3
|
-
import '../chunk-S7CPZ4UE.js';
|
|
4
|
-
import '../chunk-Q4U5OEUT.js';
|
|
5
|
-
|
|
6
|
-
// src/react/frameworks/tanstack/api/store-handler.ts
|
|
7
|
-
function tanStackStorePathSegments(params) {
|
|
8
|
-
const raw = params._splat ?? params.path ?? "";
|
|
9
|
-
return raw.split("/").filter(Boolean);
|
|
10
|
-
}
|
|
11
|
-
function createTanStackStoreApiHandler(config = {}) {
|
|
12
|
-
const handler = async ({ request, params }) => {
|
|
13
|
-
return handleStoreProxyRequest(
|
|
14
|
-
request,
|
|
15
|
-
tanStackStorePathSegments(params),
|
|
16
|
-
config
|
|
17
|
-
);
|
|
18
|
-
};
|
|
19
|
-
return {
|
|
20
|
-
GET: handler,
|
|
21
|
-
POST: handler,
|
|
22
|
-
PUT: handler,
|
|
23
|
-
PATCH: handler,
|
|
24
|
-
DELETE: handler
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export { createTanStackStoreApiHandler, tanStackStorePathSegments };
|
|
29
|
-
//# sourceMappingURL=api.js.map
|
|
30
|
-
//# sourceMappingURL=api.js.map
|
package/dist/tanstack/api.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/react/frameworks/tanstack/api/store-handler.ts"],"names":[],"mappings":";;;;;;AAeO,SAAS,0BACd,MAAA,EACU;AACV,EAAA,MAAM,GAAA,GAAM,MAAA,CAAO,MAAA,IAAU,MAAA,CAAO,IAAA,IAAQ,EAAA;AAC5C,EAAA,OAAO,GAAA,CAAI,KAAA,CAAM,GAAG,CAAA,CAAE,OAAO,OAAO,CAAA;AACtC;AAuBO,SAAS,6BAAA,CACd,MAAA,GAAwC,EAAC,EACzC;AACA,EAAA,MAAM,OAAA,GAAU,OAAO,EAAE,OAAA,EAAS,QAAO,KAA8B;AACrE,IAAA,OAAO,uBAAA;AAAA,MACL,OAAA;AAAA,MACA,0BAA0B,MAAM,CAAA;AAAA,MAChC;AAAA,KACF;AAAA,EACF,CAAA;AAEA,EAAA,OAAO;AAAA,IACL,GAAA,EAAK,OAAA;AAAA,IACL,IAAA,EAAM,OAAA;AAAA,IACN,GAAA,EAAK,OAAA;AAAA,IACL,KAAA,EAAO,OAAA;AAAA,IACP,MAAA,EAAQ;AAAA,GACV;AACF","file":"api.js","sourcesContent":["import {\n handleStoreProxyRequest,\n type StoreProxyHandlerConfig,\n} from \"../../../../core/server/store-proxy-handler\";\n\nexport type TanStackStoreApiHandlerConfig = StoreProxyHandlerConfig;\n\nexport type TanStackStoreRouteParams = {\n /** Splat de ruta `routes/api/store/$.ts` → `/api/store/products` → `\"products\"` */\n _splat?: string;\n /** Alternativa si pasas segmentos como string unido */\n path?: string;\n};\n\n/** Convierte params de TanStack Start a segmentos de path del proxy. */\nexport function tanStackStorePathSegments(\n params: TanStackStoreRouteParams,\n): string[] {\n const raw = params._splat ?? params.path ?? \"\";\n return raw.split(\"/\").filter(Boolean);\n}\n\ntype TanStackHandlerContext = {\n request: Request;\n params: TanStackStoreRouteParams;\n};\n\n/**\n * Handlers para server routes de TanStack Start (`routes/api/store/$.ts`).\n *\n * ```ts\n * import { createFileRoute } from \"@tanstack/react-router\";\n * import { createTanStackStoreApiHandler } from \"@ecomiq/storefront/tanstack/api\";\n *\n * const storeApi = createTanStackStoreApiHandler({\n * apiBaseUrl: process.env.STOREFRONT_API_URL,\n * });\n *\n * export const Route = createFileRoute(\"/api/store/$\")({\n * server: { handlers: storeApi },\n * });\n * ```\n */\nexport function createTanStackStoreApiHandler(\n config: TanStackStoreApiHandlerConfig = {},\n) {\n const handler = async ({ request, params }: TanStackHandlerContext) => {\n return handleStoreProxyRequest(\n request,\n tanStackStorePathSegments(params),\n config,\n );\n };\n\n return {\n GET: handler,\n POST: handler,\n PUT: handler,\n PATCH: handler,\n DELETE: handler,\n };\n}\n\nexport { handleStoreProxyRequest } from \"../../../../core/server/store-proxy-handler\";\n"]}
|
package/dist/tanstack.d.ts
DELETED
package/dist/tanstack.js
DELETED
package/dist/tanstack.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./chunks/server-tanstack";
|
package/dist/tanstack.server.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./chunks/server-tanstack.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":""}
|