@staff0rd/assist 0.735.0 → 0.736.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.
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import { Command } from "commander";
6
6
  // package.json
7
7
  var package_default = {
8
8
  name: "@staff0rd/assist",
9
- version: "0.735.0",
9
+ version: "0.736.0",
10
10
  type: "module",
11
11
  main: "dist/index.js",
12
12
  bin: {
@@ -13986,6 +13986,7 @@ var pickupsQuery = `query($owner: String!, $number: Int!, $after: String) {
13986
13986
  ... on ProjectV2Owner {
13987
13987
  projectV2(number: $number) {
13988
13988
  title
13989
+ url
13989
13990
  priorityField: field(name: "Priority") {
13990
13991
  ... on ProjectV2SingleSelectField { options { name } }
13991
13992
  }
@@ -14040,7 +14041,12 @@ var MAX_PAGES = 10;
14040
14041
  async function readProjectItems(cwd, project) {
14041
14042
  const [owner, number] = project.split("/");
14042
14043
  const nodes = [];
14043
- const board = { project, title: project, priorityOrder: [] };
14044
+ const board = {
14045
+ project,
14046
+ title: project,
14047
+ url: "",
14048
+ priorityOrder: []
14049
+ };
14044
14050
  let after = null;
14045
14051
  for (let page = 0; page < MAX_PAGES; page++) {
14046
14052
  const response = await readProjectPage(cwd, owner, number, after);
@@ -14050,6 +14056,7 @@ async function readProjectItems(cwd, project) {
14050
14056
  throw new Error(reason4 ?? `No project ${number} owned by ${owner}`);
14051
14057
  }
14052
14058
  board.title = projectV2.title ?? project;
14059
+ board.url = projectV2.url ?? "";
14053
14060
  board.priorityOrder = (projectV2.priorityField?.options ?? []).map(
14054
14061
  (option) => option.name
14055
14062
  );
@@ -14135,21 +14142,28 @@ function selectPickups(nodes, filter, board) {
14135
14142
  }
14136
14143
 
14137
14144
  // src/commands/sessions/web/next/fetchPickups.ts
14138
- async function loadPickups(cwd, project, filter) {
14139
- try {
14140
- const { nodes, board } = await readProjectItems(cwd, project);
14141
- return selectPickups(nodes, filter, board);
14142
- } catch (error) {
14143
- throw new Error(projectErrorText(error));
14144
- }
14145
- }
14146
14145
  async function fetchPickups(cwd, projects, filter) {
14147
- if (projects.length === 0) return { items: [], error: null };
14148
- return sectionAcross(
14146
+ if (projects.length === 0)
14147
+ return { pickups: { items: [], error: null }, boards: [] };
14148
+ const boards = /* @__PURE__ */ new Map();
14149
+ const pickups = await sectionAcross(
14149
14150
  projects,
14150
- (project) => loadPickups(cwd, project, filter),
14151
+ async (project) => {
14152
+ try {
14153
+ const { nodes, board } = await readProjectItems(cwd, project);
14154
+ const { priorityOrder: _, ...link3 } = board;
14155
+ boards.set(project, link3);
14156
+ return selectPickups(nodes, filter, board);
14157
+ } catch (error) {
14158
+ throw new Error(projectErrorText(error));
14159
+ }
14160
+ },
14151
14161
  comparePickups
14152
14162
  );
14163
+ return {
14164
+ pickups,
14165
+ boards: projects.flatMap((project) => boards.get(project) ?? [])
14166
+ };
14153
14167
  }
14154
14168
 
14155
14169
  // src/commands/sessions/web/next/nextScope.ts
@@ -14184,7 +14198,7 @@ async function nextItems(req, res) {
14184
14198
  if (!cwd) return;
14185
14199
  const scope = nextScope(cwd);
14186
14200
  const repos2 = scopeRepos(scope.repos, scope.selfRepo);
14187
- const [peerPrs, assignedIssues, pickups] = await Promise.all([
14201
+ const [peerPrs, assignedIssues, { pickups, boards }] = await Promise.all([
14188
14202
  sectionAcross(
14189
14203
  repos2,
14190
14204
  (repo) => fetchPeerPrs(cwd, repo, scope.peers),
@@ -14197,7 +14211,13 @@ async function nextItems(req, res) {
14197
14211
  ),
14198
14212
  fetchPickups(cwd, scope.projects, scope)
14199
14213
  ]);
14200
- const body = { scope, peerPrs, assignedIssues, pickups };
14214
+ const body = {
14215
+ scope,
14216
+ peerPrs,
14217
+ assignedIssues,
14218
+ pickups,
14219
+ boards
14220
+ };
14201
14221
  respondJson(res, 200, body);
14202
14222
  }
14203
14223
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@staff0rd/assist",
3
- "version": "0.735.0",
3
+ "version": "0.736.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "bin": {