chore: bump task worker version comment
Force new git SHA to avoid CI scientific notation bug. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
52
backend/scripts/test-treez-api.ts
Normal file
52
backend/scripts/test-treez-api.ts
Normal file
@@ -0,0 +1,52 @@
|
||||
import axios from 'axios';
|
||||
|
||||
async function main() {
|
||||
const url = 'https://search-kyrok9udlk.gapcommerceapi.com/product/search';
|
||||
|
||||
const query = {
|
||||
from: 0,
|
||||
size: 500,
|
||||
query: {
|
||||
bool: {
|
||||
must: [
|
||||
{ bool: { filter: { range: { customMinPrice: { gte: 0.01, lte: 500000 }}}}},
|
||||
{ bool: { should: [{ match: { isAboveThreshold: true }}]}},
|
||||
{ bool: { should: [{ match: { isHideFromMenu: false }}]}}
|
||||
]
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
console.log('Querying Treez Elasticsearch API...\n');
|
||||
|
||||
try {
|
||||
const response = await axios.post(url, query, {
|
||||
headers: { 'Content-Type': 'application/json' }
|
||||
});
|
||||
|
||||
const data = response.data;
|
||||
const total = data.hits?.total?.value || data.hits?.total;
|
||||
const products = data.hits?.hits || [];
|
||||
|
||||
console.log('Total products: ' + total);
|
||||
console.log('Products returned: ' + products.length + '\n');
|
||||
|
||||
if (products.length > 0) {
|
||||
const first = products[0]._source;
|
||||
console.log('=== PRODUCT FIELDS AVAILABLE ===\n');
|
||||
console.log(Object.keys(first).sort().join('\n'));
|
||||
|
||||
console.log('\n=== SAMPLE PRODUCT ===\n');
|
||||
console.log(JSON.stringify(first, null, 2));
|
||||
}
|
||||
|
||||
} catch (err: any) {
|
||||
console.log('Error: ' + err.message);
|
||||
if (err.response) {
|
||||
console.log('Status: ' + err.response.status);
|
||||
console.log('Data: ' + JSON.stringify(err.response.data));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
main();
|
||||
Reference in New Issue
Block a user