@leaddreamer/inventorylogic 0.0.3-beta.47 → 0.0.3-beta.53
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 +1225 -132
- package/business/Product/GoogleMarchantMarkup.js +252 -0
- package/business/Product/GoogleMerchantAPI.js +343 -0
- package/business/Product/Squarespace.js +505 -0
- package/business/Product/index.js +125 -27
- package/business/Utilities/other.js +0 -63
- package/dist/InventoryLogic.0a417df6.js +2 -0
- package/dist/InventoryLogic.4a3c62d7.js +2 -0
- package/dist/InventoryLogic.519aca5b.js +2 -0
- package/dist/InventoryLogic.5e29cd66.js +2 -0
- package/dist/InventoryLogic.76c282a4.js +2 -0
- package/dist/InventoryLogic.b49f09b1.js +2 -0
- package/dist/InventoryLogic.b8b0ac74.js +2 -0
- package/dist/InventoryLogic.ca8dec8b.js +2 -0
- package/dist/InventoryLogic.e0dc6c34.js +2 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typedefs, constants, support functions and database operations related to Products
|
|
3
|
+
* @module GoogleProduct
|
|
4
|
+
*/
|
|
5
|
+
//////////////////////////////////////////////////////////////////////
|
|
6
|
+
// Constants
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @typedef {string} SKU
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* @typedef {string} Name
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @typedef {object} ImageObject
|
|
17
|
+
* @property {?text|MediaObject} caption
|
|
18
|
+
* @property {?text} embeddedTextCaption
|
|
19
|
+
* @property {?object} exifData
|
|
20
|
+
* @property {?Date|DateTime} dateCreated
|
|
21
|
+
* @property {?Date|DateTime} dateModified
|
|
22
|
+
* @property {?Date|DateTime} datePublished
|
|
23
|
+
* @property {?text|number} position The position of an item in a series or sequence of items.
|
|
24
|
+
* @property {?text} text The textual content of this CreativeWork.
|
|
25
|
+
* @property {ImageObject} thumbnail
|
|
26
|
+
* @property {text} alternateName An alias for the item.
|
|
27
|
+
* @property {text} description A description of the item.
|
|
28
|
+
* @property {URL|ImageObject} imageAn image of the item. This can be a URL or a fully described ImageObject.
|
|
29
|
+
* @property {Name} name The name of the item.
|
|
30
|
+
* @property {URL} url
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* @typedef {object} ReviewRating
|
|
35
|
+
* @property {text} type "Rating"
|
|
36
|
+
* @property {integer|text} bestRating The highest value allowed in this rating system.
|
|
37
|
+
* @property {integer|text} worstRating The lowest value allowed in this rating system.
|
|
38
|
+
* @property {Text|Number} ratingValue
|
|
39
|
+
* The rating for the content.
|
|
40
|
+
* Usage guidelines:
|
|
41
|
+
* Use values from 0123456789 (Unicode 'DIGIT ZERO' (U+0030) to 'DIGIT NINE' (U+0039)) rather than superficially similar Unicode symbols.
|
|
42
|
+
* Use '.' (Unicode 'FULL STOP' (U+002E)) rather than ',' to indicate a decimal point. Avoid using these symbols as a readability separator.
|
|
43
|
+
*/
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @typedef {object} ReviewObject
|
|
47
|
+
* @property {text} type "Review"
|
|
48
|
+
* @property {?text} author
|
|
49
|
+
* @property {?text} name
|
|
50
|
+
* @property {?Date|DateTime} datePublished
|
|
51
|
+
* @property {text} reviewBody
|
|
52
|
+
* @property {?Array.ReviewRating} reviews
|
|
53
|
+
* @property {?ReviewRating} review
|
|
54
|
+
*/
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* @typedef {object} AggregateRatingsValue
|
|
58
|
+
* @property {text} type "AggregateRating"
|
|
59
|
+
* @property {?Thing} itemReviewed The item that is being reviewed/rated.
|
|
60
|
+
* @property {?integer} ratingCount The count of total number of ratings.
|
|
61
|
+
* @property {?integer} reviewCount The count of total number of reviews.
|
|
62
|
+
* @property {text} ratingExplanation
|
|
63
|
+
* A short explanation (e.g. one to two sentences) providing background context and other information that led to the conclusion expressed in the rating. This is particularly applicable to ratings associated with "fact check" markup using ClaimReview.
|
|
64
|
+
* @property {Text|Number} ratingValue
|
|
65
|
+
* The rating for the content.
|
|
66
|
+
* Usage guidelines:
|
|
67
|
+
* Use values from 0123456789 (Unicode 'DIGIT ZERO' (U+0030) to 'DIGIT NINE' (U+0039)) rather than superficially similar Unicode symbols.
|
|
68
|
+
* Use '.' (Unicode 'FULL STOP' (U+002E)) rather than ',' to indicate a decimal point. Avoid using these symbols as a readability separator.
|
|
69
|
+
* @property {integer|text} bestRating The highest value allowed in this rating system.
|
|
70
|
+
* @property {integer|text} worstRating The lowest value allowed in this rating system.
|
|
71
|
+
*/
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* a Brand Object
|
|
75
|
+
* @typedef {object} BrandObject
|
|
76
|
+
* @property {?AggregateRatingsValue} aggregateRating
|
|
77
|
+
* @property {?URL|ImageObject} logo
|
|
78
|
+
* @property {ReviewObject} review A review of the item. Supersedes reviews
|
|
79
|
+
* @property {text} slogan A slogan or motto associated with the item.
|
|
80
|
+
* @property {Name} name The name of the brand.
|
|
81
|
+
*/
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* @typedef {object} QuantitativeValue
|
|
85
|
+
* @property {Boolean | Number | text | StructuredValue} value
|
|
86
|
+
* The value of a QuantitativeValue (including Observation) or property value node.
|
|
87
|
+
* * For QuantitativeValue and MonetaryAmount, the recommended type for values is 'Number'.
|
|
88
|
+
* * For PropertyValue, it can be 'Text', 'Number', 'Boolean', or 'StructuredValue'.
|
|
89
|
+
* * Use values from 0123456789 (Unicode 'DIGIT ZERO' (U+0030) to 'DIGIT NINE' (U+0039)) rather than superficially similar Unicode symbols.
|
|
90
|
+
* * Use '.' (Unicode 'FULL STOP' (U+002E)) rather than ',' to indicate a decimal point. Avoid using these symbols as a readability separator.
|
|
91
|
+
* @property {number} maxValue The upper value of some characteristic or property.
|
|
92
|
+
* @property {number} minValue The lower value of some characteristic or property.
|
|
93
|
+
* @property {?Text} unitText A string or text indicating the unit of measurement. Useful if you cannot provide a standard unit code for unitCode
|
|
94
|
+
* @property {?Text | URL} unitCode
|
|
95
|
+
* The unit of measurement given using the UN/CEFACT Common Code (3 characters) or a URL. Other codes than the UN/CEFACT Common Code may be used with a prefix followed by a colon
|
|
96
|
+
*
|
|
97
|
+
*/
|
|
98
|
+
/**
|
|
99
|
+
* Size Grouping options
|
|
100
|
+
* @typedef {"Big"|"Boys"|"ExtraShort"|"ExtraTall"|"Girls"|"Husky"|"Infants"|"Juniors"|"Maternity"|"Mens"|"Misses"|"Petite"|"Plus"|"Regular"|"Short"|"Tall"|"Womens"} SizeGroupEnumeration
|
|
101
|
+
*/
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Google Merchant API Size/Fit Options
|
|
105
|
+
* @typedef {"regular"|"petite"|"maternity"|"big"|"tall"|"plus"} SizeTypeEnumeration
|
|
106
|
+
*/
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Google Merchant API Size System/Country Options
|
|
110
|
+
* @typedef {"US"|"UK"|"EU"|"DE"|"FR"|"JP"|"CN"|"IT"|"BR"|"MEX"|"AU"} SizeSystemEnumeration
|
|
111
|
+
*/
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Google Merchant API Variant-identifying dimensions and their values
|
|
115
|
+
* @typedef {object} GoogleAPIVariantOption
|
|
116
|
+
* @property {Text} name
|
|
117
|
+
* @property {Text} value
|
|
118
|
+
*/
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* @typedef {object} SizeSpecification
|
|
122
|
+
* @property {Text} type "SizeSpecification"
|
|
123
|
+
* @property {QuantitativeValue} hasMeasurement
|
|
124
|
+
* @property {Array.SizeGroupEnumeration|SizeGroupEnumeration|Text} sizeGroup
|
|
125
|
+
* The size group (also known as "size type") for a product's size. Size groups are common in the fashion industry to define size
|
|
126
|
+
* segments and suggested audiences for wearable products. Multiple values can be combined, for example "men's big and tall", "petite maternity" or "regular".
|
|
127
|
+
* @property {Array.SizeSystemEnumeration|SizeSystemEnumeration|Text} sizeSystem
|
|
128
|
+
* The size system used to identify a product's size. Typically either a standard (for example, "GS1" or "ISO-EN13402"), country
|
|
129
|
+
* code (for example "US" or "JP"), or a measuring system (for example "Metric" or "Imperial").
|
|
130
|
+
* @property {QuantitativeValue} suggestedAge The age or age range for the intended audience or user, for example 3-12 months for infants, 1-5 years for toddlers.
|
|
131
|
+
* @property {GenderType|Text} suggestedGender The suggested gender of the intended user or audience, for example "male", "female", or "unisex".
|
|
132
|
+
* @property {QuantitativeValue} suggestedMeasurement A suggested range of body measurements for the intended audience or user, for example inseam between 32 and 34 inches or
|
|
133
|
+
* height between 170 and 190 cm. Typically found on a size chart for wearable products.
|
|
134
|
+
*/
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Google Merchant API User-, merchant-, and manufacturer-authored questions and answers about the product.
|
|
138
|
+
* @typedef {object} QAObject
|
|
139
|
+
* @property {Text} question Max. 1000 characters.
|
|
140
|
+
* @property {Text} answer Max. 1000 characters.
|
|
141
|
+
*/
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* @typedef {"in_stock" | "out_of_stock" | "preorder" | "backorder"} availabilityEnum
|
|
145
|
+
*/
|
|
146
|
+
/**
|
|
147
|
+
* a Google Product record
|
|
148
|
+
* @typedef {object} GoogleProduct
|
|
149
|
+
* @property {SKU} id id of Product also used as sku
|
|
150
|
+
* @property {Name} title title (name) of Product
|
|
151
|
+
* @property {string} description Basic description of the product
|
|
152
|
+
* @property {URL} link Your product’s landing page
|
|
153
|
+
* @property {URL} image_link The URL of your product’s main image
|
|
154
|
+
* @property {?URL} additional_image_link The URL of your product’s main image
|
|
155
|
+
* @property {?URL} video_link Additional link to show a video of your product.
|
|
156
|
+
* @property {?URL} virtual_model_link Additional link to show a 3D model of your product.
|
|
157
|
+
* @property {?URL} mobile_link Your product’s mobile-optimized landing page when you have a different URL for mobile and desktop traffic
|
|
158
|
+
* @property {availabilityEnum} availability
|
|
159
|
+
* Accurately submit the product's availability and match the availability
|
|
160
|
+
* from your landing page, checkout pages, and structured data (for
|
|
161
|
+
* example, “in_stock” or “out_of_stock” in your Schema.org markup).
|
|
162
|
+
* If an item is out of stock, the price must still be clearly visible
|
|
163
|
+
* on the landing page.
|
|
164
|
+
* Provide the availability date [availability_date] attribute if you
|
|
165
|
+
* submit preorder [preorder] or backorder [backorder] as the availability value.
|
|
166
|
+
* @property {string|ISO8601} availability_date
|
|
167
|
+
* Use this attribute if your product's availability is set to preorder.
|
|
168
|
+
* Provide a value up to one year in the future.
|
|
169
|
+
* The availability date should also be added to the product’s landing
|
|
170
|
+
* page and be clear to your customers (for example, “May 6, 2023”).
|
|
171
|
+
* If an exact date can’t be provided, you can use an estimated date
|
|
172
|
+
* (for example, “May 2023”).
|
|
173
|
+
* @property {?string|ISO4217} cost_of_goods_sold
|
|
174
|
+
* The costs associated with the sale of a particular product as defined
|
|
175
|
+
* by the accounting convention you set up. These costs may include
|
|
176
|
+
* material, labor, freight, or other overhead expenses. By
|
|
177
|
+
* submittingthe COGS for your products, you gain insights about
|
|
178
|
+
* other metrics, such as your gross margin and the amount of revenue
|
|
179
|
+
* generated by your ads and free listings.
|
|
180
|
+
* @property {ISO8601} expiration_date The date that your product should stop showing
|
|
181
|
+
* @property {number|ISO4217} price
|
|
182
|
+
* @property {?number|ISO4217} sale_price
|
|
183
|
+
* @property {?DateRange} sale_price_effective_date
|
|
184
|
+
* @property {?GoogleProductTaxonomy} google_product_category
|
|
185
|
+
* @property {?string} product_type
|
|
186
|
+
* @property {Text|BrandObject} brand
|
|
187
|
+
* The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business user.
|
|
188
|
+
* @property {gtin8 | gtin12 | gtin13 | gtin14 | gtin | isbn} gtin
|
|
189
|
+
* @property {Text} mpn
|
|
190
|
+
* The Manufacturer Part Number (MPN) of the product, or the product to which the offer refers.
|
|
191
|
+
* @property {"no"|"yes"} adult
|
|
192
|
+
* @property {Text} age_group newborn | infant | toddler | kids | adult
|
|
193
|
+
* @property {Text} gender male female unisex
|
|
194
|
+
* @property {Text} color The color of the product.
|
|
195
|
+
* @property {?"new"|"refurbished"|"used"} condition
|
|
196
|
+
* @property {Text} item_group_id ID for a group of products that come in different versions (variants)
|
|
197
|
+
* @property {Text} item_group_title name for a group of products that come in different versions (variants)
|
|
198
|
+
* @property {?Text} material A material that something is made from, e.g. leather, wool, cotton, paper.
|
|
199
|
+
* @property {?Text} pattern A pattern that something has
|
|
200
|
+
* @property {?Text}product_length Your product's length
|
|
201
|
+
* @property {?Text}product_width Your product's width
|
|
202
|
+
* @property {?Text}product_height Your product's height
|
|
203
|
+
* Use the same unit of measurement for each product dimension attribute
|
|
204
|
+
* (including product length, width, and height). Otherwise, the
|
|
205
|
+
* information won't be displayed.
|
|
206
|
+
* @property {?Text} product_highlight The most relevant highlights of your products
|
|
207
|
+
* @property {?Text} product_weight Your product's weight
|
|
208
|
+
* @property {?Array.QAObject} question_and_answer User-, merchant-, and
|
|
209
|
+
* manufacturer-authored questions and answers about the product.
|
|
210
|
+
* @property {Text | SizeSpecification | QuantitativeValue} size
|
|
211
|
+
* @property {SizeTypeEnumeration} size_type Your apparel product’s cut
|
|
212
|
+
* @property {SizeSystemEnumeration} size_system
|
|
213
|
+
* The country of the size system used by your produc
|
|
214
|
+
* @property {Array.GoogleAPIVariantOption} variant_option
|
|
215
|
+
* Variant-identifying dimensions and their values
|
|
216
|
+
* @property {?URL} ads_redirect
|
|
217
|
+
* A URL used to specify additional parameters for your product page.
|
|
218
|
+
* Customers will be sent to this URL rather than the value that you
|
|
219
|
+
* submit for the link [link] or mobile link [mobile_link] attributes
|
|
220
|
+
* @property {?Text} custom_label_0
|
|
221
|
+
* Label that you assign to a product to help organize bidding and
|
|
222
|
+
* reporting in Shopping campaigns
|
|
223
|
+
* @property {?Text} custom_label_1
|
|
224
|
+
* Label that you assign to a product to help organize bidding and
|
|
225
|
+
* reporting in Shopping campaigns
|
|
226
|
+
* @property {?Text} custom_label_2
|
|
227
|
+
* Label that you assign to a product to help organize bidding and
|
|
228
|
+
* reporting in Shopping campaigns
|
|
229
|
+
* @property {?Text} custom_label_3
|
|
230
|
+
* Label that you assign to a product to help organize bidding and
|
|
231
|
+
* reporting in Shopping campaigns
|
|
232
|
+
* @property {?Text} custom_label_4
|
|
233
|
+
* Label that you assign to a product to help organize bidding and
|
|
234
|
+
* reporting in Shopping campaigns
|
|
235
|
+
* @property {?Text} promotion_id An identifier that allows you to
|
|
236
|
+
* match products to promotions
|
|
237
|
+
* @property {URL} lifestyle_image_link
|
|
238
|
+
* Attribute used to include the URL for a lifestyle image for your product
|
|
239
|
+
* @property {Text} short_title Short product name. Only available for Demand Gen Ads, including
|
|
240
|
+
* YouTube, Gmail, Maps, Discover app, Google Display Network, and Google Video Partners.
|
|
241
|
+
* @property {?Text} shipping_label
|
|
242
|
+
* Label that you assign to a product to help assign correct
|
|
243
|
+
* shipping times and transit costs in Merchant Center account settings
|
|
244
|
+
* @property {?Text} shipping_weight The weight of the product used to
|
|
245
|
+
* calculate the shipping cost
|
|
246
|
+
* @property {?Text} shipping_length The length of the product used to
|
|
247
|
+
* calculate the shipping cost by dimensional weight
|
|
248
|
+
* @property {?Text} shipping_width The width of the product used to
|
|
249
|
+
* calculate the shipping cost by dimensional weight
|
|
250
|
+
* @property {?Text} shipping_height The height of the product used to
|
|
251
|
+
* calculate the shipping cost by dimensional weight
|
|
252
|
+
*/
|
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typedefs, constants, support functions and database operations related to Products
|
|
3
|
+
* @module GoogleProduct
|
|
4
|
+
*/
|
|
5
|
+
//////////////////////////////////////////////////////////////////////
|
|
6
|
+
// Constants
|
|
7
|
+
|
|
8
|
+
import { index, string } from "mathjs";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @typedef {string} SKU
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* @typedef {string} Name
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Google Merchant API Size/Fit Options
|
|
19
|
+
* @typedef {"regular"|"petite"|"maternity"|"big"|"tall"|"plus"} SizeTypeEnumeration
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Google Merchant API Size System/Country Options
|
|
24
|
+
* @typedef {"US"|"UK"|"EU"|"DE"|"FR"|"JP"|"CN"|"IT"|"BR"|"MEX"|"AU"} SizeSystemEnumeration
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Google Merchant API Variant-identifying dimensions and their values
|
|
29
|
+
* @typedef {object} GoogleAPIVariantOption
|
|
30
|
+
* @property {Text} name
|
|
31
|
+
* @property {Text} value
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Google Merchant API User-, merchant-, and manufacturer-authored questions and answers about the product.
|
|
36
|
+
* @typedef {object} QAObject
|
|
37
|
+
* @property {Text} question Max. 1000 characters.
|
|
38
|
+
* @property {Text} answer Max. 1000 characters.
|
|
39
|
+
*/
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* a Google Product record
|
|
43
|
+
* @typedef {object} GoogleProductAPI
|
|
44
|
+
* @property {SKU} id id of Product also used as sku
|
|
45
|
+
* @property {Name} title title (name) of Product
|
|
46
|
+
* @property {Text} item_group_id ID for a group of products that come in different versions (variants)
|
|
47
|
+
* @property {Text} item_group_title name for a group of products that come in different versions (variants)
|
|
48
|
+
* @property {string} description Basic description of the product
|
|
49
|
+
* @property {URL} link Your product’s landing page
|
|
50
|
+
* @property {URL} image_link The URL of your product’s main image
|
|
51
|
+
* @property {?URL} additional_image_link The URL of your product’s main image
|
|
52
|
+
* @property {?URL} video_link Additional link to show a video of your product.
|
|
53
|
+
* @property {?URL} virtual_model_link Additional link to show a 3D model of your product.
|
|
54
|
+
* @property {?URL} mobile_link
|
|
55
|
+
* Your product’s mobile-optimized landing page when you have a different URL for mobile and desktop traffic
|
|
56
|
+
* @property {"in_stock"|"out_of_stock"|"preorder"|"backorder"} availability
|
|
57
|
+
* Accurately submit the product's availability and match the availability
|
|
58
|
+
* from your landing page, checkout pages, and structured data (for
|
|
59
|
+
* example, “in_stock” or “out_of_stock” in your Schema.org markup).
|
|
60
|
+
* If an item is out of stock, the price must still be clearly visible
|
|
61
|
+
* on the landing page.
|
|
62
|
+
* Provide the availability date [availability_date] attribute if you
|
|
63
|
+
* submit preorder [preorder] or backorder [backorder] as the availability value.
|
|
64
|
+
* @property {string|ISO8601} availability_date
|
|
65
|
+
* Use this attribute if your product's availability is set to preorder.
|
|
66
|
+
* Provide a value up to one year in the future.
|
|
67
|
+
* The availability date should also be added to the product’s landing
|
|
68
|
+
* page and be clear to your customers (for example, “May 6, 2023”).
|
|
69
|
+
* If an exact date can’t be provided, you can use an estimated date
|
|
70
|
+
* (for example, “May 2023”).
|
|
71
|
+
* @property {?string|ISO4217} cost_of_goods_sold
|
|
72
|
+
* The costs associated with the sale of a particular product as defined
|
|
73
|
+
* by the accounting convention you set up. These costs may include
|
|
74
|
+
* material, labor, freight, or other overhead expenses. By
|
|
75
|
+
* submittingthe COGS for your products, you gain insights about
|
|
76
|
+
* other metrics, such as your gross margin and the amount of revenue
|
|
77
|
+
* generated by your ads and free listings.
|
|
78
|
+
* @property {ISO8601} expiration_date The date that your product should stop showing
|
|
79
|
+
* @property {number|ISO4217} price
|
|
80
|
+
* @property {?number|ISO4217} sale_price
|
|
81
|
+
* @property {?DateRange} sale_price_effective_date
|
|
82
|
+
* @property {?GoogleProductTaxonomy} google_product_category
|
|
83
|
+
* @property {?string} product_type "Casual" google_product_category
|
|
84
|
+
* @property {Text} brand
|
|
85
|
+
* The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business user.
|
|
86
|
+
* @property {gtin8 | gtin12 | gtin13 | gtin14 | gtin | isbn} gtin
|
|
87
|
+
* @property {Text} mpn
|
|
88
|
+
* The Manufacturer Part Number (MPN) of the product, or the product to which the offer refers.
|
|
89
|
+
* @property {"no"|"yes"} adult
|
|
90
|
+
* @property {Text} age_group newborn | infant | toddler | kids | adult
|
|
91
|
+
* @property {"male"|"female"|"unisex"} gender male female unisex
|
|
92
|
+
* @property {Text} color The color of the product.
|
|
93
|
+
* @property {?"new"|"refurbished"|"used"|null} condition
|
|
94
|
+
* @property {?Text} material A material that something is made from, e.g. leather, wool, cotton, paper.
|
|
95
|
+
* @property {?Text} pattern A pattern that something has
|
|
96
|
+
* @property {?Text}product_length Your product's length
|
|
97
|
+
* @property {?Text}product_width Your product's width
|
|
98
|
+
* @property {?Text}product_height Your product's height
|
|
99
|
+
* Use the same unit of measurement for each product dimension attribute
|
|
100
|
+
* (including product length, width, and height). Otherwise, the
|
|
101
|
+
* information won't be displayed.
|
|
102
|
+
* @property {?Text} product_highlight The most relevant highlights of your products
|
|
103
|
+
* @property {?Text} product_weight Your product's weight
|
|
104
|
+
* @property {?Array.QAObject} question_and_answer User-, merchant-, and
|
|
105
|
+
* manufacturer-authored questions and answers about the product.
|
|
106
|
+
* @property {Text} size
|
|
107
|
+
* @property {SizeTypeEnumeration} size_type Your apparel product’s cut
|
|
108
|
+
* @property {SizeSystemEnumeration} size_system
|
|
109
|
+
* The country of the size system used by your produc
|
|
110
|
+
* @property {Array.GoogleAPIVariantOption} variant_option
|
|
111
|
+
* Variant-identifying dimensions and their values
|
|
112
|
+
* @property {?URL} ads_redirect
|
|
113
|
+
* A URL used to specify additional parameters for your product page.
|
|
114
|
+
* Customers will be sent to this URL rather than the value that you
|
|
115
|
+
* submit for the link [link] or mobile link [mobile_link] attributes
|
|
116
|
+
* @property {?Text} custom_label_0
|
|
117
|
+
* Label that you assign to a product to help organize bidding and
|
|
118
|
+
* reporting in Shopping campaigns
|
|
119
|
+
* @property {?Text} custom_label_1
|
|
120
|
+
* Label that you assign to a product to help organize bidding and
|
|
121
|
+
* reporting in Shopping campaigns
|
|
122
|
+
* @property {?Text} custom_label_2
|
|
123
|
+
* Label that you assign to a product to help organize bidding and
|
|
124
|
+
* reporting in Shopping campaigns
|
|
125
|
+
* @property {?Text} custom_label_3
|
|
126
|
+
* Label that you assign to a product to help organize bidding and
|
|
127
|
+
* reporting in Shopping campaigns
|
|
128
|
+
* @property {?Text} custom_label_4
|
|
129
|
+
* Label that you assign to a product to help organize bidding and
|
|
130
|
+
* reporting in Shopping campaigns
|
|
131
|
+
* @property {?Text} promotion_id An identifier that allows you to
|
|
132
|
+
* match products to promotions
|
|
133
|
+
* @property {?URL} lifestyle_image_link
|
|
134
|
+
* Attribute used to include the URL for a lifestyle image for your product
|
|
135
|
+
* @property {?Text} short_title Short product name. Only available for Demand Gen Ads, including
|
|
136
|
+
* YouTube, Gmail, Maps, Discover app, Google Display Network, and Google Video Partners.
|
|
137
|
+
* @property {?Text} shipping_label
|
|
138
|
+
* Label that you assign to a product to help assign correct
|
|
139
|
+
* shipping times and transit costs in Merchant Center account settings
|
|
140
|
+
* @property {?Text} shipping_weight The weight of the product used to
|
|
141
|
+
* calculate the shipping cost
|
|
142
|
+
* @property {?Text} shipping_length The length of the product used to
|
|
143
|
+
* calculate the shipping cost by dimensional weight
|
|
144
|
+
* @property {?Text} shipping_width The width of the product used to
|
|
145
|
+
* calculate the shipping cost by dimensional weight
|
|
146
|
+
* @property {?Text} shipping_height The height of the product used to
|
|
147
|
+
* calculate the shipping cost by dimensional weight
|
|
148
|
+
*/
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* @type {GoogleProductAPI}
|
|
152
|
+
*/
|
|
153
|
+
export const GoogleAPIProductDefault = {
|
|
154
|
+
id: string, //id of Product also used as sku
|
|
155
|
+
title: string, //title (name) of Product
|
|
156
|
+
description: string,
|
|
157
|
+
link: URL,
|
|
158
|
+
image_link: URL,
|
|
159
|
+
additional_image_link: URL | null,
|
|
160
|
+
video_link: URL | null,
|
|
161
|
+
virtual_model_link: URL | null,
|
|
162
|
+
mobile_link: URL | null,
|
|
163
|
+
availability: "in_stock" | "out_of_stock" | "preorder" | "backorder",
|
|
164
|
+
availability_date: any,
|
|
165
|
+
cost_of_goods_sold: any,
|
|
166
|
+
expiration_date: ISO8601,
|
|
167
|
+
price: any,
|
|
168
|
+
sale_price: any,
|
|
169
|
+
sale_price_effective_date: any,
|
|
170
|
+
google_product_category: any,
|
|
171
|
+
product_type: string | null,
|
|
172
|
+
brand: Text,
|
|
173
|
+
gtin: string | null,
|
|
174
|
+
mpn: Text,
|
|
175
|
+
adult: "no" | "yes",
|
|
176
|
+
age_group: Text,
|
|
177
|
+
gender: "male" | "female" | "unisex",
|
|
178
|
+
color: string,
|
|
179
|
+
condition: "new" | "refurbished" | "used" | null,
|
|
180
|
+
item_group_id: Text,
|
|
181
|
+
item_group_title: Text,
|
|
182
|
+
material: Text | null,
|
|
183
|
+
pattern: Text | null,
|
|
184
|
+
product_length: Text | null,
|
|
185
|
+
product_width: Text | null,
|
|
186
|
+
product_height: Text | null,
|
|
187
|
+
product_highlight: Text | null,
|
|
188
|
+
product_weight: Text | null,
|
|
189
|
+
question_and_answer: [
|
|
190
|
+
{
|
|
191
|
+
question: Text,
|
|
192
|
+
answer: Text,
|
|
193
|
+
}
|
|
194
|
+
],
|
|
195
|
+
size: Text | null,
|
|
196
|
+
size_type: "regular" | "petite" | "maternity" | "big" | "tall" | "plus",
|
|
197
|
+
size_system: "US" | "UK" | "EU" | "DE" | "FR" | "JP" | "CN" | "IT" | "BR" | "MEX" | "AU",
|
|
198
|
+
variant_option: [{
|
|
199
|
+
name: Text,
|
|
200
|
+
value: Text,
|
|
201
|
+
},],
|
|
202
|
+
ads_redirect: URL | null,
|
|
203
|
+
custom_label_0: Text | null,
|
|
204
|
+
custom_label_1: Text | null,
|
|
205
|
+
custom_label_2: Text | null,
|
|
206
|
+
custom_label_3: Text | null,
|
|
207
|
+
custom_label_4: Text | null,
|
|
208
|
+
promotion_id: Text | null,
|
|
209
|
+
lifestyle_image_link: URL | null,
|
|
210
|
+
short_title: Text | null,
|
|
211
|
+
shipping_length: Text | null,
|
|
212
|
+
shipping_width: Text | null,
|
|
213
|
+
shipping_height: Text | null,
|
|
214
|
+
shipping_label: Text | null,
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* @type {GoogleProductAPI}
|
|
219
|
+
*/
|
|
220
|
+
export const GoogleAPIProductMap = {
|
|
221
|
+
//id needs programmatic processing
|
|
222
|
+
id: "variants[index].sku", //id of Product also used as sku
|
|
223
|
+
title: "name", //title (name) of Product
|
|
224
|
+
item_group_id: Text,
|
|
225
|
+
item_group_title: Text,
|
|
226
|
+
description: "description",
|
|
227
|
+
link: "URL",
|
|
228
|
+
//image_link and image_additional_links need programmatic process
|
|
229
|
+
image_link: "variants[index].image.URL",
|
|
230
|
+
additional_image_link: "images[all]",
|
|
231
|
+
video_link: null,
|
|
232
|
+
virtual_model_link: null,
|
|
233
|
+
mobile_link: null,
|
|
234
|
+
//availability needs to be programmatic
|
|
235
|
+
availability: null, //"in_stock" | "out_of_stock" | "preorder" | "backorder",
|
|
236
|
+
availability_date: "variants[index].availability_date",
|
|
237
|
+
cost_of_goods_sold: null,
|
|
238
|
+
expiration_date: "variants[index].expiration_date",
|
|
239
|
+
price: "variants[index].pricing.baseprice.value| |variants[index].pricing.baseprice.currencyDescription.displayName",
|
|
240
|
+
sale_price: "variants[index].pricing.saleprice.value| |variants[index].pricing.saleprice.currencyDescription.displayName",
|
|
241
|
+
sale_price_effective_date: "variants[index].pricing.effectiveDate.",
|
|
242
|
+
google_product_category: "google_product_category",
|
|
243
|
+
product_type: string | null,
|
|
244
|
+
brand: "brand.name",
|
|
245
|
+
gtin: "variants[index].gtin",
|
|
246
|
+
mpn: "variants[index].gtin",
|
|
247
|
+
adult: "demographics.adult",
|
|
248
|
+
age_group: "demographics.age_group",
|
|
249
|
+
gender: "demographics.gender",
|
|
250
|
+
condition: "attributes.condition",
|
|
251
|
+
color: "attributes.colors[0]",
|
|
252
|
+
material: "attributes.materials[0]",
|
|
253
|
+
pattern: "attributes.patterns[0]",
|
|
254
|
+
product_length: "variants[index].productMeasurements.dimensions.length&' '&variants[index].productMeasurements.dimensions.unit",
|
|
255
|
+
product_width: "variants[index].productMeasurements.dimensions.width&' '&variants[index].productMeasurements.dimensions.unit",
|
|
256
|
+
product_height: "variants[index].productMeasurements.dimensions.height&' '&variants[index].productMeasurements.dimensions.unit",
|
|
257
|
+
product_highlight: Text | null,
|
|
258
|
+
product_weight: "variants[index].productMeasurements.weight.value&' '&variants[index].productMeasurements.weight.unit",
|
|
259
|
+
question_and_answer: [
|
|
260
|
+
{
|
|
261
|
+
question: Text,
|
|
262
|
+
answer: Text,
|
|
263
|
+
},
|
|
264
|
+
],
|
|
265
|
+
size: Text | null,
|
|
266
|
+
size_type: "regular" | "petite" | "maternity" | "big" | "tall" | "plus",
|
|
267
|
+
size_system: "US" | "UK" | "EU" | "DE" | "FR" | "JP" | "CN" | "IT" | "BR" | "MEX" | "AU",
|
|
268
|
+
variant_option: [{
|
|
269
|
+
name: Text,
|
|
270
|
+
value: Text,
|
|
271
|
+
},],
|
|
272
|
+
ads_redirect: URL | null,
|
|
273
|
+
custom_label_0: Text | null,
|
|
274
|
+
custom_label_1: Text | null,
|
|
275
|
+
custom_label_2: Text | null,
|
|
276
|
+
custom_label_3: Text | null,
|
|
277
|
+
custom_label_4: Text | null,
|
|
278
|
+
promotion_id: Text | null,
|
|
279
|
+
lifestyle_image_link: URL | null,
|
|
280
|
+
short_title: Text | null,
|
|
281
|
+
shipping_length: Text | null,
|
|
282
|
+
shipping_width: Text | null,
|
|
283
|
+
shipping_height: Text | null,
|
|
284
|
+
shipping_label: Text | null,
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
*
|
|
289
|
+
* @param {string} field
|
|
290
|
+
* @param {Product} InventoryProduct
|
|
291
|
+
*/
|
|
292
|
+
function GoogleProductAPIField(field, InventoryProduct) {
|
|
293
|
+
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
const GoogleProductCategory = {
|
|
297
|
+
"Animals & Pet Supplies": {
|
|
298
|
+
index: 1,
|
|
299
|
+
"Live Animals": {
|
|
300
|
+
index: 3237,
|
|
301
|
+
},
|
|
302
|
+
"Pet Supplies": {
|
|
303
|
+
index: 2,
|
|
304
|
+
"Bird Supplies": {
|
|
305
|
+
index: 3,
|
|
306
|
+
"Bird Cage Accessories": {
|
|
307
|
+
index: 7385,
|
|
308
|
+
"Bird Cage Bird Baths": {
|
|
309
|
+
index: 499954,
|
|
310
|
+
},
|
|
311
|
+
"Bird Cage Food & Water Dishes": {
|
|
312
|
+
index: 7386
|
|
313
|
+
},
|
|
314
|
+
},
|
|
315
|
+
"Bird Cages & Stands": {
|
|
316
|
+
index: 4989,
|
|
317
|
+
},
|
|
318
|
+
"Bird Food": {
|
|
319
|
+
index: 4990,
|
|
320
|
+
},
|
|
321
|
+
"Bird Gyms & Playstands": {
|
|
322
|
+
index: 7398,
|
|
323
|
+
},
|
|
324
|
+
"Bird Ladders & Perches": {
|
|
325
|
+
index: 4991,
|
|
326
|
+
},
|
|
327
|
+
"Bird Toys": {
|
|
328
|
+
index: 4992,
|
|
329
|
+
},
|
|
330
|
+
"Bird Treats": {
|
|
331
|
+
index: 4993,
|
|
332
|
+
},
|
|
333
|
+
},
|
|
334
|
+
"Cat Supplies": {
|
|
335
|
+
index: 4,
|
|
336
|
+
"": {
|
|
337
|
+
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
};
|