@koda-sl/baker-cli 0.377.0-dev.302280df6 → 0.377.0-dev.3b4ae88f4
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/dist/cli.js +22 -5
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -66280,7 +66280,7 @@ var fullArg = {
|
|
|
66280
66280
|
|
|
66281
66281
|
// src/commands/shopify/hints.ts
|
|
66282
66282
|
var RECONNECT = 'Baker has lost access to this Shopify store, so these products may be out of date. Say so, and ask the user to reconnect with `request_connection` { platform: "shopify" } \u2014 the card offers Reconnect.';
|
|
66283
|
-
var OWN_STOREFRONT = "This store sells through its own storefront, not a Shopify online store: Baker
|
|
66283
|
+
var OWN_STOREFRONT = "This store sells through its own storefront, not a Shopify online store: Baker links to its product pages once the website's address is set in Brain \u2192 Store (`buyUrlKind` says where each link goes); until then, link to the product pages on the client's own site, and ask the user for them if you don't know them.";
|
|
66284
66284
|
function day(iso) {
|
|
66285
66285
|
return iso ? iso.slice(0, 10) : null;
|
|
66286
66286
|
}
|
|
@@ -66389,7 +66389,7 @@ function stockHintsFor(product) {
|
|
|
66389
66389
|
var BUY_NOTES = {
|
|
66390
66390
|
password_protected: "The store asks for a password before anyone can see it: a shopper following a buy link meets it first \u2014 tell the user before sending traffic.",
|
|
66391
66391
|
subscription_optional: "It can also be bought by subscription: on a landing `<ShopifyProduct>` offers the plans; a `buyUrl` elsewhere adds it once.",
|
|
66392
|
-
own_storefront: "The store sells through its own
|
|
66392
|
+
own_storefront: "The store sells through its own website: `buyUrlKind` says where each link goes \u2014 its product page, or its cart page once its developers confirm it in Brain \u2192 Store.",
|
|
66393
66393
|
details_pending: "Baker hasn't read this product's details yet (subscriptions among them): its buy links may change.",
|
|
66394
66394
|
subscription_only: "It's sold only by subscription: on a landing `<ShopifyProduct>` offers the plans; a `buyUrl` elsewhere is its product page, where the shopper picks one."
|
|
66395
66395
|
};
|
|
@@ -67284,6 +67284,13 @@ function discountPayload(args5) {
|
|
|
67284
67284
|
combinesWith: combinesOf(args5.combines)
|
|
67285
67285
|
});
|
|
67286
67286
|
}
|
|
67287
|
+
function signupOfferFlagsProblem(args5) {
|
|
67288
|
+
if (typeof args5.name !== "string" || args5.name.trim() === "")
|
|
67289
|
+
return 'Add --name "<what shoppers and store staff see, e.g. 10% off>": every sign-up offer needs a name.';
|
|
67290
|
+
if (args5["valid-days"] === void 0)
|
|
67291
|
+
return "Add --valid-days <1-365>: how many days each code lasts after it is given.";
|
|
67292
|
+
return void 0;
|
|
67293
|
+
}
|
|
67287
67294
|
function signupOfferPayload(args5) {
|
|
67288
67295
|
return defined({
|
|
67289
67296
|
name: args5.name,
|
|
@@ -67305,13 +67312,17 @@ var signupOfferSet = leaf(
|
|
|
67305
67312
|
},
|
|
67306
67313
|
{
|
|
67307
67314
|
handle: TARGET("Offer handle, e.g. welcome-10"),
|
|
67308
|
-
name: {
|
|
67315
|
+
name: {
|
|
67316
|
+
type: "string",
|
|
67317
|
+
description: 'Offer name shoppers and store staff see (required), e.g. "10% off"',
|
|
67318
|
+
required: false
|
|
67319
|
+
},
|
|
67309
67320
|
percent: { type: "string", description: "Percentage off (choose percent or amount)", required: false },
|
|
67310
67321
|
amount: { type: "string", description: "Amount off in the store currency", required: false },
|
|
67311
67322
|
products: { type: "string", description: "Product handles or ids, comma separated", required: false },
|
|
67312
67323
|
collections: { type: "string", description: "Collection handles or ids, comma separated", required: false },
|
|
67313
67324
|
minimum: { type: "string", description: "Minimum subtotal", required: false },
|
|
67314
|
-
"valid-days": { type: "string", description: "Each code lasts 1\u2013365 days", required: false },
|
|
67325
|
+
"valid-days": { type: "string", description: "Each code lasts 1\u2013365 days (required)", required: false },
|
|
67315
67326
|
ends: { type: "string", description: "Offer end as ISO date and time; no code outlives it", required: false },
|
|
67316
67327
|
"max-codes": { type: "string", description: "Total codes the offer may give, 1\u2013100000", required: false },
|
|
67317
67328
|
prefix: { type: "string", description: "Code prefix: 2\u201312 uppercase letters or digits", required: false },
|
|
@@ -67325,7 +67336,11 @@ var signupOfferSet = leaf(
|
|
|
67325
67336
|
async (args5) => await stageFor(
|
|
67326
67337
|
"shopify.signupOffer.set",
|
|
67327
67338
|
args5,
|
|
67328
|
-
() =>
|
|
67339
|
+
() => {
|
|
67340
|
+
const problem = signupOfferFlagsProblem(args5);
|
|
67341
|
+
if (problem) failValidation3(problem);
|
|
67342
|
+
return signupOfferPayload(args5);
|
|
67343
|
+
},
|
|
67329
67344
|
() => target3(args5, "offer handle")
|
|
67330
67345
|
)
|
|
67331
67346
|
);
|
|
@@ -68095,6 +68110,8 @@ var shopifySignupOfferViewSchema = z53.object({
|
|
|
68095
68110
|
codesGiven: z53.number()
|
|
68096
68111
|
});
|
|
68097
68112
|
var shopifySignupOffersResponseSchema = z53.object({
|
|
68113
|
+
/** The company has a store connection Baker can use (connected, not waiting on a reconnect). */
|
|
68114
|
+
connected: z53.boolean(),
|
|
68098
68115
|
/** The store allows Baker to add customers (sign-ups work). */
|
|
68099
68116
|
canAddCustomers: z53.boolean(),
|
|
68100
68117
|
/** The store allows Baker to make discount codes (offers give codes). */
|