Task: the remaining v1 functions on v2 — activity sub-resource, invitations, data import, onboarding
Ticket of Desk v2 — REST API v2 everywhere. The shape is fixed in the resolution of the grilling on the remaining v1 functions; do not re-open it. Wrapper: @framework/ui/api (PR #42947, merged). Skills: /frappe-app-dev + /code-style for code, /quality-code-review in a fresh subagent before closing.
Question
Move the activity, invitations, data import and onboarding call sites onto v2 as ruled. Two PRs, with the framework half landing on desk-v2 beside the desk half and the develop PR opened as a held draft (map ruling 2026-09-18).
Framework half (
frappe/api/v2.py, tests beside the other v2 route tests):GET /document/<dt>/<name>/activitywithtypes(the visible types list), andstream=emails|milestonesplusstartfor the next page of one stream. The handler callsfrappe.desk.form.activity.get_activity_timelinefor the first page and the twoget_more_*functions for a stream page, and returns the same keys as today (activities,has_more_emails,has_more_milestones,next_milestone_start).User Invitationcontroller gainscancelandresendmethods (moving the bodies ofcancel_invitationandresend_invitation, with the same app-role gate), so the desk sendsPOST /document/User Invitation/<name>/method/canceland.../resendon the existing doc-method route. The list read must return the childrolesrows for each invitation; addrolesto the fields the v2 list route can return for this DocType, or confirmfields=["roles.role"]already works. Check that the DocType's read permission matches the app-role gate the dotted functions use, and fix the permission, not the route, if it does not.invite_by_emailstays a dotted POST. The onboarding read stays a dotted GET and the onboarding write a dotted POST, with the write argument renamed fromappNametoapp.Data Importpreview and start use the existing doc-method route:GET /document/Data Import/<name>/method/get_preview_from_templatewithimport_fileandgoogle_sheets_url, andPOST .../method/start_import. Confirm the route passes query arguments through to the method.
Desk and
ui/half ondesk-v2:ui/src/components/ActivityTimeline/useActivityTimeline.tsreads the activity sub-resource through the wrapper.ui/src/components/InviteUser/useInviteUser.ts: pending list islistDocuments("User Invitation", …)filtered onstatus=Pendingandapp_name; cancel and resend arerunDocumentMethod; invite isrunMethod. The twofrappe.client.get_listcalls in the same file belong to the lists and search task (#42948) and are not touched here.ui/src/components/DataImport/: preview and start go throughrunDocumentMethod; logs arelistDocuments("Data Import Log", {filters: [["data_import","=",name]], …, limit})with the same fields and order; the twogetdoctypecalls becomegetMeta(doctype, {include: "children"})readingdocsfrom the meta envelope. Template download and upload belong to the files task (#42992).ui/src/components/Onboarding/onboarding.ts: both calls throughrunMethod.- Wrapper gains
getDocumentPart(doctype, name, part, params)for sub-resource reads.
Done when both PRs are merged, no /api/method literal or frappe-ui fetch primitive remains in the files above, and the review gates ran.
Source: frappe/frappe