shop-client 3.9.0 → 3.9.2
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 +65 -0
- package/dist/ai/enrich.d.ts +93 -0
- package/dist/ai/enrich.js +25 -0
- package/dist/checkout.js +6 -0
- package/dist/chunk-2MF53V33.js +196 -0
- package/dist/chunk-CN7L3BHG.js +147 -0
- package/dist/chunk-CXUCPK6X.js +460 -0
- package/dist/chunk-DJQEZNHG.js +233 -0
- package/dist/chunk-MOBWPEY4.js +420 -0
- package/dist/chunk-QUDGES3A.js +195 -0
- package/dist/chunk-RR6YTQWP.js +90 -0
- package/dist/chunk-VPPCOJC3.js +865 -0
- package/dist/collections.d.ts +2 -1
- package/dist/collections.js +8 -0
- package/dist/index.d.ts +7 -84
- package/dist/index.js +753 -0
- package/dist/products.d.ts +2 -1
- package/dist/products.js +8 -0
- package/dist/store.d.ts +53 -1
- package/dist/store.js +9 -0
- package/dist/{store-iQARl6J3.d.ts → types-luPg5O08.d.ts} +1 -208
- package/dist/utils/detect-country.d.ts +32 -0
- package/dist/utils/detect-country.js +6 -0
- package/dist/utils/func.d.ts +61 -0
- package/dist/utils/func.js +24 -0
- package/dist/utils/rate-limit.js +10 -0
- package/package.json +16 -3
- package/dist/checkout.mjs +0 -1
- package/dist/chunk-6GPWNCDO.mjs +0 -130
- package/dist/chunk-EJO5U4BT.mjs +0 -2
- package/dist/chunk-FFKWCNLU.mjs +0 -1
- package/dist/chunk-KYLPIEU3.mjs +0 -2
- package/dist/chunk-MB2INNNP.mjs +0 -1
- package/dist/chunk-MI7754VX.mjs +0 -2
- package/dist/chunk-SZQPMLZG.mjs +0 -1
- package/dist/collections.mjs +0 -1
- package/dist/enrich-OZHBXKK6.mjs +0 -1
- package/dist/index.mjs +0 -2
- package/dist/products.mjs +0 -1
- package/dist/store.mjs +0 -1
- package/dist/utils/rate-limit.mjs +0 -1
package/dist/collections.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StoreInfo } from './store.js';
|
|
2
|
+
import { C as Collection, f as CurrencyCode, P as Product, b as ShopifyCollection } from './types-luPg5O08.js';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Interface for collection operations
|
package/dist/index.d.ts
CHANGED
|
@@ -1,91 +1,14 @@
|
|
|
1
1
|
import { CheckoutOperations } from './checkout.js';
|
|
2
2
|
import { CollectionOperations } from './collections.js';
|
|
3
3
|
import { ProductOperations } from './products.js';
|
|
4
|
-
import {
|
|
5
|
-
|
|
4
|
+
import { StoreOperations, StoreInfo } from './store.js';
|
|
5
|
+
import { S as ShopifyProduct, P as Product, a as ShopifySingleProduct, b as ShopifyCollection, C as Collection, c as StoreTypeBreakdown } from './types-luPg5O08.js';
|
|
6
|
+
export { d as CountryDetectionResult, e as CountryScores, f as CurrencyCode, L as LocalizedPricing, M as MetaTag, g as ProductImage, h as ProductOption, i as ProductVariant, j as ProductVariantImage } from './types-luPg5O08.js';
|
|
7
|
+
export { classifyProduct, generateSEOContent } from './ai/enrich.js';
|
|
8
|
+
export { detectShopCountry } from './utils/detect-country.js';
|
|
9
|
+
export { calculateDiscount, extractDomainWithoutSuffix, genProductSlug, generateStoreSlug, safeParseDate, sanitizeDomain } from './utils/func.js';
|
|
6
10
|
export { configureRateLimit } from './utils/rate-limit.js';
|
|
7
11
|
|
|
8
|
-
/**
|
|
9
|
-
* Classify product content into a three-tier hierarchy using LLM.
|
|
10
|
-
* Returns strictly validated JSON with audience, vertical, and optional category/subCategory.
|
|
11
|
-
*/
|
|
12
|
-
declare function classifyProduct(productContent: string, options?: {
|
|
13
|
-
apiKey?: string;
|
|
14
|
-
model?: string;
|
|
15
|
-
}): Promise<ProductClassification>;
|
|
16
|
-
/**
|
|
17
|
-
* Generate SEO and marketing content for a product. Returns strictly validated JSON.
|
|
18
|
-
*/
|
|
19
|
-
declare function generateSEOContent(product: {
|
|
20
|
-
title: string;
|
|
21
|
-
description?: string;
|
|
22
|
-
vendor?: string;
|
|
23
|
-
price?: number;
|
|
24
|
-
tags?: string[];
|
|
25
|
-
}, options?: {
|
|
26
|
-
apiKey?: string;
|
|
27
|
-
model?: string;
|
|
28
|
-
}): Promise<SEOContent>;
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Detects the country of a Shopify store by analyzing various signals in the HTML content.
|
|
32
|
-
*
|
|
33
|
-
* This function examines multiple data sources within the HTML to determine the store's country:
|
|
34
|
-
* - Shopify features JSON data (country, locale, money format)
|
|
35
|
-
* - Phone number prefixes in contact information
|
|
36
|
-
* - JSON-LD structured data with address information
|
|
37
|
-
* - Footer mentions of country names
|
|
38
|
-
* - Currency symbols in money formatting
|
|
39
|
-
*
|
|
40
|
-
* @param html - The HTML content of the Shopify store's homepage
|
|
41
|
-
* @returns Promise resolving to country detection results containing:
|
|
42
|
-
* - `country` - The detected country ISO 3166-1 alpha-2 code (e.g., "US", "GB") or "Unknown" if no reliable detection
|
|
43
|
-
* - `confidence` - Confidence score between 0 and 1 (higher = more confident)
|
|
44
|
-
* - `signals` - Array of detection signals that contributed to the result
|
|
45
|
-
*
|
|
46
|
-
* @example
|
|
47
|
-
* ```typescript
|
|
48
|
-
* const response = await fetch('https://exampleshop.com');
|
|
49
|
-
* const html = await response.text();
|
|
50
|
-
* const result = await detectShopifyCountry(html);
|
|
51
|
-
*
|
|
52
|
-
* console.log(result.country); // "US" (ISO code for United States)
|
|
53
|
-
* console.log(result.confidence); // 0.85
|
|
54
|
-
* console.log(result.signals); // ["shopify-features.country", "phone prefix +1"]
|
|
55
|
-
* ```
|
|
56
|
-
*/
|
|
57
|
-
declare function detectShopifyCountry(html: string): Promise<CountryDetectionResult>;
|
|
58
|
-
|
|
59
|
-
declare function extractDomainWithoutSuffix(domain: string): string | null;
|
|
60
|
-
declare function generateStoreSlug(domain: string): string;
|
|
61
|
-
declare const genProductSlug: ({ handle, storeDomain, }: {
|
|
62
|
-
handle: string;
|
|
63
|
-
storeDomain: string;
|
|
64
|
-
}) => string;
|
|
65
|
-
declare const calculateDiscount: (price: number, compareAtPrice?: number) => number;
|
|
66
|
-
/**
|
|
67
|
-
* Normalize and sanitize a domain string.
|
|
68
|
-
*
|
|
69
|
-
* Accepts inputs like full URLs, protocol-relative URLs, bare hostnames,
|
|
70
|
-
* or strings with paths/query/fragment, and returns a normalized domain.
|
|
71
|
-
*
|
|
72
|
-
* Examples:
|
|
73
|
-
* - "https://WWW.Example.com/path" -> "example.com"
|
|
74
|
-
* - "//sub.example.co.uk" -> "example.co.uk"
|
|
75
|
-
* - "www.example.com:8080" -> "example.com"
|
|
76
|
-
* - "example" -> "example"
|
|
77
|
-
*/
|
|
78
|
-
declare function sanitizeDomain(input: string, opts?: {
|
|
79
|
-
stripWWW?: boolean;
|
|
80
|
-
}): string;
|
|
81
|
-
/**
|
|
82
|
-
* Safely parse a date string into a Date object.
|
|
83
|
-
*
|
|
84
|
-
* Returns `undefined` when input is falsy or cannot be parsed into a valid date.
|
|
85
|
-
* Use `|| null` at call sites that expect `null` instead of `undefined`.
|
|
86
|
-
*/
|
|
87
|
-
declare function safeParseDate(input?: string | null): Date | undefined;
|
|
88
|
-
|
|
89
12
|
/**
|
|
90
13
|
* A comprehensive Shopify store client for fetching products, collections, and store information.
|
|
91
14
|
*
|
|
@@ -248,4 +171,4 @@ declare class ShopClient {
|
|
|
248
171
|
}): Promise<StoreTypeBreakdown>;
|
|
249
172
|
}
|
|
250
173
|
|
|
251
|
-
export { CheckoutOperations, Collection, CollectionOperations,
|
|
174
|
+
export { CheckoutOperations, Collection, CollectionOperations, Product, ProductOperations, ShopClient, type ShopClientOptions, StoreInfo, StoreOperations, StoreTypeBreakdown };
|