@leaddreamer/inventorylogic 0.0.3-beta.81 → 0.0.3-beta.82
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/business/Utilities/promise-queue/index.js +3 -1
- package/package.json +2 -5
- package/dist/InventoryLogic.0ac93278.js +0 -35
- package/dist/InventoryLogic.0ac93278.js.map +0 -1
- package/dist/InventoryLogic.31f6d549.js +0 -152
- package/dist/InventoryLogic.31f6d549.js.map +0 -1
- package/dist/InventoryLogic.35827495.js +0 -285
- package/dist/InventoryLogic.35827495.js.map +0 -1
- package/dist/InventoryLogic.37dfff3e.js +0 -72
- package/dist/InventoryLogic.37dfff3e.js.map +0 -1
- package/dist/InventoryLogic.4206cb15.js +0 -213
- package/dist/InventoryLogic.4206cb15.js.map +0 -1
- package/dist/InventoryLogic.44193a77.js +0 -35
- package/dist/InventoryLogic.44193a77.js.map +0 -1
- package/dist/InventoryLogic.46ca6768.js +0 -131
- package/dist/InventoryLogic.46ca6768.js.map +0 -1
- package/dist/InventoryLogic.4d012935.js +0 -151
- package/dist/InventoryLogic.4d012935.js.map +0 -1
- package/dist/InventoryLogic.57f24f5f.js +0 -155
- package/dist/InventoryLogic.57f24f5f.js.map +0 -1
- package/dist/InventoryLogic.59be76a4.js +0 -184
- package/dist/InventoryLogic.59be76a4.js.map +0 -1
- package/dist/InventoryLogic.70925a32.js +0 -375
- package/dist/InventoryLogic.70925a32.js.map +0 -1
- package/dist/InventoryLogic.72fcf301.js +0 -6
- package/dist/InventoryLogic.72fcf301.js.map +0 -1
- package/dist/InventoryLogic.7741caec.js +0 -375
- package/dist/InventoryLogic.7741caec.js.map +0 -1
- package/dist/InventoryLogic.78480e5e.js +0 -152
- package/dist/InventoryLogic.78480e5e.js.map +0 -1
- package/dist/InventoryLogic.80d0e568.js +0 -135
- package/dist/InventoryLogic.80d0e568.js.map +0 -1
- package/dist/InventoryLogic.8a273d2e.js +0 -110
- package/dist/InventoryLogic.8a273d2e.js.map +0 -1
- package/dist/InventoryLogic.8addb055.js +0 -202
- package/dist/InventoryLogic.8addb055.js.map +0 -1
- package/dist/InventoryLogic.9dee46ea.js +0 -6
- package/dist/InventoryLogic.9dee46ea.js.map +0 -1
- package/dist/InventoryLogic.b90f66ea.js +0 -124
- package/dist/InventoryLogic.b90f66ea.js.map +0 -1
- package/dist/InventoryLogic.bb447b4c.js +0 -39
- package/dist/InventoryLogic.bb447b4c.js.map +0 -1
- package/dist/InventoryLogic.d27e84a7.js +0 -75
- package/dist/InventoryLogic.d27e84a7.js.map +0 -1
- package/dist/InventoryLogic.d69ad127.js +0 -217
- package/dist/InventoryLogic.d69ad127.js.map +0 -1
- package/dist/InventoryLogic.e03e6b07.js +0 -245
- package/dist/InventoryLogic.e03e6b07.js.map +0 -1
- package/dist/InventoryLogic.f276f76c.js +0 -213
- package/dist/InventoryLogic.f276f76c.js.map +0 -1
- package/dist/InventoryLogic.f4627c8a.js +0 -160
- package/dist/InventoryLogic.f4627c8a.js.map +0 -1
- package/dist/index.js +0 -23
- package/dist/index.js.map +0 -1
|
@@ -1,375 +0,0 @@
|
|
|
1
|
-
import {ISBN_LENGTH as $fefa9c41cb73ae0b$export$dbb3cd0a4caa6254, MARKUPS as $fefa9c41cb73ae0b$export$1bfdae073fb20e6c, PRODUCT as $fefa9c41cb73ae0b$export$e36553b0ff5db35a} from "./InventoryLogic.d27e84a7.js";
|
|
2
|
-
import {typedRecordFromChild as $9ab66828811feaa2$export$9536a88c96a1be48} from "./InventoryLogic.31f6d549.js";
|
|
3
|
-
import {GoogleAPIProductMap as $e409a6a48e9bf1c0$export$4059922dac929494} from "./InventoryLogic.b90f66ea.js";
|
|
4
|
-
import {JSONProductFeedToItemMapping as $63eb266a363bf697$export$8f68ab01093b41d6, squarespaceFeedTest as $63eb266a363bf697$export$c736243f342fb27b} from "./InventoryLogic.e03e6b07.js";
|
|
5
|
-
import {updateRecord as $lRpTb$updateRecord} from "@leaddreamer/firebase-wrapper";
|
|
6
|
-
import {Forms as $lRpTb$Forms, fillForm as $lRpTb$fillForm} from "@leaddreamer/staticforms";
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Typedefs, constants, support functions and database operations related to Products
|
|
10
|
-
* @module Product
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
//////////////////////////////////////////////////////////////////////
|
|
18
|
-
// Constants
|
|
19
|
-
/**
|
|
20
|
-
* "recipe" related values - build-stage markups, product/project Flag, created/modified dates
|
|
21
|
-
* @typedef {object} Recipe_Data
|
|
22
|
-
* @property {module:Markups~Stage} markups
|
|
23
|
-
* @property {boolean} projectQ flag for product/project
|
|
24
|
-
* @property {dateTime} created
|
|
25
|
-
* @property {dateTime} modified
|
|
26
|
-
*/ /**
|
|
27
|
-
* A list of attributes for a product
|
|
28
|
-
* @typedef {Array.String} AttributeList
|
|
29
|
-
*/ /**
|
|
30
|
-
* Array of attribute name/value pairs
|
|
31
|
-
* @typedef {object} AttributeValue
|
|
32
|
-
* @property {string} attibuteName attribute name from attribute list
|
|
33
|
-
* @property {string} value value for the particular attribute
|
|
34
|
-
*/ /**
|
|
35
|
-
* @typedef
|
|
36
|
-
*/ /**
|
|
37
|
-
* Image Descriptor
|
|
38
|
-
* @typedef {object} ProductImage
|
|
39
|
-
* @property {string} altText alt text for the image - SEO etc
|
|
40
|
-
* @property {Array.string} availableFormats Available image sizes.
|
|
41
|
-
* @property {string} id unique id for this productImage
|
|
42
|
-
* @property {integer} orderIndex Position of the image in the product's image list.
|
|
43
|
-
* @property {object} originalSize Image size when first uploaded.
|
|
44
|
-
* @property {MetaData} seoOptions
|
|
45
|
-
* @property {string} URL Absolute URL of the hosted image.
|
|
46
|
-
*/ /**
|
|
47
|
-
* a Brand Object
|
|
48
|
-
* @typedef {object} BrandObject
|
|
49
|
-
* @property {?string} Id Database Id of document (redundant for convenience)
|
|
50
|
-
* @property {?string} refPath if from database, full path to document
|
|
51
|
-
* @property {?AggregateRatingsValue} aggregateRating
|
|
52
|
-
* @property {?URL|ImageObject} logo
|
|
53
|
-
* @property {ReviewObject} review A review of the item. Supersedes reviews
|
|
54
|
-
* @property {text} slogan A slogan or motto associated with the item.
|
|
55
|
-
* @property {Name} name The name of the brand.
|
|
56
|
-
*/ /**
|
|
57
|
-
* Currency Description ISO 4217 currency code
|
|
58
|
-
* @typedef {object} CurrencyDescription
|
|
59
|
-
* @property {string} currencyCode
|
|
60
|
-
* @property {integer} defaultFractionDigits
|
|
61
|
-
* @property {string} displayName
|
|
62
|
-
* @property {string} numericCodeAsString
|
|
63
|
-
* @property {string} symbol
|
|
64
|
-
*/ /**
|
|
65
|
-
* Monetary Value Specification
|
|
66
|
-
* @typedef {object} MonetaryValue
|
|
67
|
-
* @property {CurrencyDescription} currencyDescription
|
|
68
|
-
* @property {decimal} value Decimal monetary value
|
|
69
|
-
* @property {Date} effectiveDate
|
|
70
|
-
*/ /**
|
|
71
|
-
* Pricing Object
|
|
72
|
-
* @typedef {object} FullProductPricing
|
|
73
|
-
* @property {MonetaryValue} basePrice
|
|
74
|
-
* @property {boolean} onSale
|
|
75
|
-
* @property {MonetaryValue} salePrice
|
|
76
|
-
*/ /**
|
|
77
|
-
* Dimensions Object
|
|
78
|
-
* @typedef {object} ProductDimensions
|
|
79
|
-
* @property {float} height
|
|
80
|
-
* @property {float} width
|
|
81
|
-
* @property {float} length
|
|
82
|
-
* @property {text} unit //ProductDimensionsUnit
|
|
83
|
-
*/ /**
|
|
84
|
-
* Price Object
|
|
85
|
-
* @typedef {object} PriceObject
|
|
86
|
-
*
|
|
87
|
-
*/ /**
|
|
88
|
-
* Weight Object
|
|
89
|
-
* @typedef {object} ProductWeight
|
|
90
|
-
* @property {text} unit //ProductWeightUnitEnum
|
|
91
|
-
* @property {float} value
|
|
92
|
-
*/ /**
|
|
93
|
-
* Measurements of the variant when it's shipped. Present for PHYSICAL products only.
|
|
94
|
-
* @typedef {object} ProductMeasurements
|
|
95
|
-
* @property {ProductDimensions} dimensions
|
|
96
|
-
* @property {ProductWeight} weight
|
|
97
|
-
*/ /**
|
|
98
|
-
* @typedef {object} QuantitativeValue
|
|
99
|
-
* @property {Boolean | Number | text | StructuredValue} value
|
|
100
|
-
* The value of a QuantitativeValue (including Observation) or property value node.
|
|
101
|
-
* * For QuantitativeValue and MonetaryAmount, the recommended type for values is 'Number'.
|
|
102
|
-
* * For PropertyValue, it can be 'Text', 'Number', 'Boolean', or 'StructuredValue'.
|
|
103
|
-
* * Use values from 0123456789 (Unicode 'DIGIT ZERO' (U+0030) to 'DIGIT NINE' (U+0039)) rather than superficially similar Unicode symbols.
|
|
104
|
-
* * Use '.' (Unicode 'FULL STOP' (U+002E)) rather than ',' to indicate a decimal point. Avoid using these symbols as a readability separator.
|
|
105
|
-
* @property {number} maxValue The upper value of some characteristic or property.
|
|
106
|
-
* @property {number} minValue The lower value of some characteristic or property.
|
|
107
|
-
* @property {?Text} unitText A string or text indicating the unit of measurement. Useful if you cannot provide a standard unit code for unitCode
|
|
108
|
-
* @property {?Text | URL} unitCode
|
|
109
|
-
* The unit of measurement given using the UN/CEFACT Common Code (3 characters) or a URL. Other codes than the UN/CEFACT Common Code may be used with a prefix followed by a colon
|
|
110
|
-
*
|
|
111
|
-
*/ /**
|
|
112
|
-
* @typedef {object} SizeSpecification
|
|
113
|
-
* @property {Text} type "SizeSpecification"
|
|
114
|
-
* @property {QuantitativeValue} hasMeasurement
|
|
115
|
-
* @property {Array.SizeGroupEnumeration|SizeGroupEnumeration|Text} sizeGroup
|
|
116
|
-
* The size group (also known as "size type") for a product's size. Size groups are common in the fashion industry to define size
|
|
117
|
-
* segments and suggested audiences for wearable products. Multiple values can be combined, for example "men's big and tall", "petite maternity" or "regular".
|
|
118
|
-
* @property {Array.SizeSystemEnumeration|SizeSystemEnumeration|Text} sizeSystem
|
|
119
|
-
* The size system used to identify a product's size. Typically either a standard (for example, "GS1" or "ISO-EN13402"), country
|
|
120
|
-
* code (for example "US" or "JP"), or a measuring system (for example "Metric" or "Imperial").
|
|
121
|
-
* @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.
|
|
122
|
-
* @property {GenderType|Text} suggestedGender The suggested gender of the intended user or audience, for example "male", "female", or "unisex".
|
|
123
|
-
* @property {QuantitativeValue} suggestedMeasurement A suggested range of body measurements for the intended audience or user, for example inseam between 32 and 34 inches or
|
|
124
|
-
* height between 170 and 190 cm. Typically found on a size chart for wearable products.
|
|
125
|
-
*/ /**
|
|
126
|
-
* Available stock for the variant. Present for PHYSICAL products only.
|
|
127
|
-
* @typedef {object} ProductStock
|
|
128
|
-
* @property {integer} quantity
|
|
129
|
-
* @property {boolean} unlimited
|
|
130
|
-
*/ /**
|
|
131
|
-
* Meta Information for SEO
|
|
132
|
-
* @typedef {object} MetaData
|
|
133
|
-
* @property {string} title
|
|
134
|
-
* @property {string} description
|
|
135
|
-
*/ /**
|
|
136
|
-
* @typedef {"newborn" | "infant" | "toddler" | "kids" | "adult"} AgeGroupEnum
|
|
137
|
-
* @typedef {"male" | "female" | "unisex"} GenderEnum
|
|
138
|
-
*/ /**
|
|
139
|
-
* Demographics characteristics
|
|
140
|
-
* @typedef {object} Demographics
|
|
141
|
-
* @property {boolean} adultOriented
|
|
142
|
-
* @property {AgeGroupEnum} age_group
|
|
143
|
-
* @property {GenderEnum} gender
|
|
144
|
-
*/ /**
|
|
145
|
-
* List of product ID's for various platforms
|
|
146
|
-
* @typedef {object} PlatformIDs
|
|
147
|
-
* @property {Text} squarespaceId
|
|
148
|
-
* @property {Text} googleMerchantId
|
|
149
|
-
* @property {Text} shopifyId
|
|
150
|
-
*/ /**
|
|
151
|
-
* Squarespace Specific Data
|
|
152
|
-
* @typedef {object} SquarespaceDataObject
|
|
153
|
-
* @property {Text} storePageId
|
|
154
|
-
*/ /**
|
|
155
|
-
* List of Platform Specific Data
|
|
156
|
-
* @typedef {object} PlatformData
|
|
157
|
-
* @property {SquarespaceDataObject} squarespaceData
|
|
158
|
-
*/ /**
|
|
159
|
-
* @typedef {object} AttributeValueObject
|
|
160
|
-
* @property {Text} condition
|
|
161
|
-
* @property {Array.Text} tags
|
|
162
|
-
* @property {Array.Text} colors
|
|
163
|
-
* @property {Array.Text} materials
|
|
164
|
-
* @property {Array.Text} patterns
|
|
165
|
-
* @property {string} custom_label_0
|
|
166
|
-
* @property {string} custom_label_1
|
|
167
|
-
* @property {string} custom_label_2
|
|
168
|
-
* @property {string} custom_label_3
|
|
169
|
-
* @property {string} custom_label_4
|
|
170
|
-
*/ /**
|
|
171
|
-
* @typedef {object} VideoImage
|
|
172
|
-
* @property {URL} video_link
|
|
173
|
-
*/ /**
|
|
174
|
-
* @typedef {object} VirtualModel
|
|
175
|
-
* @property {URL} virtual_model_link
|
|
176
|
-
*/ /**
|
|
177
|
-
* Media Related Data
|
|
178
|
-
* @typedef {object} MediaObject
|
|
179
|
-
* @property {Array.ProductImage} images
|
|
180
|
-
* @property {VideoImage} video_image
|
|
181
|
-
* @property {VirtualModel} virtual_model
|
|
182
|
-
*/ /**
|
|
183
|
-
* variant record (including inventory and pricing)
|
|
184
|
-
* @typedef {object} PhysicalProductVariant
|
|
185
|
-
* @property {PlatformIDs} platformIds
|
|
186
|
-
* @property {string} sku
|
|
187
|
-
* @property {ProductImage} image Image associated with this variant
|
|
188
|
-
* @property {FullProductPricing} pricing
|
|
189
|
-
* @property {ProductStock} stock
|
|
190
|
-
* @property {Array.AttributeValue} attributes array of attribute/value pairs for a variant
|
|
191
|
-
* @property {ProductMeasurements} shippingMeasurements
|
|
192
|
-
* @property {string} gtin Global Trade Item Number
|
|
193
|
-
* @property {string} mpn manufacturer part number
|
|
194
|
-
* @property {ProductMeasurements} productMeasurements
|
|
195
|
-
* @property {SizeSpecification} sizeSpecification
|
|
196
|
-
* @property {"in_stock"|"out_of_stock"|"preorder"|"backorder"} availability
|
|
197
|
-
* Accurately submit the product's availability and match the availability
|
|
198
|
-
* from your landing page, checkout pages, and structured data (for
|
|
199
|
-
* example, “in_stock” or “out_of_stock” in your Schema.org markup).
|
|
200
|
-
* If an item is out of stock, the price must still be clearly visible
|
|
201
|
-
* on the landing page.
|
|
202
|
-
* Provide the availability date [availability_date] attribute if you
|
|
203
|
-
* submit preorder [preorder] or backorder [backorder] as the availability value.
|
|
204
|
-
* @property {string|ISO8601} availability_date
|
|
205
|
-
* Use this attribute if your product's availability is set to preorder.
|
|
206
|
-
* Provide a value up to one year in the future.
|
|
207
|
-
* The availability date should also be added to the product’s landing
|
|
208
|
-
* page and be clear to your customers (for example, “May 6, 2023”).
|
|
209
|
-
* If an exact date can’t be provided, you can use an estimated date
|
|
210
|
-
* (for example, “May 2023”).
|
|
211
|
-
*/ /**
|
|
212
|
-
* a product record
|
|
213
|
-
* @typedef {object} Product
|
|
214
|
-
* @property {?string} Id Database Id of document (redundant for convenience)
|
|
215
|
-
* @property {?string} refPath if from database, full path to document
|
|
216
|
-
* @property {PlatformIDs} platformIds
|
|
217
|
-
* @property {PlatformData} platformData
|
|
218
|
-
* @property {string} name name for the Product
|
|
219
|
-
* @property {string} short_name name for the Product
|
|
220
|
-
* @property {string} description Basic description of the product
|
|
221
|
-
* @property {string} short_description
|
|
222
|
-
* @property {string} google_product_category
|
|
223
|
-
* @property {?string} product_type "casual google_product_category"
|
|
224
|
-
* @property {Text|BrandObject} brand
|
|
225
|
-
* The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business user.
|
|
226
|
-
* @property {Demographics} demographics
|
|
227
|
-
* @property {AttributeValueObject} attributes array of attribute/value pairs for a product
|
|
228
|
-
* @property {Recipe_Data} recipe pricing and fabrication data
|
|
229
|
-
* @property {MediaObject} mediaObject
|
|
230
|
-
* @property {MobileInfo} mobileInfo
|
|
231
|
-
* @property {boolean} isVisible
|
|
232
|
-
* @property {MetaData} seoOptions
|
|
233
|
-
* @property {string} URL
|
|
234
|
-
* @property {string} urlSlug
|
|
235
|
-
* @property {Array.string} variantAttributes
|
|
236
|
-
* @property {Array.PhysicalProductVariant} variants
|
|
237
|
-
*/ /**
|
|
238
|
-
* @readonly
|
|
239
|
-
* @constant
|
|
240
|
-
* @type {Product}
|
|
241
|
-
* @default
|
|
242
|
-
*/ const $e615241e8e7f6b5a$var$ProductDefault = {
|
|
243
|
-
platformIds: {
|
|
244
|
-
squarespaceId: null,
|
|
245
|
-
googleMerchantId: null,
|
|
246
|
-
shopifyId: null
|
|
247
|
-
},
|
|
248
|
-
platformData: {
|
|
249
|
-
squarespaceData: {
|
|
250
|
-
storePageId: null
|
|
251
|
-
}
|
|
252
|
-
},
|
|
253
|
-
name: null,
|
|
254
|
-
short_name: null,
|
|
255
|
-
description: null,
|
|
256
|
-
short_description: null,
|
|
257
|
-
google_product_category: null,
|
|
258
|
-
product_type: null,
|
|
259
|
-
brand: {
|
|
260
|
-
aggregate_rating: null,
|
|
261
|
-
logo: null,
|
|
262
|
-
review: {},
|
|
263
|
-
slogan: null,
|
|
264
|
-
name: null
|
|
265
|
-
},
|
|
266
|
-
demographics: {
|
|
267
|
-
adultOriented: false,
|
|
268
|
-
age_group: null,
|
|
269
|
-
gender: null
|
|
270
|
-
},
|
|
271
|
-
attributes: [],
|
|
272
|
-
recipe: {
|
|
273
|
-
markups: null,
|
|
274
|
-
projectQ: false,
|
|
275
|
-
created: null,
|
|
276
|
-
modified: null
|
|
277
|
-
},
|
|
278
|
-
mediaObject: {
|
|
279
|
-
images: [],
|
|
280
|
-
video_image: null,
|
|
281
|
-
virtual_model: null
|
|
282
|
-
},
|
|
283
|
-
mobileInfo: null,
|
|
284
|
-
isVisible: true,
|
|
285
|
-
type: "PHYSICAL",
|
|
286
|
-
seoOptions: {
|
|
287
|
-
title: null,
|
|
288
|
-
description: null
|
|
289
|
-
},
|
|
290
|
-
tags: [
|
|
291
|
-
""
|
|
292
|
-
],
|
|
293
|
-
materials: [
|
|
294
|
-
""
|
|
295
|
-
],
|
|
296
|
-
patterns: [
|
|
297
|
-
""
|
|
298
|
-
],
|
|
299
|
-
URL: null,
|
|
300
|
-
urlSlug: null,
|
|
301
|
-
variantAttributes: [],
|
|
302
|
-
variants: []
|
|
303
|
-
};
|
|
304
|
-
/**
|
|
305
|
-
* Form to create test data
|
|
306
|
-
* @readonly
|
|
307
|
-
* @constant
|
|
308
|
-
* @type {Product}
|
|
309
|
-
* @default
|
|
310
|
-
*/ const $e615241e8e7f6b5a$var$ProductDataForm = {
|
|
311
|
-
Id: `string.uuid`,
|
|
312
|
-
refPath: null,
|
|
313
|
-
name: `commerce.product`,
|
|
314
|
-
description: `commerce.productDescription`,
|
|
315
|
-
sku: `commerce.isbn:${(0, $fefa9c41cb73ae0b$export$dbb3cd0a4caa6254)}`,
|
|
316
|
-
markups: `subrecord:${(0, $fefa9c41cb73ae0b$export$1bfdae073fb20e6c)}`,
|
|
317
|
-
projectQ: `checkbox`
|
|
318
|
-
};
|
|
319
|
-
/**
|
|
320
|
-
* Form to enter MINIMAL product data to start creation
|
|
321
|
-
* @readonly
|
|
322
|
-
* @constant
|
|
323
|
-
* @type {Product}
|
|
324
|
-
* @default
|
|
325
|
-
*/ const $e615241e8e7f6b5a$var$ProductDefaultForm = {
|
|
326
|
-
Id: `hidden`,
|
|
327
|
-
refPath: `hidden`,
|
|
328
|
-
name: "text",
|
|
329
|
-
description: "textarea",
|
|
330
|
-
sku: "text"
|
|
331
|
-
};
|
|
332
|
-
(0, $lRpTb$Forms).Base[0, $fefa9c41cb73ae0b$export$e36553b0ff5db35a] = $e615241e8e7f6b5a$var$ProductDefault;
|
|
333
|
-
(0, $lRpTb$Forms).BaseForm[0, $fefa9c41cb73ae0b$export$e36553b0ff5db35a] = $e615241e8e7f6b5a$var$ProductDefaultForm;
|
|
334
|
-
(0, $lRpTb$Forms).CreateForm[0, $fefa9c41cb73ae0b$export$e36553b0ff5db35a] = $e615241e8e7f6b5a$var$ProductDefaultForm;
|
|
335
|
-
(0, $lRpTb$Forms).Data[0, $fefa9c41cb73ae0b$export$e36553b0ff5db35a] = $e615241e8e7f6b5a$var$ProductDataForm;
|
|
336
|
-
(0, $lRpTb$Forms).Summarize[0, $fefa9c41cb73ae0b$export$e36553b0ff5db35a] = $e615241e8e7f6b5a$var$summarizeProduct;
|
|
337
|
-
(0, $lRpTb$Forms).Save[0, $fefa9c41cb73ae0b$export$e36553b0ff5db35a] = $e615241e8e7f6b5a$var$updateProduct;
|
|
338
|
-
(0, $lRpTb$Forms).SearchBy[0, $fefa9c41cb73ae0b$export$e36553b0ff5db35a] = "name";
|
|
339
|
-
async function $e615241e8e7f6b5a$export$9c734a715e6666d0() {
|
|
340
|
-
//get a blank Product Record
|
|
341
|
-
//write it to database, saving reference
|
|
342
|
-
//copy user stages to product stages
|
|
343
|
-
//We return the product information - but most applications will use database listeners
|
|
344
|
-
}
|
|
345
|
-
//////////////////////////////////////////////////////////////////////
|
|
346
|
-
// record operations
|
|
347
|
-
/**
|
|
348
|
-
* writes record back to database. Assumes only Id is valid
|
|
349
|
-
* @param {Product} product a partially-populated product record for updates
|
|
350
|
-
* @param {User} user minimal record of user this product belongs to
|
|
351
|
-
* @returns {promise.LineItem} a copy of the data written
|
|
352
|
-
*/ async function $e615241e8e7f6b5a$var$updateProduct(product, user = null) {
|
|
353
|
-
if (!(product?.refPath || user?.refPath)) {
|
|
354
|
-
console.log("no product specified to save LineItem");
|
|
355
|
-
//no root products
|
|
356
|
-
return null;
|
|
357
|
-
}
|
|
358
|
-
return (0, $lRpTb$updateRecord)((0, $lRpTb$fillForm)(product, (0, $fefa9c41cb73ae0b$export$e36553b0ff5db35a)), user, (0, $fefa9c41cb73ae0b$export$e36553b0ff5db35a));
|
|
359
|
-
}
|
|
360
|
-
//////////////////////////////////////////////////////////////////////
|
|
361
|
-
// utilities
|
|
362
|
-
/**
|
|
363
|
-
* Returns a standardized formatted name string
|
|
364
|
-
* @param {Unit}
|
|
365
|
-
* @returns {string} formatted name string
|
|
366
|
-
*/ function $e615241e8e7f6b5a$var$summarizeProduct(product) {
|
|
367
|
-
return `${product.name} ${product.description}`;
|
|
368
|
-
}
|
|
369
|
-
function $e615241e8e7f6b5a$export$d4a471daa895146b(child) {
|
|
370
|
-
return (0, $9ab66828811feaa2$export$9536a88c96a1be48)(child, (0, $fefa9c41cb73ae0b$export$e36553b0ff5db35a));
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
export {$e615241e8e7f6b5a$export$9c734a715e6666d0 as createProduct, $e615241e8e7f6b5a$export$d4a471daa895146b as makeProductFromChild, $e409a6a48e9bf1c0$export$4059922dac929494 as GoogleAPIProductMap, $63eb266a363bf697$export$8f68ab01093b41d6 as JSONProductFeedToItemMapping, $63eb266a363bf697$export$c736243f342fb27b as squarespaceFeedTest};
|
|
375
|
-
//# sourceMappingURL=InventoryLogic.70925a32.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":"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","sources":["business/Product/index.js"],"sourcesContent":["/**\n * Typedefs, constants, support functions and database operations related to Products\n * @module Product\n */\nimport { updateRecord } from \"@leaddreamer/firebase-wrapper\";\nimport { Forms, fillForm } from \"@leaddreamer/staticforms\";\n\nimport { PRODUCT, MARKUPS, ISBN_LENGTH } from \"../boilerplate/index.js\";\nimport { typedRecordFromChild } from \"../Utilities/index.js\"\n\n//////////////////////////////////////////////////////////////////////\n// Constants\n\n/**\n * \"recipe\" related values - build-stage markups, product/project Flag, created/modified dates\n * @typedef {object} Recipe_Data\n * @property {module:Markups~Stage} markups\n * @property {boolean} projectQ flag for product/project\n * @property {dateTime} created\n * @property {dateTime} modified\n */\n\n/**\n * A list of attributes for a product\n * @typedef {Array.String} AttributeList\n */\n\n/**\n * Array of attribute name/value pairs\n * @typedef {object} AttributeValue\n * @property {string} attibuteName attribute name from attribute list\n * @property {string} value value for the particular attribute\n */\n\n/**\n * @typedef\n */\n\n/**\n * Image Descriptor\n * @typedef {object} ProductImage\n * @property {string} altText alt text for the image - SEO etc\n * @property {Array.string} availableFormats Available image sizes.\n * @property {string} id unique id for this productImage\n * @property {integer} orderIndex Position of the image in the product's image list.\n * @property {object} originalSize Image size when first uploaded.\n * @property {MetaData} seoOptions\n * @property {string} URL Absolute URL of the hosted image.\n */\n\n/**\n * a Brand Object\n * @typedef {object} BrandObject\n * @property {?string} Id Database Id of document (redundant for convenience)\n * @property {?string} refPath if from database, full path to document\n * @property {?AggregateRatingsValue} aggregateRating\n * @property {?URL|ImageObject} logo\n * @property {ReviewObject} review A review of the item. Supersedes reviews\n * @property {text} slogan A slogan or motto associated with the item.\n * @property {Name} name The name of the brand.\n */\n\n/**\n * Currency Description ISO 4217 currency code\n * @typedef {object} CurrencyDescription\n * @property {string} currencyCode\n * @property {integer} defaultFractionDigits\n * @property {string} displayName\n * @property {string} numericCodeAsString\n * @property {string} symbol\n */\n\n/**\n * Monetary Value Specification\n * @typedef {object} MonetaryValue\n * @property {CurrencyDescription} currencyDescription\n * @property {decimal} value Decimal monetary value\n * @property {Date} effectiveDate\n */\n\n/**\n * Pricing Object\n * @typedef {object} FullProductPricing\n * @property {MonetaryValue} basePrice\n * @property {boolean} onSale\n * @property {MonetaryValue} salePrice\n */\n\n/**\n * Dimensions Object\n * @typedef {object} ProductDimensions\n * @property {float} height \n * @property {float} width \n * @property {float} length \n * @property {text} unit //ProductDimensionsUnit\n */\n\n/**\n * Price Object\n * @typedef {object} PriceObject\n * \n */\n\n/**\n * Weight Object\n * @typedef {object} ProductWeight\n * @property {text} unit //ProductWeightUnitEnum\n * @property {float} value\n */\n\n/**\n * Measurements of the variant when it's shipped. Present for PHYSICAL products only.\n * @typedef {object} ProductMeasurements\n * @property {ProductDimensions} dimensions\n * @property {ProductWeight} weight\n */\n\n/**\n * @typedef {object} QuantitativeValue\n * @property {Boolean | Number | text | StructuredValue} value\n * The value of a QuantitativeValue (including Observation) or property value node.\n * * For QuantitativeValue and MonetaryAmount, the recommended type for values is 'Number'.\n * * For PropertyValue, it can be 'Text', 'Number', 'Boolean', or 'StructuredValue'.\n * * Use values from 0123456789 (Unicode 'DIGIT ZERO' (U+0030) to 'DIGIT NINE' (U+0039)) rather than superficially similar Unicode symbols.\n * * Use '.' (Unicode 'FULL STOP' (U+002E)) rather than ',' to indicate a decimal point. Avoid using these symbols as a readability separator.\n * @property {number} maxValue The upper value of some characteristic or property.\n * @property {number} minValue The lower value of some characteristic or property.\n * @property {?Text} unitText A string or text indicating the unit of measurement. Useful if you cannot provide a standard unit code for unitCode\n * @property {?Text | URL} unitCode \n * The unit of measurement given using the UN/CEFACT Common Code (3 characters) or a URL. Other codes than the UN/CEFACT Common Code may be used with a prefix followed by a colon\n * \n */\n\n/**\n * @typedef {object} SizeSpecification\n * @property {Text} type \"SizeSpecification\"\n * @property {QuantitativeValue} hasMeasurement\n * @property {Array.SizeGroupEnumeration|SizeGroupEnumeration|Text} sizeGroup\n * The size group (also known as \"size type\") for a product's size. Size groups are common in the fashion industry to define size\n * segments and suggested audiences for wearable products. Multiple values can be combined, for example \"men's big and tall\", \"petite maternity\" or \"regular\".\n * @property {Array.SizeSystemEnumeration|SizeSystemEnumeration|Text} sizeSystem\n * The size system used to identify a product's size. Typically either a standard (for example, \"GS1\" or \"ISO-EN13402\"), country\n * code (for example \"US\" or \"JP\"), or a measuring system (for example \"Metric\" or \"Imperial\").\n * @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.\n * @property {GenderType|Text} suggestedGender The suggested gender of the intended user or audience, for example \"male\", \"female\", or \"unisex\".\n * @property {QuantitativeValue} suggestedMeasurement A suggested range of body measurements for the intended audience or user, for example inseam between 32 and 34 inches or\n * height between 170 and 190 cm. Typically found on a size chart for wearable products.\n */\n\n/**\n * Available stock for the variant. Present for PHYSICAL products only.\n * @typedef {object} ProductStock\n * @property {integer} quantity\n * @property {boolean} unlimited\n */\n\n/**\n * Meta Information for SEO\n * @typedef {object} MetaData\n * @property {string} title\n * @property {string} description\n */\n\n/**\n * @typedef {\"newborn\" | \"infant\" | \"toddler\" | \"kids\" | \"adult\"} AgeGroupEnum\n * @typedef {\"male\" | \"female\" | \"unisex\"} GenderEnum\n */\n\n/**\n * Demographics characteristics\n * @typedef {object} Demographics\n * @property {boolean} adultOriented\n * @property {AgeGroupEnum} age_group\n * @property {GenderEnum} gender\n */\n\n/**\n * List of product ID's for various platforms\n * @typedef {object} PlatformIDs\n * @property {Text} squarespaceId\n * @property {Text} googleMerchantId\n * @property {Text} shopifyId\n */\n\n/**\n * Squarespace Specific Data\n * @typedef {object} SquarespaceDataObject\n * @property {Text} storePageId\n */\n\n/**\n * List of Platform Specific Data\n * @typedef {object} PlatformData\n * @property {SquarespaceDataObject} squarespaceData\n */\n\n/**\n * @typedef {object} AttributeValueObject\n * @property {Text} condition\n * @property {Array.Text} tags\n * @property {Array.Text} colors\n * @property {Array.Text} materials\n * @property {Array.Text} patterns\n * @property {string} custom_label_0\n * @property {string} custom_label_1\n * @property {string} custom_label_2\n * @property {string} custom_label_3\n * @property {string} custom_label_4\n */\n\n/**\n * @typedef {object} VideoImage\n * @property {URL} video_link\n */\n\n/**\n * @typedef {object} VirtualModel\n * @property {URL} virtual_model_link\n */\n\n/**\n * Media Related Data\n * @typedef {object} MediaObject\n * @property {Array.ProductImage} images\n * @property {VideoImage} video_image\n * @property {VirtualModel} virtual_model \n */\n\n/**\n * variant record (including inventory and pricing)\n * @typedef {object} PhysicalProductVariant\n * @property {PlatformIDs} platformIds\n * @property {string} sku\n * @property {ProductImage} image Image associated with this variant\n * @property {FullProductPricing} pricing\n * @property {ProductStock} stock\n * @property {Array.AttributeValue} attributes array of attribute/value pairs for a variant\n * @property {ProductMeasurements} shippingMeasurements\n * @property {string} gtin Global Trade Item Number\n * @property {string} mpn manufacturer part number\n * @property {ProductMeasurements} productMeasurements\n * @property {SizeSpecification} sizeSpecification\n * @property {\"in_stock\"|\"out_of_stock\"|\"preorder\"|\"backorder\"} availability\n * Accurately submit the product's availability and match the availability\n * from your landing page, checkout pages, and structured data (for\n * example, “in_stock” or “out_of_stock” in your Schema.org markup).\n * If an item is out of stock, the price must still be clearly visible\n * on the landing page.\n * Provide the availability date [availability_date] attribute if you\n * submit preorder [preorder] or backorder [backorder] as the availability value.\n * @property {string|ISO8601} availability_date\n * Use this attribute if your product's availability is set to preorder.\n * Provide a value up to one year in the future.\n * The availability date should also be added to the product’s landing\n * page and be clear to your customers (for example, “May 6, 2023”).\n * If an exact date can’t be provided, you can use an estimated date\n * (for example, “May 2023”).\n */\n\n/**\n * a product record\n * @typedef {object} Product\n * @property {?string} Id Database Id of document (redundant for convenience)\n * @property {?string} refPath if from database, full path to document\n * @property {PlatformIDs} platformIds\n * @property {PlatformData} platformData\n * @property {string} name name for the Product\n * @property {string} short_name name for the Product\n * @property {string} description Basic description of the product\n * @property {string} short_description\n * @property {string} google_product_category\n * @property {?string} product_type \"casual google_product_category\"\n * @property {Text|BrandObject} brand\n * The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business user.\n * @property {Demographics} demographics\n * @property {AttributeValueObject} attributes array of attribute/value pairs for a product\n * @property {Recipe_Data} recipe pricing and fabrication data\n * @property {MediaObject} mediaObject\n * @property {MobileInfo} mobileInfo\n * @property {boolean} isVisible\n * @property {MetaData} seoOptions\n * @property {string} URL\n * @property {string} urlSlug\n * @property {Array.string} variantAttributes\n * @property {Array.PhysicalProductVariant} variants\n */\n\n/**\n * @readonly\n * @constant\n * @type {Product}\n * @default\n */\nconst ProductDefault = {\n platformIds: {\n squarespaceId: null,\n googleMerchantId: null,\n shopifyId: null\n },\n platformData: {\n squarespaceData: {\n storePageId: null\n }\n },\n name: null,\n short_name: null,\n description: null,\n short_description: null,\n google_product_category: null,\n product_type: null,\n brand: {\n aggregate_rating: null,\n logo: null,\n review: {},\n slogan: null,\n name: null\n },\n demographics: {\n adultOriented: false,\n age_group: null,\n gender: null\n },\n attributes: [],\n recipe: {\n markups: null,\n projectQ: false,\n created: null,\n modified: null,\n },\n mediaObject: {\n images: [],\n video_image: null,\n virtual_model: null\n },\n mobileInfo: null,\n isVisible: true,\n type: \"PHYSICAL\",\n seoOptions: {\n title: null,\n description: null,\n },\n tags: [\"\"],\n materials: [\"\"],\n patterns: [\"\"],\n URL: null,\n urlSlug: null,\n variantAttributes: [],\n variants: []\n};\n\n/**\n * Form to create test data\n * @readonly\n * @constant\n * @type {Product}\n * @default\n */\nconst ProductDataForm = {\n Id: `string.uuid`,\n refPath: null,\n name: `commerce.product`,\n description: `commerce.productDescription`,\n sku: `commerce.isbn:${ISBN_LENGTH}`,\n markups: `subrecord:${MARKUPS}`,\n projectQ: `checkbox`\n};\n\n/**\n * Form to enter MINIMAL product data to start creation\n * @readonly\n * @constant\n * @type {Product}\n * @default\n */\nconst ProductDefaultForm = {\n Id: `hidden`,\n refPath: `hidden`,\n name: \"text\",\n description: \"textarea\",\n sku: \"text\",\n};\n\nForms.Base[PRODUCT] = ProductDefault;\nForms.BaseForm[PRODUCT] = ProductDefaultForm;\nForms.CreateForm[PRODUCT] = ProductDefaultForm;\nForms.Data[PRODUCT] = ProductDataForm;\nForms.Summarize[PRODUCT] = summarizeProduct;\nForms.Save[PRODUCT] = updateProduct;\nForms.SearchBy[PRODUCT] = \"name\";\n\n//////////////////////////////////////////////////////////////////////\n// business operations\n\n/**\n * Creates a new Blank Product\n * @param {UserObject} user minimal record of user this commodity belongs to (if any)\n * @returns {Promise<void>}\n */\n\nexport async function createProduct() {\n //get a blank Product Record\n //write it to database, saving reference\n //copy user stages to product stages\n //We return the product information - but most applications will use database listeners\n};\n\n\n//////////////////////////////////////////////////////////////////////\n// record operations\n\n/**\n * writes record back to database. Assumes only Id is valid\n * @param {Product} product a partially-populated product record for updates\n * @param {User} user minimal record of user this product belongs to\n * @returns {promise.LineItem} a copy of the data written\n */\nasync function updateProduct(product, user = null) {\n if (!(product?.refPath || user?.refPath)) {\n console.log(\"no product specified to save LineItem\");\n //no root products\n return null;\n };\n\n return updateRecord(\n fillForm(product, PRODUCT), //saves only APPROPRIATE fields -does NOT populate missing fields\n user,\n PRODUCT\n );\n}\n\n//////////////////////////////////////////////////////////////////////\n// utilities\n\n/**\n * Returns a standardized formatted name string\n * @param {Unit}\n * @returns {string} formatted name string\n */\nfunction summarizeProduct(product) {\n return `${product.name} ${product.description}`;\n}\n/**\n * @param {Record} child a record assumed to be a leaf/child\n * @returns {Record}\n */\nexport function makeProductFromChild(child) {\n return typedRecordFromChild(child, PRODUCT);\n}\n\nexport * from \"./GoogleMerchantAPI.js\";\nexport * from \"./Squarespace.js\"\n"],"names":[],"version":3,"file":"InventoryLogic.70925a32.js.map"}
|