Paperwork.Core.Extensions
1.0.1
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
<PackageReference Include="Paperwork.Core.Extensions" Version="1.0.1" />
<PackageVersion Include="Paperwork.Core.Extensions" Version="1.0.1" />
<PackageReference Include="Paperwork.Core.Extensions" />
paket add Paperwork.Core.Extensions --version 1.0.1
#r "nuget: Paperwork.Core.Extensions, 1.0.1"
#:package Paperwork.Core.Extensions@1.0.1
#addin nuget:?package=Paperwork.Core.Extensions&version=1.0.1
#tool nuget:?package=Paperwork.Core.Extensions&version=1.0.1
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 | 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.7.4.3)
- Scryber.Core (>= 9.7.4.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.