Paperwork.Core.Extensions
9.8.0
See the version list below for details.
dotnet add package Paperwork.Core.Extensions --version 9.8.0
NuGet\Install-Package Paperwork.Core.Extensions -Version 9.8.0
<PackageReference Include="Paperwork.Core.Extensions" Version="9.8.0" />
<PackageVersion Include="Paperwork.Core.Extensions" Version="9.8.0" />
<PackageReference Include="Paperwork.Core.Extensions" />
paket add Paperwork.Core.Extensions --version 9.8.0
#r "nuget: Paperwork.Core.Extensions, 9.8.0"
#:package Paperwork.Core.Extensions@9.8.0
#addin nuget:?package=Paperwork.Core.Extensions&version=9.8.0
#tool nuget:?package=Paperwork.Core.Extensions&version=9.8.0
<picture> <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/paperwork-collective/Paperwork.Core/main/.github/images/extensions-banner-dark.png"> <img alt="Paperwork.Core.Extensions: a supporting package for Paperwork.Core applications" src="https://raw.githubusercontent.com/paperwork-collective/Paperwork.Core/main/.github/images/extensions-banner-light.png"> </picture>
<p align="center"> <a href="https://github.com/richard-scryber/scryber.core">Scryber</a> | <a href="https://github.com/paperwork-collective/Paperwork.Core">Core</a> | <a href="https://www.nuget.org/packages/Paperwork.CLI">CLI</a> | <a href="https://github.com/paperwork-collective/Paperwork.Skill">Skill</a> | <a href="https://paperwork.design" target="_blank" rel="noopener">Design</a> | <a href="https://paperwork.vu" target="_blank" rel="noopener">View</a> | <a href="https://paperwork.help/paperwork.core/" target="_blank" rel="noopener">Help</a> | <a href="https://www.paperwork-collective.com" target="_blank" rel="noopener">Corp</a> </p>
Paperwork.Core.Extensions
A supporting package for Paperwork.Core applications.
Shared configuration, $assets/$maps resolution and auth handlers for Paperwork.Core applications, used by the Paperwork.CLI and the Paperwork apps.
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 | Versions 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. |
-
net8.0
- Paperwork.Core (>= 9.8.0)
- Scryber.Core (>= 9.8.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.