@leaddreamer/inventorylogic 0.0.3-beta.87 → 0.0.3-beta.89
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 +334 -68
- package/business/APIs/index.js +18 -0
- package/business/Product/googleMerchantAPI.js +368 -43
- package/business/Product/index.js +14 -12
- package/business/Product/squarespace.js +132 -59
- package/index.js +2 -1
- package/package.json +2 -1
- package/whack.js +18 -0
package/README.md
CHANGED
|
@@ -93,19 +93,21 @@ services.
|
|
|
93
93
|
|
|
94
94
|
|
|
95
95
|
* [InventoryLogic](#module_InventoryLogic)
|
|
96
|
-
*
|
|
97
|
-
* [
|
|
96
|
+
* _static_
|
|
97
|
+
* [.databasePromise(firebase, config, thisLogger)](#module_InventoryLogic.databasePromise) ⇒ <code>Promise.Firebase</code>
|
|
98
|
+
* _inner_
|
|
99
|
+
* [~FirebaseConfigObject](#module_InventoryLogic..FirebaseConfigObject) : <code>object</code>
|
|
98
100
|
|
|
99
|
-
<a name="
|
|
101
|
+
<a name="module_InventoryLogic.databasePromise"></a>
|
|
100
102
|
|
|
101
|
-
###
|
|
103
|
+
### InventoryLogic.databasePromise(firebase, config, thisLogger) ⇒ <code>Promise.Firebase</code>
|
|
102
104
|
all-in-one wrapper for a solid subset of CLIENT-SIDE Firebase
|
|
103
105
|
functions, with a consistent interface. There is a parallel set for
|
|
104
106
|
ADMIN-SIDE functions as well.
|
|
105
107
|
Call/initialize with Firebase Configuration settings in an object as
|
|
106
108
|
described below
|
|
107
109
|
|
|
108
|
-
**Kind**:
|
|
110
|
+
**Kind**: static method of [<code>InventoryLogic</code>](#module_InventoryLogic)
|
|
109
111
|
|
|
110
112
|
| Param | Type | Description |
|
|
111
113
|
| --- | --- | --- |
|
|
@@ -122,13 +124,13 @@ import FirebaseWrapper from "@leaddreamer/firebase-wrapper";
|
|
|
122
124
|
FirebaseWrapper(config); //see below
|
|
123
125
|
export * from "@leaddreamer/firebase-wrapper";
|
|
124
126
|
```
|
|
125
|
-
<a name="module_InventoryLogic
|
|
127
|
+
<a name="module_InventoryLogic..FirebaseConfigObject"></a>
|
|
126
128
|
|
|
127
|
-
|
|
129
|
+
### InventoryLogic~FirebaseConfigObject : <code>object</code>
|
|
128
130
|
only authDomain, databaseURL and storageBucket are present when
|
|
129
131
|
called from a cloud environment
|
|
130
132
|
|
|
131
|
-
**Kind**: inner typedef of [<code>
|
|
133
|
+
**Kind**: inner typedef of [<code>InventoryLogic</code>](#module_InventoryLogic)
|
|
132
134
|
**Properties**
|
|
133
135
|
|
|
134
136
|
| Name | Type | Description |
|
|
@@ -151,19 +153,21 @@ frontEnd and NodeJS BackEnd
|
|
|
151
153
|
|
|
152
154
|
|
|
153
155
|
* [InventoryLogic](#module_InventoryLogic)
|
|
154
|
-
*
|
|
155
|
-
* [
|
|
156
|
+
* _static_
|
|
157
|
+
* [.databasePromise(firebase, config, thisLogger)](#module_InventoryLogic.databasePromise) ⇒ <code>Promise.Firebase</code>
|
|
158
|
+
* _inner_
|
|
159
|
+
* [~FirebaseConfigObject](#module_InventoryLogic..FirebaseConfigObject) : <code>object</code>
|
|
156
160
|
|
|
157
|
-
<a name="
|
|
161
|
+
<a name="module_InventoryLogic.databasePromise"></a>
|
|
158
162
|
|
|
159
|
-
###
|
|
163
|
+
### InventoryLogic.databasePromise(firebase, config, thisLogger) ⇒ <code>Promise.Firebase</code>
|
|
160
164
|
all-in-one wrapper for a solid subset of CLIENT-SIDE Firebase
|
|
161
165
|
functions, with a consistent interface. There is a parallel set for
|
|
162
166
|
ADMIN-SIDE functions as well.
|
|
163
167
|
Call/initialize with Firebase Configuration settings in an object as
|
|
164
168
|
described below
|
|
165
169
|
|
|
166
|
-
**Kind**:
|
|
170
|
+
**Kind**: static method of [<code>InventoryLogic</code>](#module_InventoryLogic)
|
|
167
171
|
|
|
168
172
|
| Param | Type | Description |
|
|
169
173
|
| --- | --- | --- |
|
|
@@ -180,13 +184,13 @@ import FirebaseWrapper from "@leaddreamer/firebase-wrapper";
|
|
|
180
184
|
FirebaseWrapper(config); //see below
|
|
181
185
|
export * from "@leaddreamer/firebase-wrapper";
|
|
182
186
|
```
|
|
183
|
-
<a name="module_InventoryLogic
|
|
187
|
+
<a name="module_InventoryLogic..FirebaseConfigObject"></a>
|
|
184
188
|
|
|
185
|
-
|
|
189
|
+
### InventoryLogic~FirebaseConfigObject : <code>object</code>
|
|
186
190
|
only authDomain, databaseURL and storageBucket are present when
|
|
187
191
|
called from a cloud environment
|
|
188
192
|
|
|
189
|
-
**Kind**: inner typedef of [<code>
|
|
193
|
+
**Kind**: inner typedef of [<code>InventoryLogic</code>](#module_InventoryLogic)
|
|
190
194
|
**Properties**
|
|
191
195
|
|
|
192
196
|
| Name | Type | Description |
|
|
@@ -1839,8 +1843,13 @@ Typedefs, constants, support functions and database operations related to Produc
|
|
|
1839
1843
|
|
|
1840
1844
|
* [GoogleProduct](#module_GoogleProduct)
|
|
1841
1845
|
* _static_
|
|
1842
|
-
* [.
|
|
1846
|
+
* [.ggProductMap](#module_GoogleProduct.ggProductMap) : <code>GoogleProductAPI</code>
|
|
1847
|
+
* [.ggProductInputMap](#module_GoogleProduct.ggProductInputMap) : <code>GoogleProductAPI</code>
|
|
1848
|
+
* [.ggProductAttributeMap](#module_GoogleProduct.ggProductAttributeMap) : <code>GoogleProductAttributes</code>
|
|
1849
|
+
* [.ggProductFeedToProducts(feedJSON)](#module_GoogleProduct.ggProductFeedToProducts) ⇒ <code>Array.Products</code>
|
|
1850
|
+
* [.productsToGgProductFeed(productsArray)](#module_GoogleProduct.productsToGgProductFeed)
|
|
1843
1851
|
* _inner_
|
|
1852
|
+
* [~recursiveMapWalk(thisObject, labels)](#module_GoogleProduct..recursiveMapWalk)
|
|
1844
1853
|
* [~googleProductAPIField(field, InventoryProduct)](#module_GoogleProduct..googleProductAPIField)
|
|
1845
1854
|
* [~SKU](#module_GoogleProduct..SKU) : <code>string</code>
|
|
1846
1855
|
* [~Name](#module_GoogleProduct..Name) : <code>string</code>
|
|
@@ -1858,18 +1867,73 @@ Typedefs, constants, support functions and database operations related to Produc
|
|
|
1858
1867
|
* [~QAObject](#module_GoogleProduct..QAObject) : <code>object</code>
|
|
1859
1868
|
* [~availabilityEnum](#module_GoogleProduct..availabilityEnum) : <code>"in\_stock"</code> \| <code>"out\_of\_stock"</code> \| <code>"preorder"</code> \| <code>"backorder"</code>
|
|
1860
1869
|
* [~GoogleProduct](#module_GoogleProduct..GoogleProduct) : <code>object</code>
|
|
1870
|
+
* [~Price](#module_GoogleProduct..Price) : <code>object</code>
|
|
1861
1871
|
* [~SKU](#module_GoogleProduct..SKU) : <code>string</code>
|
|
1862
1872
|
* [~Name](#module_GoogleProduct..Name) : <code>string</code>
|
|
1863
1873
|
* [~SizeTypeEnumeration](#module_GoogleProduct..SizeTypeEnumeration) : <code>"regular"</code> \| <code>"petite"</code> \| <code>"maternity"</code> \| <code>"big"</code> \| <code>"tall"</code> \| <code>"plus"</code>
|
|
1864
1874
|
* [~SizeSystemEnumeration](#module_GoogleProduct..SizeSystemEnumeration) : <code>"US"</code> \| <code>"UK"</code> \| <code>"EU"</code> \| <code>"DE"</code> \| <code>"FR"</code> \| <code>"JP"</code> \| <code>"CN"</code> \| <code>"IT"</code> \| <code>"BR"</code> \| <code>"MEX"</code> \| <code>"AU"</code>
|
|
1865
1875
|
* [~GoogleAPIVariantOption](#module_GoogleProduct..GoogleAPIVariantOption) : <code>object</code>
|
|
1866
1876
|
* [~QAObject](#module_GoogleProduct..QAObject) : <code>object</code>
|
|
1877
|
+
* [~GoogleProductAttributes](#module_GoogleProduct..GoogleProductAttributes) : <code>object</code>
|
|
1878
|
+
* [~CustomAttribute](#module_GoogleProduct..CustomAttribute) : <code>object</code>
|
|
1867
1879
|
* [~GoogleProductAPI](#module_GoogleProduct..GoogleProductAPI) : <code>object</code>
|
|
1868
1880
|
|
|
1869
|
-
<a name="module_GoogleProduct.
|
|
1881
|
+
<a name="module_GoogleProduct.ggProductMap"></a>
|
|
1882
|
+
|
|
1883
|
+
### GoogleProduct.ggProductMap : <code>GoogleProductAPI</code>
|
|
1884
|
+
A Map between GoogleProductAPI and Pricing Internal API
|
|
1885
|
+
|
|
1886
|
+
**Kind**: static constant of [<code>GoogleProduct</code>](#module_GoogleProduct)
|
|
1887
|
+
<a name="module_GoogleProduct.ggProductInputMap"></a>
|
|
1888
|
+
|
|
1889
|
+
### GoogleProduct.ggProductInputMap : <code>GoogleProductAPI</code>
|
|
1890
|
+
Map between GoogleProductAPI and internal Product Data
|
|
1891
|
+
Note that when gg >> internal, index is *discovered* by searching
|
|
1892
|
+
for a matching item_group_id <<>> id. if item_group_id is *not*
|
|
1893
|
+
found add a new top-level product.
|
|
1894
|
+
Then look within varinats for a matching SKU; if found, use that
|
|
1895
|
+
value for the index; if *not* found add the variant.
|
|
1896
|
+
|
|
1897
|
+
**Kind**: static constant of [<code>GoogleProduct</code>](#module_GoogleProduct)
|
|
1898
|
+
<a name="module_GoogleProduct.ggProductAttributeMap"></a>
|
|
1870
1899
|
|
|
1871
|
-
### GoogleProduct.
|
|
1900
|
+
### GoogleProduct.ggProductAttributeMap : <code>GoogleProductAttributes</code>
|
|
1872
1901
|
**Kind**: static constant of [<code>GoogleProduct</code>](#module_GoogleProduct)
|
|
1902
|
+
<a name="module_GoogleProduct.ggProductFeedToProducts"></a>
|
|
1903
|
+
|
|
1904
|
+
### GoogleProduct.ggProductFeedToProducts(feedJSON) ⇒ <code>Array.Products</code>
|
|
1905
|
+
Converts a JSON encoded Squarespace product feed to an array of internal products.
|
|
1906
|
+
|
|
1907
|
+
**Kind**: static method of [<code>GoogleProduct</code>](#module_GoogleProduct)
|
|
1908
|
+
|
|
1909
|
+
| Param | Type |
|
|
1910
|
+
| --- | --- |
|
|
1911
|
+
| feedJSON | <code>JSON</code> |
|
|
1912
|
+
|
|
1913
|
+
<a name="module_GoogleProduct.productsToGgProductFeed"></a>
|
|
1914
|
+
|
|
1915
|
+
### GoogleProduct.productsToGgProductFeed(productsArray)
|
|
1916
|
+
Takes an array of internal Product Objects and converts it to
|
|
1917
|
+
a JSON feed
|
|
1918
|
+
|
|
1919
|
+
**Kind**: static method of [<code>GoogleProduct</code>](#module_GoogleProduct)
|
|
1920
|
+
|
|
1921
|
+
| Param | Type |
|
|
1922
|
+
| --- | --- |
|
|
1923
|
+
| productsArray | <code>Array.Product</code> |
|
|
1924
|
+
|
|
1925
|
+
<a name="module_GoogleProduct..recursiveMapWalk"></a>
|
|
1926
|
+
|
|
1927
|
+
### GoogleProduct~recursiveMapWalk(thisObject, labels)
|
|
1928
|
+
Uses an array of object member labels to insert a value into an object
|
|
1929
|
+
|
|
1930
|
+
**Kind**: inner method of [<code>GoogleProduct</code>](#module_GoogleProduct)
|
|
1931
|
+
|
|
1932
|
+
| Param | Type |
|
|
1933
|
+
| --- | --- |
|
|
1934
|
+
| thisObject | <code>object</code> |
|
|
1935
|
+
| labels | <code>Array.string</code> |
|
|
1936
|
+
|
|
1873
1937
|
<a name="module_GoogleProduct..googleProductAPIField"></a>
|
|
1874
1938
|
|
|
1875
1939
|
### GoogleProduct~googleProductAPIField(field, InventoryProduct)
|
|
@@ -2116,6 +2180,17 @@ a Google Product record
|
|
|
2116
2180
|
| shipping_width | <code>Text</code> | The width of the product used to calculate the shipping cost by dimensional weight |
|
|
2117
2181
|
| shipping_height | <code>Text</code> | The height of the product used to calculate the shipping cost by dimensional weight |
|
|
2118
2182
|
|
|
2183
|
+
<a name="module_GoogleProduct..Price"></a>
|
|
2184
|
+
|
|
2185
|
+
### GoogleProduct~Price : <code>object</code>
|
|
2186
|
+
**Kind**: inner typedef of [<code>GoogleProduct</code>](#module_GoogleProduct)
|
|
2187
|
+
**Properties**
|
|
2188
|
+
|
|
2189
|
+
| Name | Type | Description |
|
|
2190
|
+
| --- | --- | --- |
|
|
2191
|
+
| amountMicros | <code>string</code> | int64. The price represented as a number in micros (1 million micros is an equivalent to one's currency standard unit, for example, 1 USD = 1000000 micros). |
|
|
2192
|
+
| currencyCode | <code>string</code> | The currency of the price using three-letter acronyms according to ISO 4217. |
|
|
2193
|
+
|
|
2119
2194
|
<a name="module_GoogleProduct..SKU"></a>
|
|
2120
2195
|
|
|
2121
2196
|
### GoogleProduct~SKU : <code>string</code>
|
|
@@ -2162,10 +2237,10 @@ Google Merchant API User-, merchant-, and manufacturer-authored questions and an
|
|
|
2162
2237
|
| question | <code>Text</code> | Max. 1000 characters. |
|
|
2163
2238
|
| answer | <code>Text</code> | Max. 1000 characters. |
|
|
2164
2239
|
|
|
2165
|
-
<a name="module_GoogleProduct..
|
|
2240
|
+
<a name="module_GoogleProduct..GoogleProductAttributes"></a>
|
|
2166
2241
|
|
|
2167
|
-
### GoogleProduct~
|
|
2168
|
-
a Google Product
|
|
2242
|
+
### GoogleProduct~GoogleProductAttributes : <code>object</code>
|
|
2243
|
+
a Google Product Attributes - Product-specific part of product Feed
|
|
2169
2244
|
|
|
2170
2245
|
**Kind**: inner typedef of [<code>GoogleProduct</code>](#module_GoogleProduct)
|
|
2171
2246
|
**Properties**
|
|
@@ -2185,15 +2260,15 @@ a Google Product record
|
|
|
2185
2260
|
| mobile_link | <code>URL</code> | Your product’s mobile-optimized landing page when you have a different URL for mobile and desktop traffic |
|
|
2186
2261
|
| availability | <code>"in\_stock"</code> \| <code>"out\_of\_stock"</code> \| <code>"preorder"</code> \| <code>"backorder"</code> | Accurately submit the product's availability and match the availability from your landing page, checkout pages, and structured data (for example, “in_stock” or “out_of_stock” in your Schema.org markup). If an item is out of stock, the price must still be clearly visible on the landing page. Provide the availability date [availability_date] attribute if you submit preorder [preorder] or backorder [backorder] as the availability value. |
|
|
2187
2262
|
| availability_date | <code>string</code> \| <code>ISO8601</code> | Use this attribute if your product's availability is set to preorder. Provide a value up to one year in the future. The availability date should also be added to the product’s landing page and be clear to your customers (for example, “May 6, 2023”). If an exact date can’t be provided, you can use an estimated date (for example, “May 2023”). |
|
|
2188
|
-
| cost_of_goods_sold | <code>
|
|
2263
|
+
| cost_of_goods_sold | <code>Price</code> | The costs associated with the sale of a particular product as defined by the accounting convention you set up. These costs may include material, labor, freight, or other overhead expenses. By submittingthe COGS for your products, you gain insights about other metrics, such as your gross margin and the amount of revenue generated by your ads and free listings. |
|
|
2189
2264
|
| expiration_date | <code>ISO8601</code> | The date that your product should stop showing |
|
|
2190
|
-
| price | <code>
|
|
2191
|
-
| sale_price | <code>
|
|
2265
|
+
| price | <code>Price</code> | |
|
|
2266
|
+
| sale_price | <code>Price</code> | |
|
|
2192
2267
|
| sale_price_effective_date | <code>DateRange</code> | |
|
|
2193
2268
|
| google_product_category | <code>GoogleProductTaxonomy</code> | |
|
|
2194
2269
|
| product_type | <code>string</code> | "Casual" google_product_category |
|
|
2195
2270
|
| brand | <code>Text</code> | The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business user. |
|
|
2196
|
-
| gtin | <code
|
|
2271
|
+
| gtin | <code>"gtin8"</code> \| <code>"gtin12"</code> \| <code>"gtin13"</code> \| <code>"gtin14"</code> \| <code>"gtin"</code> | |
|
|
2197
2272
|
| mpn | <code>Text</code> | The Manufacturer Part Number (MPN) of the product, or the product to which the offer refers. |
|
|
2198
2273
|
| adult | <code>"no"</code> \| <code>"yes"</code> | |
|
|
2199
2274
|
| age_group | <code>Text</code> | newborn | infant | toddler | kids | adult |
|
|
@@ -2227,6 +2302,42 @@ a Google Product record
|
|
|
2227
2302
|
| shipping_width | <code>Text</code> | The width of the product used to calculate the shipping cost by dimensional weight |
|
|
2228
2303
|
| shipping_height | <code>Text</code> | The height of the product used to calculate the shipping cost by dimensional weight |
|
|
2229
2304
|
|
|
2305
|
+
<a name="module_GoogleProduct..CustomAttribute"></a>
|
|
2306
|
+
|
|
2307
|
+
### GoogleProduct~CustomAttribute : <code>object</code>
|
|
2308
|
+
A message that represents custom attributes. Exactly one of value or groupValues must not be empty.
|
|
2309
|
+
|
|
2310
|
+
**Kind**: inner typedef of [<code>GoogleProduct</code>](#module_GoogleProduct)
|
|
2311
|
+
**Properties**
|
|
2312
|
+
|
|
2313
|
+
| Name | Type | Description |
|
|
2314
|
+
| --- | --- | --- |
|
|
2315
|
+
| name | <code>string</code> | The name of the attribute. |
|
|
2316
|
+
| value | <code>string</code> | The value of the attribute. If value is not empty, groupValues must be empty. |
|
|
2317
|
+
| groupValues | <code>Array.CustomAttribute</code> | Subattributes within this attribute group. If groupValues is not empty, value must be empty. |
|
|
2318
|
+
|
|
2319
|
+
<a name="module_GoogleProduct..GoogleProductAPI"></a>
|
|
2320
|
+
|
|
2321
|
+
### GoogleProduct~GoogleProductAPI : <code>object</code>
|
|
2322
|
+
Google Product feed "wrapper"
|
|
2323
|
+
|
|
2324
|
+
**Kind**: inner typedef of [<code>GoogleProduct</code>](#module_GoogleProduct)
|
|
2325
|
+
**Properties**
|
|
2326
|
+
|
|
2327
|
+
| Name | Type | Description |
|
|
2328
|
+
| --- | --- | --- |
|
|
2329
|
+
| name | <code>string</code> | Identifier. The name of the product. Format: accounts/{account}/productInputs/{productinput} The {productinput} segment is a unique identifier for the product. This identifier must be unique within a merchant account and generally follows the structure: contentLanguage~feedLabel~offerId. Example: en~US~sku123 For legacy local products, the structure is: local~contentLanguage~feedLabel~offerId. Example: local~en~US~sku123 |
|
|
2330
|
+
| base64EncodedName | <code>string</code> | Output only. The unpadded base64url encoded name of the product input. Format: accounts/{account}/productInputs/{productinput} where the last section productinput is the unpadded base64url encoding of the contentLanguage~feedLabel~offerId name. Example: accounts/123/productInputs/ZW5-VVN-c2t1LzEyMw for the decoded product input name accounts/123/productInputs/en~US~sku/123. This field can be used directly as input to the API methods that require the product input name to be encoded if it contains special characters, for example GetProductInput. |
|
|
2331
|
+
| product | <code>string</code> | Output only. The name of the processed product. Format: accounts/{account}/products/{product} |
|
|
2332
|
+
| base64EncodedProduct | <code>string</code> | Output only. The unpadded base64url encoded name of the processed product. Format: accounts/{account}/products/{product} where the last section product is the unpadded base64url encoding of the contentLanguage~feedLabel~offerId name. Example: accounts/123/products/ZW5-VVN-c2t1LzEyMw for the decoded product name accounts/123/products/en~US~sku/123. This field can be used directly as input to the API methods that require the product name to be encoded if it contains special characters, for example GetProduct. |
|
|
2333
|
+
| legacyLocal | <code>boolean</code> | Immutable. Determines whether the product is only targeting local destinations and whether the product name should be distinguished with a local~ prefix. For example, accounts/123/productInputs/local~en~US~sku123. If a product that is not legacyLocal is already targeting local destinations, creating a legacyLocal product with an otherwise matching name will fail. |
|
|
2334
|
+
| offerId | <code>string</code> | Required. Immutable. Your unique identifier for the product. This is the same for the product input and processed product. Leading and trailing whitespaces are stripped and multiple whitespaces are replaced by a single whitespace upon submission. See the products data specification for details. |
|
|
2335
|
+
| contentLanguage | <code>string</code> | Required. Immutable. The two-letter ISO 639-1 language code for the product. |
|
|
2336
|
+
| feedLabel | <code>string</code> | Required. Immutable. The feed label that lets you categorize and identify your products. The maximum allowed characters are 20, and the supported characters are A-Z, 0-9, hyphen, and underscore. The feed label must not include any spaces. For more information, see Using feed labels. |
|
|
2337
|
+
| productAttributes | <code>GoogleProductAttributes</code> | Optional. A list of strongly-typed product attributes. |
|
|
2338
|
+
| customAttributes | <code>Array.CustomAttribute</code> | Optional. A list of custom (merchant-provided) attributes. It can also be used for submitting any attribute of the data specification in its generic form (for example, { "name": "size type", "value": "regular" }). This is useful for submitting attributes not explicitly exposed by the API. Maximum allowed number of characters for each custom attribute is 10240 (represents sum of characters for name and value). Maximum 2500 custom attributes can be set per product, with total size of 102.4kB. Underscores in custom attribute names are replaced by spaces upon insertion. |
|
|
2339
|
+
| versionNumber | <code>string</code> | Optional. Immutable. Represents the existing version (freshness) of the product, which can be used to preserve the right order when multiple updates are done at the same time. If set, the insertion is prevented when version number is lower than the current version number of the existing product. Re-insertion (for example, product refresh after 30 days) can be performed with the current versionNumber. Only supported for insertions into primary data sources. Do not set this field for updates. Do not set this field for insertions into supplemental data sources. If the operation is prevented, the aborted exception will be thrown. |
|
|
2340
|
+
|
|
2230
2341
|
<a name="module_GoogleProduct"></a>
|
|
2231
2342
|
|
|
2232
2343
|
## GoogleProduct
|
|
@@ -2235,8 +2346,13 @@ Typedefs, constants, support functions and database operations related to Produc
|
|
|
2235
2346
|
|
|
2236
2347
|
* [GoogleProduct](#module_GoogleProduct)
|
|
2237
2348
|
* _static_
|
|
2238
|
-
* [.
|
|
2349
|
+
* [.ggProductMap](#module_GoogleProduct.ggProductMap) : <code>GoogleProductAPI</code>
|
|
2350
|
+
* [.ggProductInputMap](#module_GoogleProduct.ggProductInputMap) : <code>GoogleProductAPI</code>
|
|
2351
|
+
* [.ggProductAttributeMap](#module_GoogleProduct.ggProductAttributeMap) : <code>GoogleProductAttributes</code>
|
|
2352
|
+
* [.ggProductFeedToProducts(feedJSON)](#module_GoogleProduct.ggProductFeedToProducts) ⇒ <code>Array.Products</code>
|
|
2353
|
+
* [.productsToGgProductFeed(productsArray)](#module_GoogleProduct.productsToGgProductFeed)
|
|
2239
2354
|
* _inner_
|
|
2355
|
+
* [~recursiveMapWalk(thisObject, labels)](#module_GoogleProduct..recursiveMapWalk)
|
|
2240
2356
|
* [~googleProductAPIField(field, InventoryProduct)](#module_GoogleProduct..googleProductAPIField)
|
|
2241
2357
|
* [~SKU](#module_GoogleProduct..SKU) : <code>string</code>
|
|
2242
2358
|
* [~Name](#module_GoogleProduct..Name) : <code>string</code>
|
|
@@ -2254,18 +2370,73 @@ Typedefs, constants, support functions and database operations related to Produc
|
|
|
2254
2370
|
* [~QAObject](#module_GoogleProduct..QAObject) : <code>object</code>
|
|
2255
2371
|
* [~availabilityEnum](#module_GoogleProduct..availabilityEnum) : <code>"in\_stock"</code> \| <code>"out\_of\_stock"</code> \| <code>"preorder"</code> \| <code>"backorder"</code>
|
|
2256
2372
|
* [~GoogleProduct](#module_GoogleProduct..GoogleProduct) : <code>object</code>
|
|
2373
|
+
* [~Price](#module_GoogleProduct..Price) : <code>object</code>
|
|
2257
2374
|
* [~SKU](#module_GoogleProduct..SKU) : <code>string</code>
|
|
2258
2375
|
* [~Name](#module_GoogleProduct..Name) : <code>string</code>
|
|
2259
2376
|
* [~SizeTypeEnumeration](#module_GoogleProduct..SizeTypeEnumeration) : <code>"regular"</code> \| <code>"petite"</code> \| <code>"maternity"</code> \| <code>"big"</code> \| <code>"tall"</code> \| <code>"plus"</code>
|
|
2260
2377
|
* [~SizeSystemEnumeration](#module_GoogleProduct..SizeSystemEnumeration) : <code>"US"</code> \| <code>"UK"</code> \| <code>"EU"</code> \| <code>"DE"</code> \| <code>"FR"</code> \| <code>"JP"</code> \| <code>"CN"</code> \| <code>"IT"</code> \| <code>"BR"</code> \| <code>"MEX"</code> \| <code>"AU"</code>
|
|
2261
2378
|
* [~GoogleAPIVariantOption](#module_GoogleProduct..GoogleAPIVariantOption) : <code>object</code>
|
|
2262
2379
|
* [~QAObject](#module_GoogleProduct..QAObject) : <code>object</code>
|
|
2380
|
+
* [~GoogleProductAttributes](#module_GoogleProduct..GoogleProductAttributes) : <code>object</code>
|
|
2381
|
+
* [~CustomAttribute](#module_GoogleProduct..CustomAttribute) : <code>object</code>
|
|
2263
2382
|
* [~GoogleProductAPI](#module_GoogleProduct..GoogleProductAPI) : <code>object</code>
|
|
2264
2383
|
|
|
2265
|
-
<a name="module_GoogleProduct.
|
|
2384
|
+
<a name="module_GoogleProduct.ggProductMap"></a>
|
|
2385
|
+
|
|
2386
|
+
### GoogleProduct.ggProductMap : <code>GoogleProductAPI</code>
|
|
2387
|
+
A Map between GoogleProductAPI and Pricing Internal API
|
|
2388
|
+
|
|
2389
|
+
**Kind**: static constant of [<code>GoogleProduct</code>](#module_GoogleProduct)
|
|
2390
|
+
<a name="module_GoogleProduct.ggProductInputMap"></a>
|
|
2391
|
+
|
|
2392
|
+
### GoogleProduct.ggProductInputMap : <code>GoogleProductAPI</code>
|
|
2393
|
+
Map between GoogleProductAPI and internal Product Data
|
|
2394
|
+
Note that when gg >> internal, index is *discovered* by searching
|
|
2395
|
+
for a matching item_group_id <<>> id. if item_group_id is *not*
|
|
2396
|
+
found add a new top-level product.
|
|
2397
|
+
Then look within varinats for a matching SKU; if found, use that
|
|
2398
|
+
value for the index; if *not* found add the variant.
|
|
2399
|
+
|
|
2400
|
+
**Kind**: static constant of [<code>GoogleProduct</code>](#module_GoogleProduct)
|
|
2401
|
+
<a name="module_GoogleProduct.ggProductAttributeMap"></a>
|
|
2266
2402
|
|
|
2267
|
-
### GoogleProduct.
|
|
2403
|
+
### GoogleProduct.ggProductAttributeMap : <code>GoogleProductAttributes</code>
|
|
2268
2404
|
**Kind**: static constant of [<code>GoogleProduct</code>](#module_GoogleProduct)
|
|
2405
|
+
<a name="module_GoogleProduct.ggProductFeedToProducts"></a>
|
|
2406
|
+
|
|
2407
|
+
### GoogleProduct.ggProductFeedToProducts(feedJSON) ⇒ <code>Array.Products</code>
|
|
2408
|
+
Converts a JSON encoded Squarespace product feed to an array of internal products.
|
|
2409
|
+
|
|
2410
|
+
**Kind**: static method of [<code>GoogleProduct</code>](#module_GoogleProduct)
|
|
2411
|
+
|
|
2412
|
+
| Param | Type |
|
|
2413
|
+
| --- | --- |
|
|
2414
|
+
| feedJSON | <code>JSON</code> |
|
|
2415
|
+
|
|
2416
|
+
<a name="module_GoogleProduct.productsToGgProductFeed"></a>
|
|
2417
|
+
|
|
2418
|
+
### GoogleProduct.productsToGgProductFeed(productsArray)
|
|
2419
|
+
Takes an array of internal Product Objects and converts it to
|
|
2420
|
+
a JSON feed
|
|
2421
|
+
|
|
2422
|
+
**Kind**: static method of [<code>GoogleProduct</code>](#module_GoogleProduct)
|
|
2423
|
+
|
|
2424
|
+
| Param | Type |
|
|
2425
|
+
| --- | --- |
|
|
2426
|
+
| productsArray | <code>Array.Product</code> |
|
|
2427
|
+
|
|
2428
|
+
<a name="module_GoogleProduct..recursiveMapWalk"></a>
|
|
2429
|
+
|
|
2430
|
+
### GoogleProduct~recursiveMapWalk(thisObject, labels)
|
|
2431
|
+
Uses an array of object member labels to insert a value into an object
|
|
2432
|
+
|
|
2433
|
+
**Kind**: inner method of [<code>GoogleProduct</code>](#module_GoogleProduct)
|
|
2434
|
+
|
|
2435
|
+
| Param | Type |
|
|
2436
|
+
| --- | --- |
|
|
2437
|
+
| thisObject | <code>object</code> |
|
|
2438
|
+
| labels | <code>Array.string</code> |
|
|
2439
|
+
|
|
2269
2440
|
<a name="module_GoogleProduct..googleProductAPIField"></a>
|
|
2270
2441
|
|
|
2271
2442
|
### GoogleProduct~googleProductAPIField(field, InventoryProduct)
|
|
@@ -2512,6 +2683,17 @@ a Google Product record
|
|
|
2512
2683
|
| shipping_width | <code>Text</code> | The width of the product used to calculate the shipping cost by dimensional weight |
|
|
2513
2684
|
| shipping_height | <code>Text</code> | The height of the product used to calculate the shipping cost by dimensional weight |
|
|
2514
2685
|
|
|
2686
|
+
<a name="module_GoogleProduct..Price"></a>
|
|
2687
|
+
|
|
2688
|
+
### GoogleProduct~Price : <code>object</code>
|
|
2689
|
+
**Kind**: inner typedef of [<code>GoogleProduct</code>](#module_GoogleProduct)
|
|
2690
|
+
**Properties**
|
|
2691
|
+
|
|
2692
|
+
| Name | Type | Description |
|
|
2693
|
+
| --- | --- | --- |
|
|
2694
|
+
| amountMicros | <code>string</code> | int64. The price represented as a number in micros (1 million micros is an equivalent to one's currency standard unit, for example, 1 USD = 1000000 micros). |
|
|
2695
|
+
| currencyCode | <code>string</code> | The currency of the price using three-letter acronyms according to ISO 4217. |
|
|
2696
|
+
|
|
2515
2697
|
<a name="module_GoogleProduct..SKU"></a>
|
|
2516
2698
|
|
|
2517
2699
|
### GoogleProduct~SKU : <code>string</code>
|
|
@@ -2558,10 +2740,10 @@ Google Merchant API User-, merchant-, and manufacturer-authored questions and an
|
|
|
2558
2740
|
| question | <code>Text</code> | Max. 1000 characters. |
|
|
2559
2741
|
| answer | <code>Text</code> | Max. 1000 characters. |
|
|
2560
2742
|
|
|
2561
|
-
<a name="module_GoogleProduct..
|
|
2743
|
+
<a name="module_GoogleProduct..GoogleProductAttributes"></a>
|
|
2562
2744
|
|
|
2563
|
-
### GoogleProduct~
|
|
2564
|
-
a Google Product
|
|
2745
|
+
### GoogleProduct~GoogleProductAttributes : <code>object</code>
|
|
2746
|
+
a Google Product Attributes - Product-specific part of product Feed
|
|
2565
2747
|
|
|
2566
2748
|
**Kind**: inner typedef of [<code>GoogleProduct</code>](#module_GoogleProduct)
|
|
2567
2749
|
**Properties**
|
|
@@ -2581,15 +2763,15 @@ a Google Product record
|
|
|
2581
2763
|
| mobile_link | <code>URL</code> | Your product’s mobile-optimized landing page when you have a different URL for mobile and desktop traffic |
|
|
2582
2764
|
| availability | <code>"in\_stock"</code> \| <code>"out\_of\_stock"</code> \| <code>"preorder"</code> \| <code>"backorder"</code> | Accurately submit the product's availability and match the availability from your landing page, checkout pages, and structured data (for example, “in_stock” or “out_of_stock” in your Schema.org markup). If an item is out of stock, the price must still be clearly visible on the landing page. Provide the availability date [availability_date] attribute if you submit preorder [preorder] or backorder [backorder] as the availability value. |
|
|
2583
2765
|
| availability_date | <code>string</code> \| <code>ISO8601</code> | Use this attribute if your product's availability is set to preorder. Provide a value up to one year in the future. The availability date should also be added to the product’s landing page and be clear to your customers (for example, “May 6, 2023”). If an exact date can’t be provided, you can use an estimated date (for example, “May 2023”). |
|
|
2584
|
-
| cost_of_goods_sold | <code>
|
|
2766
|
+
| cost_of_goods_sold | <code>Price</code> | The costs associated with the sale of a particular product as defined by the accounting convention you set up. These costs may include material, labor, freight, or other overhead expenses. By submittingthe COGS for your products, you gain insights about other metrics, such as your gross margin and the amount of revenue generated by your ads and free listings. |
|
|
2585
2767
|
| expiration_date | <code>ISO8601</code> | The date that your product should stop showing |
|
|
2586
|
-
| price | <code>
|
|
2587
|
-
| sale_price | <code>
|
|
2768
|
+
| price | <code>Price</code> | |
|
|
2769
|
+
| sale_price | <code>Price</code> | |
|
|
2588
2770
|
| sale_price_effective_date | <code>DateRange</code> | |
|
|
2589
2771
|
| google_product_category | <code>GoogleProductTaxonomy</code> | |
|
|
2590
2772
|
| product_type | <code>string</code> | "Casual" google_product_category |
|
|
2591
2773
|
| brand | <code>Text</code> | The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business user. |
|
|
2592
|
-
| gtin | <code
|
|
2774
|
+
| gtin | <code>"gtin8"</code> \| <code>"gtin12"</code> \| <code>"gtin13"</code> \| <code>"gtin14"</code> \| <code>"gtin"</code> | |
|
|
2593
2775
|
| mpn | <code>Text</code> | The Manufacturer Part Number (MPN) of the product, or the product to which the offer refers. |
|
|
2594
2776
|
| adult | <code>"no"</code> \| <code>"yes"</code> | |
|
|
2595
2777
|
| age_group | <code>Text</code> | newborn | infant | toddler | kids | adult |
|
|
@@ -2623,6 +2805,42 @@ a Google Product record
|
|
|
2623
2805
|
| shipping_width | <code>Text</code> | The width of the product used to calculate the shipping cost by dimensional weight |
|
|
2624
2806
|
| shipping_height | <code>Text</code> | The height of the product used to calculate the shipping cost by dimensional weight |
|
|
2625
2807
|
|
|
2808
|
+
<a name="module_GoogleProduct..CustomAttribute"></a>
|
|
2809
|
+
|
|
2810
|
+
### GoogleProduct~CustomAttribute : <code>object</code>
|
|
2811
|
+
A message that represents custom attributes. Exactly one of value or groupValues must not be empty.
|
|
2812
|
+
|
|
2813
|
+
**Kind**: inner typedef of [<code>GoogleProduct</code>](#module_GoogleProduct)
|
|
2814
|
+
**Properties**
|
|
2815
|
+
|
|
2816
|
+
| Name | Type | Description |
|
|
2817
|
+
| --- | --- | --- |
|
|
2818
|
+
| name | <code>string</code> | The name of the attribute. |
|
|
2819
|
+
| value | <code>string</code> | The value of the attribute. If value is not empty, groupValues must be empty. |
|
|
2820
|
+
| groupValues | <code>Array.CustomAttribute</code> | Subattributes within this attribute group. If groupValues is not empty, value must be empty. |
|
|
2821
|
+
|
|
2822
|
+
<a name="module_GoogleProduct..GoogleProductAPI"></a>
|
|
2823
|
+
|
|
2824
|
+
### GoogleProduct~GoogleProductAPI : <code>object</code>
|
|
2825
|
+
Google Product feed "wrapper"
|
|
2826
|
+
|
|
2827
|
+
**Kind**: inner typedef of [<code>GoogleProduct</code>](#module_GoogleProduct)
|
|
2828
|
+
**Properties**
|
|
2829
|
+
|
|
2830
|
+
| Name | Type | Description |
|
|
2831
|
+
| --- | --- | --- |
|
|
2832
|
+
| name | <code>string</code> | Identifier. The name of the product. Format: accounts/{account}/productInputs/{productinput} The {productinput} segment is a unique identifier for the product. This identifier must be unique within a merchant account and generally follows the structure: contentLanguage~feedLabel~offerId. Example: en~US~sku123 For legacy local products, the structure is: local~contentLanguage~feedLabel~offerId. Example: local~en~US~sku123 |
|
|
2833
|
+
| base64EncodedName | <code>string</code> | Output only. The unpadded base64url encoded name of the product input. Format: accounts/{account}/productInputs/{productinput} where the last section productinput is the unpadded base64url encoding of the contentLanguage~feedLabel~offerId name. Example: accounts/123/productInputs/ZW5-VVN-c2t1LzEyMw for the decoded product input name accounts/123/productInputs/en~US~sku/123. This field can be used directly as input to the API methods that require the product input name to be encoded if it contains special characters, for example GetProductInput. |
|
|
2834
|
+
| product | <code>string</code> | Output only. The name of the processed product. Format: accounts/{account}/products/{product} |
|
|
2835
|
+
| base64EncodedProduct | <code>string</code> | Output only. The unpadded base64url encoded name of the processed product. Format: accounts/{account}/products/{product} where the last section product is the unpadded base64url encoding of the contentLanguage~feedLabel~offerId name. Example: accounts/123/products/ZW5-VVN-c2t1LzEyMw for the decoded product name accounts/123/products/en~US~sku/123. This field can be used directly as input to the API methods that require the product name to be encoded if it contains special characters, for example GetProduct. |
|
|
2836
|
+
| legacyLocal | <code>boolean</code> | Immutable. Determines whether the product is only targeting local destinations and whether the product name should be distinguished with a local~ prefix. For example, accounts/123/productInputs/local~en~US~sku123. If a product that is not legacyLocal is already targeting local destinations, creating a legacyLocal product with an otherwise matching name will fail. |
|
|
2837
|
+
| offerId | <code>string</code> | Required. Immutable. Your unique identifier for the product. This is the same for the product input and processed product. Leading and trailing whitespaces are stripped and multiple whitespaces are replaced by a single whitespace upon submission. See the products data specification for details. |
|
|
2838
|
+
| contentLanguage | <code>string</code> | Required. Immutable. The two-letter ISO 639-1 language code for the product. |
|
|
2839
|
+
| feedLabel | <code>string</code> | Required. Immutable. The feed label that lets you categorize and identify your products. The maximum allowed characters are 20, and the supported characters are A-Z, 0-9, hyphen, and underscore. The feed label must not include any spaces. For more information, see Using feed labels. |
|
|
2840
|
+
| productAttributes | <code>GoogleProductAttributes</code> | Optional. A list of strongly-typed product attributes. |
|
|
2841
|
+
| customAttributes | <code>Array.CustomAttribute</code> | Optional. A list of custom (merchant-provided) attributes. It can also be used for submitting any attribute of the data specification in its generic form (for example, { "name": "size type", "value": "regular" }). This is useful for submitting attributes not explicitly exposed by the API. Maximum allowed number of characters for each custom attribute is 10240 (represents sum of characters for name and value). Maximum 2500 custom attributes can be set per product, with total size of 102.4kB. Underscores in custom attribute names are replaced by spaces upon insertion. |
|
|
2842
|
+
| versionNumber | <code>string</code> | Optional. Immutable. Represents the existing version (freshness) of the product, which can be used to preserve the right order when multiple updates are done at the same time. If set, the insertion is prevented when version number is lower than the current version number of the existing product. Re-insertion (for example, product refresh after 30 days) can be performed with the current versionNumber. Only supported for insertions into primary data sources. Do not set this field for updates. Do not set this field for insertions into supplemental data sources. If the operation is prevented, the aborted exception will be thrown. |
|
|
2843
|
+
|
|
2626
2844
|
<a name="module_Product"></a>
|
|
2627
2845
|
|
|
2628
2846
|
## Product
|
|
@@ -2657,7 +2875,7 @@ Typedefs, constants, support functions and database operations related to Produc
|
|
|
2657
2875
|
* [~MetaData](#module_Product..MetaData) : <code>object</code>
|
|
2658
2876
|
* [~GenderEnum](#module_Product..GenderEnum) : <code>"newborn"</code> \| <code>"infant"</code> \| <code>"toddler"</code> \| <code>"kids"</code> \| <code>"adult"</code>
|
|
2659
2877
|
* [~Demographics](#module_Product..Demographics) : <code>object</code>
|
|
2660
|
-
* [~
|
|
2878
|
+
* [~PlatformData](#module_Product..PlatformData) : <code>object</code>
|
|
2661
2879
|
* [~SquarespaceDataObject](#module_Product..SquarespaceDataObject) : <code>object</code>
|
|
2662
2880
|
* [~PlatformData](#module_Product..PlatformData) : <code>object</code>
|
|
2663
2881
|
* [~AttributeValueObject](#module_Product..AttributeValueObject) : <code>object</code>
|
|
@@ -2691,7 +2909,7 @@ Creates a new Blank Product
|
|
|
2691
2909
|
|
|
2692
2910
|
### Product~productDefault : <code>Product</code>
|
|
2693
2911
|
**Kind**: inner constant of [<code>Product</code>](#module_Product)
|
|
2694
|
-
**Default**: <code>{"
|
|
2912
|
+
**Default**: <code>{"platformData":"","name":null,"short_name":null,"description":null,"short_description":null,"google_product_category":null,"product_type":null,"brand":"","demographics":"","attributes":"","recipe":"","mediaObject":"","mobileInfo":null,"isVisible":true,"type":"PHYSICAL","seoOptions":"","tags":"","materials":"","patterns":"","URL":null,"urlSlug":null,"variantAttributes":"","variants":""}</code>
|
|
2695
2913
|
**Read only**: true
|
|
2696
2914
|
<a name="module_Product..productDataForm"></a>
|
|
2697
2915
|
|
|
@@ -2969,9 +3187,9 @@ Demographics characteristics
|
|
|
2969
3187
|
| age_group | <code>AgeGroupEnum</code> |
|
|
2970
3188
|
| gender | <code>GenderEnum</code> |
|
|
2971
3189
|
|
|
2972
|
-
<a name="module_Product..
|
|
3190
|
+
<a name="module_Product..PlatformData"></a>
|
|
2973
3191
|
|
|
2974
|
-
### Product~
|
|
3192
|
+
### Product~PlatformData : <code>object</code>
|
|
2975
3193
|
List of product ID's for various platforms
|
|
2976
3194
|
|
|
2977
3195
|
**Kind**: inner typedef of [<code>Product</code>](#module_Product)
|
|
@@ -2979,9 +3197,9 @@ List of product ID's for various platforms
|
|
|
2979
3197
|
|
|
2980
3198
|
| Name | Type |
|
|
2981
3199
|
| --- | --- |
|
|
2982
|
-
|
|
|
2983
|
-
|
|
|
2984
|
-
|
|
|
3200
|
+
| squarespace | <code>Text</code> |
|
|
3201
|
+
| googleMerchant | <code>Text</code> |
|
|
3202
|
+
| shopify | <code>Text</code> |
|
|
2985
3203
|
|
|
2986
3204
|
<a name="module_Product..SquarespaceDataObject"></a>
|
|
2987
3205
|
|
|
@@ -2993,7 +3211,8 @@ Squarespace Specific Data
|
|
|
2993
3211
|
|
|
2994
3212
|
| Name | Type |
|
|
2995
3213
|
| --- | --- |
|
|
2996
|
-
|
|
|
3214
|
+
| SquarespaceId | <code>string</code> |
|
|
3215
|
+
| storePageId | <code>string</code> |
|
|
2997
3216
|
|
|
2998
3217
|
<a name="module_Product..PlatformData"></a>
|
|
2999
3218
|
|
|
@@ -3006,6 +3225,8 @@ List of Platform Specific Data
|
|
|
3006
3225
|
| Name | Type |
|
|
3007
3226
|
| --- | --- |
|
|
3008
3227
|
| squarespaceData | <code>SquarespaceDataObject</code> |
|
|
3228
|
+
| googleData | <code>GoogleDataObject</code> |
|
|
3229
|
+
| shopifyData | <code>ShopifyDataObject</code> |
|
|
3009
3230
|
|
|
3010
3231
|
<a name="module_Product..AttributeValueObject"></a>
|
|
3011
3232
|
|
|
@@ -3070,7 +3291,7 @@ variant record (including inventory and pricing)
|
|
|
3070
3291
|
|
|
3071
3292
|
| Name | Type | Description |
|
|
3072
3293
|
| --- | --- | --- |
|
|
3073
|
-
|
|
|
3294
|
+
| platformData | <code>PlatformData</code> | |
|
|
3074
3295
|
| sku | <code>string</code> | |
|
|
3075
3296
|
| image | <code>ProductImage</code> | Image associated with this variant |
|
|
3076
3297
|
| pricing | <code>FullProductPricing</code> | |
|
|
@@ -3096,7 +3317,6 @@ a product record
|
|
|
3096
3317
|
| --- | --- | --- |
|
|
3097
3318
|
| Id | <code>string</code> | Database Id of document (redundant for convenience) |
|
|
3098
3319
|
| refPath | <code>string</code> | if from database, full path to document |
|
|
3099
|
-
| platformIds | <code>PlatformIDs</code> | |
|
|
3100
3320
|
| platformData | <code>PlatformData</code> | |
|
|
3101
3321
|
| name | <code>string</code> | name for the Product |
|
|
3102
3322
|
| short_name | <code>string</code> | name for the Product |
|
|
@@ -3124,24 +3344,63 @@ Typedefs, constants, support functions and database operations related to Produc
|
|
|
3124
3344
|
|
|
3125
3345
|
|
|
3126
3346
|
* [SquarespaceProduct](#module_SquarespaceProduct)
|
|
3127
|
-
*
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
*
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3347
|
+
* _static_
|
|
3348
|
+
* [.sqsProductFeedToProducts(feedJSON)](#module_SquarespaceProduct.sqsProductFeedToProducts) ⇒ <code>Array.Products</code>
|
|
3349
|
+
* [.productsToSqsProductFeed(productsArray)](#module_SquarespaceProduct.productsToSqsProductFeed)
|
|
3350
|
+
* _inner_
|
|
3351
|
+
* [~sqsVariantMap](#module_SquarespaceProduct..sqsVariantMap) : <code>sqsPhysicalProductVariant</code>
|
|
3352
|
+
* [~sqsProductMap](#module_SquarespaceProduct..sqsProductMap) : <code>sqsPhysicalProduct</code>
|
|
3353
|
+
* [~recursiveMapWalk(thisObject, labels)](#module_SquarespaceProduct..recursiveMapWalk)
|
|
3354
|
+
* [~AttributeList](#module_SquarespaceProduct..AttributeList) : <code>Array.String</code>
|
|
3355
|
+
* [~AttributeValue](#module_SquarespaceProduct..AttributeValue) : <code>object</code>
|
|
3356
|
+
* [~ProductImage](#module_SquarespaceProduct..ProductImage) : <code>object</code>
|
|
3357
|
+
* [~CurrencyDescription](#module_SquarespaceProduct..CurrencyDescription) : <code>object</code>
|
|
3358
|
+
* [~MonetaryValue](#module_SquarespaceProduct..MonetaryValue) : <code>object</code>
|
|
3359
|
+
* [~FullProductPricing](#module_SquarespaceProduct..FullProductPricing) : <code>object</code>
|
|
3360
|
+
* [~ProductDimensionsUnit](#module_SquarespaceProduct..ProductDimensionsUnit) : <code>object</code>
|
|
3361
|
+
* [~ProductDimensions](#module_SquarespaceProduct..ProductDimensions) : <code>object</code>
|
|
3362
|
+
* [~ProductWeightUnitEnum](#module_SquarespaceProduct..ProductWeightUnitEnum) : <code>"KILOGRAM"</code> \| <code>"POUND"</code>
|
|
3363
|
+
* [~ProductWeight](#module_SquarespaceProduct..ProductWeight) : <code>object</code>
|
|
3364
|
+
* [~ProductMeasurements](#module_SquarespaceProduct..ProductMeasurements) : <code>object</code>
|
|
3365
|
+
* [~ProductStock](#module_SquarespaceProduct..ProductStock) : <code>object</code>
|
|
3366
|
+
* [~MetaData](#module_SquarespaceProduct..MetaData) : <code>object</code>
|
|
3367
|
+
* [~ProductTypeV2Enum](#module_SquarespaceProduct..ProductTypeV2Enum) : <code>"PHYSICAL"</code> \| <code>"SERVICE"</code> \| <code>"GIFT\_CARD"</code> \| <code>"DIGITAL"</code>
|
|
3368
|
+
* [~sqsPhysicalProductVariant](#module_SquarespaceProduct..sqsPhysicalProductVariant) : <code>object</code>
|
|
3369
|
+
* [~sqsPhysicalProduct](#module_SquarespaceProduct..sqsPhysicalProduct) : <code>object</code>
|
|
3370
|
+
|
|
3371
|
+
<a name="module_SquarespaceProduct.sqsProductFeedToProducts"></a>
|
|
3372
|
+
|
|
3373
|
+
### SquarespaceProduct.sqsProductFeedToProducts(feedJSON) ⇒ <code>Array.Products</code>
|
|
3374
|
+
Converts a JSON encoded Squarespace product feed to an array of internal products.
|
|
3375
|
+
|
|
3376
|
+
**Kind**: static method of [<code>SquarespaceProduct</code>](#module_SquarespaceProduct)
|
|
3377
|
+
|
|
3378
|
+
| Param | Type |
|
|
3379
|
+
| --- | --- |
|
|
3380
|
+
| feedJSON | <code>JSON</code> |
|
|
3381
|
+
|
|
3382
|
+
<a name="module_SquarespaceProduct.productsToSqsProductFeed"></a>
|
|
3383
|
+
|
|
3384
|
+
### SquarespaceProduct.productsToSqsProductFeed(productsArray)
|
|
3385
|
+
Takes an array of internal Product Objects and converts it to
|
|
3386
|
+
a JSON feed
|
|
3387
|
+
|
|
3388
|
+
**Kind**: static method of [<code>SquarespaceProduct</code>](#module_SquarespaceProduct)
|
|
3389
|
+
|
|
3390
|
+
| Param | Type |
|
|
3391
|
+
| --- | --- |
|
|
3392
|
+
| productsArray | <code>Array.Product</code> |
|
|
3393
|
+
|
|
3394
|
+
<a name="module_SquarespaceProduct..sqsVariantMap"></a>
|
|
3395
|
+
|
|
3396
|
+
### SquarespaceProduct~sqsVariantMap : <code>sqsPhysicalProductVariant</code>
|
|
3397
|
+
**Kind**: inner constant of [<code>SquarespaceProduct</code>](#module_SquarespaceProduct)
|
|
3398
|
+
**Default**: <code>{"undefined":""}</code>
|
|
3399
|
+
<a name="module_SquarespaceProduct..sqsProductMap"></a>
|
|
3144
3400
|
|
|
3401
|
+
### SquarespaceProduct~sqsProductMap : <code>sqsPhysicalProduct</code>
|
|
3402
|
+
**Kind**: inner constant of [<code>SquarespaceProduct</code>](#module_SquarespaceProduct)
|
|
3403
|
+
**Default**: <code>{"undefined":""}</code>
|
|
3145
3404
|
<a name="module_SquarespaceProduct..recursiveMapWalk"></a>
|
|
3146
3405
|
|
|
3147
3406
|
### SquarespaceProduct~recursiveMapWalk(thisObject, labels)
|
|
@@ -3319,9 +3578,9 @@ Meta Information for SEO
|
|
|
3319
3578
|
|
|
3320
3579
|
### SquarespaceProduct~ProductTypeV2Enum : <code>"PHYSICAL"</code> \| <code>"SERVICE"</code> \| <code>"GIFT\_CARD"</code> \| <code>"DIGITAL"</code>
|
|
3321
3580
|
**Kind**: inner typedef of [<code>SquarespaceProduct</code>](#module_SquarespaceProduct)
|
|
3322
|
-
<a name="module_SquarespaceProduct..
|
|
3581
|
+
<a name="module_SquarespaceProduct..sqsPhysicalProductVariant"></a>
|
|
3323
3582
|
|
|
3324
|
-
### SquarespaceProduct~
|
|
3583
|
+
### SquarespaceProduct~sqsPhysicalProductVariant : <code>object</code>
|
|
3325
3584
|
variant record (including inventory and pricing)
|
|
3326
3585
|
|
|
3327
3586
|
**Kind**: inner typedef of [<code>SquarespaceProduct</code>](#module_SquarespaceProduct)
|
|
@@ -3333,15 +3592,22 @@ variant record (including inventory and pricing)
|
|
|
3333
3592
|
| gtin | <code>string</code> | Global Trade Item Number |
|
|
3334
3593
|
| id | <code>string</code> | unique ID for product variant |
|
|
3335
3594
|
| image | <code>ProductImage</code> | Image associated with this variant |
|
|
3595
|
+
| pricing | <code>Pricing</code> | |
|
|
3336
3596
|
| mpn | <code>string</code> | manufacturer part number |
|
|
3337
3597
|
| shippingMeasurements | <code>ProductMeasurements</code> | |
|
|
3338
3598
|
| sku | <code>string</code> | |
|
|
3339
3599
|
| stock | <code>ProductStock</code> | |
|
|
3340
3600
|
|
|
3341
|
-
<a name="module_SquarespaceProduct..
|
|
3601
|
+
<a name="module_SquarespaceProduct..sqsPhysicalProduct"></a>
|
|
3342
3602
|
|
|
3343
|
-
### SquarespaceProduct~
|
|
3344
|
-
a
|
|
3603
|
+
### SquarespaceProduct~sqsPhysicalProduct : <code>object</code>
|
|
3604
|
+
a Squarespace product record
|
|
3605
|
+
Map between GoogleProductAPI and internal Product Data
|
|
3606
|
+
Note that when gg >> internal, index is *discovered* by searching
|
|
3607
|
+
for a matching item_group_id <<>> id. if item_group_id is *not*
|
|
3608
|
+
found add a new top-level product.
|
|
3609
|
+
Then look within varinats for a matching SKU; if found, use that
|
|
3610
|
+
value for the index; if *not* found add the variant.
|
|
3345
3611
|
|
|
3346
3612
|
**Kind**: inner typedef of [<code>SquarespaceProduct</code>](#module_SquarespaceProduct)
|
|
3347
3613
|
**Properties**
|