@leaddreamer/inventorylogic 0.0.3-beta.48 → 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 -28
- 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/dist/InventoryLogic.0a417df6.js +2 -0
- package/dist/InventoryLogic.76c282a4.js +2 -0
- package/dist/InventoryLogic.b8b0ac74.js +2 -0
- package/dist/InventoryLogic.ca8dec8b.js +2 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Typedefs, constants, support functions and database operations related to Products
|
|
3
3
|
* @module Product
|
|
4
4
|
*/
|
|
5
|
-
import { updateRecord} from "@leaddreamer/firebase-wrapper";
|
|
5
|
+
import { updateRecord } from "@leaddreamer/firebase-wrapper";
|
|
6
6
|
import { Forms, fillForm } from "@leaddreamer/staticforms";
|
|
7
7
|
|
|
8
8
|
import { PRODUCT, MARKUPS, ISBN_LENGTH } from "../boilerplate/index.js";
|
|
@@ -44,6 +44,16 @@ import { typedRecordFromChild } from "../Utilities/index.js"
|
|
|
44
44
|
* @property {string} URL Absolute URL of the hosted image.
|
|
45
45
|
*/
|
|
46
46
|
|
|
47
|
+
/**
|
|
48
|
+
* a Brand Object
|
|
49
|
+
* @typedef {object} BrandObject
|
|
50
|
+
* @property {?AggregateRatingsValue} aggregateRating
|
|
51
|
+
* @property {?URL|ImageObject} logo
|
|
52
|
+
* @property {ReviewObject} review A review of the item. Supersedes reviews
|
|
53
|
+
* @property {text} slogan A slogan or motto associated with the item.
|
|
54
|
+
* @property {Name} name The name of the brand.
|
|
55
|
+
*/
|
|
56
|
+
|
|
47
57
|
/**
|
|
48
58
|
* Currency Description ISO 4217 currency code
|
|
49
59
|
* @typedef {object} CurrencyDescription
|
|
@@ -57,8 +67,9 @@ import { typedRecordFromChild } from "../Utilities/index.js"
|
|
|
57
67
|
/**
|
|
58
68
|
* Monetary Value Specification
|
|
59
69
|
* @typedef {object} MonetaryValue
|
|
60
|
-
* @property {CurrencyDescription}
|
|
70
|
+
* @property {CurrencyDescription} currencyDescription
|
|
61
71
|
* @property {decimal} value Decimal monetary value
|
|
72
|
+
* @property {Date} effectiveDate
|
|
62
73
|
*/
|
|
63
74
|
|
|
64
75
|
/**
|
|
@@ -98,6 +109,22 @@ import { typedRecordFromChild } from "../Utilities/index.js"
|
|
|
98
109
|
* @property {ProductWeight} weight
|
|
99
110
|
*/
|
|
100
111
|
|
|
112
|
+
/**
|
|
113
|
+
* @typedef {object} SizeSpecification
|
|
114
|
+
* @property {Text} type "SizeSpecification"
|
|
115
|
+
* @property {QuantitativeValue} hasMeasurement
|
|
116
|
+
* @property {Array.SizeGroupEnumeration|SizeGroupEnumeration|Text} sizeGroup
|
|
117
|
+
* The size group (also known as "size type") for a product's size. Size groups are common in the fashion industry to define size
|
|
118
|
+
* segments and suggested audiences for wearable products. Multiple values can be combined, for example "men's big and tall", "petite maternity" or "regular".
|
|
119
|
+
* @property {Array.SizeSystemEnumeration|SizeSystemEnumeration|Text} sizeSystem
|
|
120
|
+
* The size system used to identify a product's size. Typically either a standard (for example, "GS1" or "ISO-EN13402"), country
|
|
121
|
+
* code (for example "US" or "JP"), or a measuring system (for example "Metric" or "Imperial").
|
|
122
|
+
* @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.
|
|
123
|
+
* @property {GenderType|Text} suggestedGender The suggested gender of the intended user or audience, for example "male", "female", or "unisex".
|
|
124
|
+
* @property {QuantitativeValue} suggestedMeasurement A suggested range of body measurements for the intended audience or user, for example inseam between 32 and 34 inches or
|
|
125
|
+
* height between 170 and 190 cm. Typically found on a size chart for wearable products.
|
|
126
|
+
*/
|
|
127
|
+
|
|
101
128
|
/**
|
|
102
129
|
* Available stock for the variant. Present for PHYSICAL products only.
|
|
103
130
|
* @typedef {object} ProductStock
|
|
@@ -106,24 +133,71 @@ import { typedRecordFromChild } from "../Utilities/index.js"
|
|
|
106
133
|
*/
|
|
107
134
|
|
|
108
135
|
|
|
136
|
+
/**
|
|
137
|
+
* Meta Information for SEO
|
|
138
|
+
* @typedef {object} MetaData
|
|
139
|
+
* @property {string} title
|
|
140
|
+
* @property {string} description
|
|
141
|
+
*/
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* @typedef {"newborn" | "infant" | "toddler" | "kids" | "adult"} AgeGroupEnum
|
|
145
|
+
* @typedef {"male" | "female" | "unisex"} GenderEnum
|
|
146
|
+
*/
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Demographics characteristics
|
|
150
|
+
* @typedef {object} Demographics
|
|
151
|
+
* @property {boolean} adult
|
|
152
|
+
* @property {AgeGroupEnum} age_group
|
|
153
|
+
* @property {GenderEnum} gender
|
|
154
|
+
*/
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* List of product ID's for various platforms
|
|
158
|
+
* @typedef {object} PlatformIDs
|
|
159
|
+
* @property {Text} SquarespaceId
|
|
160
|
+
* @property {Text} GoogleMerchantId
|
|
161
|
+
* @property {Text} ShopifyId
|
|
162
|
+
*/
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Squarespace Specific Data
|
|
166
|
+
* @typedef {object} SquarespaceDataObject
|
|
167
|
+
* @property {Text} storePageId
|
|
168
|
+
*/
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* List of Platform Specific Data
|
|
172
|
+
* @typedef {object} PlatformData
|
|
173
|
+
* @property {SquarespaceDataObject} squarespaceData
|
|
174
|
+
*/
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* @typedef {object} AttributeValueObject
|
|
178
|
+
* @property {Text} condition
|
|
179
|
+
* @property {Array.Text} tags
|
|
180
|
+
* @property {Array.Text} colors
|
|
181
|
+
* @property {Array.Text} materials
|
|
182
|
+
* @property {Array.Text} patterns
|
|
183
|
+
* @property {Date} createdOn
|
|
184
|
+
* @property {Date} modifiedOn
|
|
185
|
+
*/
|
|
186
|
+
|
|
109
187
|
/**
|
|
110
188
|
* variant record (including inventory and pricing)
|
|
111
189
|
* @typedef {object} PhysicalProductVariant
|
|
112
|
-
* @property {Array.AttributeValue} attributes array of attribute/value pairs for a variant
|
|
113
|
-
* @property {string} sku
|
|
114
|
-
* @property {string} mpn manufacturer part number
|
|
115
|
-
* @property {string} gtin Global Trade Item Number
|
|
116
190
|
* @property {string} id unique ID for product variant
|
|
191
|
+
* @property {string} sku
|
|
117
192
|
* @property {ProductImage} image Image associated with this variant
|
|
118
|
-
* @property {
|
|
193
|
+
* @property {FullProductPricing} pricing
|
|
119
194
|
* @property {ProductStock} stock
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
*
|
|
124
|
-
* @
|
|
125
|
-
* @property {
|
|
126
|
-
* @property {string} description
|
|
195
|
+
* @property {Array.AttributeValue} attributes array of attribute/value pairs for a variant
|
|
196
|
+
* @property {ProductMeasurements} shippingMeasurements
|
|
197
|
+
* @property {string} gtin Global Trade Item Number
|
|
198
|
+
* @property {string} mpn manufacturer part number
|
|
199
|
+
* @property {ProductMeasurements} productMeasurements
|
|
200
|
+
* @property {date} availabilityDate
|
|
127
201
|
*/
|
|
128
202
|
|
|
129
203
|
/**
|
|
@@ -131,18 +205,25 @@ import { typedRecordFromChild } from "../Utilities/index.js"
|
|
|
131
205
|
* @typedef {object} Product
|
|
132
206
|
* @property {?string} Id Database Id of document (redundant for convenience)
|
|
133
207
|
* @property {?string} refPath if from database, full path to document
|
|
208
|
+
* @property {PlatformIDs} platformIds
|
|
209
|
+
* @property {platformData} platformData
|
|
210
|
+
* @property {SquarespaceDataObject} squarespaceData
|
|
211
|
+
* @property {Text} storePageId
|
|
134
212
|
* @property {string} name name for the Product
|
|
135
213
|
* @property {string} description Basic description of the product
|
|
214
|
+
* @property {string} google_product_category
|
|
215
|
+
* @property {?string} product_type "casual google_product_category"
|
|
216
|
+
* @property {Text|BrandObject} brand
|
|
217
|
+
* The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business user.
|
|
218
|
+
* @property {Demographics} demographics
|
|
219
|
+
* @property {AttributeValueObject} attributes array of attribute/value pairs for a product
|
|
136
220
|
* @property {Recipe_Data} recipe pricing and fabrication data
|
|
137
|
-
* @property {Array:
|
|
138
|
-
* @property {
|
|
221
|
+
* @property {Array:ProductImage} images
|
|
222
|
+
* @property {VideoImage} video_image
|
|
223
|
+
* @property {VirtualModel} virtual_model
|
|
224
|
+
* @property {MobileInfo} mobileInfo
|
|
139
225
|
* @property {boolean} isVisible
|
|
140
226
|
* @property {MetaData} seoOptions
|
|
141
|
-
* @property {string} name name for the Product
|
|
142
|
-
* @property {MetaData} seoOptions
|
|
143
|
-
* @property {Array.string} tags
|
|
144
|
-
* @property {Array.string} materials
|
|
145
|
-
* @property {Array.string} patterns
|
|
146
227
|
* @property {string} URL
|
|
147
228
|
* @property {string} urlSlug
|
|
148
229
|
* @property {Array.string} variantAttributes
|
|
@@ -165,7 +246,21 @@ const ProductDefault = {
|
|
|
165
246
|
modified: null,
|
|
166
247
|
},
|
|
167
248
|
image_links: [],
|
|
168
|
-
type: "",
|
|
249
|
+
type: "PHYSICAL",
|
|
250
|
+
isVisible: true,
|
|
251
|
+
seoOptions: {
|
|
252
|
+
title: "",
|
|
253
|
+
description: "",
|
|
254
|
+
},
|
|
255
|
+
tags: [""],
|
|
256
|
+
materials: [""],
|
|
257
|
+
patterns: [""],
|
|
258
|
+
URL: "",
|
|
259
|
+
urlSlug: "",
|
|
260
|
+
variantAttributes: [""],
|
|
261
|
+
variants: [
|
|
262
|
+
|
|
263
|
+
],
|
|
169
264
|
google_product_type: "",
|
|
170
265
|
shipping_time: 0,
|
|
171
266
|
condition: "",
|
|
@@ -179,9 +274,9 @@ const ProductDefault = {
|
|
|
179
274
|
size: "",
|
|
180
275
|
weight: 0,
|
|
181
276
|
shippingMeasurements: {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
277
|
+
shipping_length: 0,
|
|
278
|
+
shippin_width: 0,
|
|
279
|
+
shipping_height: 0
|
|
185
280
|
}
|
|
186
281
|
};
|
|
187
282
|
|
|
@@ -234,7 +329,7 @@ Forms.SearchBy[PRODUCT] = "name";
|
|
|
234
329
|
* @returns {Promise<void>}
|
|
235
330
|
*/
|
|
236
331
|
|
|
237
|
-
export async function createProduct(){
|
|
332
|
+
export async function createProduct() {
|
|
238
333
|
//get a blank Product Record
|
|
239
334
|
//write it to database, saving reference
|
|
240
335
|
//copy user stages to product stages
|
|
@@ -252,7 +347,7 @@ export async function createProduct(){
|
|
|
252
347
|
* @returns {promise.LineItem} a copy of the data written
|
|
253
348
|
*/
|
|
254
349
|
async function updateProduct(product, user = null) {
|
|
255
|
-
if (
|
|
350
|
+
if (!(product?.refPath || user?.refPath)) {
|
|
256
351
|
console.log("no product specified to save LineItem");
|
|
257
352
|
//no root products
|
|
258
353
|
return null;
|
|
@@ -283,3 +378,6 @@ function summarizeProduct(product) {
|
|
|
283
378
|
export function makeProductFromChild(child) {
|
|
284
379
|
return typedRecordFromChild(child, PRODUCT);
|
|
285
380
|
}
|
|
381
|
+
|
|
382
|
+
export * from "./GoogleMerchantAPI.js";
|
|
383
|
+
export * from "./Squarespace.js"
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function $parcel$exportWildcard(e,r){return Object.keys(r).forEach(function(c){"default"===c||"__esModule"===c||Object.prototype.hasOwnProperty.call(e,c)||Object.defineProperty(e,c,{enumerable:!0,get:function(){return r[c]}})}),e}require("./InventoryLogic.f716bebc.js"),require("./InventoryLogic.87addb57.js"),require("./InventoryLogic.f8d080e8.js"),require("./InventoryLogic.9658c8e7.js"),require("./InventoryLogic.ca8dec8b.js"),require("./InventoryLogic.20d9efd7.js"),require("./InventoryLogic.b49f09b1.js"),require("./InventoryLogic.4e7ced22.js"),require("./InventoryLogic.1e519cb0.js"),require("./InventoryLogic.74baf986.js"),require("./InventoryLogic.2468e70a.js"),require("./InventoryLogic.e0dc6c34.js"),require("./InventoryLogic.30e7c3e7.js");var $parcel$global=globalThis,$parcel$modules={},$parcel$inits={},parcelRequire=$parcel$global.parcelRequire3c55;null==parcelRequire&&((parcelRequire=function(e){if(e in $parcel$modules)return $parcel$modules[e].exports;if(e in $parcel$inits){var r=$parcel$inits[e];delete $parcel$inits[e];var c={id:e,exports:{}};return $parcel$modules[e]=c,r.call(c.exports,c,c.exports),c.exports}var l=Error("Cannot find module '"+e+"'");throw l.code="MODULE_NOT_FOUND",l}).register=function(e,r){$parcel$inits[e]=r},$parcel$global.parcelRequire3c55=parcelRequire);var parcelRegister=parcelRequire.register,$fjZig=parcelRequire("fjZig"),$cFg1d=parcelRequire("cFg1d"),$9Lshm=parcelRequire("9Lshm"),$4wblz=parcelRequire("4wblz"),$5nIdj=parcelRequire("5nIdj"),$goJkr=parcelRequire("goJkr"),$40TGC=parcelRequire("40TGC"),$gcNAj=parcelRequire("gcNAj"),$9QUJ4=parcelRequire("9QUJ4"),$8DeQu=parcelRequire("8DeQu"),$56KtY=parcelRequire("56KtY"),$2QvMT=parcelRequire("2QvMT"),$19KWm=parcelRequire("19KWm");$parcel$exportWildcard(module.exports,$fjZig),$parcel$exportWildcard(module.exports,$4wblz),$parcel$exportWildcard(module.exports,$goJkr),$parcel$exportWildcard(module.exports,$9QUJ4),$parcel$exportWildcard(module.exports,$56KtY),$parcel$exportWildcard(module.exports,$40TGC),$parcel$exportWildcard(module.exports,$19KWm),$parcel$exportWildcard(module.exports,$9Lshm),$parcel$exportWildcard(module.exports,$cFg1d),$parcel$exportWildcard(module.exports,$5nIdj),$parcel$exportWildcard(module.exports,$8DeQu),$parcel$exportWildcard(module.exports,$2QvMT),$parcel$exportWildcard(module.exports,$gcNAj);
|
|
2
|
+
//# sourceMappingURL=InventoryLogic.0a417df6.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var $9CRjk$mathjs=require("mathjs");function $parcel$export(e,t,i,n){Object.defineProperty(e,t,{get:i,set:n,enumerable:!0,configurable:!0})}$parcel$export(module.exports,"GoogleAPIProductDefault",()=>$263382218db2c3bc$export$1b06195c15cf22cc),$parcel$export(module.exports,"GoogleAPIProductMap",()=>$263382218db2c3bc$export$4059922dac929494);const $263382218db2c3bc$export$1b06195c15cf22cc={id:$9CRjk$mathjs.string,title:$9CRjk$mathjs.string,description:$9CRjk$mathjs.string,link:URL,image_link:URL,additional_image_link:null|URL,video_link:null|URL,virtual_model_link:null|URL,mobile_link:null|URL,availability:0,availability_date:any,cost_of_goods_sold:any,expiration_date:ISO8601,price:any,sale_price:any,sale_price_effective_date:any,google_product_category:any,product_type:null|$9CRjk$mathjs.string,brand:Text,gtin:null|$9CRjk$mathjs.string,mpn:Text,adult:0,age_group:Text,gender:0,color:$9CRjk$mathjs.string,condition:0,item_group_id:Text,item_group_title:Text,material:null|Text,pattern:null|Text,product_length:null|Text,product_width:null|Text,product_height:null|Text,product_highlight:null|Text,product_weight:null|Text,question_and_answer:[{question:Text,answer:Text}],size:null|Text,size_type:0,size_system:0,variant_option:[{name:Text,value:Text}],ads_redirect:null|URL,custom_label_0:null|Text,custom_label_1:null|Text,custom_label_2:null|Text,custom_label_3:null|Text,custom_label_4:null|Text,promotion_id:null|Text,lifestyle_image_link:null|URL,short_title:null|Text,shipping_length:null|Text,shipping_width:null|Text,shipping_height:null|Text,shipping_label:null|Text},$263382218db2c3bc$export$4059922dac929494={id:"variants[index].sku",title:"name",item_group_id:Text,item_group_title:Text,description:"description",link:"URL",image_link:"variants[index].image.URL",additional_image_link:"images[all]",video_link:null,virtual_model_link:null,mobile_link:null,availability:null,availability_date:"variants[index].availability_date",cost_of_goods_sold:null,expiration_date:"variants[index].expiration_date",price:"variants[index].pricing.baseprice.value| |variants[index].pricing.baseprice.currencyDescription.displayName",sale_price:"variants[index].pricing.saleprice.value| |variants[index].pricing.saleprice.currencyDescription.displayName",sale_price_effective_date:"variants[index].pricing.effectiveDate.",google_product_category:"google_product_category",product_type:null|$9CRjk$mathjs.string,brand:"brand.name",gtin:"variants[index].gtin",mpn:"variants[index].gtin",adult:"demographics.adult",age_group:"demographics.age_group",gender:"demographics.gender",condition:"attributes.condition",color:"attributes.colors[0]",material:"attributes.materials[0]",pattern:"attributes.patterns[0]",product_length:"variants[index].productMeasurements.dimensions.length&' '&variants[index].productMeasurements.dimensions.unit",product_width:"variants[index].productMeasurements.dimensions.width&' '&variants[index].productMeasurements.dimensions.unit",product_height:"variants[index].productMeasurements.dimensions.height&' '&variants[index].productMeasurements.dimensions.unit",product_highlight:null|Text,product_weight:"variants[index].productMeasurements.weight.value&' '&variants[index].productMeasurements.weight.unit",question_and_answer:[{question:Text,answer:Text}],size:null|Text,size_type:0,size_system:0,variant_option:[{name:Text,value:Text}],ads_redirect:null|URL,custom_label_0:null|Text,custom_label_1:null|Text,custom_label_2:null|Text,custom_label_3:null|Text,custom_label_4:null|Text,promotion_id:null|Text,lifestyle_image_link:null|URL,short_title:null|Text,shipping_length:null|Text,shipping_width:null|Text,shipping_height:null|Text,shipping_label:null|Text};function $263382218db2c3bc$var$GoogleProductAPIField(e,t){}const $263382218db2c3bc$var$GoogleProductCategory={"Animals & Pet Supplies":{index:1,"Live Animals":{index:3237},"Pet Supplies":{index:2,"Bird Supplies":{index:3,"Bird Cage Accessories":{index:7385,"Bird Cage Bird Baths":{index:499954},"Bird Cage Food & Water Dishes":{index:7386}},"Bird Cages & Stands":{index:4989},"Bird Food":{index:4990},"Bird Gyms & Playstands":{index:7398},"Bird Ladders & Perches":{index:4991},"Bird Toys":{index:4992},"Bird Treats":{index:4993}},"Cat Supplies":{index:4,"":{}}}}};
|
|
2
|
+
//# sourceMappingURL=InventoryLogic.76c282a4.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
require("./InventoryLogic.f716bebc.js");var $553fi$leaddreamerstaticforms=require("@leaddreamer/staticforms"),$parcel$global=globalThis,$parcel$modules={},$parcel$inits={},parcelRequire=$parcel$global.parcelRequire3c55;null==parcelRequire&&((parcelRequire=function(e){if(e in $parcel$modules)return $parcel$modules[e].exports;if(e in $parcel$inits){var a=$parcel$inits[e];delete $parcel$inits[e];var r={id:e,exports:{}};return $parcel$modules[e]=r,a.call(r.exports,r,r.exports),r.exports}var i=Error("Cannot find module '"+e+"'");throw i.code="MODULE_NOT_FOUND",i}).register=function(e,a){$parcel$inits[e]=a},$parcel$global.parcelRequire3c55=parcelRequire);var parcelRegister=parcelRequire.register,$fjZig=parcelRequire("fjZig");const $37f30a02897e95be$var$PhysicalProductDefault={created:null,id:null,modified:null,storePageId:"",type:PHYSICAL,description:null,images:[],isVisible:!0,name:"A Product",seoOptions:{title:"",description:""},tags:[],url:"",urlSlug:"",variantAttributes:[],variants:[{attributes:[],gtin:"",id:"",image:{},mpn:"",shippingMeasurements:{dimensions:{height:0,width:0,length:0,height:0,unit:INCH},weight:{value:0,unit:POUND}},sku:"",stock:{quantity:0,unlimited:!1}}]},$37f30a02897e95be$var$PhysicalProductMap={},$37f30a02897e95be$var$ProductDataForm={Id:"string.uuid",refPath:null,name:"commerce.product",description:"commerce.productDescription",sku:`commerce.isbn:${$fjZig.ISBN_LENGTH}`,markups:`subrecord:${$fjZig.MARKUPS}`,projectQ:"checkbox"},$37f30a02897e95be$var$ProductDefaultForm={Id:"hidden",refPath:"hidden",name:"text",description:"textarea",sku:"text",markups:`subrecord:${$fjZig.MARKUPS}`,projectQ:"checkbox"};$553fi$leaddreamerstaticforms.Forms.Base[$fjZig.PRODUCT]=ProductDefault,$553fi$leaddreamerstaticforms.Forms.BaseForm[$fjZig.PRODUCT]=$37f30a02897e95be$var$ProductDefaultForm,$553fi$leaddreamerstaticforms.Forms.CreateForm[$fjZig.PRODUCT]=$37f30a02897e95be$var$ProductDefaultForm,$553fi$leaddreamerstaticforms.Forms.Data[$fjZig.PRODUCT]=$37f30a02897e95be$var$ProductDataForm,$553fi$leaddreamerstaticforms.Forms.Summarize[$fjZig.PRODUCT]=summarizeProduct,$553fi$leaddreamerstaticforms.Forms.Save[$fjZig.PRODUCT]=updateProduct,$553fi$leaddreamerstaticforms.Forms.SearchBy[$fjZig.PRODUCT]="name";const $37f30a02897e95be$var$SampleJSON={id:"69fa54e8f691fe20c13bc732",type:"PHYSICAL",name:"Stack : : short gemstone earrings",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>',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-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."},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:!1},stock:{quantity:1,unlimited:!1},attributes:{Color:"Blue with Labradorite"},shippingMeasurements:{weight:{unit:"POUND",value:.0625},dimensions:{unit:"INCH",length:9,width:6,height:.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:!1},stock:{quantity:1,unlimited:!1},attributes:{Color:"Silver with Black Onyx"},shippingMeasurements:{weight:{unit:"POUND",value:.0625},dimensions:{unit:"INCH",length:9,width:6,height:.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:!1},stock:{quantity:1,unlimited:!1},attributes:{Color:"Champagne yellow and Pearl"},shippingMeasurements:{weight:{unit:"POUND",value:.0625},dimensions:{unit:"INCH",length:9,width:6,height:.5}},gtin:null,mpn:null}],variantAttributes:["Color"],isVisible:!0},$37f30a02897e95be$var$SquarespaceProductMap={id:"platformIds.SquarespaceId",type:"PHYSICAL",name:"name",description:"description",storePageId:"platformData.squarespaceData.storePageId",url:"URL",urlSlug:"urlSlug",images:["images[index]"],tags:"attributes.tags",seoOptions:"seoOptions",createdOn:"attributes.createdOn",modifiedOn:"attributes.modifiedOn",variants:[$37f30a02897e95be$var$squarespaceVariantMapping],variantAttributes:"variantAttributes",isVisible:"isVisible"};function $37f30a02897e95be$var$squarespaceJSONtoProductMapping(e){console.log(Object.getOwnPropertyNames(JSON.parse(e)))}$37f30a02897e95be$var$squarespaceJSONtoProductMapping($37f30a02897e95be$var$SampleJSON);const $37f30a02897e95be$var$SquarespaceVariantMap={id:"id",sku:"sku",image:"image",pricing:"price",stock:"stock",attributes:"attributes",shippingMeasurements:"shippingMeasurements",gtin:"gtin",mpn:"mpn"};async function $37f30a02897e95be$var$squarespaceVariantMapping(e){}
|
|
2
|
+
//# sourceMappingURL=InventoryLogic.b8b0ac74.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
require("./InventoryLogic.f716bebc.js"),require("./InventoryLogic.b49f09b1.js"),require("./InventoryLogic.76c282a4.js"),require("./InventoryLogic.b8b0ac74.js");var $kEiMh$leaddreamerfirebasewrapper=require("@leaddreamer/firebase-wrapper"),$kEiMh$leaddreamerstaticforms=require("@leaddreamer/staticforms");function $parcel$exportWildcard(e,r){return Object.keys(r).forEach(function(a){"default"===a||"__esModule"===a||Object.prototype.hasOwnProperty.call(e,a)||Object.defineProperty(e,a,{enumerable:!0,get:function(){return r[a]}})}),e}function $parcel$export(e,r,a,t){Object.defineProperty(e,r,{get:a,set:t,enumerable:!0,configurable:!0})}var $parcel$global=globalThis,$parcel$modules={},$parcel$inits={},parcelRequire=$parcel$global.parcelRequire3c55;null==parcelRequire&&((parcelRequire=function(e){if(e in $parcel$modules)return $parcel$modules[e].exports;if(e in $parcel$inits){var r=$parcel$inits[e];delete $parcel$inits[e];var a={id:e,exports:{}};return $parcel$modules[e]=a,r.call(a.exports,a,a.exports),a.exports}var t=Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}).register=function(e,r){$parcel$inits[e]=r},$parcel$global.parcelRequire3c55=parcelRequire);var parcelRegister=parcelRequire.register;$parcel$export(module.exports,"createProduct",()=>$3b8191bf4bd48653$export$9c734a715e6666d0),$parcel$export(module.exports,"makeProductFromChild",()=>$3b8191bf4bd48653$export$d4a471daa895146b);var $fjZig=parcelRequire("fjZig"),$19KWm=parcelRequire("19KWm"),$3hlkM=parcelRequire("3hlkM"),$4NOFh=parcelRequire("4NOFh");const $3b8191bf4bd48653$var$ProductDefault={name:"A Product",description:null,recipe:{markups:null,projectQ:!1,created:null,modified:null},image_links:[],type:"PHYSICAL",isVisible:!0,seoOptions:{title:"",description:""},tags:[""],materials:[""],patterns:[""],URL:"",urlSlug:"",variantAttributes:[""],variants:[],google_product_type:"",shipping_time:0,condition:"",adultQ:!1,age_group:"adult",color:[""],material:[""],gender:"unisex",attributes_gemstones:[""],pattern:"",size:"",weight:0,shippingMeasurements:{shipping_length:0,shippin_width:0,shipping_height:0}},$3b8191bf4bd48653$var$ProductDataForm={Id:"string.uuid",refPath:null,name:"commerce.product",description:"commerce.productDescription",sku:`commerce.isbn:${$fjZig.ISBN_LENGTH}`,markups:`subrecord:${$fjZig.MARKUPS}`,projectQ:"checkbox"},$3b8191bf4bd48653$var$ProductDefaultForm={Id:"hidden",refPath:"hidden",name:"text",description:"textarea",sku:"text",markups:`subrecord:${$fjZig.MARKUPS}`,projectQ:"checkbox"};async function $3b8191bf4bd48653$export$9c734a715e6666d0(){}async function $3b8191bf4bd48653$var$updateProduct(e,r=null){return e?.refPath||r?.refPath?(0,$kEiMh$leaddreamerfirebasewrapper.updateRecord)((0,$kEiMh$leaddreamerstaticforms.fillForm)(e,$fjZig.PRODUCT),r,$fjZig.PRODUCT):(console.log("no product specified to save LineItem"),null)}function $3b8191bf4bd48653$var$summarizeProduct(e){return`${e.name} ${e.description}`}function $3b8191bf4bd48653$export$d4a471daa895146b(e){return(0,$19KWm.typedRecordFromChild)(e,$fjZig.PRODUCT)}$kEiMh$leaddreamerstaticforms.Forms.Base[$fjZig.PRODUCT]=$3b8191bf4bd48653$var$ProductDefault,$kEiMh$leaddreamerstaticforms.Forms.BaseForm[$fjZig.PRODUCT]=$3b8191bf4bd48653$var$ProductDefaultForm,$kEiMh$leaddreamerstaticforms.Forms.CreateForm[$fjZig.PRODUCT]=$3b8191bf4bd48653$var$ProductDefaultForm,$kEiMh$leaddreamerstaticforms.Forms.Data[$fjZig.PRODUCT]=$3b8191bf4bd48653$var$ProductDataForm,$kEiMh$leaddreamerstaticforms.Forms.Summarize[$fjZig.PRODUCT]=$3b8191bf4bd48653$var$summarizeProduct,$kEiMh$leaddreamerstaticforms.Forms.Save[$fjZig.PRODUCT]=$3b8191bf4bd48653$var$updateProduct,$kEiMh$leaddreamerstaticforms.Forms.SearchBy[$fjZig.PRODUCT]="name",$parcel$exportWildcard(module.exports,$3hlkM),$parcel$exportWildcard(module.exports,$4NOFh);
|
|
2
|
+
//# sourceMappingURL=InventoryLogic.ca8dec8b.js.map
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
require("./InventoryLogic.
|
|
1
|
+
require("./InventoryLogic.0a417df6.js");var $kAdfK$leaddreamerfirebasewrapper=require("@leaddreamer/firebase-wrapper"),$kAdfK$leaddreamergenericutilities=require("@leaddreamer/genericutilities"),$kAdfK$leaddreamerstaticforms=require("@leaddreamer/staticforms");function $parcel$interopDefault(e){return e&&e.__esModule?e.default:e}function $parcel$defineInteropFlag(e){Object.defineProperty(e,"__esModule",{value:!0,configurable:!0})}function $parcel$exportWildcard(e,r){return Object.keys(r).forEach(function(a){"default"===a||"__esModule"===a||Object.prototype.hasOwnProperty.call(e,a)||Object.defineProperty(e,a,{enumerable:!0,get:function(){return r[a]}})}),e}function $parcel$export(e,r,a,l){Object.defineProperty(e,r,{get:a,set:l,enumerable:!0,configurable:!0})}var $parcel$global=globalThis,$parcel$modules={},$parcel$inits={},parcelRequire=$parcel$global.parcelRequire3c55;null==parcelRequire&&((parcelRequire=function(e){if(e in $parcel$modules)return $parcel$modules[e].exports;if(e in $parcel$inits){var r=$parcel$inits[e];delete $parcel$inits[e];var a={id:e,exports:{}};return $parcel$modules[e]=a,r.call(a.exports,a,a.exports),a.exports}var l=Error("Cannot find module '"+e+"'");throw l.code="MODULE_NOT_FOUND",l}).register=function(e,r){$parcel$inits[e]=r},$parcel$global.parcelRequire3c55=parcelRequire);var parcelRegister=parcelRequire.register;$parcel$defineInteropFlag(module.exports),$parcel$export(module.exports,"databasePromise",()=>$68678d58f0f75295$export$49c539bdd2044f17),$parcel$export(module.exports,"default",()=>$68678d58f0f75295$export$2e2bcd8739ae039);var $9qs3A=parcelRequire("9qs3A");async function $68678d58f0f75295$export$49c539bdd2044f17(e,r,a=null){return(0,$kAdfK$leaddreamergenericutilities.setLogger)(a),$parcel$interopDefault($kAdfK$leaddreamerfirebasewrapper)(e,r,a)}var $68678d58f0f75295$export$2e2bcd8739ae039=$68678d58f0f75295$export$49c539bdd2044f17;$parcel$exportWildcard(module.exports,$kAdfK$leaddreamerfirebasewrapper),$parcel$exportWildcard(module.exports,$kAdfK$leaddreamergenericutilities),$parcel$exportWildcard(module.exports,$9qs3A),$parcel$exportWildcard(module.exports,$kAdfK$leaddreamerstaticforms);
|
|
2
2
|
//# sourceMappingURL=index.js.map
|