import { createSidecarProxy } from '@@/sidecar/create-proxy'; import { mountPrefix } from '@@/plugins/manifest'; import { manifest } from '../manifest'; // /api/invoiceshelf/* — auth, then forward to officer-invoiceshelf. No routes of its own and no invoiceshelf knowledge: // this file must never grow app logic. // // The sidecar owns the InvoiceShelf contract and holds its credentials. const proxy = createSidecarProxy({ name: 'invoiceshelf', // DERIVED, never written out. Note the appName is `invoices`, not `invoiceshelf`: the plugin is named // for the thing it shows rather than the daemon behind it, which is what keeps the URL `/invoices`. prefix: `/api${mountPrefix({ appName: 'invoices', manifest })}`, }); export const router = proxy.router; /** Base URL of the sidecar's HTTP server, or null if it hasn't reported in yet. */ export const getInvoiceshelfServerUrl = proxy.getHttpUrl;