fluncle 0.169.0 → 0.170.0

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.
Files changed (2) hide show
  1. package/bin/fluncle.mjs +29 -3
  2. package/package.json +1 -1
package/bin/fluncle.mjs CHANGED
@@ -561,7 +561,7 @@ function parseVersion(version) {
561
561
  var currentVersion;
562
562
  var init_version = __esm(() => {
563
563
  init_output();
564
- currentVersion = "0.169.0".trim() ? "0.169.0".trim() : "0.1.0";
564
+ currentVersion = "0.170.0".trim() ? "0.170.0".trim() : "0.1.0";
565
565
  });
566
566
 
567
567
  // src/update-notifier.ts
@@ -2259,7 +2259,7 @@ function parseVersion2(version) {
2259
2259
  var currentVersion2, latestReleaseUrl = "https://api.github.com/repos/mauricekleine/fluncle/releases/latest";
2260
2260
  var init_version2 = __esm(() => {
2261
2261
  init_output();
2262
- currentVersion2 = "0.169.0".trim() ? "0.169.0".trim() : "0.1.0";
2262
+ currentVersion2 = "0.170.0".trim() ? "0.170.0".trim() : "0.1.0";
2263
2263
  });
2264
2264
 
2265
2265
  // ../../packages/registry/src/index.ts
@@ -6344,12 +6344,17 @@ var init_admin_artists2 = __esm(() => {
6344
6344
  // src/commands/admin-labels.ts
6345
6345
  var exports_admin_labels = {};
6346
6346
  __export(exports_admin_labels, {
6347
+ mergeLabelCommand: () => mergeLabelCommand,
6347
6348
  labelsBioQueueCommand: () => labelsBioQueueCommand,
6348
6349
  draftLabelBioCommand: () => draftLabelBioCommand,
6349
6350
  describeLabelCommand: () => describeLabelCommand,
6350
6351
  backfillLabelLineageCommand: () => backfillLabelLineageCommand,
6351
6352
  backfillLabelImagesCommand: () => backfillLabelImagesCommand
6352
6353
  });
6354
+ async function mergeLabelCommand(losingSlug, canonicalSlug) {
6355
+ const response = await adminApiPost(`/api/admin/labels/${encodeURIComponent(losingSlug)}/merge`, { canonicalSlug });
6356
+ return response.result;
6357
+ }
6353
6358
  async function describeLabelCommand(slug, options) {
6354
6359
  return adminApiPost(`/api/admin/labels/${encodeURIComponent(slug)}/bio`, buildBioBody2(options));
6355
6360
  }
@@ -9653,7 +9658,7 @@ function addAdminCommands(program2) {
9653
9658
  const { draftArtistBioCommand: draftArtistBioCommand2 } = await Promise.resolve().then(() => (init_admin_artists(), exports_admin_artists));
9654
9659
  await runEntityBioDraft("artist", slug, options, draftArtistBioCommand2);
9655
9660
  });
9656
- const labels = configureCommand(admin.command("labels").description("Label entity commands (the voiced bio)"));
9661
+ const labels = configureCommand(admin.command("labels").description("Label entity commands (voiced bio + slug-split merge)"));
9657
9662
  labels.action(() => {
9658
9663
  labels.outputHelp();
9659
9664
  });
@@ -9670,6 +9675,27 @@ function addAdminCommands(program2) {
9670
9675
  const { draftLabelBioCommand: draftLabelBioCommand2 } = await Promise.resolve().then(() => (init_admin_labels(), exports_admin_labels));
9671
9676
  await runEntityBioDraft("label", slug, options, draftLabelBioCommand2);
9672
9677
  });
9678
+ labels.command("merge").description("Merge a slug-split label into its canonical row (operator; re-points + redirects)").argument("<losingSlug>", "The duplicate label to fold away").argument("<canonicalSlug>", "The label to keep \u2014 everything re-points onto it").option("--json", "Print JSON", false).action(async (losingSlug, canonicalSlug, options) => {
9679
+ const { mergeLabelCommand: mergeLabelCommand2 } = await Promise.resolve().then(() => (init_admin_labels(), exports_admin_labels));
9680
+ const result = await mergeLabelCommand2(losingSlug, canonicalSlug);
9681
+ if (options.json) {
9682
+ printJson({ ok: true, result });
9683
+ return;
9684
+ }
9685
+ const {
9686
+ aliasWritten,
9687
+ canonicalSlug: canon,
9688
+ losingSlug: loser,
9689
+ reconciled,
9690
+ repointed
9691
+ } = result;
9692
+ console.log(`Merged ${loser} \u2192 ${canon}.`);
9693
+ console.log(` Re-pointed: ${repointed.tracks} track(s), ${repointed.childLabels} sublabel(s), ${repointed.aliases} alias(es).`);
9694
+ console.log(reconciled.length > 0 ? ` Filled onto ${canon} (was empty): ${reconciled.join(", ")}.` : ` Nothing to fill \u2014 ${canon} already carried every fact.`);
9695
+ console.log(` Seed state resolved to: ${result.seedState}.`);
9696
+ console.log(` Alias written: "${aliasWritten.alias}" (${aliasWritten.aliasSlug}) \u2192 confirmed, so it can never re-mint.`);
9697
+ console.log(` /label/${loser} now 301s to /label/${canon}.`);
9698
+ });
9673
9699
  const albums = configureCommand(admin.command("albums").description("Album entity commands (the voiced bio)"));
9674
9700
  albums.action(() => {
9675
9701
  albums.outputHelp();
package/package.json CHANGED
@@ -31,5 +31,5 @@
31
31
  "url": "git+https://github.com/mauricekleine/fluncle.git"
32
32
  },
33
33
  "type": "module",
34
- "version": "0.169.0"
34
+ "version": "0.170.0"
35
35
  }