@koda-sl/baker-cli 0.169.1 → 0.169.2

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
@@ -7229,6 +7229,15 @@ function handleGoogleError(err) {
7229
7229
  function noopHints(data) {
7230
7230
  return data.staged ? [] : [`NOT STAGED \u2014 ${data.reason}. Nothing to publish for this change; say so rather than reporting it as done.`];
7231
7231
  }
7232
+ function skippedHints(skipped, total) {
7233
+ if (skipped.length === 0) {
7234
+ return [];
7235
+ }
7236
+ const detail = skipped.map((s) => `${s.summary} \u2014 ${s.reason}`).join("; ");
7237
+ return [
7238
+ `${skipped.length} of ${total} op(s) NOT STAGED: ${detail}. Don't re-stage them; tell the user which changes couldn't be made and why, then carry on with the rest.`
7239
+ ];
7240
+ }
7232
7241
  async function stageGoogleOp(raw, hints) {
7233
7242
  const preflight = googleDraftOpInputSchema.safeParse(raw);
7234
7243
  if (!preflight.success) {
@@ -7285,14 +7294,7 @@ async function stageGoogleOps(rawOps, hints) {
7285
7294
  try {
7286
7295
  const chatId = requireChatId();
7287
7296
  const response = await apiPost("/api/ads/google/draft/stage-batch", { chatId, ops });
7288
- const skipped = response.data.skipped ?? [];
7289
- const allHints = [
7290
- ...skipped.length > 0 ? [
7291
- `${skipped.length} of ${ops.length} op(s) NOT STAGED \u2014 already in the requested state: ${skipped.map((s) => s.reason).join("; ")}`
7292
- ] : [],
7293
- ...hints ?? [],
7294
- ...adCopyHints(ops)
7295
- ];
7297
+ const allHints = [...skippedHints(response.data.skipped ?? [], ops.length), ...hints ?? [], ...adCopyHints(ops)];
7296
7298
  writeJsonEnvelope(allHints.length > 0 ? { ...response, hints: allHints } : response);
7297
7299
  } catch (err) {
7298
7300
  handleGoogleError(err);