@frontic/nuxt 0.1.13 → 0.1.14

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.
@@ -72,7 +72,7 @@ export declare function useFronticPage(slug?: MaybeRef<string>, options?: UseFro
72
72
  /**
73
73
  * Route metadata (code, redirect, alternates, context)
74
74
  */
75
- route: ComputedRef<PageRoute | undefined>;
75
+ route: ComputedRef<RouteMeta | undefined>;
76
76
  /**
77
77
  * Alternate URLs for hreflang tags
78
78
  */
@@ -80,7 +80,7 @@ export declare function useFronticPage(slug?: MaybeRef<string>, options?: UseFro
80
80
  /**
81
81
  * Suggested route when context changes (for locale switching)
82
82
  */
83
- suggested: ComputedRef<string | undefined>;
83
+ suggested: ComputedRef<AlternateRoute | undefined>;
84
84
  /**
85
85
  * Query status: 'pending' | 'error' | 'success'
86
86
  */
@@ -6,8 +6,9 @@
6
6
  *
7
7
  * For simple listing access without search features, use useFronticListing instead.
8
8
  */
9
+ import { type ComputedRef, type ShallowRef } from 'vue';
9
10
  import type { MaybeRef } from 'vue';
10
- import type { Listings, ListingParameters, ListingQueryFilters, ListingQuerySorts } from '@frontic/stack/generated-types';
11
+ import type { Listings, ListingParameters, ListingQueryFilters, ListingQuerySorts, Responses } from '@frontic/stack/generated-types';
11
12
  import type { UseFronticSearchOptions, SearchState } from '../types/search.js';
12
13
  /**
13
14
  * Full-featured composable for managing Frontic search listings with filtering, sorting, and pagination
@@ -40,15 +41,15 @@ export declare function useFronticSearch<TSearch extends keyof Listings, TFilter
40
41
  /**
41
42
  * The full listing response containing items, pagination info, and filter metadata.
42
43
  */
43
- data: import("vue").ShallowRef<unknown>;
44
+ data: ShallowRef<Responses[TSearch] | undefined>;
44
45
  /**
45
46
  * The items array from the listing response.
46
47
  */
47
- result: import("vue").ComputedRef<unknown[] | undefined>;
48
+ result: ComputedRef<Responses[TSearch] | undefined>;
48
49
  /**
49
50
  * Query status: 'pending' | 'error' | 'success'
50
51
  */
51
- status: import("vue").ShallowRef<import("@pinia/colada").DataStateStatus>;
52
+ status: ShallowRef<import("@pinia/colada").DataStateStatus>;
52
53
  /**
53
54
  * Current search state including active filters, sorts, pagination, and available options.
54
55
  * Use this to build filter/sort UI components.
@@ -107,22 +107,35 @@ declare interface Page {
107
107
  id?: string
108
108
  slug?: string
109
109
  title?: string
110
+ type?: string
111
+ block?: string
110
112
  meta?: Record<string, unknown>
111
113
  data?: Record<string, unknown>
112
- route?: PageRoute
114
+ route?: RouteMeta
113
115
  }
114
116
 
115
117
  declare interface PageRoute {
116
- code?: number
117
- redirect?: { path: string }
118
- alternates?: AlternateRoute[]
119
- context?: { suggested?: string }
118
+ href: string
119
+ path: string
120
+ slug: string
121
+ url: string
120
122
  }
121
123
 
122
- declare interface AlternateRoute {
123
- locale?: string
124
+ declare interface AlternateRoute extends PageRoute {
125
+ locale: string
126
+ region: string
124
127
  lang?: string
125
- href: string
128
+ }
129
+
130
+ declare interface RouteMeta {
131
+ code: 200 | 301 | 404
132
+ redirect?: PageRoute
133
+ alternates?: AlternateRoute[]
134
+ context?: {
135
+ region: string
136
+ locale: string
137
+ suggested?: AlternateRoute
138
+ }
126
139
  }
127
140
 
128
141
  declare interface Context {
@@ -1,5 +1,4 @@
1
1
  import { proxyRequest, getHeader, createError, defineEventHandler } from "h3";
2
- import { useRuntimeConfig } from "nuxt/app";
3
2
  export default defineEventHandler(async (event) => {
4
3
  const targetUrl = getHeader(event, "fs-target-url");
5
4
  if (!targetUrl) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontic/nuxt",
3
- "version": "0.1.13",
3
+ "version": "0.1.14",
4
4
  "description": "Nuxt module for Frontstack headless commerce - zero config data fetching composables with smart caching, page routing, and context management",
5
5
  "license": "MIT",
6
6
  "author": "Frontic",