@leaddreamer/inventorylogic 0.0.3-beta.75 → 0.0.3-beta.77

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.
Files changed (175) hide show
  1. package/.devcontainer/devcontainer.json +23 -0
  2. package/README.md +36 -21
  3. package/business/Brands/index.js +0 -0
  4. package/business/Markups/index.js +1 -1
  5. package/business/Product/SampleJSON.json +1 -0
  6. package/business/Product/Squarespace.js +83 -47
  7. package/business/Product/SquarespaceSample.js +4905 -0
  8. package/business/Product/feedSample.json +1 -0
  9. package/business/Product/index.js +54 -43
  10. package/dist/InventoryLogic.0fde24a4.js +2 -0
  11. package/dist/InventoryLogic.30338491.js +2 -0
  12. package/dist/InventoryLogic.62b5247c.js +2 -0
  13. package/dist/InventoryLogic.6479c130.js +2 -0
  14. package/dist/{InventoryLogic.0a417df6.js → InventoryLogic.7852e007.js} +2 -2
  15. package/dist/index.js +1 -1
  16. package/jsdoc.conf.json +5 -0
  17. package/package.json +4 -4
  18. package/dist/InventoryLogic.05ef18c0.js +0 -2
  19. package/dist/InventoryLogic.0763ecc1.js +0 -2
  20. package/dist/InventoryLogic.086745e8.js +0 -2
  21. package/dist/InventoryLogic.09daaeaa.js +0 -2
  22. package/dist/InventoryLogic.0ba84fa7.js +0 -2
  23. package/dist/InventoryLogic.0bc31ab2.js +0 -2
  24. package/dist/InventoryLogic.0d599c03.js +0 -2
  25. package/dist/InventoryLogic.0f55a872.js +0 -2
  26. package/dist/InventoryLogic.119de060.js +0 -2
  27. package/dist/InventoryLogic.137e5482.js +0 -2
  28. package/dist/InventoryLogic.14a7860a.js +0 -2
  29. package/dist/InventoryLogic.14b7f292.js +0 -2
  30. package/dist/InventoryLogic.188504b1.js +0 -2
  31. package/dist/InventoryLogic.196261df.js +0 -2
  32. package/dist/InventoryLogic.197dee48.js +0 -2
  33. package/dist/InventoryLogic.1aa3d0be.js +0 -2
  34. package/dist/InventoryLogic.205007e9.js +0 -2
  35. package/dist/InventoryLogic.22a36cc8.js +0 -2
  36. package/dist/InventoryLogic.2433062e.js +0 -2
  37. package/dist/InventoryLogic.248e0905.js +0 -2
  38. package/dist/InventoryLogic.2642cf62.js +0 -2
  39. package/dist/InventoryLogic.28bf2bc8.js +0 -2
  40. package/dist/InventoryLogic.28d9cb10.js +0 -2
  41. package/dist/InventoryLogic.2a1c4b0c.js +0 -2
  42. package/dist/InventoryLogic.2d256bf6.js +0 -2
  43. package/dist/InventoryLogic.2e2dcd29.js +0 -2
  44. package/dist/InventoryLogic.30ea2574.js +0 -2
  45. package/dist/InventoryLogic.32301353.js +0 -2
  46. package/dist/InventoryLogic.335afbe0.js +0 -2
  47. package/dist/InventoryLogic.34455124.js +0 -2
  48. package/dist/InventoryLogic.35061b34.js +0 -2
  49. package/dist/InventoryLogic.359755ba.js +0 -2
  50. package/dist/InventoryLogic.3675b133.js +0 -2
  51. package/dist/InventoryLogic.38084c21.js +0 -2
  52. package/dist/InventoryLogic.3b10ccc5.js +0 -2
  53. package/dist/InventoryLogic.3ccd3412.js +0 -2
  54. package/dist/InventoryLogic.3cd7da47.js +0 -2
  55. package/dist/InventoryLogic.3f8300b9.js +0 -2
  56. package/dist/InventoryLogic.415ac613.js +0 -2
  57. package/dist/InventoryLogic.421e1e7c.js +0 -9
  58. package/dist/InventoryLogic.457956a7.js +0 -2
  59. package/dist/InventoryLogic.4724e88f.js +0 -2
  60. package/dist/InventoryLogic.48cfeaff.js +0 -2
  61. package/dist/InventoryLogic.4e7559ed.js +0 -2
  62. package/dist/InventoryLogic.50cb471b.js +0 -2
  63. package/dist/InventoryLogic.5129f774.js +0 -2
  64. package/dist/InventoryLogic.519aca5b.js +0 -2
  65. package/dist/InventoryLogic.53279d78.js +0 -2
  66. package/dist/InventoryLogic.53d95ef7.js +0 -2
  67. package/dist/InventoryLogic.545bffb9.js +0 -2
  68. package/dist/InventoryLogic.54a209b5.js +0 -2
  69. package/dist/InventoryLogic.5735139f.js +0 -2
  70. package/dist/InventoryLogic.5807f92a.js +0 -2
  71. package/dist/InventoryLogic.58dceea1.js +0 -2
  72. package/dist/InventoryLogic.58ef1cf1.js +0 -2
  73. package/dist/InventoryLogic.5a96277c.js +0 -2
  74. package/dist/InventoryLogic.5b55873b.js +0 -2
  75. package/dist/InventoryLogic.5baab4fe.js +0 -2
  76. package/dist/InventoryLogic.5c08e39a.js +0 -2
  77. package/dist/InventoryLogic.5c885f7a.js +0 -2
  78. package/dist/InventoryLogic.5da5f9f7.js +0 -2
  79. package/dist/InventoryLogic.5e29cd66.js +0 -2
  80. package/dist/InventoryLogic.5f65485d.js +0 -2
  81. package/dist/InventoryLogic.60354f53.js +0 -2
  82. package/dist/InventoryLogic.636fbde2.js +0 -2
  83. package/dist/InventoryLogic.648c0930.js +0 -2
  84. package/dist/InventoryLogic.66b9ac09.js +0 -2
  85. package/dist/InventoryLogic.679c12fa.js +0 -2
  86. package/dist/InventoryLogic.67c1b155.js +0 -2
  87. package/dist/InventoryLogic.69764b18.js +0 -2
  88. package/dist/InventoryLogic.6d5e9bcf.js +0 -2
  89. package/dist/InventoryLogic.6f8b7ae0.js +0 -2
  90. package/dist/InventoryLogic.708f773f.js +0 -2
  91. package/dist/InventoryLogic.7220657c.js +0 -2
  92. package/dist/InventoryLogic.724cdb7a.js +0 -2
  93. package/dist/InventoryLogic.73e98cc9.js +0 -2
  94. package/dist/InventoryLogic.7407f5ab.js +0 -2
  95. package/dist/InventoryLogic.7559452d.js +0 -2
  96. package/dist/InventoryLogic.76c282a4.js +0 -2
  97. package/dist/InventoryLogic.7a6d85eb.js +0 -2
  98. package/dist/InventoryLogic.81d4c177.js +0 -2
  99. package/dist/InventoryLogic.83662d7e.js +0 -2
  100. package/dist/InventoryLogic.84a0ee40.js +0 -2
  101. package/dist/InventoryLogic.85f39b3b.js +0 -2
  102. package/dist/InventoryLogic.86caed3d.js +0 -2
  103. package/dist/InventoryLogic.89bc98ac.js +0 -2
  104. package/dist/InventoryLogic.89c53906.js +0 -2
  105. package/dist/InventoryLogic.8a73f080.js +0 -2
  106. package/dist/InventoryLogic.8aa9c9eb.js +0 -2
  107. package/dist/InventoryLogic.926192ec.js +0 -2
  108. package/dist/InventoryLogic.9273f975.js +0 -2
  109. package/dist/InventoryLogic.94f30ee4.js +0 -9
  110. package/dist/InventoryLogic.95d27be0.js +0 -2
  111. package/dist/InventoryLogic.95f4bcdc.js +0 -2
  112. package/dist/InventoryLogic.9878bc32.js +0 -2
  113. package/dist/InventoryLogic.9899e841.js +0 -2
  114. package/dist/InventoryLogic.996922e0.js +0 -2
  115. package/dist/InventoryLogic.9a4b1e67.js +0 -2
  116. package/dist/InventoryLogic.9b53b460.js +0 -2
  117. package/dist/InventoryLogic.9f07806b.js +0 -2
  118. package/dist/InventoryLogic.a08adebe.js +0 -2
  119. package/dist/InventoryLogic.a4e13ed0.js +0 -2
  120. package/dist/InventoryLogic.a5644644.js +0 -2
  121. package/dist/InventoryLogic.a6d12709.js +0 -2
  122. package/dist/InventoryLogic.a8a5f494.js +0 -2
  123. package/dist/InventoryLogic.ac0345c3.js +0 -9
  124. package/dist/InventoryLogic.aecbeacc.js +0 -2
  125. package/dist/InventoryLogic.b1a593cd.js +0 -2
  126. package/dist/InventoryLogic.b5934d14.js +0 -2
  127. package/dist/InventoryLogic.b5f983cb.js +0 -2
  128. package/dist/InventoryLogic.b63836dc.js +0 -2
  129. package/dist/InventoryLogic.b6a32e7a.js +0 -2
  130. package/dist/InventoryLogic.b8b0ac74.js +0 -2
  131. package/dist/InventoryLogic.bd3fc04f.js +0 -2
  132. package/dist/InventoryLogic.bf7b624e.js +0 -2
  133. package/dist/InventoryLogic.bf93fd66.js +0 -2
  134. package/dist/InventoryLogic.c44fa152.js +0 -2
  135. package/dist/InventoryLogic.c5bdd6e0.js +0 -2
  136. package/dist/InventoryLogic.c72232ce.js +0 -2
  137. package/dist/InventoryLogic.c903d27c.js +0 -2
  138. package/dist/InventoryLogic.ca8dec8b.js +0 -2
  139. package/dist/InventoryLogic.caf3c5cd.js +0 -2
  140. package/dist/InventoryLogic.ce72ae5e.js +0 -2
  141. package/dist/InventoryLogic.d14897a2.js +0 -2
  142. package/dist/InventoryLogic.d285cce7.js +0 -2
  143. package/dist/InventoryLogic.d3ab85c6.js +0 -2
  144. package/dist/InventoryLogic.d678c3ae.js +0 -2
  145. package/dist/InventoryLogic.d76d5857.js +0 -2
  146. package/dist/InventoryLogic.d7bc67fb.js +0 -2
  147. package/dist/InventoryLogic.d85eb4a9.js +0 -2
  148. package/dist/InventoryLogic.dd89041a.js +0 -2
  149. package/dist/InventoryLogic.dd8ca214.js +0 -2
  150. package/dist/InventoryLogic.dda8477e.js +0 -2
  151. package/dist/InventoryLogic.de5836f0.js +0 -2
  152. package/dist/InventoryLogic.df1596da.js +0 -2
  153. package/dist/InventoryLogic.e02cbd0d.js +0 -2
  154. package/dist/InventoryLogic.e1a6db03.js +0 -2
  155. package/dist/InventoryLogic.e5ed5151.js +0 -2
  156. package/dist/InventoryLogic.e7e04396.js +0 -2
  157. package/dist/InventoryLogic.e92db878.js +0 -2
  158. package/dist/InventoryLogic.e92e017e.js +0 -2
  159. package/dist/InventoryLogic.eadb902f.js +0 -2
  160. package/dist/InventoryLogic.eaecbd8b.js +0 -2
  161. package/dist/InventoryLogic.eed8150d.js +0 -2
  162. package/dist/InventoryLogic.f23aef9c.js +0 -2
  163. package/dist/InventoryLogic.f27b4a7e.js +0 -2
  164. package/dist/InventoryLogic.f27e2dc7.js +0 -2
  165. package/dist/InventoryLogic.f29bd369.js +0 -2
  166. package/dist/InventoryLogic.f3361cdd.js +0 -2
  167. package/dist/InventoryLogic.f61ed887.js +0 -2
  168. package/dist/InventoryLogic.f6297418.js +0 -2
  169. package/dist/InventoryLogic.f63493c3.js +0 -2
  170. package/dist/InventoryLogic.f95b8524.js +0 -2
  171. package/dist/InventoryLogic.f9a99f05.js +0 -2
  172. package/dist/InventoryLogic.fb851384.js +0 -2
  173. package/dist/InventoryLogic.fc4194ae.js +0 -2
  174. package/dist/InventoryLogic.fcbfca1e.js +0 -2
  175. package/dist/InventoryLogic.ff65d86c.js +0 -2
@@ -0,0 +1,23 @@
1
+ // For format details, see https://aka.ms/devcontainer.json. For config options, see the
2
+ // README at: https://github.com/devcontainers/templates/tree/main/src/javascript-node
3
+ {
4
+ "name": "Node.js",
5
+ // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6
+ "image": "mcr.microsoft.com/devcontainers/javascript-node:1-22"
7
+
8
+ // Features to add to the dev container. More info: https://containers.dev/features.
9
+ // "features": {},
10
+
11
+ // Use 'forwardPorts' to make a list of ports inside the container available locally.
12
+ // "forwardPorts": [],
13
+
14
+ // Use 'postCreateCommand' to run commands after the container is created.
15
+ // "postCreateCommand": "yarn install",
16
+
17
+ // Configure tool-specific properties.
18
+ // "customizations": {},
19
+
20
+ // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
21
+ // "remoteUser": "root"
22
+ }
23
+
package/README.md CHANGED
@@ -1185,7 +1185,7 @@ users
1185
1185
  * [~MarkupsDefault](#module_Markups..MarkupsDefault) : <code>Markups</code>
1186
1186
  * [~MaterialDefaultForm](#module_Markups..MaterialDefaultForm) : <code>Material</code>
1187
1187
  * [~MarkupsDefaultForm](#module_Markups..MarkupsDefaultForm) : <code>Stage</code>
1188
- * [~updateMarkups(stage, parent)](#module_Markups..updateMarkups) ⇒ <code>promise.LineItem</code>
1188
+ * [~updateMarkups(markups, parent)](#module_Markups..updateMarkups) ⇒ <code>promise.LineItem</code>
1189
1189
  * [~Markups](#module_Markups..Markups) : <code>number</code>
1190
1190
 
1191
1191
  <a name="module_Markups.MaterialChoices"></a>
@@ -1224,16 +1224,16 @@ users
1224
1224
  **Read only**: true
1225
1225
  <a name="module_Markups..updateMarkups"></a>
1226
1226
 
1227
- ### Markups~updateMarkups(stage, parent) ⇒ <code>promise.LineItem</code>
1227
+ ### Markups~updateMarkups(markups, parent) ⇒ <code>promise.LineItem</code>
1228
1228
  writes record back to database. Assumes only Id is valid
1229
1229
 
1230
1230
  **Kind**: inner method of [<code>Markups</code>](#module_Markups)
1231
1231
  **Returns**: <code>promise.LineItem</code> - a copy of the data written
1232
1232
 
1233
- | Param | Type | Description |
1234
- | --- | --- | --- |
1235
- | stage | <code>LineItem</code> | a partially-populated product record for updates |
1236
- | parent | <code>Record</code> | minimal record of product, user (or none) this stage belongs to |
1233
+ | Param | Type | Default | Description |
1234
+ | --- | --- | --- | --- |
1235
+ | markups | <code>Markups</code> | | a partially-populated product record for updates |
1236
+ | parent | <code>Record</code> | <code></code> | minimal record of product, user (or none) this stage belongs to |
1237
1237
 
1238
1238
  <a name="module_Markups..Markups"></a>
1239
1239
 
@@ -2638,6 +2638,7 @@ Typedefs, constants, support functions and database operations related to Produc
2638
2638
 
2639
2639
 
2640
2640
  * [SquarespaceProduct](#module_SquarespaceProduct)
2641
+ * [~recursiveMapWalk(thisObject, labels)](#module_SquarespaceProduct..recursiveMapWalk)
2641
2642
  * [~AttributeList](#module_SquarespaceProduct..AttributeList) : <code>Array.String</code>
2642
2643
  * [~AttributeValue](#module_SquarespaceProduct..AttributeValue) : <code>object</code>
2643
2644
  * [~ProductImage](#module_SquarespaceProduct..ProductImage) : <code>object</code>
@@ -2655,6 +2656,18 @@ Typedefs, constants, support functions and database operations related to Produc
2655
2656
  * [~PhysicalProductVariant](#module_SquarespaceProduct..PhysicalProductVariant) : <code>object</code>
2656
2657
  * [~PhysicalProduct](#module_SquarespaceProduct..PhysicalProduct) : <code>object</code>
2657
2658
 
2659
+ <a name="module_SquarespaceProduct..recursiveMapWalk"></a>
2660
+
2661
+ ### SquarespaceProduct~recursiveMapWalk(thisObject, labels)
2662
+ Uses an array of object member labels to insert a value into an object
2663
+
2664
+ **Kind**: inner method of [<code>SquarespaceProduct</code>](#module_SquarespaceProduct)
2665
+
2666
+ | Param | Type |
2667
+ | --- | --- |
2668
+ | thisObject | <code>object</code> |
2669
+ | labels | <code>Array.string</code> |
2670
+
2658
2671
  <a name="module_SquarespaceProduct..AttributeList"></a>
2659
2672
 
2660
2673
  ### SquarespaceProduct~AttributeList : <code>Array.String</code>
@@ -2933,19 +2946,23 @@ Creates a new Blank Product
2933
2946
 
2934
2947
  ### Product~ProductDefault : <code>Product</code>
2935
2948
  **Kind**: inner constant of [<code>Product</code>](#module_Product)
2936
- **Default**: <code>{&quot;name&quot;:&quot;&quot;,&quot;description&quot;:null,&quot;recipe&quot;:&quot;&quot;,&quot;image_links&quot;:&quot;&quot;,&quot;type&quot;:&quot;PHYSICAL&quot;,&quot;isVisible&quot;:true,&quot;seoOptions&quot;:&quot;&quot;,&quot;tags&quot;:&quot;&quot;,&quot;materials&quot;:&quot;&quot;,&quot;patterns&quot;:&quot;&quot;,&quot;URL&quot;:&quot;&quot;,&quot;urlSlug&quot;:&quot;&quot;,&quot;variantAttributes&quot;:&quot;&quot;,&quot;variants&quot;:&quot;&quot;,&quot;google_product_type&quot;:&quot;&quot;,&quot;shipping_time&quot;:0,&quot;condition&quot;:&quot;&quot;,&quot;adultQ&quot;:false,&quot;age_group&quot;:&quot;adult&quot;,&quot;color&quot;:&quot;&quot;,&quot;material&quot;:&quot;&quot;,&quot;gender&quot;:&quot;unisex&quot;,&quot;attributes_gemstones&quot;:&quot;&quot;,&quot;pattern&quot;:&quot;&quot;,&quot;size&quot;:&quot;&quot;,&quot;weight&quot;:0,&quot;shippingMeasurements&quot;:&quot;&quot;}</code>
2949
+ **Default**: <code>{&quot;platformIds&quot;:&quot;&quot;,&quot;platformData&quot;:&quot;&quot;,&quot;name&quot;:null,&quot;short_name&quot;:null,&quot;description&quot;:null,&quot;short_description&quot;:null,&quot;google_product_category&quot;:null,&quot;product_type&quot;:null,&quot;brand&quot;:&quot;&quot;,&quot;demographics&quot;:&quot;&quot;,&quot;attributes&quot;:&quot;&quot;,&quot;recipe&quot;:&quot;&quot;,&quot;mediaObject&quot;:&quot;&quot;,&quot;mobileInfo&quot;:null,&quot;isVisible&quot;:true,&quot;type&quot;:&quot;PHYSICAL&quot;,&quot;seoOptions&quot;:&quot;&quot;,&quot;tags&quot;:&quot;&quot;,&quot;materials&quot;:&quot;&quot;,&quot;patterns&quot;:&quot;&quot;,&quot;URL&quot;:null,&quot;urlSlug&quot;:null,&quot;variantAttributes&quot;:&quot;&quot;,&quot;variants&quot;:&quot;&quot;}</code>
2937
2950
  **Read only**: true
2938
2951
  <a name="module_Product..ProductDataForm"></a>
2939
2952
 
2940
2953
  ### Product~ProductDataForm : <code>Product</code>
2954
+ Form to create test data
2955
+
2941
2956
  **Kind**: inner constant of [<code>Product</code>](#module_Product)
2942
2957
  **Default**: <code>{&quot;Id&quot;:&quot;&quot;,&quot;refPath&quot;:null,&quot;name&quot;:&quot;&quot;,&quot;description&quot;:&quot;&quot;,&quot;sku&quot;:&quot;&quot;,&quot;markups&quot;:&quot;&quot;,&quot;projectQ&quot;:&quot;&quot;}</code>
2943
2958
  **Read only**: true
2944
2959
  <a name="module_Product..ProductDefaultForm"></a>
2945
2960
 
2946
2961
  ### Product~ProductDefaultForm : <code>Product</code>
2962
+ Form to enter MINIMAL product data to start creation
2963
+
2947
2964
  **Kind**: inner constant of [<code>Product</code>](#module_Product)
2948
- **Default**: <code>{&quot;Id&quot;:&quot;&quot;,&quot;refPath&quot;:&quot;&quot;,&quot;name&quot;:&quot;text&quot;,&quot;description&quot;:&quot;textarea&quot;,&quot;sku&quot;:&quot;text&quot;,&quot;markups&quot;:&quot;&quot;,&quot;projectQ&quot;:&quot;&quot;}</code>
2965
+ **Default**: <code>{&quot;Id&quot;:&quot;&quot;,&quot;refPath&quot;:&quot;&quot;,&quot;name&quot;:&quot;text&quot;,&quot;description&quot;:&quot;textarea&quot;,&quot;sku&quot;:&quot;text&quot;}</code>
2949
2966
  **Read only**: true
2950
2967
  <a name="module_Product..updateProduct"></a>
2951
2968
 
@@ -2957,8 +2974,8 @@ writes record back to database. Assumes only Id is valid
2957
2974
 
2958
2975
  | Param | Type | Default | Description |
2959
2976
  | --- | --- | --- | --- |
2960
- | product | <code>LineItem</code> | | a partially-populated product record for updates |
2961
- | user | <code>Product</code> | <code></code> | minimal record of user this product belongs to |
2977
+ | product | <code>Product</code> | | a partially-populated product record for updates |
2978
+ | user | <code>User</code> | <code></code> | minimal record of user this product belongs to |
2962
2979
 
2963
2980
  <a name="module_Product..summarizeProduct"></a>
2964
2981
 
@@ -3034,6 +3051,8 @@ a Brand Object
3034
3051
 
3035
3052
  | Name | Type | Description |
3036
3053
  | --- | --- | --- |
3054
+ | Id | <code>string</code> | Database Id of document (redundant for convenience) |
3055
+ | refPath | <code>string</code> | if from database, full path to document |
3037
3056
  | aggregateRating | <code>AggregateRatingsValue</code> | |
3038
3057
  | logo | <code>URL</code> \| <code>ImageObject</code> | |
3039
3058
  | review | <code>ReviewObject</code> | A review of the item. Supersedes reviews |
@@ -3201,7 +3220,7 @@ Demographics characteristics
3201
3220
 
3202
3221
  | Name | Type |
3203
3222
  | --- | --- |
3204
- | adult | <code>boolean</code> |
3223
+ | adultOriented | <code>boolean</code> |
3205
3224
  | age_group | <code>AgeGroupEnum</code> |
3206
3225
  | gender | <code>GenderEnum</code> |
3207
3226
 
@@ -3215,9 +3234,9 @@ List of product ID's for various platforms
3215
3234
 
3216
3235
  | Name | Type |
3217
3236
  | --- | --- |
3218
- | SquarespaceId | <code>Text</code> |
3219
- | GoogleMerchantId | <code>Text</code> |
3220
- | ShopifyId | <code>Text</code> |
3237
+ | squarespaceId | <code>Text</code> |
3238
+ | googleMerchantId | <code>Text</code> |
3239
+ | shopifyId | <code>Text</code> |
3221
3240
 
3222
3241
  <a name="module_Product..SquarespaceDataObject"></a>
3223
3242
 
@@ -3261,8 +3280,6 @@ List of Platform Specific Data
3261
3280
  | custom_label_2 | <code>string</code> |
3262
3281
  | custom_label_3 | <code>string</code> |
3263
3282
  | custom_label_4 | <code>string</code> |
3264
- | createdOn | <code>Date</code> |
3265
- | modifiedOn | <code>Date</code> |
3266
3283
 
3267
3284
  <a name="module_Product..VideoImage"></a>
3268
3285
 
@@ -3294,7 +3311,7 @@ Media Related Data
3294
3311
 
3295
3312
  | Name | Type |
3296
3313
  | --- | --- |
3297
- | images | <code>Array:ProductImage</code> |
3314
+ | images | <code>Array.ProductImage</code> |
3298
3315
  | video_image | <code>VideoImage</code> |
3299
3316
  | virtual_model | <code>VirtualModel</code> |
3300
3317
 
@@ -3308,7 +3325,7 @@ variant record (including inventory and pricing)
3308
3325
 
3309
3326
  | Name | Type | Description |
3310
3327
  | --- | --- | --- |
3311
- | id | <code>string</code> | unique ID for product variant |
3328
+ | platformIds | <code>PlatformIDs</code> | |
3312
3329
  | sku | <code>string</code> | |
3313
3330
  | image | <code>ProductImage</code> | Image associated with this variant |
3314
3331
  | pricing | <code>FullProductPricing</code> | |
@@ -3335,9 +3352,7 @@ a product record
3335
3352
  | Id | <code>string</code> | Database Id of document (redundant for convenience) |
3336
3353
  | refPath | <code>string</code> | if from database, full path to document |
3337
3354
  | platformIds | <code>PlatformIDs</code> | |
3338
- | platformData | <code>platformData</code> | |
3339
- | squarespaceData | <code>SquarespaceDataObject</code> | |
3340
- | storePageId | <code>Text</code> | |
3355
+ | platformData | <code>PlatformData</code> | |
3341
3356
  | name | <code>string</code> | name for the Product |
3342
3357
  | short_name | <code>string</code> | name for the Product |
3343
3358
  | description | <code>string</code> | Basic description of the product |
File without changes
@@ -168,7 +168,7 @@ Forms.Choices[MATERIAL] = MaterialChoices
168
168
  // record operations
169
169
  /**
170
170
  * writes record back to database. Assumes only Id is valid
171
- * @param {LineItem} stage a partially-populated product record for updates
171
+ * @param {Markups} markups a partially-populated product record for updates
172
172
  * @param {Record} parent minimal record of product, user (or none) this stage belongs to
173
173
  * @returns {promise.LineItem} a copy of the data written
174
174
  */
@@ -0,0 +1 @@
1
+ " {\r\n \"id\": \"69fa54e8f691fe20c13bc732\",\r\n \"type\": \"PHYSICAL\",\r\n \"name\": \"Stack : : short gemstone earrings\",\r\n \"description\": \"<p style=\\\"white-space:pre-wrap;\\\" data-rte-preserve-empty=\\\"true\\\">About an inch long, my Stack earrings are quick grabs of a bit of neutral with a pop of color when you want earrings for a casual day look. Choose your favorite palette or ping me with your own color combinations and ideas!</p><p style=\\\"white-space:pre-wrap;\\\" data-rte-preserve-empty=\\\"true\\\"><span>:: great gift!<br />:: 1.25 inches<br />:: limited edition<br />:: ships 4-7 days from purchase<br />:: handcrafted in tucson, arizona</span></p>\",\r\n \"storePageId\": \"694b2289b16b8d02d4bdaaba\",\r\n \"url\": \"https://sirlinhalljewelry.com/shop/p/stack-earrings-26050500\",\r\n \"urlSlug\": \"p/stack-earrings-26050500\",\r\n \"images\": [\r\n {\r\n \"id\": \"69fa5769cfa3e81e12d7c224\",\r\n \"altText\": \"PXL_20260505_201834132.jpg\",\r\n \"orderIndex\": 0,\r\n \"url\": \"https://images.squarespace-cdn.com/content/v1/694b2288b16b8d02d4bdaa0c/2bf39ac2-a49b-4820-a211-961d6a0722ef/PXL_20260505_201834132.jpg\",\r\n \"originalSize\": {\r\n \"width\": 480,\r\n \"height\": 480\r\n },\r\n \"availableFormats\": []\r\n },\r\n {\r\n \"id\": \"69fa5769f691fe20c13bc9f8\",\r\n \"altText\": \"PXL_20260505_201739701.jpg\",\r\n \"orderIndex\": 1,\r\n \"url\": \"https://images.squarespace-cdn.com/content/v1/694b2288b16b8d02d4bdaa0c/8d5186e3-e5a1-43bb-9714-77a939b8bc40/PXL_20260505_201739701.jpg\",\r\n \"originalSize\": {\r\n \"width\": 480,\r\n \"height\": 480\r\n },\r\n \"availableFormats\": []\r\n },\r\n {\r\n \"id\": \"69fa5769cfa3e81e12d7c225\",\r\n \"altText\": \"PXL_20260505_201915047.jpg\",\r\n \"orderIndex\": 2,\r\n \"url\": \"https://images.squarespace-cdn.com/content/v1/694b2288b16b8d02d4bdaa0c/ff61c7e8-a03b-442e-81b2-db67241d85ec/PXL_20260505_201915047.jpg\",\r\n \"originalSize\": {\r\n \"width\": 480,\r\n \"height\": 480\r\n },\r\n \"availableFormats\": []\r\n },\r\n {\r\n \"id\": \"69fa5769f691fe20c13bc9f9\",\r\n \"altText\": \"PXL_20260505_202122912.jpg\",\r\n \"orderIndex\": 3,\r\n \"url\": \"https://images.squarespace-cdn.com/content/v1/694b2288b16b8d02d4bdaa0c/357dfd2f-1bce-4687-b57b-1ff53209d970/PXL_20260505_202122912.jpg\",\r\n \"originalSize\": {\r\n \"width\": 480,\r\n \"height\": 480\r\n },\r\n \"availableFormats\": []\r\n },\r\n {\r\n \"id\": \"69fa5769a3780355a2edfbb0\",\r\n \"altText\": \"PXL_20260505_202100350.jpg\",\r\n \"orderIndex\": 4,\r\n \"url\": \"https://images.squarespace-cdn.com/content/v1/694b2288b16b8d02d4bdaa0c/4fcf4192-dbe3-477a-90e7-be0c553f4c5b/PXL_20260505_202100350.jpg\",\r\n \"originalSize\": {\r\n \"width\": 480,\r\n \"height\": 480\r\n },\r\n \"availableFormats\": []\r\n },\r\n {\r\n \"id\": \"69fa5769cfa3e81e12d7c226\",\r\n \"altText\": \"PXL_20260505_201947380.jpg\",\r\n \"orderIndex\": 5,\r\n \"url\": \"https://images.squarespace-cdn.com/content/v1/694b2288b16b8d02d4bdaa0c/fba1dcf8-8526-47ab-ab7f-be2ab37a1dbd/PXL_20260505_201947380.jpg\",\r\n \"originalSize\": {\r\n \"width\": 480,\r\n \"height\": 480\r\n },\r\n \"availableFormats\": []\r\n }\r\n ],\r\n \"tags\": [],\r\n \"seoOptions\": {\r\n \"title\": \"Stack short gemstone and pearl earrings\",\r\n \"description\": \"Tucson designer Lisa Sirlin-Hall's Stack earrings are quick grabs of a bit of neutral with a pop of color when you want earrings for a casual day look.\"\r\n },\r\n \"createdOn\": \"2026-05-05T20:36:56.235Z\",\r\n \"modifiedOn\": \"2026-08-31T20:06:56.852Z\",\r\n \"variants\": [\r\n {\r\n \"id\": \"fdb09e8d-467c-412e-a355-f6a40a24af24\",\r\n \"sku\": \"26050101\",\r\n \"image\": null,\r\n \"pricing\": {\r\n \"basePrice\": {\r\n \"currency\": \"USD\",\r\n \"value\": \"68.00\"\r\n },\r\n \"salePrice\": {\r\n \"currency\": \"USD\",\r\n \"value\": \"0.00\"\r\n },\r\n \"onSale\": false\r\n },\r\n \"stock\": {\r\n \"quantity\": 1,\r\n \"unlimited\": false\r\n },\r\n \"attributes\": {\r\n \"Color\": \"Blue with Labradorite\"\r\n },\r\n \"shippingMeasurements\": {\r\n \"weight\": {\r\n \"unit\": \"POUND\",\r\n \"value\": 0.0625\r\n },\r\n \"dimensions\": {\r\n \"unit\": \"INCH\",\r\n \"length\": 9.0,\r\n \"width\": 6.0,\r\n \"height\": 0.5\r\n }\r\n },\r\n \"gtin\": null,\r\n \"mpn\": null\r\n },\r\n {\r\n \"id\": \"61c47a68-5acb-4d74-b18b-83ac27e49aeb\",\r\n \"sku\": \"26050102\",\r\n \"image\": null,\r\n \"pricing\": {\r\n \"basePrice\": {\r\n \"currency\": \"USD\",\r\n \"value\": \"68.00\"\r\n },\r\n \"salePrice\": {\r\n \"currency\": \"USD\",\r\n \"value\": \"0.00\"\r\n },\r\n \"onSale\": false\r\n },\r\n \"stock\": {\r\n \"quantity\": 1,\r\n \"unlimited\": false\r\n },\r\n \"attributes\": {\r\n \"Color\": \"Silver with Black Onyx\"\r\n },\r\n \"shippingMeasurements\": {\r\n \"weight\": {\r\n \"unit\": \"POUND\",\r\n \"value\": 0.0625\r\n },\r\n \"dimensions\": {\r\n \"unit\": \"INCH\",\r\n \"length\": 9.0,\r\n \"width\": 6.0,\r\n \"height\": 0.5\r\n }\r\n },\r\n \"gtin\": null,\r\n \"mpn\": null\r\n },\r\n {\r\n \"id\": \"4b1ca060-8d0e-4e20-9863-cb37324da85d\",\r\n \"sku\": \"26050103\",\r\n \"image\": null,\r\n \"pricing\": {\r\n \"basePrice\": {\r\n \"currency\": \"USD\",\r\n \"value\": \"68.00\"\r\n },\r\n \"salePrice\": {\r\n \"currency\": \"USD\",\r\n \"value\": \"0.00\"\r\n },\r\n \"onSale\": false\r\n },\r\n \"stock\": {\r\n \"quantity\": 1,\r\n \"unlimited\": false\r\n },\r\n \"attributes\": {\r\n \"Color\": \"Champagne yellow and Pearl\"\r\n },\r\n \"shippingMeasurements\": {\r\n \"weight\": {\r\n \"unit\": \"POUND\",\r\n \"value\": 0.0625\r\n },\r\n \"dimensions\": {\r\n \"unit\": \"INCH\",\r\n \"length\": 9.0,\r\n \"width\": 6.0,\r\n \"height\": 0.5\r\n }\r\n },\r\n \"gtin\": null,\r\n \"mpn\": null\r\n }\r\n ],\r\n \"variantAttributes\": [\r\n \"Color\"\r\n ],\r\n \"isVisible\": true\r\n }\r\n"
@@ -6,6 +6,9 @@
6
6
 
7
7
  //import { PRODUCT, MARKUPS, ISBN_LENGTH } from "../boilerplate/index.js";
8
8
 
9
+ //import {SampleJSON, feedSample} from "./SquarespaceSample.js"
10
+ import SampleJSON from './SampleJSON.json' with { type: 'json' };
11
+ import feedSample from './feedSample.json' with { type: 'json' };
9
12
  //////////////////////////////////////////////////////////////////////
10
13
  // Constants
11
14
 
@@ -150,59 +153,92 @@
150
153
  //////////////////////////////////////////////////////////////////////
151
154
  // utilities
152
155
 
153
- const SampleJSON = '{"id":"69fa54e8f691fe20c13bc732","type":"PHYSICAL","name":"Stack : : short gemstone earrings","description":"Bob","storePageId":"694b2289b16b8d02d4bdaaba","url":"https://sirlinhalljewelry.com/shop/p/stack-earrings-26050500","urlSlug":"p/stack-earrings-26050500","images":[{"id":"69fa5769cfa3e81e12d7c224","altText":"PXL_20260505_201834132.jpg","orderIndex":0,"url":"https://images.squarespace-cdn.com/content/v1/694b2288b16b8d02d4bdaa0c/2bf39ac2-a49b-4820-a211-961d6a0722ef/PXL_20260505_201834132.jpg","originalSize":{"width":480,"height":480},"availableFormats":[]},{"id":"69fa5769f691fe20c13bc9f8","altText":"PXL_20260505_201739701.jpg","orderIndex":1,"url":"https://images.squarespace-cdn.com/content/v1/694b2288b16b8d02d4bdaa0c/8d5186e3-e5a1-43bb-9714-77a939b8bc40/PXL_20260505_201739701.jpg","originalSize":{"width":480,"height":480},"availableFormats":[]},{"id":"69fa5769cfa3e81e12d7c225","altText":"PXL_20260505_201915047.jpg","orderIndex":2,"url":"https://images.squarespace-cdn.com/content/v1/694b2288b16b8d02d4bdaa0c/ff61c7e8-a03b-442e-81b2-db67241d85ec/PXL_20260505_201915047.jpg","originalSize":{"width":480,"height":480},"availableFormats":[]},{"id":"69fa5769f691fe20c13bc9f9","altText":"PXL_20260505_202122912.jpg","orderIndex":3,"url":"https://images.squarespace-cdn.com/content/v1/694b2288b16b8d02d4bdaa0c/357dfd2f-1bce-4687-b57b-1ff53209d970/PXL_20260505_202122912.jpg","originalSize":{"width":480,"height":480},"availableFormats":[]},{"id":"69fa5769a3780355a2edfbb0","altText":"PXL_20260505_202100350.jpg","orderIndex":4,"url":"https://images.squarespace-cdn.com/content/v1/694b2288b16b8d02d4bdaa0c/4fcf4192-dbe3-477a-90e7-be0c553f4c5b/PXL_20260505_202100350.jpg","originalSize":{"width":480,"height":480},"availableFormats":[]},{"id":"69fa5769cfa3e81e12d7c226","altText":"PXL_20260505_201947380.jpg","orderIndex":5,"url":"https://images.squarespace-cdn.com/content/v1/694b2288b16b8d02d4bdaa0c/fba1dcf8-8526-47ab-ab7f-be2ab37a1dbd/PXL_20260505_201947380.jpg","originalSize":{"width":480,"height":480},"availableFormats":[]}],"tags":[],"seoOptions":{"title":"Stack short gemstone and pearl earrings","description":"Tucson designer Lisa Sirlin-Halls Stack earrings are quick grabs of a bit of neutral with a pop of color when you want earrings for a casual day look."},"createdOn":"2026-05-05T20:36:56.235Z","modifiedOn":"2026-05-05T20:48:35.104Z","variants":[{"id":"fdb09e8d-467c-412e-a355-f6a40a24af24","sku":"26050101","image":null,"pricing":{"basePrice":{"currency":"USD","value":"68.00"},"salePrice":{"currency":"USD","value":"0.00"},"onSale":false},"stock":{"quantity":1,"unlimited":false},"attributes":{"Color":"Blue with Labradorite"},"shippingMeasurements":{"weight":{"unit":"POUND","value":0.0625},"dimensions":{"unit":"INCH","length":9,"width":6,"height":0.5}},"gtin":null,"mpn":null},{"id":"61c47a68-5acb-4d74-b18b-83ac27e49aeb","sku":"26050102","image":null,"pricing":{"basePrice":{"currency":"USD","value":"68.00"},"salePrice":{"currency":"USD","value":"0.00"},"onSale":false},"stock":{"quantity":1,"unlimited":false},"attributes":{"Color":"Silver with Black Onyx"},"shippingMeasurements":{"weight":{"unit":"POUND","value":0.0625},"dimensions":{"unit":"INCH","length":9,"width":6,"height":0.5}},"gtin":null,"mpn":null},{"id":"4b1ca060-8d0e-4e20-9863-cb37324da85d","sku":"26050103","image":null,"pricing":{"basePrice":{"currency":"USD","value":"68.00"},"salePrice":{"currency":"USD","value":"0.00"},"onSale":false},"stock":{"quantity":1,"unlimited":false},"attributes":{"Color":"Champagne yellow and Pearl"},"shippingMeasurements":{"weight":{"unit":"POUND","value":0.0625},"dimensions":{"unit":"INCH","length":9,"width":6,"height":0.5}},"gtin":null,"mpn":null}],"variantAttributes":["Color"],"isVisible":true}';
156
+ const SquarespaceVariantMap = {
157
+ "id": {target: "platformIds.SquarespaceId"},
158
+ "sku": {target: "sku"},
159
+ "image": {target: "image"},
160
+ "pricing": {target: "price"},
161
+ "stock": {target: "stock"},
162
+ "attributes": {target: "attributes"},
163
+ "shippingMeasurements": {target: "shippingMeasurements"},
164
+ "gtin": {target: "gtin"},
165
+ "mpn": {target: "mpn"},
166
+ //other fields not used
167
+ };
154
168
 
155
169
  const SquarespaceProductMap = {
156
- "id": "platformIds.SquarespaceId",
157
- "type": "PHYSICAL",
158
- "name": "name",
159
- "description": "description",
160
- "storePageId": "platformData.squarespaceData.storePageId",
161
- "url": "URL",
162
- "urlSlug": "urlSlug",
163
- "images": [
164
- "images[index]",
165
- ],
166
- "tags": "attributes.tags",
167
- "seoOptions": "seoOptions",
168
- "createdOn": "attributes.createdOn",
169
- "modifiedOn": "attributes.modifiedOn",
170
- "variants": [squarespaceVariantMapping],
171
- "variantAttributes": "variantAttributes",
172
- "isVisible": "isVisible",
170
+ "id": {target: "platformIds.SquarespaceId"},
171
+ "type": {target:"product_type"},
172
+ "name": {target: "name"},
173
+ "description": {target: "description"},
174
+ "storePageId": {target: "platformData.squarespaceData.storePageId"},
175
+ "url": {target: "URL"},
176
+ "urlSlug": {target: "urlSlug"},
177
+ "images": {target: "mediaObject.images"},
178
+ "tags": {target: "attributes.tags"},
179
+ "seoOptions": {target: "seoOptions"},
180
+ "createdOn": {target: "recipe.createdOn"},
181
+ "modifiedOn": {target: "recipe.modifiedOn"},
182
+ "variants": {
183
+ target: "variants",
184
+ formatter: SquarespaceVariantMap
185
+ },
186
+ "variantAttributes": {target: "variantAttributes"},
187
+ "isVisible": {target: "isVisible"},
173
188
  };
174
189
 
175
- function squarespaceJSONtoProductMapping(productJSON) {
176
- console.log("productJSON");
177
- console.dir(productJSON, { depth: null });
178
- const lesser = '{"id":"69fa5769cfa3e81e12d7c224","altText":"PXL_20260505_201834132.jpg","orderIndex":0,"url":"https://images.squarespace-cdn.com/content/v1/694b2288b16b8d02d4bdaa0c/2bf39ac2-a49b-4820-a211-961d6a0722ef/PXL_20260505_201834132.jpg","originalSize":{"width":480,"height":480},"availableFormats":[]}';
179
- const incomingProduct = JSON.parse(productJSON);
180
- console.log("incomingProduct");
181
- console.dir(incomingProduct, {depth: null});
182
-
183
- let properties = Object.getOwnPropertyNames(incomingProduct);
184
- console.log("properties: ", properties);
185
- let storageProduct = properties.reduce((outbound, property) => {
186
- const formatString = SquarespaceProductMap[property];
187
- console.log(property, ": ", formatString);
188
- }, {})
189
- };
190
+ function JSONtoItemMapping(itemJSON, itemMap) {
191
+ const incomingItem = JSON.parse(itemJSON);
192
+ return ItemToItemMapping(incomingItem, itemMap);
193
+ }
190
194
 
191
- squarespaceJSONtoProductMapping(SampleJSON);
195
+ export function JSONProductFeedToItemMapping(feedJSON) {
196
+ const incomingFeed = JSON.parse(feedJSON);
197
+ return incomingFeed.products.map(product => {
198
+ return ItemToItemMapping(product, SquarespaceProductMap);
199
+ });
200
+ }
192
201
 
193
- const SquarespaceVariantMap = {
194
- "id": "id",
195
- "sku": "sku",
196
- "image": "image",
197
- "pricing": "price",
198
- "stock": "stock",
199
- "attributes": "attributes",
200
- "shippingMeasurements": "shippingMeasurements",
201
- "gtin": "gtin",
202
- "mpn": "mpn",
203
- //other fields not used
202
+ function ItemToItemMapping(incomingItem, itemMap) {
203
+
204
+ let properties = Object.getOwnPropertyNames(incomingItem);
205
+ let outputItem = properties.reduce((outbound, property) => {
206
+ const target = itemMap[property]?.target
207
+ const formatter = itemMap[property]?.formatter;
208
+ let saveValue = Array.isArray(incomingItem[property])
209
+ ? incomingItem[property].map((entry) => {
210
+ return formatter
211
+ ? ItemToItemMapping(entry, formatter)
212
+ : entry;
213
+ })
214
+ : incomingItem[property];
215
+
216
+ const labels = target.split(".");
217
+ return recursiveMapWalk(outbound, labels, saveValue);
218
+
219
+ }, {}) ;
220
+
221
+ return outputItem;
204
222
  };
205
223
 
206
- async function squarespaceVariantMapping(product){
224
+ /**
225
+ * Uses an array of object member labels to insert a value into an object
226
+ * @param {object} thisObject
227
+ * @param {Array.string} labels
228
+ */
229
+ function recursiveMapWalk(thisObject, labels, value) {
230
+ if (labels.length < 1) {
231
+ return value;
232
+ } else {
233
+ const downObject = thisObject[labels[0]] ? thisObject[labels[0]] : {};
234
+ return {
235
+ ...thisObject,
236
+ //labels[0] as recursively passed to this level
237
+ [labels[0]]: recursiveMapWalk(downObject, labels.slice(1), value)
238
+ };
239
+ }
240
+ };
207
241
 
208
- };
242
+ export function squarespaceFeedTest () {
243
+ return JSONProductFeedToItemMapping(feedSample);
244
+ }