Files
wehub-resource-sync 9b395f5cc3
E2E Headed Chrome / e2e-headed (macos-15) (push) Has been cancelled
E2E Headed Chrome / e2e-headed (ubuntu-latest) (push) Has been cancelled
E2E Headed Chrome / e2e-headed (windows-latest) (push) Has been cancelled
CI / build (macos-latest) (push) Has been cancelled
CI / build (ubuntu-latest) (push) Has been cancelled
CI / build (windows-latest) (push) Has been cancelled
CI / unit-test (push) Has been cancelled
CI / bun-test (push) Has been cancelled
CI / adapter-test (push) Has been cancelled
CI / smoke-test (macos-latest) (push) Has been cancelled
CI / smoke-test (ubuntu-latest) (push) Has been cancelled
Security Audit / audit (push) Has been cancelled
Build Chrome Extension / build (push) Has been cancelled
Trigger Website Rebuild (Docs Updated) / dispatch (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:39:48 +08:00

59 lines
2.3 KiB
JavaScript

/**
* OpenReview submissions by author profile id (newest first).
*
* Pairs with `openreview paper <id>` and `openreview reviews <id>` for the
* full read-side workflow: list every submission an author put on
* OpenReview, then drill into a specific paper or its review thread.
*
* Uses the public v2 endpoint `/notes?content.authorids=~<profile-id>`,
* which returns the same note shape as `paper`, sorted by `cdate:desc`.
*/
import { cli, Strategy } from '@jackwener/opencli/registry';
import { EmptyResultError } from '@jackwener/opencli/errors';
import {
noteToRow,
openreviewFetch,
requireBoundedInt,
requireProfileId,
} from './utils.js';
cli({
site: 'openreview',
name: 'author',
access: 'read',
description: 'List OpenReview submissions by an author profile id (newest first)',
domain: 'openreview.net',
strategy: Strategy.PUBLIC,
browser: false,
args: [
{ name: 'profile', positional: true, required: true, help: 'OpenReview profile id (e.g. "~Yoshua_Bengio1"). Find it on the author profile URL on openreview.net.' },
{ name: 'limit', type: 'int', default: 50, help: 'Max submissions (1-1000)' },
],
columns: ['rank', 'id', 'title', 'authors', 'venue', 'pdate', 'url'],
func: async (args) => {
const profile = requireProfileId(args.profile);
const limit = requireBoundedInt(args.limit, 50, 1000);
const path = `/notes?content.authorids=${encodeURIComponent(profile)}&limit=${limit}&sort=cdate:desc`;
const json = await openreviewFetch(path, `openreview author ${profile}`);
const notes = Array.isArray(json?.notes) ? json.notes : [];
if (!notes.length) {
throw new EmptyResultError(
'openreview author',
`No OpenReview submissions found for profile "${profile}". Confirm the id format (~First_LastN) and that the profile has public submissions.`,
);
}
return notes.slice(0, limit).map((note, i) => {
const row = noteToRow(note);
return {
rank: i + 1,
id: row.id,
title: row.title,
authors: row.authors,
venue: row.venue,
pdate: row.pdate,
url: row.url,
};
});
},
});