@trustrails/sdk 0.4.0 → 0.4.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 +15 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -62,8 +62,12 @@ new TrustRails({ apiKey: string, baseUrl?: string })
|
|
|
62
62
|
Search for products.
|
|
63
63
|
|
|
64
64
|
**Parameters:**
|
|
65
|
-
- `options.query?: string` - Search query string
|
|
66
|
-
- `options.
|
|
65
|
+
- `options.query?: string` - Search query string (searches title, brand, category)
|
|
66
|
+
- `options.brand?: string` - Filter by brand name (e.g., 'Sony', 'HP', 'Anker')
|
|
67
|
+
- `options.category?: string` - Filter by product category (e.g., 'Laptops', 'Headphones')
|
|
68
|
+
- `options.minPrice?: number` - Minimum price filter in GBP
|
|
69
|
+
- `options.maxPrice?: number` - Maximum price filter in GBP
|
|
70
|
+
- `options.limit?: number` - Maximum number of results (default: 20, max: 100)
|
|
67
71
|
|
|
68
72
|
**Returns:** Promise resolving to `SearchResponse` containing `products` array and `total` count.
|
|
69
73
|
|
|
@@ -71,7 +75,11 @@ Search for products.
|
|
|
71
75
|
```typescript
|
|
72
76
|
const results = await trustrails.search({
|
|
73
77
|
query: 'laptop',
|
|
74
|
-
|
|
78
|
+
brand: 'HP',
|
|
79
|
+
minPrice: 400,
|
|
80
|
+
maxPrice: 1000,
|
|
81
|
+
category: 'Laptops',
|
|
82
|
+
limit: 10
|
|
75
83
|
});
|
|
76
84
|
```
|
|
77
85
|
|
|
@@ -120,7 +128,11 @@ interface Product {
|
|
|
120
128
|
```typescript
|
|
121
129
|
interface SearchOptions {
|
|
122
130
|
query?: string;
|
|
131
|
+
brand?: string;
|
|
132
|
+
category?: string;
|
|
133
|
+
minPrice?: number;
|
|
123
134
|
maxPrice?: number;
|
|
135
|
+
limit?: number;
|
|
124
136
|
}
|
|
125
137
|
```
|
|
126
138
|
|