fluncle 0.34.0 → 0.35.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 +37 -1
  2. package/package.json +1 -1
package/bin/fluncle.mjs CHANGED
@@ -3789,7 +3789,7 @@ function parseVersion(version) {
3789
3789
  var currentVersion, latestReleaseUrl = "https://api.github.com/repos/mauricekleine/fluncle/releases/latest";
3790
3790
  var init_version = __esm(() => {
3791
3791
  init_output();
3792
- currentVersion = "0.34.0".trim() ? "0.34.0".trim() : "0.1.0";
3792
+ currentVersion = "0.35.0".trim() ? "0.35.0".trim() : "0.1.0";
3793
3793
  });
3794
3794
 
3795
3795
  // src/commands/track.ts
@@ -4618,6 +4618,38 @@ var init_mixtape_mixcloud2 = __esm(() => {
4618
4618
  PICTURE_MAX_BYTES2 = 10 * 1024 * 1024;
4619
4619
  });
4620
4620
 
4621
+ // src/commands/auth-lastfm.ts
4622
+ var exports_auth_lastfm = {};
4623
+ __export(exports_auth_lastfm, {
4624
+ authLastfmCommand: () => authLastfmCommand
4625
+ });
4626
+ async function authLastfmCommand(options) {
4627
+ if (options.token?.trim()) {
4628
+ const response2 = await adminApiPost("/api/admin/lastfm/auth/session", { token: options.token.trim() });
4629
+ console.log(`Last.fm connected as ${response2.name || "fluncle"}.
4630
+
4631
+ Set this as the Worker secret LASTFM_SESSION_KEY (it does not expire):
4632
+
4633
+ ${response2.sessionKey}
4634
+
4635
+ bun run --cwd apps/web wrangler secret put LASTFM_SESSION_KEY
4636
+
4637
+ Also store it in 1Password (Fluncle vault) alongside the API key + shared secret.`);
4638
+ return;
4639
+ }
4640
+ const response = await adminApiGet("/api/admin/lastfm/auth/start");
4641
+ console.log(`Open this Last.fm authorization URL (logged in as fluncle) and click "Yes, allow access":
4642
+
4643
+ ${response.authUrl}
4644
+
4645
+ After approving, run this to mint the durable session key:
4646
+
4647
+ fluncle admin auth lastfm --token ${response.token}`);
4648
+ }
4649
+ var init_auth_lastfm = __esm(() => {
4650
+ init_api();
4651
+ });
4652
+
4621
4653
  // src/interactive.ts
4622
4654
  var exports_interactive = {};
4623
4655
  __export(exports_interactive, {
@@ -5202,6 +5234,10 @@ function addAdminCommands(program2) {
5202
5234
  const { authMixcloudCommand: authMixcloudCommand3 } = await Promise.resolve().then(() => (init_mixtape_mixcloud2(), exports_mixtape_mixcloud2));
5203
5235
  await authMixcloudCommand3();
5204
5236
  });
5237
+ auth.command("lastfm").description("Authorize Last.fm access (love-on-add). Run once for the URL, then again with --token").option("--token <token>", "The approved request token, to mint the session key").action(async (options) => {
5238
+ const { authLastfmCommand: authLastfmCommand2 } = await Promise.resolve().then(() => (init_auth_lastfm(), exports_auth_lastfm));
5239
+ await authLastfmCommand2(options);
5240
+ });
5205
5241
  const backfill = configureCommand(admin.command("backfill").description("Backfill operator-only archives"));
5206
5242
  backfill.action(() => {
5207
5243
  backfill.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.34.0"
34
+ "version": "0.35.0"
35
35
  }