Paperwork.Core.Extensions 1.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package Paperwork.Core.Extensions --version 1.0.1
                    
NuGet\Install-Package Paperwork.Core.Extensions -Version 1.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Paperwork.Core.Extensions" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Paperwork.Core.Extensions" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Paperwork.Core.Extensions" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Paperwork.Core.Extensions --version 1.0.1
                    
#r "nuget: Paperwork.Core.Extensions, 1.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Paperwork.Core.Extensions@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Paperwork.Core.Extensions&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Paperwork.Core.Extensions&version=1.0.1
                    
Install as a Cake Tool

Paperwork.Core.Extensions

Shared portal configuration, $assets/$maps remote-file resolution, and cross-platform auth handlers for Paperwork.Core consumers. Split out of the private Paperwork Designer/Viewer solution so the Paperwork.CLI and the Designer/Viewer web apps share one implementation instead of hand-ported, drifting copies.

For full documentation see Paperwork.help.

Installation

dotnet add package Paperwork.Core.Extensions

Requires Paperwork.Core (pulled in automatically as a dependency).

What's in here

PaperworkConfig

A portal's runtime configuration — asset storage root, map provider endpoints, domain allow/block lists. Populate it once (per session for a long-lived app, per invocation for a one-shot CLI) before generating:

using Paperwork;

PaperworkConfig.SetCurrent(new PaperworkConfig
{
    Endpoints = [
        new PaperworkEndpoint { Key = "asset.storageRoot", Url = "https://firebasestorage.googleapis.com/v0/b/your-bucket/o/" },
    ],
});

Path mapping fix

Scryber's default path mapping silently prepends a base path (e.g. the process's working directory, for a console app) onto any reference that isn't already an absolute URI — including Paperwork's own "$assets/..." and "$maps/..." synthetic paths, which then never match the resolvers below. Call this once at startup, before generating anything:

PaperworkServiceProviderSetup.EnsureRegistered();

Asset and map resolution

Wire these into your PaperworkFactory via .WithFileRequests(...) to resolve $assets/... (Storage-relative images/fonts/files) and $maps/<Provider>/... (static map images, via a Cloud Function proxy) references embedded in template content or field values:

using Paperwork.Assets;
using Paperwork.Maps;
using Paperwork.Generation;

var fileRequests = new PaperworkMapFileRequestService(
    new PaperworkAssetFileRequestService(
        new EmptyFileRequestService(),
        assetAuthToken: firebaseIdTokenOrNull));  // null for public/unauthenticated fetches

var factory = PaperworkFactory.Create(httpClient)
    .WithFileRequests(fileRequests)
    .WithDefaultAuth()   // see below
    .Build();

Generation must use the async render path (builder.UseAsync() / BuildBytesAsync() on an async-configured builder) if any $assets/$maps/Source-type reference is present — the synchronous path doesn't wait on outstanding async remote file requests.

Auth handlers

WithDefaultAuth() (extension on PaperworkFactory) registers two browser-free IPaperworkAuthService implementations:

Auth id Handler Mechanism
Jira AltassianAuthService Atlassian OAuth via a proxy Cloud Function
$Asset FirebaseAssetAuthService Fetches via the same asset-path resolution as above, against PaperworkConfig's storage root
var factory = PaperworkFactory.Create(httpClient)
    .WithDefaultAuth()
    .Build();

A third handler, NoCors (routes around browser CORS restrictions via a proxy function), is not in this package — it only makes sense for a browser-hosted (Blazor WASM) consumer, which has its own equivalent extension.

What's not in here

  • Anything genuinely browser/WASM-specific (a NoCors-style CORS proxy handler, for instance) — that stays in the consuming app.
  • Per-environment configuration (which Firebase project's bucket/API keys to use) — that's specific to how each consumer resolves its own environments and isn't something this package can own.

License

MIT

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
9.7.4.5 47 10/2/2026
9.7.4.4 43 10/1/2026
1.0.1 40 10/1/2026
1.0.0 53 9/30/2026