@koda-sl/baker-cli 0.370.0-dev.886bf7ec3 → 0.371.0-dev.01d691680

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 CHANGED
@@ -5897,11 +5897,7 @@ var REJECTION_CODES = [
5897
5897
  "missing_identity",
5898
5898
  "invalid_timestamp",
5899
5899
  "invalid_value",
5900
- "batch_too_large",
5901
- // Appended, never inserted: the set a client branches on grows, and no code
5902
- // it already handles changes meaning.
5903
- "invalid_items",
5904
- "invalid_consent"
5900
+ "batch_too_large"
5905
5901
  ];
5906
5902
  var EVENT_INGEST_BATCH_MAX = 500;
5907
5903
  var EVENT_INGEST_BODY_MAX_BYTES = 8 * 1024 * 1024;
@@ -5914,15 +5910,12 @@ function validateEventName(name) {
5914
5910
  if (value === "" || value.length > MAX_EVENT_NAME || !EVENT_NAME.test(value)) return "invalid_name";
5915
5911
  return null;
5916
5912
  }
5917
- var MAX_ITEM_QUANTITY = 1e6;
5918
5913
  var REJECTION_MESSAGES = {
5919
5914
  invalid_event_id: "event_id, when sent, must be 1-128 characters of A-Z a-z 0-9 . _ : -",
5920
5915
  invalid_name: "event_name is required: up to 80 characters of letters (any language), digits, spaces, . _ and -, starting with a letter or a digit",
5921
5916
  missing_identity: "user_data named nobody, and no url named a page",
5922
5917
  invalid_timestamp: "event_time must be an ISO-8601 instant with an offset or Unix seconds, and not in the future",
5923
5918
  invalid_value: "value and currency go together: a non-negative decimal and an ISO-4217 code",
5924
- invalid_items: "each item names a product_id, variant_id or feed_id; quantity is a whole number from 1 to 1000000; price is a non-negative decimal sent with a currency",
5925
- invalid_consent: "consent.analytics and consent.marketing, when sent, are granted or denied",
5926
5919
  batch_too_large: `a request carries at most ${EVENT_INGEST_BATCH_MAX} events and ${EVENT_INGEST_BODY_MAX_BYTES / (1024 * 1024)} MB`
5927
5920
  };
5928
5921
 
@@ -7301,8 +7294,7 @@ var TRIGGER_KINDS = {
7301
7294
  "utm_source",
7302
7295
  "utm_medium",
7303
7296
  "utm_campaign",
7304
- "properties.<name>",
7305
- "items"
7297
+ "properties.<name>"
7306
7298
  ],
7307
7299
  keywords: ["purchase", "signup", "conversion", "analytics", "tracking", "hubspot", "crm", "deal", "funnel", "lead"]
7308
7300
  },
@@ -14914,22 +14906,8 @@ var ANALYTICS_EVENT_TYPES = [
14914
14906
  * page, `ingest` for a third party's server — and every report that needs to
14915
14907
  * tell them apart filters on that.
14916
14908
  */
14917
- "custom",
14918
- /**
14919
- * A fact about the business that names no person — a product changed, a
14920
- * variant went out of stock.
14921
- *
14922
- * Only a commerce door writes it (`ingestShopifyFacts`), and it is a type of
14923
- * its own rather than a `custom` event with no identity for one reason:
14924
- * every report that lists named events whitelists `custom`, so an
14925
- * operational fact would otherwise appear in the conversion picker, the
14926
- * funnel and the sends. Here it reaches the raw feed and the agents that
14927
- * listen for its name, and no person-level report. The row builder blanks
14928
- * every identity column on it, whatever it carried.
14929
- */
14930
- "operational"
14909
+ "custom"
14931
14910
  ];
14932
- var EVENT_ITEMS_MAX = 250;
14933
14911
  var ANALYTICS_DEVICE_TYPES = ["desktop", "mobile", "tablet", "bot", "unknown"];
14934
14912
  var ANALYTICS_BEACON_BATCH_MAX = 50;
14935
14913
 
@@ -30942,48 +30920,6 @@ var EVENT_FIELDS = [
30942
30920
  name: "properties",
30943
30921
  need: "optional",
30944
30922
  takes: "A flat object of strings \u2014 anything you want to break the event down by later."
30945
- },
30946
- {
30947
- name: "items",
30948
- need: "optional",
30949
- takes: "What was bought, one entry per product line \u2014 for a purchase, a cart or a refund.",
30950
- note: `Each line names its product by at least one of the ids below. value still carries the whole event's money. An order with more than ${EVENT_ITEMS_MAX} lines keeps the first ${EVENT_ITEMS_MAX}.`
30951
- },
30952
- {
30953
- name: "product_id, variant_id, feed_id",
30954
- need: "conditional",
30955
- under: true,
30956
- takes: "Your store's product id, its variant id, or the id the product has in your ads catalog. At least one per line, up to 255 characters each."
30957
- },
30958
- {
30959
- name: "quantity",
30960
- need: "optional",
30961
- under: true,
30962
- takes: `How many: a whole number from 1 to ${MAX_ITEM_QUANTITY.toLocaleString("en-US")}.`
30963
- },
30964
- {
30965
- name: "price",
30966
- need: "optional",
30967
- under: true,
30968
- takes: "The price of one unit, in the event's currency \u2014 so it needs currency. A decimal like value."
30969
- },
30970
- {
30971
- name: "consent",
30972
- need: "optional",
30973
- takes: "What the person allowed, if your site asked them.",
30974
- note: "Send it whenever you know it. A person who said no to marketing is still counted in your reports, and is never matched or sent to an ad platform."
30975
- },
30976
- {
30977
- name: "analytics",
30978
- need: "optional",
30979
- under: true,
30980
- takes: "granted or denied \u2014 whether they allowed being measured. Denied keeps the event and forgets who it was."
30981
- },
30982
- {
30983
- name: "marketing",
30984
- need: "optional",
30985
- under: true,
30986
- takes: "granted or denied \u2014 whether they allowed their visit to be used for advertising."
30987
30923
  }
30988
30924
  ];
30989
30925
  var RESPONSE_FIELDS = [
@@ -31313,37 +31249,7 @@ var ingestEventSchema = z39.strictObject({
31313
31249
  * left alone: masking one would rename the field and could collide with a
31314
31250
  * sibling.
31315
31251
  */
31316
- properties: z39.record(z39.string(), z39.string()).nullish(),
31317
- /**
31318
- * What was bought, one entry per line — for a purchase, a cart, a refund.
31319
- *
31320
- * Flat and Meta-like for the same reason as the rest of this body: it is
31321
- * Meta's `contents` (`id`, `quantity`, `item_price`) and GA4's `items`
31322
- * (`item_id`, `quantity`, `price`) under one spelling a sender can map from
31323
- * either. A line names what it is by any of three ids — the store's product,
31324
- * its variant, or the id the product has in an ads catalog. `price` is the
31325
- * *unit* price in the event's `currency`; `value` stays the whole event's
31326
- * money. Structure only here; `validateItems` judges each line.
31327
- */
31328
- items: z39.array(
31329
- z39.strictObject({
31330
- product_id: z39.string().nullish(),
31331
- variant_id: z39.string().nullish(),
31332
- feed_id: z39.string().nullish(),
31333
- quantity: z39.union([z39.string(), z39.number()]).nullish(),
31334
- price: z39.union([z39.string(), z39.number()]).nullish()
31335
- })
31336
- ).nullish(),
31337
- /**
31338
- * What the person allowed, each `granted` or `denied`: `analytics` (being
31339
- * measured at all) and `marketing` (being matched and sent to an ad
31340
- * platform). Absent means the sender did not say. Enforced before anything
31341
- * is stored — see `./consent`. `validateConsent` judges the values.
31342
- */
31343
- consent: z39.strictObject({
31344
- analytics: z39.string().nullish(),
31345
- marketing: z39.string().nullish()
31346
- }).nullish()
31252
+ properties: z39.record(z39.string(), z39.string()).nullish()
31347
31253
  });
31348
31254
  var ingestBatchSchema = z39.strictObject({
31349
31255
  events: z39.array(ingestEventSchema).min(1).max(EVENT_INGEST_BATCH_MAX)
@@ -64678,8 +64584,6 @@ var shopifyProductRequestSchema = z50.object({
64678
64584
  content: flag.optional(),
64679
64585
  /** One custom field whole, by its name or `namespace.key`. */
64680
64586
  field: z50.string().min(1).max(200).optional(),
64681
- /** With `field`: the option (its `variantId`) whose field to return, when options share one. */
64682
- variant: z50.string().regex(/^\d{1,30}$/, "an option's variantId").optional(),
64683
64587
  /** How many of the option each buy link puts in the cart (1-99, default 1). */
64684
64588
  quantity: z50.coerce.number().int().min(1).max(SHOPIFY_MAX_BUY_QUANTITY).optional()
64685
64589
  });
@@ -64823,8 +64727,6 @@ var shopifyFieldRefSchema = z50.object({
64823
64727
  url: z50.string().optional(),
64824
64728
  mimeType: z50.string().optional(),
64825
64729
  alt: z50.string().optional(),
64826
- /** A video's preview image; its `url` is the video file itself. */
64827
- previewUrl: z50.string().optional(),
64828
64730
  /** A product's or a collection's title, from Baker's copy. */
64829
64731
  title: z50.string().optional(),
64830
64732
  /** An image brought into the library: its imageId, to place like the product's photos. */
@@ -65151,8 +65053,7 @@ function contentHints(product) {
65151
65053
  }
65152
65054
  const truncated = product.content?.fields.find((field) => field.truncated);
65153
65055
  if (truncated) {
65154
- const option = truncated.variantId ? ` --variant ${truncated.variantId}` : "";
65155
- hints2.push(`Some fields are shown in part: read one whole with \`--field ${truncated.key}${option}\`.`);
65056
+ hints2.push(`Some fields are shown in part: read one whole with \`--field ${truncated.key}\`.`);
65156
65057
  }
65157
65058
  if (product.content?.unreadable?.length || product.content?.fields.some((field) => field.unreadable)) {
65158
65059
  hints2.push(
@@ -65355,11 +65256,6 @@ registerSchema({
65355
65256
  description: 'One custom field whole, by its name or its key (e.g. "Size chart" or custom.size_chart)',
65356
65257
  required: false
65357
65258
  },
65358
- variant: {
65359
- type: "string",
65360
- description: "With --field: the option whose field to return, by its variantId (options share their fields, e.g. --field custom.fit --variant 102)",
65361
- required: false
65362
- },
65363
65259
  quantity: {
65364
65260
  type: "number",
65365
65261
  description: "How many of the option each buy link puts in the cart, 1-99 (default 1)",
@@ -65471,11 +65367,6 @@ var productCommand = defineCommand209({
65471
65367
  default: false
65472
65368
  },
65473
65369
  field: { type: "string", description: "One custom field whole, by its name or key", required: false },
65474
- variant: {
65475
- type: "string",
65476
- description: "With --field: the option whose field it is, by its variantId",
65477
- required: false
65478
- },
65479
65370
  quantity: {
65480
65371
  type: "string",
65481
65372
  description: "How many each buy link puts in the cart, 1-99 (default 1)",
@@ -65500,7 +65391,6 @@ var productCommand = defineCommand209({
65500
65391
  outOfStock: args5["out-of-stock"],
65501
65392
  content: args5.content,
65502
65393
  field: args5.field,
65503
- variant: args5.variant,
65504
65394
  quantity: args5.quantity,
65505
65395
  full: args5.full
65506
65396
  })
@@ -65576,7 +65466,6 @@ Examples:
65576
65466
  baker shopify product the-complete-snowboard # one product: options with buyUrl, prices, photos, videos
65577
65467
  baker shopify product <handle> --content # its whole details: description, custom fields, subscriptions
65578
65468
  baker shopify product <handle> --field "Size chart" # one custom field, whole
65579
- baker shopify product <handle> --field custom.fit --variant <variantId> # one option's field, whole
65580
65469
  baker shopify product <handle> --quantity 2 # buy links that put 2 in the cart
65581
65470
  baker shopify product <id> --out-of-stock # only its options that are out of stock
65582
65471
  baker shopify stock # every product with options out of stock