@bensandee/forgejo-cli 0.4.0 → 0.4.1
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/bin.mjs +9 -3
- package/package.json +2 -2
package/dist/bin.mjs
CHANGED
|
@@ -245,7 +245,7 @@ function loadEnvFileForBin(rawArgs, bin, io = processIo) {
|
|
|
245
245
|
//#region src/version.ts
|
|
246
246
|
const parsed = z.object({ version: z.string() }).safeParse({
|
|
247
247
|
name: "@bensandee/forgejo-cli",
|
|
248
|
-
version: "0.4.
|
|
248
|
+
version: "0.4.1",
|
|
249
249
|
description: "bst-fj: Forgejo API commands without the rest of bst",
|
|
250
250
|
license: "MIT",
|
|
251
251
|
repository: {
|
|
@@ -280,7 +280,7 @@ const parsed = z.object({ version: z.string() }).safeParse({
|
|
|
280
280
|
devDependencies: {
|
|
281
281
|
"@bensandee/cli-kit": "workspace:*",
|
|
282
282
|
"@bensandee/forgejo": "workspace:*",
|
|
283
|
-
"@types/node": "24.
|
|
283
|
+
"@types/node": "24.19.1",
|
|
284
284
|
"tsdown": "0.23.0"
|
|
285
285
|
}
|
|
286
286
|
});
|
|
@@ -5322,6 +5322,9 @@ const PullListItemSchema = z.object({
|
|
|
5322
5322
|
updated_at: z.string().nullish(),
|
|
5323
5323
|
labels: z.array(z.object({ name: z.string() })).nullish()
|
|
5324
5324
|
});
|
|
5325
|
+
function updatedBefore(since) {
|
|
5326
|
+
return (pr) => pr.updatedAt !== null && Date.parse(pr.updatedAt) < since;
|
|
5327
|
+
}
|
|
5325
5328
|
/**
|
|
5326
5329
|
* Every pull request -- open, merged, and closed-unmerged -- by default, via `state=all`; a caller
|
|
5327
5330
|
* may narrow the read with {@link ListPullsOptions.state}. Paged to an empty page or to
|
|
@@ -5349,7 +5352,9 @@ async function listPulls(executor, conn, options = {}) {
|
|
|
5349
5352
|
limit: String(PULLS_PAGE_SIZE),
|
|
5350
5353
|
page: String(page)
|
|
5351
5354
|
});
|
|
5352
|
-
|
|
5355
|
+
const sort = options.updatedSince === void 0 ? options.sort : "recentupdate";
|
|
5356
|
+
if (sort !== void 0) params.set("sort", sort);
|
|
5357
|
+
for (const id of options.labelIds ?? []) params.append("labels", String(id));
|
|
5353
5358
|
const url = `${conn.serverUrl}/api/v1/repos/${conn.repository}/pulls?${params.toString()}`;
|
|
5354
5359
|
const res = await executor.fetch(url, {
|
|
5355
5360
|
headers,
|
|
@@ -5378,6 +5383,7 @@ async function listPulls(executor, conn, options = {}) {
|
|
|
5378
5383
|
pulls.push(...items);
|
|
5379
5384
|
if (items.length === 0) break;
|
|
5380
5385
|
if (options.stopWhen !== void 0 && items.some(options.stopWhen)) break;
|
|
5386
|
+
if (options.updatedSince !== void 0 && items.some(updatedBefore(options.updatedSince))) break;
|
|
5381
5387
|
if (options.limit !== void 0 && pulls.length >= options.limit) break;
|
|
5382
5388
|
if (page === PULLS_MAX_PAGES) {
|
|
5383
5389
|
log.warn(`PR listing on ${conn.repository} hit the ${String(PULLS_MAX_PAGES)}-page cap without an empty page; results may be truncated`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bensandee/forgejo-cli",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "bst-fj: Forgejo API commands without the rest of bst",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@bensandee/cli-kit": "0.0.0",
|
|
36
36
|
"@bensandee/forgejo": "0.7.0",
|
|
37
|
-
"@types/node": "24.
|
|
37
|
+
"@types/node": "24.19.1",
|
|
38
38
|
"tsdown": "0.23.0"
|
|
39
39
|
},
|
|
40
40
|
"scripts": {
|