@koda-sl/baker-cli 0.368.0-dev.c6b4ee821 → 0.369.0-dev.ba2803c37
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 +1 -1
- package/dist/cli.js +13 -20
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3699,7 +3699,7 @@ baker shopify stock --limit 20 # every product with every op
|
|
|
3699
3699
|
```
|
|
3700
3700
|
|
|
3701
3701
|
**`meta.store`** is on every answer: `connection` (`connected` · `needs_reconnect` · `disconnected`), `catalog` (`starting` · `importing` · `ready` · `failed`, with `importProgress` while importing), `unreadable` (products Baker couldn't read; `unreadableCapped` past 100), `checksFailing` (Baker couldn't check the store for changes lately), `storefront` (`online_store`, or `own` for a store that sells through its own site) and `lastActivity` (when Baker last heard from the store — not a promise the copy is current). `hints[]` turn each of these into what to tell the user.
|
|
3702
|
-
**`products`:** `--search <words>`, `--collection <handle|id>`, `--stock`, `--limit <1-100>`, `--cursor`; `--full` adds vendor, type, option count, photo link, visibility and status. A row's `availability` is absent when the product is on the store, `link_only` when it is buyable only through its link, `not_for_sale` (with `status`) when it can't be bought on the online store.
|
|
3702
|
+
**`products`:** `--search <words>`, `--collection <handle|id>`, `--stock`, `--limit <1-100>`, `--cursor`; `--full` adds vendor, type, option count, photo link, visibility and status. Every price, here and in `product` (`price`, `compareAt`, each option's price, `pricesByCountry`), is one string with its currency beside each amount: `"USD 785.95"`, `"USD 9.95 – USD 49.95"`. A row's `availability` is absent when the product is on the store, `link_only` when it is buyable only through its link, `not_for_sale` (with `status`) when it can't be bought on the online store.
|
|
3703
3703
|
**`product`:** positional `<ref>` — the numeric id, the handle, a store product link (`…/products/<handle>`, even an all-digit handle), a Baker Products link, or `gid://shopify/Product/<n>`. Returns options (50 per page, `--variants-cursor` for more; 250 with `--full`), `outOptions` (up to 50, `outOptionsMore` for the rest), `pricesByCountry` when the store sells at more than one price, `photos[]` (`imageId` + a Baker-hosted `url`, never a Shopify link), `url` (the product's page in Baker) and `storeUrl`. `--full` adds the whole description, SEO, category, the admin link and each option's SKU, barcode, feed id and prices by country. `NOT_FOUND` carries a hint to search instead.
|
|
3704
3704
|
**`collections`:** `--search <words>`; each row has `handle`, Shopify's product count and, on a store with an online store, `onStore`.
|
|
3705
3705
|
**`stock`:** `--collection`, `--limit <1-200>` (default 50 per list), `--full` (SKUs and Baker links). Options that keep selling at zero or don't track stock are not out of stock.
|
package/dist/cli.js
CHANGED
|
@@ -64576,8 +64576,9 @@ var shopifyStockRequestSchema = z50.object({
|
|
|
64576
64576
|
limit: z50.coerce.number().int().min(1).max(200).optional(),
|
|
64577
64577
|
full: flag.optional()
|
|
64578
64578
|
});
|
|
64579
|
-
var
|
|
64580
|
-
var
|
|
64579
|
+
var AMOUNT = String.raw`[A-Z]{3} \d+(?:\.\d+)?`;
|
|
64580
|
+
var shopifyPriceSchema = z50.string().regex(new RegExp(`^${AMOUNT}$`), "a price is '<CURRENCY> <amount>'");
|
|
64581
|
+
var shopifyPriceRangeSchema = z50.string().regex(new RegExp(`^${AMOUNT}(?: \u2013 ${AMOUNT})?$`), "a price range is '<CURRENCY> <min> \u2013 <CURRENCY> <max>'");
|
|
64581
64582
|
var shopifyStoreSummarySchema = z50.object({
|
|
64582
64583
|
name: z50.string(),
|
|
64583
64584
|
domain: z50.string(),
|
|
@@ -64609,8 +64610,8 @@ var shopifyStoreResponseSchema = z50.object({
|
|
|
64609
64610
|
var shopifyProductRowSchema = z50.object({
|
|
64610
64611
|
productId: z50.string(),
|
|
64611
64612
|
title: z50.string(),
|
|
64612
|
-
price:
|
|
64613
|
-
compareAt:
|
|
64613
|
+
price: shopifyPriceRangeSchema,
|
|
64614
|
+
compareAt: shopifyPriceRangeSchema.optional(),
|
|
64614
64615
|
stock: shopifyStockStateSchema,
|
|
64615
64616
|
/** "<out>/<all>" options out of stock, when partly out. */
|
|
64616
64617
|
optionsOut: z50.string().optional(),
|
|
@@ -64632,15 +64633,14 @@ var shopifyProductsResponseSchema = z50.object({
|
|
|
64632
64633
|
var outOptionSchema = z50.object({ variantId: z50.string(), title: z50.string(), sku: z50.string().optional() });
|
|
64633
64634
|
var countryPriceSchema = z50.object({
|
|
64634
64635
|
name: z50.string(),
|
|
64635
|
-
|
|
64636
|
-
|
|
64637
|
-
compareAtPrice: z50.string().optional()
|
|
64636
|
+
price: shopifyPriceSchema,
|
|
64637
|
+
compareAtPrice: shopifyPriceSchema.optional()
|
|
64638
64638
|
});
|
|
64639
64639
|
var shopifyVariantSchema = z50.object({
|
|
64640
64640
|
variantId: z50.string(),
|
|
64641
64641
|
title: z50.string(),
|
|
64642
|
-
price:
|
|
64643
|
-
compareAtPrice:
|
|
64642
|
+
price: shopifyPriceSchema,
|
|
64643
|
+
compareAtPrice: shopifyPriceSchema.optional(),
|
|
64644
64644
|
stock: shopifyOptionStockSchema,
|
|
64645
64645
|
quantity: z50.number().optional(),
|
|
64646
64646
|
// --full
|
|
@@ -64662,8 +64662,8 @@ var shopifyProductDetailSchema = z50.object({
|
|
|
64662
64662
|
status: shopifyProductStatusSchema.optional(),
|
|
64663
64663
|
vendor: z50.string(),
|
|
64664
64664
|
productType: z50.string(),
|
|
64665
|
-
price:
|
|
64666
|
-
compareAt:
|
|
64665
|
+
price: shopifyPriceRangeSchema,
|
|
64666
|
+
compareAt: shopifyPriceRangeSchema.optional(),
|
|
64667
64667
|
stock: z50.object({ state: shopifyStockStateSchema, optionsOut: z50.number(), options: z50.number() }),
|
|
64668
64668
|
outOptions: z50.array(outOptionSchema),
|
|
64669
64669
|
outOptionsMore: z50.number().optional(),
|
|
@@ -64681,9 +64681,7 @@ var shopifyProductDetailSchema = z50.object({
|
|
|
64681
64681
|
pricesByCountry: z50.array(
|
|
64682
64682
|
z50.object({
|
|
64683
64683
|
name: z50.string(),
|
|
64684
|
-
|
|
64685
|
-
min: z50.string(),
|
|
64686
|
-
max: z50.string(),
|
|
64684
|
+
price: shopifyPriceRangeSchema,
|
|
64687
64685
|
countries: z50.array(z50.string()),
|
|
64688
64686
|
moreCountries: z50.number().optional()
|
|
64689
64687
|
})
|
|
@@ -64811,9 +64809,6 @@ function productsHints(answer, options) {
|
|
|
64811
64809
|
}
|
|
64812
64810
|
return hints2;
|
|
64813
64811
|
}
|
|
64814
|
-
function priceText(range, currency) {
|
|
64815
|
-
return range.min === range.max ? `${range.min} ${currency}` : `${range.min}\u2013${range.max} ${currency}`;
|
|
64816
|
-
}
|
|
64817
64812
|
function photoHints(product) {
|
|
64818
64813
|
const hints2 = [];
|
|
64819
64814
|
if (product.photos.length > 0) {
|
|
@@ -64863,9 +64858,7 @@ function productHints(product, store) {
|
|
|
64863
64858
|
);
|
|
64864
64859
|
}
|
|
64865
64860
|
if (product.compareAt) {
|
|
64866
|
-
hints2.push(
|
|
64867
|
-
`On sale: was ${priceText(product.compareAt, product.price.currency)}, now ${priceText(product.price, product.price.currency)}.`
|
|
64868
|
-
);
|
|
64861
|
+
hints2.push(`On sale: was ${product.compareAt}, now ${product.price}.`);
|
|
64869
64862
|
}
|
|
64870
64863
|
if (product.pricesByCountry) {
|
|
64871
64864
|
hints2.push(
|