@nycpickleball/cli 1.5.0 → 1.6.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/dist/index.js +27 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -728,6 +728,33 @@ function rootOpts2(cmd) {
728
728
  }
729
729
  function registerPlayerCommands(program2) {
730
730
  const player = program2.command("player").description("Manage players");
731
+ player.command("refresh-dupr").description(
732
+ "Trigger an immediate DUPR rating refresh for all players with a duprId"
733
+ ).action(async function() {
734
+ const { client } = resolveConfig(rootOpts2(this));
735
+ try {
736
+ const res = await client.get("/api/cron/refresh-dupr");
737
+ console.log(
738
+ `attempted=${res.attempted ?? "?"} refreshed=${res.refreshed} skipped=${res.skipped} errors=${res.errors.length}`
739
+ );
740
+ if (res.errors.length > 0) {
741
+ printTable(
742
+ res.errors.map((e) => ({
743
+ duprId: e.duprId,
744
+ name: e.name,
745
+ message: e.message
746
+ })),
747
+ [
748
+ { key: "duprId", label: "DUPR ID" },
749
+ { key: "name", label: "NAME" },
750
+ { key: "message", label: "ERROR" }
751
+ ]
752
+ );
753
+ }
754
+ } catch (e) {
755
+ dieWith(e);
756
+ }
757
+ });
731
758
  player.command("list").description("List all players").action(async function() {
732
759
  const { client } = resolveConfig(rootOpts2(this));
733
760
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nycpickleball/cli",
3
- "version": "1.5.0",
3
+ "version": "1.6.0",
4
4
  "description": "CLI for managing NYC Pickleball leagues via the deployed API.",
5
5
  "license": "UNLICENSED",
6
6
  "publishConfig": {