Member Junction
    Preparing search index...

    Module @memberjunction/excel-addin

    @memberjunction/excel-addin

    The browser-safe half of MemberJunction's Excel add-in. Its server half is @memberjunction/excel-addin-server, and the admin guide is guides/EXCEL_ADDIN_GUIDE.md.

    Open in Excel, in MJ Explorer's views grid and query results grid, downloads a connected workbook. The workbook holds headings and no rows. Opening it in Excel opens the MemberJunction pane, the person signs in once, and every sheet fills with what that person can see. Refresh brings current data.

    Module For
    contract The workbook format the server writes and the pane reads/updates: one data sheet per entity, saved view, or saved query, and a very-hidden MJ_Sources sheet recording each source. ParseWorkbookManifest validates it, because a workbook is user-editable.
    catalog-types Dependency-free catalog and source-resolution DTOs shared between the browser pane and server operations.
    operations The typed Remote Operations Explorer and the Excel pane call: ExcelAddin.GetStatus, ExcelAddin.CreateConnection, ExcelAddin.BuildWorkbook, ExcelAddin.GetCatalog, ExcelAddin.GetEntityViews, and ExcelAddin.ResolveSource. These bases are not registered; the server package registers their bodies.
    handoff The encrypted sign-in handoff between Explorer's connect page and the pane (RSA-OAEP-wrapped AES-GCM, Web Crypto only).
    client ExcelAddinClient: caches the add-in's status per provider and downloads a workbook. Used by the grids.
    src/web The pane itself, bundled with esbuild to dist/web. Plain TypeScript and Office.js, no framework.

    contract and handoff import nothing, so the pane bundle carries no MemberJunction runtime.

    1. The pane makes a one-time RSA key pair and opens an Office dialog on its own host (connect.html).
    2. That page sends the dialog to Explorer's office/connect page with the public key. The person signs in to Explorer as they always do and approves the connection.
    3. ExcelAddin.CreateConnection mints an MJ API key for that person that can only run views and queries (view:run, query:run) and expires. Explorer seals it, with Explorer's own GraphQL address, to the pane's public key, and returns to connected.html with the sealed text in the URL fragment.
    4. connected.html hands the sealed text to the pane, which opens it with its private key and keeps the connection in its own storage.

    The key is never in a URL in plain text, can't change data, and is revocable on Explorer's API Keys page.

    pnpm run build   # tsc for the library, then tsc -p tsconfig.web.json + esbuild for the pane
    pnpm test

    Classes

    ExcelAddinBuildWorkbookOperation
    ExcelAddinClient
    ExcelAddinCreateConnectionOperation
    ExcelAddinGetCatalogOperation
    ExcelAddinGetEntityViewsOperation
    ExcelAddinGetStatusOperation
    ExcelAddinResolveSourceOperation

    Interfaces

    ExcelAddinBuildWorkbookInput
    ExcelAddinBuildWorkbookOutput
    ExcelAddinCatalogOutput
    ExcelAddinCreateConnectionOutput
    ExcelAddinEntityViewsInput
    ExcelAddinEntityViewsOutput
    ExcelAddinResolveSourceInput
    ExcelAddinResolveSourceOutput
    ExcelAddinStatusOutput
    ExcelCatalogApplication
    ExcelCatalogEntity
    ExcelCatalogQuery
    ExcelCatalogQueryCategory
    ExcelCatalogQueryParameter
    ExcelCatalogView
    ExcelConnectionPayload
    ExcelSourceColumn
    ExcelWorkbookManifest
    ExcelWorkbookSource
    ExcelWorkbookSourceRequest
    OfficeConnectRequest
    OfficeConnectUser
    OpenInExcelResult
    ParseWorkbookManifestResult

    Type Aliases

    ExcelAddinCatalogInput
    ExcelAddinCreateConnectionInput
    ExcelAddinStatusInput
    ExcelCellValue
    ExcelColumnDataType
    ExcelParameterValue
    ExcelQueryParameterType
    ExcelResolvedWorkbookSource
    ExcelSourceKind
    OfficeConnectQueryParams
    OfficeHandoffOutcome
    OfficeSignInRedirectOptions

    Variables

    EXCEL_ADDIN_OPERATION_KEYS
    EXCEL_HANDOFF_VERSION
    EXCEL_MAX_CELL_LENGTH
    EXCEL_MAX_SHEET_NAME_LENGTH
    EXCEL_MAX_SOURCES_PER_WORKBOOK
    EXCEL_SOURCES_CHUNK_SIZE
    EXCEL_SOURCES_SHEET_NAME
    EXCEL_WORKBOOK_CONTRACT_VERSION
    OFFICE_CONNECT_ROUTE_PATH

    Functions

    BuildOfficeHandoffUrl
    BuildOfficeSignInOptions
    BuildSheetMatrix
    CreateHandoffKeyPair
    CreateHandoffState
    DecodeBase64Url
    DisplayNameForUser
    EncodeBase64Url
    ExportHandoffPublicKey
    IsHandoffToken
    MakeUniqueSheetName
    NextSourceKey
    OpenConnectionPayload
    ParseWorkbookManifest
    ReadOfficeConnectRequest
    RemoveWorkbookSource
    ResolveColumns
    SealConnectionPayload
    SplitManifestForCells
    TableNameForSource
    ToExcelCellValue
    ToExcelSerialDate
    UpsertWorkbookSource