@pvh-afl/graphql 1.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 +135 -0
- package/dist/cart/cart.hooks.d.ts +66 -0
- package/dist/cart/cart.hooks.d.ts.map +1 -0
- package/dist/cart/cart.hooks.js +12 -0
- package/dist/cart/cart.hooks.js.map +1 -0
- package/dist/cart/cart.module.d.ts +25 -0
- package/dist/cart/cart.module.d.ts.map +1 -0
- package/dist/cart/cart.module.js +44 -0
- package/dist/cart/cart.module.js.map +1 -0
- package/dist/cart/cart.resolver.d.ts +23 -0
- package/dist/cart/cart.resolver.d.ts.map +1 -0
- package/dist/cart/cart.resolver.js +153 -0
- package/dist/cart/cart.resolver.js.map +1 -0
- package/dist/cart/cart.service.d.ts +31 -0
- package/dist/cart/cart.service.d.ts.map +1 -0
- package/dist/cart/cart.service.js +305 -0
- package/dist/cart/cart.service.js.map +1 -0
- package/dist/cart/cart.types.d.ts +144 -0
- package/dist/cart/cart.types.d.ts.map +1 -0
- package/dist/cart/cart.types.js +629 -0
- package/dist/cart/cart.types.js.map +1 -0
- package/dist/cart/index.d.ts +6 -0
- package/dist/cart/index.d.ts.map +1 -0
- package/dist/cart/index.js +9 -0
- package/dist/cart/index.js.map +1 -0
- package/dist/cms/cms.module.d.ts +3 -0
- package/dist/cms/cms.module.d.ts.map +1 -0
- package/dist/cms/cms.module.js +18 -0
- package/dist/cms/cms.module.js.map +1 -0
- package/dist/cms/cms.resolver.d.ts +15 -0
- package/dist/cms/cms.resolver.d.ts.map +1 -0
- package/dist/cms/cms.resolver.js +44 -0
- package/dist/cms/cms.resolver.js.map +1 -0
- package/dist/cms/cms.service.d.ts +14 -0
- package/dist/cms/cms.service.d.ts.map +1 -0
- package/dist/cms/cms.service.js +111 -0
- package/dist/cms/cms.service.js.map +1 -0
- package/dist/cms/cms.types.d.ts +20 -0
- package/dist/cms/cms.types.d.ts.map +1 -0
- package/dist/cms/cms.types.js +89 -0
- package/dist/cms/cms.types.js.map +1 -0
- package/dist/cms/index.d.ts +5 -0
- package/dist/cms/index.d.ts.map +1 -0
- package/dist/cms/index.js +8 -0
- package/dist/cms/index.js.map +1 -0
- package/dist/collection/collection.module.d.ts +3 -0
- package/dist/collection/collection.module.d.ts.map +1 -0
- package/dist/collection/collection.module.js +19 -0
- package/dist/collection/collection.module.js.map +1 -0
- package/dist/collection/collection.resolver.d.ts +15 -0
- package/dist/collection/collection.resolver.d.ts.map +1 -0
- package/dist/collection/collection.resolver.js +45 -0
- package/dist/collection/collection.resolver.js.map +1 -0
- package/dist/collection/collection.service.d.ts +19 -0
- package/dist/collection/collection.service.d.ts.map +1 -0
- package/dist/collection/collection.service.js +132 -0
- package/dist/collection/collection.service.js.map +1 -0
- package/dist/collection/collection.types.d.ts +18 -0
- package/dist/collection/collection.types.d.ts.map +1 -0
- package/dist/collection/collection.types.js +75 -0
- package/dist/collection/collection.types.js.map +1 -0
- package/dist/collection/index.d.ts +5 -0
- package/dist/collection/index.d.ts.map +1 -0
- package/dist/collection/index.js +8 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/common/index.d.ts +8 -0
- package/dist/common/index.d.ts.map +1 -0
- package/dist/common/index.js +16 -0
- package/dist/common/index.js.map +1 -0
- package/dist/graphql.module.d.ts +3 -0
- package/dist/graphql.module.d.ts.map +1 -0
- package/dist/graphql.module.js +46 -0
- package/dist/graphql.module.js.map +1 -0
- package/dist/header/header.module.d.ts +9 -0
- package/dist/header/header.module.d.ts.map +1 -0
- package/dist/header/header.module.js +21 -0
- package/dist/header/header.module.js.map +1 -0
- package/dist/header/header.resolver.d.ts +18 -0
- package/dist/header/header.resolver.d.ts.map +1 -0
- package/dist/header/header.resolver.js +42 -0
- package/dist/header/header.resolver.js.map +1 -0
- package/dist/header/index.d.ts +4 -0
- package/dist/header/index.d.ts.map +1 -0
- package/dist/header/index.js +7 -0
- package/dist/header/index.js.map +1 -0
- package/dist/header/types/header.types.d.ts +36 -0
- package/dist/header/types/header.types.d.ts.map +1 -0
- package/dist/header/types/header.types.js +154 -0
- package/dist/header/types/header.types.js.map +1 -0
- package/dist/header/types/index.d.ts +3 -0
- package/dist/header/types/index.d.ts.map +1 -0
- package/dist/header/types/index.js +6 -0
- package/dist/header/types/index.js.map +1 -0
- package/dist/header/types/response.types.d.ts +13 -0
- package/dist/header/types/response.types.d.ts.map +1 -0
- package/dist/header/types/response.types.js +54 -0
- package/dist/header/types/response.types.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +29 -0
- package/dist/index.js.map +1 -0
- package/dist/page-content/index.d.ts +5 -0
- package/dist/page-content/index.d.ts.map +1 -0
- package/dist/page-content/index.js +8 -0
- package/dist/page-content/index.js.map +1 -0
- package/dist/page-content/page-content.module.d.ts +9 -0
- package/dist/page-content/page-content.module.d.ts.map +1 -0
- package/dist/page-content/page-content.module.js +25 -0
- package/dist/page-content/page-content.module.js.map +1 -0
- package/dist/page-content/page-content.resolver.d.ts +18 -0
- package/dist/page-content/page-content.resolver.d.ts.map +1 -0
- package/dist/page-content/page-content.resolver.js +42 -0
- package/dist/page-content/page-content.resolver.js.map +1 -0
- package/dist/page-content/page-content.service.d.ts +59 -0
- package/dist/page-content/page-content.service.d.ts.map +1 -0
- package/dist/page-content/page-content.service.js +253 -0
- package/dist/page-content/page-content.service.js.map +1 -0
- package/dist/page-content/types/common.types.d.ts +49 -0
- package/dist/page-content/types/common.types.d.ts.map +1 -0
- package/dist/page-content/types/common.types.js +217 -0
- package/dist/page-content/types/common.types.js.map +1 -0
- package/dist/page-content/types/index.d.ts +4 -0
- package/dist/page-content/types/index.d.ts.map +1 -0
- package/dist/page-content/types/index.js +7 -0
- package/dist/page-content/types/index.js.map +1 -0
- package/dist/page-content/types/response.types.d.ts +8 -0
- package/dist/page-content/types/response.types.d.ts.map +1 -0
- package/dist/page-content/types/response.types.js +29 -0
- package/dist/page-content/types/response.types.js.map +1 -0
- package/dist/page-content/types/section.types.d.ts +276 -0
- package/dist/page-content/types/section.types.d.ts.map +1 -0
- package/dist/page-content/types/section.types.js +1252 -0
- package/dist/page-content/types/section.types.js.map +1 -0
- package/dist/product/index.d.ts +5 -0
- package/dist/product/index.d.ts.map +1 -0
- package/dist/product/index.js +8 -0
- package/dist/product/index.js.map +1 -0
- package/dist/product/product.module.d.ts +3 -0
- package/dist/product/product.module.d.ts.map +1 -0
- package/dist/product/product.module.js +19 -0
- package/dist/product/product.module.js.map +1 -0
- package/dist/product/product.resolver.d.ts +15 -0
- package/dist/product/product.resolver.d.ts.map +1 -0
- package/dist/product/product.resolver.js +45 -0
- package/dist/product/product.resolver.js.map +1 -0
- package/dist/product/product.service.d.ts +38 -0
- package/dist/product/product.service.d.ts.map +1 -0
- package/dist/product/product.service.js +337 -0
- package/dist/product/product.service.js.map +1 -0
- package/dist/product/product.types.d.ts +63 -0
- package/dist/product/product.types.d.ts.map +1 -0
- package/dist/product/product.types.js +276 -0
- package/dist/product/product.types.js.map +1 -0
- package/dist/product-content/index.d.ts +5 -0
- package/dist/product-content/index.d.ts.map +1 -0
- package/dist/product-content/index.js +8 -0
- package/dist/product-content/index.js.map +1 -0
- package/dist/product-content/product-content.module.d.ts +3 -0
- package/dist/product-content/product-content.module.d.ts.map +1 -0
- package/dist/product-content/product-content.module.js +27 -0
- package/dist/product-content/product-content.module.js.map +1 -0
- package/dist/product-content/product-content.resolver.d.ts +20 -0
- package/dist/product-content/product-content.resolver.d.ts.map +1 -0
- package/dist/product-content/product-content.resolver.js +44 -0
- package/dist/product-content/product-content.resolver.js.map +1 -0
- package/dist/product-content/product-content.service.d.ts +40 -0
- package/dist/product-content/product-content.service.d.ts.map +1 -0
- package/dist/product-content/product-content.service.js +239 -0
- package/dist/product-content/product-content.service.js.map +1 -0
- package/dist/product-content/types/common.types.d.ts +85 -0
- package/dist/product-content/types/common.types.d.ts.map +1 -0
- package/dist/product-content/types/common.types.js +384 -0
- package/dist/product-content/types/common.types.js.map +1 -0
- package/dist/product-content/types/index.d.ts +3 -0
- package/dist/product-content/types/index.d.ts.map +1 -0
- package/dist/product-content/types/index.js +6 -0
- package/dist/product-content/types/index.js.map +1 -0
- package/dist/product-content/types/response.types.d.ts +10 -0
- package/dist/product-content/types/response.types.d.ts.map +1 -0
- package/dist/product-content/types/response.types.js +39 -0
- package/dist/product-content/types/response.types.js.map +1 -0
- package/dist/serviceability/index.d.ts +5 -0
- package/dist/serviceability/index.d.ts.map +1 -0
- package/dist/serviceability/index.js +8 -0
- package/dist/serviceability/index.js.map +1 -0
- package/dist/serviceability/serviceability.module.d.ts +3 -0
- package/dist/serviceability/serviceability.module.d.ts.map +1 -0
- package/dist/serviceability/serviceability.module.js +18 -0
- package/dist/serviceability/serviceability.module.js.map +1 -0
- package/dist/serviceability/serviceability.resolver.d.ts +19 -0
- package/dist/serviceability/serviceability.resolver.d.ts.map +1 -0
- package/dist/serviceability/serviceability.resolver.js +40 -0
- package/dist/serviceability/serviceability.resolver.js.map +1 -0
- package/dist/serviceability/serviceability.service.d.ts +42 -0
- package/dist/serviceability/serviceability.service.d.ts.map +1 -0
- package/dist/serviceability/serviceability.service.js +169 -0
- package/dist/serviceability/serviceability.service.js.map +1 -0
- package/dist/serviceability/serviceability.types.d.ts +42 -0
- package/dist/serviceability/serviceability.types.d.ts.map +1 -0
- package/dist/serviceability/serviceability.types.js +184 -0
- package/dist/serviceability/serviceability.types.js.map +1 -0
- package/package.json +67 -0
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProductContentService = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const common_1 = require("@nestjs/common");
|
|
6
|
+
const core_1 = require("@pvh-afl/core");
|
|
7
|
+
const product_service_1 = require("../product/product.service");
|
|
8
|
+
const collection_service_1 = require("../collection/collection.service");
|
|
9
|
+
/**
|
|
10
|
+
* Product Content Service
|
|
11
|
+
*
|
|
12
|
+
* Provides product content with theme template integration.
|
|
13
|
+
* See original implementation in afl repo for full logic.
|
|
14
|
+
*/
|
|
15
|
+
let ProductContentService = class ProductContentService {
|
|
16
|
+
cacheService;
|
|
17
|
+
configService;
|
|
18
|
+
productService;
|
|
19
|
+
collectionService;
|
|
20
|
+
shopifyThemeService;
|
|
21
|
+
constructor(cacheService, configService, productService, collectionService, shopifyThemeService) {
|
|
22
|
+
this.cacheService = cacheService;
|
|
23
|
+
this.configService = configService;
|
|
24
|
+
this.productService = productService;
|
|
25
|
+
this.collectionService = collectionService;
|
|
26
|
+
this.shopifyThemeService = shopifyThemeService;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Get product content by slug/handle.
|
|
30
|
+
* Returns sections array with product data mapped into blocks.
|
|
31
|
+
*/
|
|
32
|
+
async getProductBySlug(brand, slug) {
|
|
33
|
+
const normalizedSlug = slug.toLowerCase();
|
|
34
|
+
try {
|
|
35
|
+
// Fetch product data
|
|
36
|
+
const product = await this.productService.getProductByHandle(brand, normalizedSlug);
|
|
37
|
+
if (!product) {
|
|
38
|
+
return {
|
|
39
|
+
success: false,
|
|
40
|
+
error: {
|
|
41
|
+
code: 'PRODUCT_NOT_FOUND',
|
|
42
|
+
message: `Product not found: ${normalizedSlug}`,
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
// Build sections array with product data mapped in
|
|
47
|
+
const sections = await this.buildSections(brand, normalizedSlug, product);
|
|
48
|
+
core_1.logger.info('Product content fetched', {
|
|
49
|
+
brand,
|
|
50
|
+
slug: normalizedSlug,
|
|
51
|
+
productId: product.id,
|
|
52
|
+
sectionsCount: sections.length,
|
|
53
|
+
});
|
|
54
|
+
return {
|
|
55
|
+
success: true,
|
|
56
|
+
data: {
|
|
57
|
+
sections,
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
core_1.logger.error('Failed to fetch product content', {
|
|
63
|
+
brand,
|
|
64
|
+
slug: normalizedSlug,
|
|
65
|
+
error: error instanceof Error ? error.message : 'Unknown',
|
|
66
|
+
});
|
|
67
|
+
return {
|
|
68
|
+
success: false,
|
|
69
|
+
error: {
|
|
70
|
+
code: 'INTERNAL_ERROR',
|
|
71
|
+
message: 'Failed to fetch product content',
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Build sections array from theme template, enriched with product data.
|
|
78
|
+
*/
|
|
79
|
+
async buildSections(brand, handle, product) {
|
|
80
|
+
// Get theme template
|
|
81
|
+
const templateConfig = await this.shopifyThemeService.getThemeAsset(brand, 'templates/product.json');
|
|
82
|
+
if (!templateConfig) {
|
|
83
|
+
core_1.logger.error('Failed to load product theme template', { brand, handle });
|
|
84
|
+
return [];
|
|
85
|
+
}
|
|
86
|
+
const { sections: sectionConfigs, order } = templateConfig;
|
|
87
|
+
const sections = [];
|
|
88
|
+
for (const sectionId of order) {
|
|
89
|
+
const sectionConfig = sectionConfigs[sectionId];
|
|
90
|
+
if (!sectionConfig)
|
|
91
|
+
continue;
|
|
92
|
+
const section = {
|
|
93
|
+
id: sectionId,
|
|
94
|
+
type: sectionConfig.type,
|
|
95
|
+
settings: sectionConfig.settings,
|
|
96
|
+
};
|
|
97
|
+
// Build blocks for main section
|
|
98
|
+
if (sectionId === 'main' && sectionConfig.blocks && sectionConfig.block_order) {
|
|
99
|
+
section.blocks = this.buildBlocks(sectionConfig, product);
|
|
100
|
+
}
|
|
101
|
+
sections.push(section);
|
|
102
|
+
}
|
|
103
|
+
// Resolve product recommendations
|
|
104
|
+
const resolvedSections = await this.resolveRecommendationSections(brand, product.id, sections);
|
|
105
|
+
return resolvedSections;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Build blocks array for a section, enriched with product data.
|
|
109
|
+
*/
|
|
110
|
+
buildBlocks(sectionConfig, product) {
|
|
111
|
+
const { blocks, block_order } = sectionConfig;
|
|
112
|
+
if (!blocks || !block_order)
|
|
113
|
+
return [];
|
|
114
|
+
return block_order
|
|
115
|
+
.filter((blockKey) => blocks[blockKey])
|
|
116
|
+
.map((blockKey) => {
|
|
117
|
+
const blockConfig = blocks[blockKey];
|
|
118
|
+
return {
|
|
119
|
+
type: blockConfig.type,
|
|
120
|
+
settings: blockConfig.settings,
|
|
121
|
+
data: this.getBlockData(blockConfig.type, product),
|
|
122
|
+
};
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Get the relevant product data for a specific block type.
|
|
127
|
+
*/
|
|
128
|
+
getBlockData(blockType, product) {
|
|
129
|
+
switch (blockType) {
|
|
130
|
+
case 'title':
|
|
131
|
+
return {
|
|
132
|
+
title: product.title,
|
|
133
|
+
vendor: product.vendor,
|
|
134
|
+
productType: product.productType,
|
|
135
|
+
tags: product.tags,
|
|
136
|
+
};
|
|
137
|
+
case 'price':
|
|
138
|
+
return {
|
|
139
|
+
priceRange: product.priceRange,
|
|
140
|
+
defaultPrice: product.variants[0]?.price,
|
|
141
|
+
defaultCompareAtPrice: product.variants[0]?.compareAtPrice,
|
|
142
|
+
};
|
|
143
|
+
case 'variant_selector':
|
|
144
|
+
return {
|
|
145
|
+
options: product.options.map((opt) => ({
|
|
146
|
+
id: opt.id,
|
|
147
|
+
name: opt.name,
|
|
148
|
+
values: opt.values,
|
|
149
|
+
})),
|
|
150
|
+
variants: product.variants.map((v) => ({
|
|
151
|
+
id: v.id,
|
|
152
|
+
title: v.title,
|
|
153
|
+
availableForSale: v.availableForSale,
|
|
154
|
+
quantityAvailable: v.quantityAvailable,
|
|
155
|
+
price: v.price,
|
|
156
|
+
compareAtPrice: v.compareAtPrice,
|
|
157
|
+
selectedOptions: v.selectedOptions,
|
|
158
|
+
image: v.image,
|
|
159
|
+
})),
|
|
160
|
+
};
|
|
161
|
+
case 'buy_buttons':
|
|
162
|
+
return {
|
|
163
|
+
productId: product.id,
|
|
164
|
+
availableForSale: product.variants.some((v) => v.availableForSale),
|
|
165
|
+
defaultVariantId: product.variants.find((v) => v.availableForSale)?.id,
|
|
166
|
+
};
|
|
167
|
+
default:
|
|
168
|
+
return undefined;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Resolve product recommendations for sections with type "product-recommendations".
|
|
173
|
+
*/
|
|
174
|
+
async resolveRecommendationSections(brand, productId, sections) {
|
|
175
|
+
const recommendationSections = sections
|
|
176
|
+
.map((section, index) => ({ section, index }))
|
|
177
|
+
.filter(({ section }) => section.type === 'product-recommendations');
|
|
178
|
+
if (recommendationSections.length === 0) {
|
|
179
|
+
return sections;
|
|
180
|
+
}
|
|
181
|
+
const firstSection = recommendationSections[0].section;
|
|
182
|
+
const productsCount = firstSection.settings?.products_count || 5;
|
|
183
|
+
try {
|
|
184
|
+
const handles = await this.productService.getProductRecommendationHandles(brand, productId, productsCount);
|
|
185
|
+
if (handles.length === 0) {
|
|
186
|
+
return sections;
|
|
187
|
+
}
|
|
188
|
+
// Fetch full products
|
|
189
|
+
const products = await Promise.all(handles.map((handle) => this.productService.getProductByHandle(brand, handle).catch(() => null)));
|
|
190
|
+
const validProducts = products.filter((p) => p !== null);
|
|
191
|
+
// Normalize products
|
|
192
|
+
const normalizedProducts = validProducts.map((p) => ({
|
|
193
|
+
id: p.id,
|
|
194
|
+
title: p.title,
|
|
195
|
+
handle: p.handle,
|
|
196
|
+
vendor: p.vendor,
|
|
197
|
+
productType: p.productType,
|
|
198
|
+
featuredImage: p.featuredImage,
|
|
199
|
+
images: p.images.map((img) => ({
|
|
200
|
+
id: img.url,
|
|
201
|
+
url: img.url,
|
|
202
|
+
altText: img.altText ?? undefined,
|
|
203
|
+
width: img.width,
|
|
204
|
+
height: img.height,
|
|
205
|
+
})),
|
|
206
|
+
priceRange: p.priceRange,
|
|
207
|
+
compareAtPrice: p.variants[0]?.compareAtPrice ?? null,
|
|
208
|
+
tags: p.tags,
|
|
209
|
+
displayTag: null,
|
|
210
|
+
}));
|
|
211
|
+
// Merge into sections
|
|
212
|
+
return sections.map((section, index) => {
|
|
213
|
+
const isRecommendationSection = recommendationSections.some((rs) => rs.index === index);
|
|
214
|
+
if (isRecommendationSection) {
|
|
215
|
+
return { ...section, products: normalizedProducts };
|
|
216
|
+
}
|
|
217
|
+
return section;
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
catch (error) {
|
|
221
|
+
core_1.logger.error('Failed to resolve product recommendations', {
|
|
222
|
+
brand,
|
|
223
|
+
productId,
|
|
224
|
+
error: error instanceof Error ? error.message : 'Unknown',
|
|
225
|
+
});
|
|
226
|
+
return sections;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
exports.ProductContentService = ProductContentService;
|
|
231
|
+
exports.ProductContentService = ProductContentService = tslib_1.__decorate([
|
|
232
|
+
(0, common_1.Injectable)(),
|
|
233
|
+
tslib_1.__metadata("design:paramtypes", [core_1.CacheService,
|
|
234
|
+
core_1.ConfigService,
|
|
235
|
+
product_service_1.ProductService,
|
|
236
|
+
collection_service_1.CollectionService,
|
|
237
|
+
core_1.ShopifyThemeService])
|
|
238
|
+
], ProductContentService);
|
|
239
|
+
//# sourceMappingURL=product-content.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product-content.service.js","sourceRoot":"","sources":["../../src/product-content/product-content.service.ts"],"names":[],"mappings":";;;;AAAA,2CAA4C;AAC5C,wCAKuB;AACvB,gEAA4D;AAC5D,yEAAqE;AAOrE;;;;;GAKG;AAEI,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAEb;IACA;IACA;IACA;IACA;IALnB,YACmB,YAA0B,EAC1B,aAA4B,EAC5B,cAA8B,EAC9B,iBAAoC,EACpC,mBAAwC;QAJxC,iBAAY,GAAZ,YAAY,CAAc;QAC1B,kBAAa,GAAb,aAAa,CAAe;QAC5B,mBAAc,GAAd,cAAc,CAAgB;QAC9B,sBAAiB,GA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0,0 +1,85 @@
|
|
|
1
|
+
export declare class ProductContentError {
|
|
2
|
+
code: string;
|
|
3
|
+
message: string;
|
|
4
|
+
}
|
|
5
|
+
export declare class ProductContentImage {
|
|
6
|
+
url: string;
|
|
7
|
+
altText: string | null;
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
}
|
|
11
|
+
export declare class ProductContentMoney {
|
|
12
|
+
amount: string;
|
|
13
|
+
currencyCode: string;
|
|
14
|
+
}
|
|
15
|
+
export declare class ProductContentPriceRange {
|
|
16
|
+
minVariantPrice: ProductContentMoney;
|
|
17
|
+
maxVariantPrice: ProductContentMoney;
|
|
18
|
+
}
|
|
19
|
+
export declare class ProductContentSelectedOption {
|
|
20
|
+
name: string;
|
|
21
|
+
value: string;
|
|
22
|
+
}
|
|
23
|
+
export declare class ProductContentVariant {
|
|
24
|
+
id: string;
|
|
25
|
+
title: string;
|
|
26
|
+
availableForSale: boolean;
|
|
27
|
+
quantityAvailable?: number | null;
|
|
28
|
+
price: ProductContentMoney;
|
|
29
|
+
compareAtPrice: ProductContentMoney | null;
|
|
30
|
+
selectedOptions: ProductContentSelectedOption[];
|
|
31
|
+
image: ProductContentImage | null;
|
|
32
|
+
}
|
|
33
|
+
export declare class ProductContentProduct {
|
|
34
|
+
id: string;
|
|
35
|
+
handle: string;
|
|
36
|
+
title: string;
|
|
37
|
+
description: string;
|
|
38
|
+
descriptionHtml: string;
|
|
39
|
+
vendor: string;
|
|
40
|
+
productType: string;
|
|
41
|
+
tags: string[];
|
|
42
|
+
featuredImage: ProductContentImage | null;
|
|
43
|
+
images: ProductContentImage[];
|
|
44
|
+
variants: ProductContentVariant[];
|
|
45
|
+
priceRange: ProductContentPriceRange;
|
|
46
|
+
}
|
|
47
|
+
export declare class ProductThemeBlock {
|
|
48
|
+
type: string;
|
|
49
|
+
settings?: Record<string, unknown>;
|
|
50
|
+
data?: Record<string, unknown>;
|
|
51
|
+
}
|
|
52
|
+
export declare class RecommendedProductFeaturedImage {
|
|
53
|
+
url: string;
|
|
54
|
+
altText?: string | null;
|
|
55
|
+
width?: number;
|
|
56
|
+
height?: number;
|
|
57
|
+
}
|
|
58
|
+
export declare class RecommendedProductImage {
|
|
59
|
+
id: string;
|
|
60
|
+
url: string;
|
|
61
|
+
altText?: string;
|
|
62
|
+
width: number;
|
|
63
|
+
height: number;
|
|
64
|
+
}
|
|
65
|
+
export declare class RecommendedProduct {
|
|
66
|
+
id: string;
|
|
67
|
+
handle: string;
|
|
68
|
+
title: string;
|
|
69
|
+
vendor?: string;
|
|
70
|
+
productType?: string;
|
|
71
|
+
featuredImage?: RecommendedProductFeaturedImage | null;
|
|
72
|
+
images?: RecommendedProductImage[];
|
|
73
|
+
priceRange: ProductContentPriceRange;
|
|
74
|
+
compareAtPrice?: ProductContentMoney | null;
|
|
75
|
+
tags?: string[];
|
|
76
|
+
displayTag?: string | null;
|
|
77
|
+
}
|
|
78
|
+
export declare class ProductContentSection {
|
|
79
|
+
id: string;
|
|
80
|
+
type: string;
|
|
81
|
+
settings?: Record<string, unknown>;
|
|
82
|
+
blocks?: ProductThemeBlock[];
|
|
83
|
+
products?: RecommendedProduct[];
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=common.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.types.d.ts","sourceRoot":"","sources":["../../../src/product-content/types/common.types.ts"],"names":[],"mappings":"AAKA,qBACa,mBAAmB;IAE9B,IAAI,EAAE,MAAM,CAAC;IAGb,OAAO,EAAE,MAAM,CAAC;CACjB;AAID,qBACa,mBAAmB;IAE9B,GAAG,EAAE,MAAM,CAAC;IAGZ,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAGvB,KAAK,EAAE,MAAM,CAAC;IAGd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,qBACa,mBAAmB;IAE9B,MAAM,EAAE,MAAM,CAAC;IAGf,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,qBACa,wB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