@embedpdf/plugin-signature 3.0.0-next.14 → 3.0.0-next.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -8
- package/dist/contract-Bu7_S84K.cjs +99 -0
- package/dist/contract-Bu7_S84K.cjs.map +1 -0
- package/dist/contract-GUWa_aBY.d.ts +299 -0
- package/dist/contract-NW5jPVqt.js +59 -0
- package/dist/contract-NW5jPVqt.js.map +1 -0
- package/dist/contract-c89MSPDK.d.cts +299 -0
- package/dist/contract.cjs +3 -1
- package/dist/contract.d.cts +2 -2
- package/dist/contract.d.ts +2 -2
- package/dist/contract.js +2 -2
- package/dist/index.cjs +814 -364
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +31 -25
- package/dist/index.d.ts +31 -25
- package/dist/index.js +805 -364
- package/dist/index.js.map +1 -1
- package/package.json +10 -10
- package/dist/contract-BvHa9Zl_.d.cts +0 -176
- package/dist/contract-C3nQtwGf.js +0 -14
- package/dist/contract-C3nQtwGf.js.map +0 -1
- package/dist/contract-CojqGdMH.cjs +0 -43
- package/dist/contract-CojqGdMH.cjs.map +0 -1
- package/dist/contract-Dg50puf7.d.ts +0 -176
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @embedpdf/plugin-signature
|
|
2
2
|
|
|
3
|
-
Document-scoped digital signing for EmbedPDF
|
|
3
|
+
Document-scoped digital signing for EmbedPDF: sign a signature field with a
|
|
4
4
|
**mark** (a stamp-library asset — drawn, typed, uploaded — or bytes you bring)
|
|
5
5
|
through a **signer port** you configure; fill a field visually without
|
|
6
6
|
sealing; validate what is signed; and drop an armed mark onto a field.
|
|
@@ -10,23 +10,29 @@ The plugin owns the act and nothing else:
|
|
|
10
10
|
- marks are the stamp plugin's (`@embedpdf/plugin-stamp`) — one library of kind
|
|
11
11
|
`signatures` per person, holding a `signature` asset and optional `initials`;
|
|
12
12
|
- the key is a `SignerPort` from `@embedpdf/core-signature` (`webCryptoSigner`,
|
|
13
|
-
`remoteSigner`, `personalSigner`), resolved per signing;
|
|
13
|
+
`remoteSigner`, `personalSigner`), the `key` setting, resolved per signing;
|
|
14
14
|
- the engine draws the mark's page into the field and seals the bytes
|
|
15
15
|
(`doc.signatures.prepare` → CMS → `complete`); on the cloud the server
|
|
16
16
|
publishes the new version.
|
|
17
17
|
|
|
18
18
|
```ts
|
|
19
|
-
import {
|
|
19
|
+
import { toFieldRef } from '@embedpdf/plugin-form';
|
|
20
|
+
import {
|
|
21
|
+
signaturePlugin,
|
|
22
|
+
SignatureToken,
|
|
23
|
+
personalSigner,
|
|
24
|
+
indexedDbKeyStore,
|
|
25
|
+
} from '@embedpdf/plugin-signature';
|
|
20
26
|
|
|
21
27
|
signaturePlugin({
|
|
22
|
-
|
|
28
|
+
key: () => personalSigner({ subject: 'Ada Lovelace', store: indexedDbKeyStore('keys') }),
|
|
23
29
|
trust: { anchors: async () => [rootCertificateDer] },
|
|
24
|
-
mode: 'sign', // 'sign' (default with a
|
|
30
|
+
mode: 'sign', // 'sign' (the default with a key) | 'visual' (the default without) | 'ask'
|
|
25
31
|
});
|
|
26
32
|
|
|
27
33
|
const signature = ctx.get(SignatureToken);
|
|
28
|
-
await signature.placeMark({ assetId }, { field:
|
|
29
|
-
await signature.placeMark({ assetId }, {
|
|
34
|
+
await signature.placeMark({ assetId }, { field: toFieldRef('approval') }); // sign / fill / ask, by mode
|
|
35
|
+
await signature.placeMark({ assetId }, { page, center: { x: 120, y: 90 } }); // elsewhere: a stamp
|
|
30
36
|
```
|
|
31
37
|
|
|
32
38
|
With the interaction hub and the stamp plugin present, a mark armed from a
|
|
@@ -35,4 +41,4 @@ the field; anywhere else it is placed as a stamp.
|
|
|
35
41
|
|
|
36
42
|
Requires `@embedpdf/plugin-form`; optional `@embedpdf/plugin-stamp`,
|
|
37
43
|
`@embedpdf/plugin-annotation`, `@embedpdf/plugin-interaction`. See the docs
|
|
38
|
-
page `headless/
|
|
44
|
+
page `headless/forms/signatures` for the full contract.
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
//#region src/token.ts
|
|
2
|
+
/** The package token, created once here and re-exported by `contract.ts`. */
|
|
3
|
+
const SignatureToken = (0, require("@embedpdf/core").createCapabilityToken)("signature", {
|
|
4
|
+
hint: `add signaturePlugin() from '@embedpdf/plugin-signature' to your plugins list`,
|
|
5
|
+
promises: {
|
|
6
|
+
sign: true,
|
|
7
|
+
prepareSignature: true,
|
|
8
|
+
completeSignature: true,
|
|
9
|
+
cancelPending: true,
|
|
10
|
+
fillField: true,
|
|
11
|
+
clearField: true,
|
|
12
|
+
placeMark: true,
|
|
13
|
+
refresh: true,
|
|
14
|
+
validate: true,
|
|
15
|
+
validateField: true,
|
|
16
|
+
analyzeChanges: true,
|
|
17
|
+
readRevision: true
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/contract.ts
|
|
22
|
+
/** What the signature settings are when the app registers none. */
|
|
23
|
+
const SIGNATURE_DEFAULTS = {
|
|
24
|
+
key: null,
|
|
25
|
+
mode: null,
|
|
26
|
+
trust: null,
|
|
27
|
+
allowCertify: false
|
|
28
|
+
};
|
|
29
|
+
/** The stamp-library kind that holds people's marks: one library per person. */
|
|
30
|
+
const SIGNATURES_LIBRARY_KIND = "signatures";
|
|
31
|
+
/** The asset identifiers inside a signatures library: the full signature and the initials. */
|
|
32
|
+
const SIGNATURE_MARK_NAME = "signature";
|
|
33
|
+
const INITIALS_MARK_NAME = "initials";
|
|
34
|
+
/** Which mark an asset of a signatures library is (anything not named `initials` is a signature). */
|
|
35
|
+
const markRoleOf = (asset) => asset.name === "initials" ? "initials" : "signature";
|
|
36
|
+
/**
|
|
37
|
+
* The people whose marks the stamp plugin holds, one row per library of kind
|
|
38
|
+
* `signatures`, in the order of `libraries`: give it the stamp plugin's
|
|
39
|
+
* `listLibraries({ kind: SIGNATURES_LIBRARY_KIND })` and `listAssets()`. A
|
|
40
|
+
* pure derivation: rename, delete and export are the stamp plugin's library
|
|
41
|
+
* verbs, and nothing is stored beyond the library's file.
|
|
42
|
+
*/
|
|
43
|
+
function signerRowsOf(libraries, assets) {
|
|
44
|
+
return libraries.filter((library) => library.kind === SIGNATURES_LIBRARY_KIND).map((library) => {
|
|
45
|
+
const own = assets.filter((asset) => asset.libraryId === library.id);
|
|
46
|
+
return {
|
|
47
|
+
libraryId: library.id,
|
|
48
|
+
name: library.name,
|
|
49
|
+
library,
|
|
50
|
+
signatures: own.filter((asset) => markRoleOf(asset) === "signature"),
|
|
51
|
+
initials: own.find((asset) => markRoleOf(asset) === "initials") ?? null
|
|
52
|
+
};
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
//#endregion
|
|
56
|
+
Object.defineProperty(exports, "INITIALS_MARK_NAME", {
|
|
57
|
+
enumerable: true,
|
|
58
|
+
get: function() {
|
|
59
|
+
return INITIALS_MARK_NAME;
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
Object.defineProperty(exports, "SIGNATURES_LIBRARY_KIND", {
|
|
63
|
+
enumerable: true,
|
|
64
|
+
get: function() {
|
|
65
|
+
return SIGNATURES_LIBRARY_KIND;
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
Object.defineProperty(exports, "SIGNATURE_DEFAULTS", {
|
|
69
|
+
enumerable: true,
|
|
70
|
+
get: function() {
|
|
71
|
+
return SIGNATURE_DEFAULTS;
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
Object.defineProperty(exports, "SIGNATURE_MARK_NAME", {
|
|
75
|
+
enumerable: true,
|
|
76
|
+
get: function() {
|
|
77
|
+
return SIGNATURE_MARK_NAME;
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
Object.defineProperty(exports, "SignatureToken", {
|
|
81
|
+
enumerable: true,
|
|
82
|
+
get: function() {
|
|
83
|
+
return SignatureToken;
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
Object.defineProperty(exports, "markRoleOf", {
|
|
87
|
+
enumerable: true,
|
|
88
|
+
get: function() {
|
|
89
|
+
return markRoleOf;
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
Object.defineProperty(exports, "signerRowsOf", {
|
|
93
|
+
enumerable: true,
|
|
94
|
+
get: function() {
|
|
95
|
+
return signerRowsOf;
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
//# sourceMappingURL=contract-Bu7_S84K.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract-Bu7_S84K.cjs","names":[],"sources":["../src/token.ts","../src/contract.ts"],"sourcesContent":["/** The package token, created once here and re-exported by `contract.ts`. */\nimport { createCapabilityToken } from '@embedpdf/core';\n\nimport type { SignatureCapability } from './contract';\n\nexport const SignatureToken = createCapabilityToken<SignatureCapability>('signature', {\n hint: `add signaturePlugin() from '@embedpdf/plugin-signature' to your plugins list`,\n // Without a document, an adapter's stand-in rejects these with `not-ready`, as the\n // capability would; the type asks for every member that returns a promise.\n promises: {\n sign: true,\n prepareSignature: true,\n completeSignature: true,\n cancelPending: true,\n fillField: true,\n clearField: true,\n placeMark: true,\n refresh: true,\n validate: true,\n validateField: true,\n analyzeChanges: true,\n readRevision: true,\n },\n});\n","/**\n * @embedpdf/plugin-signature/contract: the public signature vocabulary: the\n * act of signing (one-shot and two-phase), visual fills, validation, the\n * sign-here flow, and the facts about a document's signatures.\n */\nimport type {\n EventHook,\n EventOrigin,\n OperationOptions,\n ResourceStatus,\n SettingsApi,\n} from '@embedpdf/core';\nimport type {\n SignatureVerdict,\n SignerPort,\n TrustPort,\n ValidationTime,\n} from '@embedpdf/core-signature';\nimport type {\n AnalyzeInput,\n AnnotationRef,\n BinarySource,\n ChangeAnalysis,\n DigestAlgorithm,\n DocMdpPermission,\n DocumentProtection,\n FieldLockSpec,\n FormFieldRef,\n FormWidget,\n SignatureCompleteResult,\n SignatureDTO,\n SignaturePrepared,\n SignatureSignerInput,\n SignatureSnapshot,\n SignatureSubFilter,\n} from '@embedpdf/engine-core/runtime';\nimport type { StampPlacement } from '@embedpdf/plugin-annotation/contract';\nimport type { StampAsset, StampLibrary } from '@embedpdf/plugin-stamp/contract';\n\nexport { SignatureToken } from './token';\nexport type {\n AnalyzeInput,\n ChangeAnalysis,\n DocMdpPermission,\n DocumentProtection,\n FieldLockSpec,\n FormFieldRef,\n SignatureCompleteResult,\n SignatureDTO,\n SignaturePrepared,\n SignatureSnapshot,\n} from '@embedpdf/engine-core/runtime';\nexport type {\n SignatureVerdict,\n SignerPort,\n TrustPort,\n ValidationTime,\n} from '@embedpdf/core-signature';\n\n/**\n * What placing a mark on a signature field does:\n * - `sign` seal the field with the configured key (the mark is the appearance);\n * - `visual` draw the mark into the field without sealing (Preview's \"signature\");\n * - `ask` neither: `onSignRequested` fires so the chrome can open its dialog and decide.\n */\nexport type SignatureMode = 'sign' | 'visual' | 'ask';\n\n/** The key that signs: a signer port, or a function that returns one when someone signs. */\nexport type SignatureKey = SignerPort | (() => SignerPort | Promise<SignerPort>);\n\n/**\n * The signature plugin's settings. `signaturePlugin(config)` registers them\n * over {@link SIGNATURE_DEFAULTS}, and `updateSettings()` changes them for\n * every document while the app runs. Each is one value: a change replaces a\n * key or a trust port whole.\n */\nexport interface SignatureSettings {\n /** The key: a raw signer (the CMS is built here) or a CMS signer (a service builds it); `null` for none. */\n readonly key: SignatureKey | null;\n /** What a mark does in a field; `null` is `'sign'` with a key, else `'visual'`. */\n readonly mode: SignatureMode | null;\n /** The certificates you trust, for checking signatures. Without them a verdict is at best `valid-untrusted`. */\n readonly trust: TrustPort | null;\n /** Let a first signature be a certification (still needs `doc.sign.certify`). */\n readonly allowCertify: boolean;\n}\n\n/** What the signature settings are when the app registers none. */\nexport const SIGNATURE_DEFAULTS: SignatureSettings = {\n key: null,\n mode: null,\n trust: null,\n allowCertify: false,\n};\n\n/** What `signaturePlugin(config)` takes: any of the settings. */\nexport type SignatureConfig = Partial<SignatureSettings>;\n\n/** The mark: a stamp-plugin asset, or bytes the embedder brings (PNG, JPEG, or a one-page PDF). */\nexport type Mark = { assetId: string } | { source: BinarySource };\n\n/**\n * How a signature field is addressed: its field ref, or its widget, by\n * annotation ref or as a signature names it (`SignatureDTO.widget`).\n */\nexport type SignatureFieldAddress = FormFieldRef | AnnotationRef | FormWidget;\n\nexport interface SignFieldInput {\n field: FormFieldRef;\n mark: Mark;\n /** A per-call key; the `key` setting otherwise. */\n key?: SignatureKey;\n /** What the signature dictionary says about the signer; the name defaults to the certificate's subject. */\n signer?: SignatureSignerInput;\n /** Instead of the mark: a ready one-page appearance PDF the embedder composed itself. */\n appearance?: BinarySource;\n certify?: { permission: DocMdpPermission };\n lock?: FieldLockSpec;\n}\n\n/** Two-phase signing, step one: everything but the key. The digest comes back; a CMS goes in. */\nexport interface PrepareSignatureInput {\n field: FormFieldRef;\n mark?: Mark;\n appearance?: BinarySource;\n signer?: SignatureSignerInput;\n certify?: { permission: DocMdpPermission };\n lock?: FieldLockSpec;\n subFilter?: SignatureSubFilter;\n digest?: Exclude<DigestAlgorithm, 'sha1'>;\n}\n\n/** The parked half of a two-phase signing (`prepareSignature` → `completeSignature`). */\nexport type PreparedSignature = SignaturePrepared;\n\n/** The stamp-library kind that holds people's marks: one library per person. */\nexport const SIGNATURES_LIBRARY_KIND = 'signatures';\n/** The asset identifiers inside a signatures library: the full signature and the initials. */\nexport const SIGNATURE_MARK_NAME = 'signature';\nexport const INITIALS_MARK_NAME = 'initials';\nexport type MarkRole = 'signature' | 'initials';\n/** Which mark an asset of a signatures library is (anything not named `initials` is a signature). */\nexport const markRoleOf = (asset: Pick<StampAsset, 'name'>): MarkRole =>\n asset.name === INITIALS_MARK_NAME ? 'initials' : 'signature';\n\n/** One person in a signatures picker: a library of kind `signatures`, with its marks split by role. */\nexport interface SignerRow {\n readonly libraryId: string;\n readonly name: string;\n readonly library: StampLibrary;\n /** Every full signature of the person, in the library's order. */\n readonly signatures: StampAsset[];\n /** The person's initials, or `null` when the library has none. */\n readonly initials: StampAsset | null;\n}\n\n/**\n * The people whose marks the stamp plugin holds, one row per library of kind\n * `signatures`, in the order of `libraries`: give it the stamp plugin's\n * `listLibraries({ kind: SIGNATURES_LIBRARY_KIND })` and `listAssets()`. A\n * pure derivation: rename, delete and export are the stamp plugin's library\n * verbs, and nothing is stored beyond the library's file.\n */\nexport function signerRowsOf(\n libraries: readonly StampLibrary[],\n assets: readonly StampAsset[],\n): SignerRow[] {\n return libraries\n .filter((library) => library.kind === SIGNATURES_LIBRARY_KIND)\n .map((library) => {\n const own = assets.filter((asset) => asset.libraryId === library.id);\n return {\n libraryId: library.id,\n name: library.name,\n library,\n signatures: own.filter((asset) => markRoleOf(asset) === 'signature'),\n initials: own.find((asset) => markRoleOf(asset) === 'initials') ?? null,\n };\n });\n}\n\n/** A signature prepared in two steps and not completed yet. */\nexport interface SignaturePending {\n readonly signingId: string;\n readonly field: FormFieldRef;\n}\n\n/** A signed field's facts, with its verdict from the last check (`null` until one ran). */\nexport interface SignatureInfo extends SignatureDTO {\n readonly verdict: SignatureVerdict | null;\n}\n\n/** What `placeMark` did: sealed, drawn, handed to the chrome (mode `ask`), or placed as a stamp. */\nexport type PlaceMarkResult =\n | { kind: 'signed'; field: FormFieldRef; result: SignatureCompleteResult }\n | { kind: 'filled'; field: FormFieldRef }\n | { kind: 'requested'; field: FormFieldRef }\n | { kind: 'placed'; annotation: AnnotationRef };\n\n// ── events ──\n/** A signing completed, in this session or another: the confirmed `signatures.completed` fact. */\nexport interface SignatureSignedEvent {\n /** The sealed field, by its durable object-number ref. */\n readonly field: FormFieldRef;\n readonly result: SignatureCompleteResult;\n readonly origin: EventOrigin;\n}\n/** This session's `fillField()` drew a mark into a field. */\nexport interface SignatureFilledEvent {\n readonly field: FormFieldRef;\n}\n/** This session's `clearField()` took a drawn mark out of a field. */\nexport interface SignatureClearedEvent {\n readonly field: FormFieldRef;\n}\nexport interface SignatureValidatedEvent {\n readonly verdicts: readonly SignatureVerdict[];\n}\nexport interface SignatureProtectionChangedEvent {\n readonly protection: DocumentProtection;\n}\n/** An unsaved edit just turned a signature that held into one a save would invalidate. Once per edge. */\nexport interface SignatureInvalidationPredictedEvent {\n readonly field: FormFieldRef;\n readonly detail: string;\n}\nexport interface SignatureTargetChangedEvent {\n readonly field: FormFieldRef | null;\n}\n/** Mode `ask`: a mark met a field and the chrome decides (open its dialog, then `sign` / `fillField`). */\nexport interface SignatureSignRequestedEvent {\n readonly field: FormFieldRef;\n readonly mark: Mark;\n}\n/** A signed field was activated: show what its signature says. */\nexport interface SignatureInspectionRequestedEvent {\n readonly field: FormFieldRef;\n}\n\n/** Options for `validate()` and `validateField()`. */\nexport interface SignatureValidateOptions extends OperationOptions {\n /** The moment the certificates are judged at; now by default. */\n readonly at?: ValidationTime;\n /** `'persisted'` checks the file as it was opened; `'working-copy'` (the default) counts unsaved changes. */\n readonly until?: 'persisted' | 'working-copy';\n}\n\n/**\n * Signing, visual fills and checking signatures for one document. Every verb\n * rejects with a `PluginError`, and every async verb takes a `signal`. Its\n * settings belong to the plugin, not to a document.\n */\nexport interface SignatureCapability extends SettingsApi<SignatureSettings> {\n // ── reading ──\n /** Every signature field and its facts, the file's versions and `protection`. The same object until it changes. */\n getSnapshot(): SignatureSnapshot | null;\n /** Whether the signatures are read. */\n getStatus(): ResourceStatus;\n /** The signed fields, in document order, each with its verdict once checked. The same array until one changes. */\n listSignatures(): readonly SignatureInfo[];\n /** Signature fields still to sign, in document order. The same array until one changes. */\n listUnsignedFields(): readonly FormFieldRef[];\n /** One signature field's facts, signed or not, by its ref or its widget's, or `null`. */\n getSignature(field: SignatureFieldAddress): SignatureDTO | null;\n /** Every verdict from the last check; `null` before the first. */\n listVerdicts(): readonly SignatureVerdict[] | null;\n /** One signed field's verdict from the last check, or `null`. */\n getVerdict(field: SignatureFieldAddress): SignatureVerdict | null;\n /** What the document's signatures allow, or `null` before they're read. */\n getProtection(): DocumentProtection | null;\n /** A signature prepared in two steps and not completed: the document can't be changed until it is, or is cancelled. */\n getPending(): SignaturePending | null;\n /** Whether a signing or a fill is running. */\n isBusy(): boolean;\n /** The mode in effect: the `mode` setting, or its default. */\n getMode(): SignatureMode;\n /** The field the next picked mark goes to, or `null`. */\n getTarget(): FormFieldRef | null;\n\n // ── signing ──\n /**\n * Sign a field: the mark becomes what it shows, the key seals the document,\n * and the signed document is a new version. A signal that fires before the\n * seal leaves nothing signed. Fires `onSigned`. Rejects `permission-denied`\n * for a field you may not sign (`canSign`), or without `doc.sign.certify`\n * to certify, `invalid-input` without a key, `not-found`,\n * `operation-cancelled`.\n */\n sign(input: SignFieldInput, options?: OperationOptions): Promise<SignatureCompleteResult>;\n /**\n * Signing in two steps, the first: resolves the digest for your key to sign,\n * and keeps the document from changing until `completeSignature()` or\n * `cancelPending()`. Rejects like `sign()`.\n */\n prepareSignature(\n input: PrepareSignatureInput,\n options?: OperationOptions,\n ): Promise<PreparedSignature>;\n /** Signing in two steps, the second: the key's CMS seals the document. Fires `onSigned`. Rejects `not-found` for a signing this session didn't prepare. */\n completeSignature(\n signingId: string,\n cms: Uint8Array,\n options?: OperationOptions,\n ): Promise<SignatureCompleteResult>;\n /** Give up a signature prepared in two steps, so the document can be changed again. */\n cancelPending(options?: OperationOptions): Promise<void>;\n /**\n * Draw a mark into a field without signing. Fires `onFilled`. Rejects\n * `permission-denied` for a field you may not fill in (`canFill`),\n * `conflict` on a signed field.\n */\n fillField(field: FormFieldRef, mark: Mark, options?: OperationOptions): Promise<void>;\n /** Take a drawn mark out of a field. Fires `onCleared`. Rejects like `fillField()`. */\n clearField(field: FormFieldRef, options?: OperationOptions): Promise<void>;\n /**\n * Do what a click with an armed mark does: in a field, sign, fill or ask\n * (`onSignRequested`), by `mode`; anywhere else, place it as a stamp.\n * Rejects like the verb it runs.\n */\n placeMark(\n mark: Mark,\n target: { field: FormFieldRef } | StampPlacement,\n options?: OperationOptions,\n ): Promise<PlaceMarkResult>;\n /** Make a field the target, where the next mark the person picks goes; `null` clears. Fires `onTargetChanged`. */\n setTarget(field: FormFieldRef | null): void;\n /** Ask your UI to show a signed field's details, as clicking it does. Fires `onInspectionRequested`. */\n requestInspection(field: FormFieldRef): void;\n\n // ── checking ──\n /** Read the signatures again; resolves the snapshot. */\n refresh(options?: OperationOptions): Promise<SignatureSnapshot | null>;\n /**\n * Check every signature again and resolve the verdicts. Unsaved changes\n * count, so the verdict is the one the downloaded file will get;\n * `until: 'persisted'` checks the file as it was opened. Fires `onValidated`.\n */\n validate(options?: SignatureValidateOptions): Promise<readonly SignatureVerdict[]>;\n /** Check one signed field. Rejects `not-found` for an unsigned or unknown field. */\n validateField(\n field: SignatureFieldAddress,\n options?: SignatureValidateOptions,\n ): Promise<SignatureVerdict>;\n /** What changed after a signature or a version of the file, rule by rule. */\n analyzeChanges(input: AnalyzeInput, options?: OperationOptions): Promise<ChangeAnalysis>;\n /**\n * The exact bytes of the file version a signature covers. Rejects\n * `permission-denied` without `doc.download`, `not-found` for an unsigned\n * field.\n */\n readRevision(\n target: SignatureFieldAddress | { revisionIndex: number },\n options?: OperationOptions,\n ): Promise<Uint8Array>;\n\n // ── permissions ──\n /**\n * Whether signing this field is allowed: `doc.sign`, or a `fields:sign`\n * permission for its group. `false` for a field the form doesn't have. A\n * per-call key or two-step signing needs no `key` setting.\n */\n canSign(field: FormFieldRef): boolean;\n /**\n * Whether drawing a mark into this field without signing is allowed:\n * `doc.forms.fill`, or a `fields:fill` permission for its group.\n */\n canFill(field: FormFieldRef): boolean;\n /** Whether a certification may be offered: the `allowCertify` setting and `doc.sign.certify`. */\n canCertify(): boolean;\n /** Whether the signed bytes may be read: `doc.download`. */\n canReadRevision(): boolean;\n\n // ── events ──\n /** A field was signed, whoever signed it; fires once the facts show the sealed field. */\n readonly onSigned: EventHook<SignatureSignedEvent>;\n /** A mark was drawn into a field. */\n readonly onFilled: EventHook<SignatureFilledEvent>;\n /** A drawn mark was taken out of a field. */\n readonly onCleared: EventHook<SignatureClearedEvent>;\n /** The signatures were checked. */\n readonly onValidated: EventHook<SignatureValidatedEvent>;\n /** What the signatures allow changed. */\n readonly onProtectionChanged: EventHook<SignatureProtectionChangedEvent>;\n /** A change would break a signature once saved. */\n readonly onInvalidationPredicted: EventHook<SignatureInvalidationPredictedEvent>;\n /** A field became the target, or the target was cleared. */\n readonly onTargetChanged: EventHook<SignatureTargetChangedEvent>;\n /** In `'ask'` mode, a mark was dropped on a field. */\n readonly onSignRequested: EventHook<SignatureSignRequestedEvent>;\n /** A signed field was clicked. */\n readonly onInspectionRequested: EventHook<SignatureInspectionRequestedEvent>;\n}\n"],"mappings":";;AAKA,MAAa,kBAAA,2BAAA,CAAA,CAAA,sBAAA,CAA4D,aAAa;CACpF,MAAM;CAGN,UAAU;EACR,MAAM;EACN,kBAAkB;EAClB,mBAAmB;EACnB,eAAe;EACf,WAAW;EACX,YAAY;EACZ,WAAW;EACX,SAAS;EACT,UAAU;EACV,eAAe;EACf,gBAAgB;EAChB,cAAc;CAChB;AACF,CAAC;;;;ACiED,MAAa,qBAAwC;CACnD,KAAK;CACL,MAAM;CACN,OAAO;CACP,cAAc;AAChB;;AA2CA,MAAa,0BAA0B;;AAEvC,MAAa,sBAAsB;AACnC,MAAa,qBAAqB;;AAGlC,MAAa,cAAc,UACzB,MAAM,SAAA,aAA8B,aAAa;;;;;;;;AAoBnD,SAAgB,aACd,WACA,QACa;CACb,OAAO,UACJ,QAAQ,YAAY,QAAQ,SAAS,uBAAuB,CAAC,CAC7D,KAAK,YAAY;EAChB,MAAM,MAAM,OAAO,QAAQ,UAAU,MAAM,cAAc,QAAQ,EAAE;EACnE,OAAO;GACL,WAAW,QAAQ;GACnB,MAAM,QAAQ;GACd;GACA,YAAY,IAAI,QAAQ,UAAU,WAAW,KAAK,MAAM,WAAW;GACnE,UAAU,IAAI,MAAM,UAAU,WAAW,KAAK,MAAM,UAAU,KAAK;EACrE;CACF,CAAC;AACL"}
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
import { EventHook, EventOrigin, OperationOptions, ResourceStatus, SettingsApi } from "@embedpdf/core";
|
|
2
|
+
import { StampPlacement } from "@embedpdf/plugin-annotation/contract";
|
|
3
|
+
import { StampAsset, StampLibrary } from "@embedpdf/plugin-stamp/contract";
|
|
4
|
+
import { AnalyzeInput, AnalyzeInput as AnalyzeInput$1, AnnotationRef, BinarySource, ChangeAnalysis, ChangeAnalysis as ChangeAnalysis$1, DigestAlgorithm, DocMdpPermission, DocMdpPermission as DocMdpPermission$1, DocumentProtection, DocumentProtection as DocumentProtection$1, FieldLockSpec, FieldLockSpec as FieldLockSpec$1, FormFieldRef, FormFieldRef as FormFieldRef$1, FormWidget, SignatureCompleteResult, SignatureCompleteResult as SignatureCompleteResult$1, SignatureDTO, SignatureDTO as SignatureDTO$1, SignaturePrepared, SignaturePrepared as SignaturePrepared$1, SignatureSignerInput, SignatureSnapshot, SignatureSnapshot as SignatureSnapshot$1, SignatureSubFilter } from "@embedpdf/engine-core/runtime";
|
|
5
|
+
import { SignatureVerdict, SignatureVerdict as SignatureVerdict$1, SignerPort, SignerPort as SignerPort$1, TrustPort, TrustPort as TrustPort$1, ValidationTime, ValidationTime as ValidationTime$1 } from "@embedpdf/core-signature";
|
|
6
|
+
//#region src/token.d.ts
|
|
7
|
+
declare const SignatureToken: import("@embedpdf/core").CapabilityToken<SignatureCapability>;
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region src/contract.d.ts
|
|
10
|
+
/**
|
|
11
|
+
* What placing a mark on a signature field does:
|
|
12
|
+
* - `sign` seal the field with the configured key (the mark is the appearance);
|
|
13
|
+
* - `visual` draw the mark into the field without sealing (Preview's "signature");
|
|
14
|
+
* - `ask` neither: `onSignRequested` fires so the chrome can open its dialog and decide.
|
|
15
|
+
*/
|
|
16
|
+
type SignatureMode = 'sign' | 'visual' | 'ask';
|
|
17
|
+
/** The key that signs: a signer port, or a function that returns one when someone signs. */
|
|
18
|
+
type SignatureKey = SignerPort | (() => SignerPort | Promise<SignerPort>);
|
|
19
|
+
/**
|
|
20
|
+
* The signature plugin's settings. `signaturePlugin(config)` registers them
|
|
21
|
+
* over {@link SIGNATURE_DEFAULTS}, and `updateSettings()` changes them for
|
|
22
|
+
* every document while the app runs. Each is one value: a change replaces a
|
|
23
|
+
* key or a trust port whole.
|
|
24
|
+
*/
|
|
25
|
+
interface SignatureSettings {
|
|
26
|
+
/** The key: a raw signer (the CMS is built here) or a CMS signer (a service builds it); `null` for none. */
|
|
27
|
+
readonly key: SignatureKey | null;
|
|
28
|
+
/** What a mark does in a field; `null` is `'sign'` with a key, else `'visual'`. */
|
|
29
|
+
readonly mode: SignatureMode | null;
|
|
30
|
+
/** The certificates you trust, for checking signatures. Without them a verdict is at best `valid-untrusted`. */
|
|
31
|
+
readonly trust: TrustPort | null;
|
|
32
|
+
/** Let a first signature be a certification (still needs `doc.sign.certify`). */
|
|
33
|
+
readonly allowCertify: boolean;
|
|
34
|
+
}
|
|
35
|
+
/** What the signature settings are when the app registers none. */
|
|
36
|
+
declare const SIGNATURE_DEFAULTS: SignatureSettings;
|
|
37
|
+
/** What `signaturePlugin(config)` takes: any of the settings. */
|
|
38
|
+
type SignatureConfig = Partial<SignatureSettings>;
|
|
39
|
+
/** The mark: a stamp-plugin asset, or bytes the embedder brings (PNG, JPEG, or a one-page PDF). */
|
|
40
|
+
type Mark = {
|
|
41
|
+
assetId: string;
|
|
42
|
+
} | {
|
|
43
|
+
source: BinarySource;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* How a signature field is addressed: its field ref, or its widget, by
|
|
47
|
+
* annotation ref or as a signature names it (`SignatureDTO.widget`).
|
|
48
|
+
*/
|
|
49
|
+
type SignatureFieldAddress = FormFieldRef | AnnotationRef | FormWidget;
|
|
50
|
+
interface SignFieldInput {
|
|
51
|
+
field: FormFieldRef;
|
|
52
|
+
mark: Mark;
|
|
53
|
+
/** A per-call key; the `key` setting otherwise. */
|
|
54
|
+
key?: SignatureKey;
|
|
55
|
+
/** What the signature dictionary says about the signer; the name defaults to the certificate's subject. */
|
|
56
|
+
signer?: SignatureSignerInput;
|
|
57
|
+
/** Instead of the mark: a ready one-page appearance PDF the embedder composed itself. */
|
|
58
|
+
appearance?: BinarySource;
|
|
59
|
+
certify?: {
|
|
60
|
+
permission: DocMdpPermission;
|
|
61
|
+
};
|
|
62
|
+
lock?: FieldLockSpec;
|
|
63
|
+
}
|
|
64
|
+
/** Two-phase signing, step one: everything but the key. The digest comes back; a CMS goes in. */
|
|
65
|
+
interface PrepareSignatureInput {
|
|
66
|
+
field: FormFieldRef;
|
|
67
|
+
mark?: Mark;
|
|
68
|
+
appearance?: BinarySource;
|
|
69
|
+
signer?: SignatureSignerInput;
|
|
70
|
+
certify?: {
|
|
71
|
+
permission: DocMdpPermission;
|
|
72
|
+
};
|
|
73
|
+
lock?: FieldLockSpec;
|
|
74
|
+
subFilter?: SignatureSubFilter;
|
|
75
|
+
digest?: Exclude<DigestAlgorithm, 'sha1'>;
|
|
76
|
+
}
|
|
77
|
+
/** The parked half of a two-phase signing (`prepareSignature` → `completeSignature`). */
|
|
78
|
+
type PreparedSignature = SignaturePrepared;
|
|
79
|
+
/** The stamp-library kind that holds people's marks: one library per person. */
|
|
80
|
+
declare const SIGNATURES_LIBRARY_KIND = "signatures";
|
|
81
|
+
/** The asset identifiers inside a signatures library: the full signature and the initials. */
|
|
82
|
+
declare const SIGNATURE_MARK_NAME = "signature";
|
|
83
|
+
declare const INITIALS_MARK_NAME = "initials";
|
|
84
|
+
type MarkRole = 'signature' | 'initials';
|
|
85
|
+
/** Which mark an asset of a signatures library is (anything not named `initials` is a signature). */
|
|
86
|
+
declare const markRoleOf: (asset: Pick<StampAsset, "name">) => MarkRole;
|
|
87
|
+
/** One person in a signatures picker: a library of kind `signatures`, with its marks split by role. */
|
|
88
|
+
interface SignerRow {
|
|
89
|
+
readonly libraryId: string;
|
|
90
|
+
readonly name: string;
|
|
91
|
+
readonly library: StampLibrary;
|
|
92
|
+
/** Every full signature of the person, in the library's order. */
|
|
93
|
+
readonly signatures: StampAsset[];
|
|
94
|
+
/** The person's initials, or `null` when the library has none. */
|
|
95
|
+
readonly initials: StampAsset | null;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* The people whose marks the stamp plugin holds, one row per library of kind
|
|
99
|
+
* `signatures`, in the order of `libraries`: give it the stamp plugin's
|
|
100
|
+
* `listLibraries({ kind: SIGNATURES_LIBRARY_KIND })` and `listAssets()`. A
|
|
101
|
+
* pure derivation: rename, delete and export are the stamp plugin's library
|
|
102
|
+
* verbs, and nothing is stored beyond the library's file.
|
|
103
|
+
*/
|
|
104
|
+
declare function signerRowsOf(libraries: readonly StampLibrary[], assets: readonly StampAsset[]): SignerRow[];
|
|
105
|
+
/** A signature prepared in two steps and not completed yet. */
|
|
106
|
+
interface SignaturePending {
|
|
107
|
+
readonly signingId: string;
|
|
108
|
+
readonly field: FormFieldRef;
|
|
109
|
+
}
|
|
110
|
+
/** A signed field's facts, with its verdict from the last check (`null` until one ran). */
|
|
111
|
+
interface SignatureInfo extends SignatureDTO {
|
|
112
|
+
readonly verdict: SignatureVerdict | null;
|
|
113
|
+
}
|
|
114
|
+
/** What `placeMark` did: sealed, drawn, handed to the chrome (mode `ask`), or placed as a stamp. */
|
|
115
|
+
type PlaceMarkResult = {
|
|
116
|
+
kind: 'signed';
|
|
117
|
+
field: FormFieldRef;
|
|
118
|
+
result: SignatureCompleteResult;
|
|
119
|
+
} | {
|
|
120
|
+
kind: 'filled';
|
|
121
|
+
field: FormFieldRef;
|
|
122
|
+
} | {
|
|
123
|
+
kind: 'requested';
|
|
124
|
+
field: FormFieldRef;
|
|
125
|
+
} | {
|
|
126
|
+
kind: 'placed';
|
|
127
|
+
annotation: AnnotationRef;
|
|
128
|
+
};
|
|
129
|
+
/** A signing completed, in this session or another: the confirmed `signatures.completed` fact. */
|
|
130
|
+
interface SignatureSignedEvent {
|
|
131
|
+
/** The sealed field, by its durable object-number ref. */
|
|
132
|
+
readonly field: FormFieldRef;
|
|
133
|
+
readonly result: SignatureCompleteResult;
|
|
134
|
+
readonly origin: EventOrigin;
|
|
135
|
+
}
|
|
136
|
+
/** This session's `fillField()` drew a mark into a field. */
|
|
137
|
+
interface SignatureFilledEvent {
|
|
138
|
+
readonly field: FormFieldRef;
|
|
139
|
+
}
|
|
140
|
+
/** This session's `clearField()` took a drawn mark out of a field. */
|
|
141
|
+
interface SignatureClearedEvent {
|
|
142
|
+
readonly field: FormFieldRef;
|
|
143
|
+
}
|
|
144
|
+
interface SignatureValidatedEvent {
|
|
145
|
+
readonly verdicts: readonly SignatureVerdict[];
|
|
146
|
+
}
|
|
147
|
+
interface SignatureProtectionChangedEvent {
|
|
148
|
+
readonly protection: DocumentProtection;
|
|
149
|
+
}
|
|
150
|
+
/** An unsaved edit just turned a signature that held into one a save would invalidate. Once per edge. */
|
|
151
|
+
interface SignatureInvalidationPredictedEvent {
|
|
152
|
+
readonly field: FormFieldRef;
|
|
153
|
+
readonly detail: string;
|
|
154
|
+
}
|
|
155
|
+
interface SignatureTargetChangedEvent {
|
|
156
|
+
readonly field: FormFieldRef | null;
|
|
157
|
+
}
|
|
158
|
+
/** Mode `ask`: a mark met a field and the chrome decides (open its dialog, then `sign` / `fillField`). */
|
|
159
|
+
interface SignatureSignRequestedEvent {
|
|
160
|
+
readonly field: FormFieldRef;
|
|
161
|
+
readonly mark: Mark;
|
|
162
|
+
}
|
|
163
|
+
/** A signed field was activated: show what its signature says. */
|
|
164
|
+
interface SignatureInspectionRequestedEvent {
|
|
165
|
+
readonly field: FormFieldRef;
|
|
166
|
+
}
|
|
167
|
+
/** Options for `validate()` and `validateField()`. */
|
|
168
|
+
interface SignatureValidateOptions extends OperationOptions {
|
|
169
|
+
/** The moment the certificates are judged at; now by default. */
|
|
170
|
+
readonly at?: ValidationTime;
|
|
171
|
+
/** `'persisted'` checks the file as it was opened; `'working-copy'` (the default) counts unsaved changes. */
|
|
172
|
+
readonly until?: 'persisted' | 'working-copy';
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Signing, visual fills and checking signatures for one document. Every verb
|
|
176
|
+
* rejects with a `PluginError`, and every async verb takes a `signal`. Its
|
|
177
|
+
* settings belong to the plugin, not to a document.
|
|
178
|
+
*/
|
|
179
|
+
interface SignatureCapability extends SettingsApi<SignatureSettings> {
|
|
180
|
+
/** Every signature field and its facts, the file's versions and `protection`. The same object until it changes. */
|
|
181
|
+
getSnapshot(): SignatureSnapshot | null;
|
|
182
|
+
/** Whether the signatures are read. */
|
|
183
|
+
getStatus(): ResourceStatus;
|
|
184
|
+
/** The signed fields, in document order, each with its verdict once checked. The same array until one changes. */
|
|
185
|
+
listSignatures(): readonly SignatureInfo[];
|
|
186
|
+
/** Signature fields still to sign, in document order. The same array until one changes. */
|
|
187
|
+
listUnsignedFields(): readonly FormFieldRef[];
|
|
188
|
+
/** One signature field's facts, signed or not, by its ref or its widget's, or `null`. */
|
|
189
|
+
getSignature(field: SignatureFieldAddress): SignatureDTO | null;
|
|
190
|
+
/** Every verdict from the last check; `null` before the first. */
|
|
191
|
+
listVerdicts(): readonly SignatureVerdict[] | null;
|
|
192
|
+
/** One signed field's verdict from the last check, or `null`. */
|
|
193
|
+
getVerdict(field: SignatureFieldAddress): SignatureVerdict | null;
|
|
194
|
+
/** What the document's signatures allow, or `null` before they're read. */
|
|
195
|
+
getProtection(): DocumentProtection | null;
|
|
196
|
+
/** A signature prepared in two steps and not completed: the document can't be changed until it is, or is cancelled. */
|
|
197
|
+
getPending(): SignaturePending | null;
|
|
198
|
+
/** Whether a signing or a fill is running. */
|
|
199
|
+
isBusy(): boolean;
|
|
200
|
+
/** The mode in effect: the `mode` setting, or its default. */
|
|
201
|
+
getMode(): SignatureMode;
|
|
202
|
+
/** The field the next picked mark goes to, or `null`. */
|
|
203
|
+
getTarget(): FormFieldRef | null;
|
|
204
|
+
/**
|
|
205
|
+
* Sign a field: the mark becomes what it shows, the key seals the document,
|
|
206
|
+
* and the signed document is a new version. A signal that fires before the
|
|
207
|
+
* seal leaves nothing signed. Fires `onSigned`. Rejects `permission-denied`
|
|
208
|
+
* for a field you may not sign (`canSign`), or without `doc.sign.certify`
|
|
209
|
+
* to certify, `invalid-input` without a key, `not-found`,
|
|
210
|
+
* `operation-cancelled`.
|
|
211
|
+
*/
|
|
212
|
+
sign(input: SignFieldInput, options?: OperationOptions): Promise<SignatureCompleteResult>;
|
|
213
|
+
/**
|
|
214
|
+
* Signing in two steps, the first: resolves the digest for your key to sign,
|
|
215
|
+
* and keeps the document from changing until `completeSignature()` or
|
|
216
|
+
* `cancelPending()`. Rejects like `sign()`.
|
|
217
|
+
*/
|
|
218
|
+
prepareSignature(input: PrepareSignatureInput, options?: OperationOptions): Promise<PreparedSignature>;
|
|
219
|
+
/** Signing in two steps, the second: the key's CMS seals the document. Fires `onSigned`. Rejects `not-found` for a signing this session didn't prepare. */
|
|
220
|
+
completeSignature(signingId: string, cms: Uint8Array, options?: OperationOptions): Promise<SignatureCompleteResult>;
|
|
221
|
+
/** Give up a signature prepared in two steps, so the document can be changed again. */
|
|
222
|
+
cancelPending(options?: OperationOptions): Promise<void>;
|
|
223
|
+
/**
|
|
224
|
+
* Draw a mark into a field without signing. Fires `onFilled`. Rejects
|
|
225
|
+
* `permission-denied` for a field you may not fill in (`canFill`),
|
|
226
|
+
* `conflict` on a signed field.
|
|
227
|
+
*/
|
|
228
|
+
fillField(field: FormFieldRef, mark: Mark, options?: OperationOptions): Promise<void>;
|
|
229
|
+
/** Take a drawn mark out of a field. Fires `onCleared`. Rejects like `fillField()`. */
|
|
230
|
+
clearField(field: FormFieldRef, options?: OperationOptions): Promise<void>;
|
|
231
|
+
/**
|
|
232
|
+
* Do what a click with an armed mark does: in a field, sign, fill or ask
|
|
233
|
+
* (`onSignRequested`), by `mode`; anywhere else, place it as a stamp.
|
|
234
|
+
* Rejects like the verb it runs.
|
|
235
|
+
*/
|
|
236
|
+
placeMark(mark: Mark, target: {
|
|
237
|
+
field: FormFieldRef;
|
|
238
|
+
} | StampPlacement, options?: OperationOptions): Promise<PlaceMarkResult>;
|
|
239
|
+
/** Make a field the target, where the next mark the person picks goes; `null` clears. Fires `onTargetChanged`. */
|
|
240
|
+
setTarget(field: FormFieldRef | null): void;
|
|
241
|
+
/** Ask your UI to show a signed field's details, as clicking it does. Fires `onInspectionRequested`. */
|
|
242
|
+
requestInspection(field: FormFieldRef): void;
|
|
243
|
+
/** Read the signatures again; resolves the snapshot. */
|
|
244
|
+
refresh(options?: OperationOptions): Promise<SignatureSnapshot | null>;
|
|
245
|
+
/**
|
|
246
|
+
* Check every signature again and resolve the verdicts. Unsaved changes
|
|
247
|
+
* count, so the verdict is the one the downloaded file will get;
|
|
248
|
+
* `until: 'persisted'` checks the file as it was opened. Fires `onValidated`.
|
|
249
|
+
*/
|
|
250
|
+
validate(options?: SignatureValidateOptions): Promise<readonly SignatureVerdict[]>;
|
|
251
|
+
/** Check one signed field. Rejects `not-found` for an unsigned or unknown field. */
|
|
252
|
+
validateField(field: SignatureFieldAddress, options?: SignatureValidateOptions): Promise<SignatureVerdict>;
|
|
253
|
+
/** What changed after a signature or a version of the file, rule by rule. */
|
|
254
|
+
analyzeChanges(input: AnalyzeInput, options?: OperationOptions): Promise<ChangeAnalysis>;
|
|
255
|
+
/**
|
|
256
|
+
* The exact bytes of the file version a signature covers. Rejects
|
|
257
|
+
* `permission-denied` without `doc.download`, `not-found` for an unsigned
|
|
258
|
+
* field.
|
|
259
|
+
*/
|
|
260
|
+
readRevision(target: SignatureFieldAddress | {
|
|
261
|
+
revisionIndex: number;
|
|
262
|
+
}, options?: OperationOptions): Promise<Uint8Array>;
|
|
263
|
+
/**
|
|
264
|
+
* Whether signing this field is allowed: `doc.sign`, or a `fields:sign`
|
|
265
|
+
* permission for its group. `false` for a field the form doesn't have. A
|
|
266
|
+
* per-call key or two-step signing needs no `key` setting.
|
|
267
|
+
*/
|
|
268
|
+
canSign(field: FormFieldRef): boolean;
|
|
269
|
+
/**
|
|
270
|
+
* Whether drawing a mark into this field without signing is allowed:
|
|
271
|
+
* `doc.forms.fill`, or a `fields:fill` permission for its group.
|
|
272
|
+
*/
|
|
273
|
+
canFill(field: FormFieldRef): boolean;
|
|
274
|
+
/** Whether a certification may be offered: the `allowCertify` setting and `doc.sign.certify`. */
|
|
275
|
+
canCertify(): boolean;
|
|
276
|
+
/** Whether the signed bytes may be read: `doc.download`. */
|
|
277
|
+
canReadRevision(): boolean;
|
|
278
|
+
/** A field was signed, whoever signed it; fires once the facts show the sealed field. */
|
|
279
|
+
readonly onSigned: EventHook<SignatureSignedEvent>;
|
|
280
|
+
/** A mark was drawn into a field. */
|
|
281
|
+
readonly onFilled: EventHook<SignatureFilledEvent>;
|
|
282
|
+
/** A drawn mark was taken out of a field. */
|
|
283
|
+
readonly onCleared: EventHook<SignatureClearedEvent>;
|
|
284
|
+
/** The signatures were checked. */
|
|
285
|
+
readonly onValidated: EventHook<SignatureValidatedEvent>;
|
|
286
|
+
/** What the signatures allow changed. */
|
|
287
|
+
readonly onProtectionChanged: EventHook<SignatureProtectionChangedEvent>;
|
|
288
|
+
/** A change would break a signature once saved. */
|
|
289
|
+
readonly onInvalidationPredicted: EventHook<SignatureInvalidationPredictedEvent>;
|
|
290
|
+
/** A field became the target, or the target was cleared. */
|
|
291
|
+
readonly onTargetChanged: EventHook<SignatureTargetChangedEvent>;
|
|
292
|
+
/** In `'ask'` mode, a mark was dropped on a field. */
|
|
293
|
+
readonly onSignRequested: EventHook<SignatureSignRequestedEvent>;
|
|
294
|
+
/** A signed field was clicked. */
|
|
295
|
+
readonly onInspectionRequested: EventHook<SignatureInspectionRequestedEvent>;
|
|
296
|
+
}
|
|
297
|
+
//#endregion
|
|
298
|
+
export { SignaturePrepared$1 as A, SignerPort$1 as B, SignatureFilledEvent as C, SignatureKey as D, SignatureInvalidationPredictedEvent as E, SignatureSnapshot$1 as F, signerRowsOf as G, TrustPort$1 as H, SignatureTargetChangedEvent as I, SignatureToken as K, SignatureValidateOptions as L, SignatureSettings as M, SignatureSignRequestedEvent as N, SignatureMode as O, SignatureSignedEvent as P, SignatureValidatedEvent as R, SignatureFieldAddress as S, SignatureInspectionRequestedEvent as T, ValidationTime$1 as U, SignerRow as V, markRoleOf as W, SignatureCapability as _, FieldLockSpec$1 as a, SignatureConfig as b, Mark as c, PrepareSignatureInput as d, PreparedSignature as f, SignFieldInput as g, SIGNATURE_MARK_NAME as h, DocumentProtection$1 as i, SignatureProtectionChangedEvent as j, SignaturePending as k, MarkRole as l, SIGNATURE_DEFAULTS as m, ChangeAnalysis$1 as n, FormFieldRef$1 as o, SIGNATURES_LIBRARY_KIND as p, DocMdpPermission$1 as r, INITIALS_MARK_NAME as s, AnalyzeInput$1 as t, PlaceMarkResult as u, SignatureClearedEvent as v, SignatureInfo as w, SignatureDTO$1 as x, SignatureCompleteResult$1 as y, SignatureVerdict$1 as z };
|
|
299
|
+
//# sourceMappingURL=contract-GUWa_aBY.d.ts.map
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { createCapabilityToken } from "@embedpdf/core";
|
|
2
|
+
//#region src/token.ts
|
|
3
|
+
/** The package token, created once here and re-exported by `contract.ts`. */
|
|
4
|
+
const SignatureToken = createCapabilityToken("signature", {
|
|
5
|
+
hint: `add signaturePlugin() from '@embedpdf/plugin-signature' to your plugins list`,
|
|
6
|
+
promises: {
|
|
7
|
+
sign: true,
|
|
8
|
+
prepareSignature: true,
|
|
9
|
+
completeSignature: true,
|
|
10
|
+
cancelPending: true,
|
|
11
|
+
fillField: true,
|
|
12
|
+
clearField: true,
|
|
13
|
+
placeMark: true,
|
|
14
|
+
refresh: true,
|
|
15
|
+
validate: true,
|
|
16
|
+
validateField: true,
|
|
17
|
+
analyzeChanges: true,
|
|
18
|
+
readRevision: true
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/contract.ts
|
|
23
|
+
/** What the signature settings are when the app registers none. */
|
|
24
|
+
const SIGNATURE_DEFAULTS = {
|
|
25
|
+
key: null,
|
|
26
|
+
mode: null,
|
|
27
|
+
trust: null,
|
|
28
|
+
allowCertify: false
|
|
29
|
+
};
|
|
30
|
+
/** The stamp-library kind that holds people's marks: one library per person. */
|
|
31
|
+
const SIGNATURES_LIBRARY_KIND = "signatures";
|
|
32
|
+
/** The asset identifiers inside a signatures library: the full signature and the initials. */
|
|
33
|
+
const SIGNATURE_MARK_NAME = "signature";
|
|
34
|
+
const INITIALS_MARK_NAME = "initials";
|
|
35
|
+
/** Which mark an asset of a signatures library is (anything not named `initials` is a signature). */
|
|
36
|
+
const markRoleOf = (asset) => asset.name === "initials" ? "initials" : "signature";
|
|
37
|
+
/**
|
|
38
|
+
* The people whose marks the stamp plugin holds, one row per library of kind
|
|
39
|
+
* `signatures`, in the order of `libraries`: give it the stamp plugin's
|
|
40
|
+
* `listLibraries({ kind: SIGNATURES_LIBRARY_KIND })` and `listAssets()`. A
|
|
41
|
+
* pure derivation: rename, delete and export are the stamp plugin's library
|
|
42
|
+
* verbs, and nothing is stored beyond the library's file.
|
|
43
|
+
*/
|
|
44
|
+
function signerRowsOf(libraries, assets) {
|
|
45
|
+
return libraries.filter((library) => library.kind === SIGNATURES_LIBRARY_KIND).map((library) => {
|
|
46
|
+
const own = assets.filter((asset) => asset.libraryId === library.id);
|
|
47
|
+
return {
|
|
48
|
+
libraryId: library.id,
|
|
49
|
+
name: library.name,
|
|
50
|
+
library,
|
|
51
|
+
signatures: own.filter((asset) => markRoleOf(asset) === "signature"),
|
|
52
|
+
initials: own.find((asset) => markRoleOf(asset) === "initials") ?? null
|
|
53
|
+
};
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
//#endregion
|
|
57
|
+
export { markRoleOf as a, SIGNATURE_MARK_NAME as i, SIGNATURES_LIBRARY_KIND as n, signerRowsOf as o, SIGNATURE_DEFAULTS as r, SignatureToken as s, INITIALS_MARK_NAME as t };
|
|
58
|
+
|
|
59
|
+
//# sourceMappingURL=contract-NW5jPVqt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract-NW5jPVqt.js","names":[],"sources":["../src/token.ts","../src/contract.ts"],"sourcesContent":["/** The package token, created once here and re-exported by `contract.ts`. */\nimport { createCapabilityToken } from '@embedpdf/core';\n\nimport type { SignatureCapability } from './contract';\n\nexport const SignatureToken = createCapabilityToken<SignatureCapability>('signature', {\n hint: `add signaturePlugin() from '@embedpdf/plugin-signature' to your plugins list`,\n // Without a document, an adapter's stand-in rejects these with `not-ready`, as the\n // capability would; the type asks for every member that returns a promise.\n promises: {\n sign: true,\n prepareSignature: true,\n completeSignature: true,\n cancelPending: true,\n fillField: true,\n clearField: true,\n placeMark: true,\n refresh: true,\n validate: true,\n validateField: true,\n analyzeChanges: true,\n readRevision: true,\n },\n});\n","/**\n * @embedpdf/plugin-signature/contract: the public signature vocabulary: the\n * act of signing (one-shot and two-phase), visual fills, validation, the\n * sign-here flow, and the facts about a document's signatures.\n */\nimport type {\n EventHook,\n EventOrigin,\n OperationOptions,\n ResourceStatus,\n SettingsApi,\n} from '@embedpdf/core';\nimport type {\n SignatureVerdict,\n SignerPort,\n TrustPort,\n ValidationTime,\n} from '@embedpdf/core-signature';\nimport type {\n AnalyzeInput,\n AnnotationRef,\n BinarySource,\n ChangeAnalysis,\n DigestAlgorithm,\n DocMdpPermission,\n DocumentProtection,\n FieldLockSpec,\n FormFieldRef,\n FormWidget,\n SignatureCompleteResult,\n SignatureDTO,\n SignaturePrepared,\n SignatureSignerInput,\n SignatureSnapshot,\n SignatureSubFilter,\n} from '@embedpdf/engine-core/runtime';\nimport type { StampPlacement } from '@embedpdf/plugin-annotation/contract';\nimport type { StampAsset, StampLibrary } from '@embedpdf/plugin-stamp/contract';\n\nexport { SignatureToken } from './token';\nexport type {\n AnalyzeInput,\n ChangeAnalysis,\n DocMdpPermission,\n DocumentProtection,\n FieldLockSpec,\n FormFieldRef,\n SignatureCompleteResult,\n SignatureDTO,\n SignaturePrepared,\n SignatureSnapshot,\n} from '@embedpdf/engine-core/runtime';\nexport type {\n SignatureVerdict,\n SignerPort,\n TrustPort,\n ValidationTime,\n} from '@embedpdf/core-signature';\n\n/**\n * What placing a mark on a signature field does:\n * - `sign` seal the field with the configured key (the mark is the appearance);\n * - `visual` draw the mark into the field without sealing (Preview's \"signature\");\n * - `ask` neither: `onSignRequested` fires so the chrome can open its dialog and decide.\n */\nexport type SignatureMode = 'sign' | 'visual' | 'ask';\n\n/** The key that signs: a signer port, or a function that returns one when someone signs. */\nexport type SignatureKey = SignerPort | (() => SignerPort | Promise<SignerPort>);\n\n/**\n * The signature plugin's settings. `signaturePlugin(config)` registers them\n * over {@link SIGNATURE_DEFAULTS}, and `updateSettings()` changes them for\n * every document while the app runs. Each is one value: a change replaces a\n * key or a trust port whole.\n */\nexport interface SignatureSettings {\n /** The key: a raw signer (the CMS is built here) or a CMS signer (a service builds it); `null` for none. */\n readonly key: SignatureKey | null;\n /** What a mark does in a field; `null` is `'sign'` with a key, else `'visual'`. */\n readonly mode: SignatureMode | null;\n /** The certificates you trust, for checking signatures. Without them a verdict is at best `valid-untrusted`. */\n readonly trust: TrustPort | null;\n /** Let a first signature be a certification (still needs `doc.sign.certify`). */\n readonly allowCertify: boolean;\n}\n\n/** What the signature settings are when the app registers none. */\nexport const SIGNATURE_DEFAULTS: SignatureSettings = {\n key: null,\n mode: null,\n trust: null,\n allowCertify: false,\n};\n\n/** What `signaturePlugin(config)` takes: any of the settings. */\nexport type SignatureConfig = Partial<SignatureSettings>;\n\n/** The mark: a stamp-plugin asset, or bytes the embedder brings (PNG, JPEG, or a one-page PDF). */\nexport type Mark = { assetId: string } | { source: BinarySource };\n\n/**\n * How a signature field is addressed: its field ref, or its widget, by\n * annotation ref or as a signature names it (`SignatureDTO.widget`).\n */\nexport type SignatureFieldAddress = FormFieldRef | AnnotationRef | FormWidget;\n\nexport interface SignFieldInput {\n field: FormFieldRef;\n mark: Mark;\n /** A per-call key; the `key` setting otherwise. */\n key?: SignatureKey;\n /** What the signature dictionary says about the signer; the name defaults to the certificate's subject. */\n signer?: SignatureSignerInput;\n /** Instead of the mark: a ready one-page appearance PDF the embedder composed itself. */\n appearance?: BinarySource;\n certify?: { permission: DocMdpPermission };\n lock?: FieldLockSpec;\n}\n\n/** Two-phase signing, step one: everything but the key. The digest comes back; a CMS goes in. */\nexport interface PrepareSignatureInput {\n field: FormFieldRef;\n mark?: Mark;\n appearance?: BinarySource;\n signer?: SignatureSignerInput;\n certify?: { permission: DocMdpPermission };\n lock?: FieldLockSpec;\n subFilter?: SignatureSubFilter;\n digest?: Exclude<DigestAlgorithm, 'sha1'>;\n}\n\n/** The parked half of a two-phase signing (`prepareSignature` → `completeSignature`). */\nexport type PreparedSignature = SignaturePrepared;\n\n/** The stamp-library kind that holds people's marks: one library per person. */\nexport const SIGNATURES_LIBRARY_KIND = 'signatures';\n/** The asset identifiers inside a signatures library: the full signature and the initials. */\nexport const SIGNATURE_MARK_NAME = 'signature';\nexport const INITIALS_MARK_NAME = 'initials';\nexport type MarkRole = 'signature' | 'initials';\n/** Which mark an asset of a signatures library is (anything not named `initials` is a signature). */\nexport const markRoleOf = (asset: Pick<StampAsset, 'name'>): MarkRole =>\n asset.name === INITIALS_MARK_NAME ? 'initials' : 'signature';\n\n/** One person in a signatures picker: a library of kind `signatures`, with its marks split by role. */\nexport interface SignerRow {\n readonly libraryId: string;\n readonly name: string;\n readonly library: StampLibrary;\n /** Every full signature of the person, in the library's order. */\n readonly signatures: StampAsset[];\n /** The person's initials, or `null` when the library has none. */\n readonly initials: StampAsset | null;\n}\n\n/**\n * The people whose marks the stamp plugin holds, one row per library of kind\n * `signatures`, in the order of `libraries`: give it the stamp plugin's\n * `listLibraries({ kind: SIGNATURES_LIBRARY_KIND })` and `listAssets()`. A\n * pure derivation: rename, delete and export are the stamp plugin's library\n * verbs, and nothing is stored beyond the library's file.\n */\nexport function signerRowsOf(\n libraries: readonly StampLibrary[],\n assets: readonly StampAsset[],\n): SignerRow[] {\n return libraries\n .filter((library) => library.kind === SIGNATURES_LIBRARY_KIND)\n .map((library) => {\n const own = assets.filter((asset) => asset.libraryId === library.id);\n return {\n libraryId: library.id,\n name: library.name,\n library,\n signatures: own.filter((asset) => markRoleOf(asset) === 'signature'),\n initials: own.find((asset) => markRoleOf(asset) === 'initials') ?? null,\n };\n });\n}\n\n/** A signature prepared in two steps and not completed yet. */\nexport interface SignaturePending {\n readonly signingId: string;\n readonly field: FormFieldRef;\n}\n\n/** A signed field's facts, with its verdict from the last check (`null` until one ran). */\nexport interface SignatureInfo extends SignatureDTO {\n readonly verdict: SignatureVerdict | null;\n}\n\n/** What `placeMark` did: sealed, drawn, handed to the chrome (mode `ask`), or placed as a stamp. */\nexport type PlaceMarkResult =\n | { kind: 'signed'; field: FormFieldRef; result: SignatureCompleteResult }\n | { kind: 'filled'; field: FormFieldRef }\n | { kind: 'requested'; field: FormFieldRef }\n | { kind: 'placed'; annotation: AnnotationRef };\n\n// ── events ──\n/** A signing completed, in this session or another: the confirmed `signatures.completed` fact. */\nexport interface SignatureSignedEvent {\n /** The sealed field, by its durable object-number ref. */\n readonly field: FormFieldRef;\n readonly result: SignatureCompleteResult;\n readonly origin: EventOrigin;\n}\n/** This session's `fillField()` drew a mark into a field. */\nexport interface SignatureFilledEvent {\n readonly field: FormFieldRef;\n}\n/** This session's `clearField()` took a drawn mark out of a field. */\nexport interface SignatureClearedEvent {\n readonly field: FormFieldRef;\n}\nexport interface SignatureValidatedEvent {\n readonly verdicts: readonly SignatureVerdict[];\n}\nexport interface SignatureProtectionChangedEvent {\n readonly protection: DocumentProtection;\n}\n/** An unsaved edit just turned a signature that held into one a save would invalidate. Once per edge. */\nexport interface SignatureInvalidationPredictedEvent {\n readonly field: FormFieldRef;\n readonly detail: string;\n}\nexport interface SignatureTargetChangedEvent {\n readonly field: FormFieldRef | null;\n}\n/** Mode `ask`: a mark met a field and the chrome decides (open its dialog, then `sign` / `fillField`). */\nexport interface SignatureSignRequestedEvent {\n readonly field: FormFieldRef;\n readonly mark: Mark;\n}\n/** A signed field was activated: show what its signature says. */\nexport interface SignatureInspectionRequestedEvent {\n readonly field: FormFieldRef;\n}\n\n/** Options for `validate()` and `validateField()`. */\nexport interface SignatureValidateOptions extends OperationOptions {\n /** The moment the certificates are judged at; now by default. */\n readonly at?: ValidationTime;\n /** `'persisted'` checks the file as it was opened; `'working-copy'` (the default) counts unsaved changes. */\n readonly until?: 'persisted' | 'working-copy';\n}\n\n/**\n * Signing, visual fills and checking signatures for one document. Every verb\n * rejects with a `PluginError`, and every async verb takes a `signal`. Its\n * settings belong to the plugin, not to a document.\n */\nexport interface SignatureCapability extends SettingsApi<SignatureSettings> {\n // ── reading ──\n /** Every signature field and its facts, the file's versions and `protection`. The same object until it changes. */\n getSnapshot(): SignatureSnapshot | null;\n /** Whether the signatures are read. */\n getStatus(): ResourceStatus;\n /** The signed fields, in document order, each with its verdict once checked. The same array until one changes. */\n listSignatures(): readonly SignatureInfo[];\n /** Signature fields still to sign, in document order. The same array until one changes. */\n listUnsignedFields(): readonly FormFieldRef[];\n /** One signature field's facts, signed or not, by its ref or its widget's, or `null`. */\n getSignature(field: SignatureFieldAddress): SignatureDTO | null;\n /** Every verdict from the last check; `null` before the first. */\n listVerdicts(): readonly SignatureVerdict[] | null;\n /** One signed field's verdict from the last check, or `null`. */\n getVerdict(field: SignatureFieldAddress): SignatureVerdict | null;\n /** What the document's signatures allow, or `null` before they're read. */\n getProtection(): DocumentProtection | null;\n /** A signature prepared in two steps and not completed: the document can't be changed until it is, or is cancelled. */\n getPending(): SignaturePending | null;\n /** Whether a signing or a fill is running. */\n isBusy(): boolean;\n /** The mode in effect: the `mode` setting, or its default. */\n getMode(): SignatureMode;\n /** The field the next picked mark goes to, or `null`. */\n getTarget(): FormFieldRef | null;\n\n // ── signing ──\n /**\n * Sign a field: the mark becomes what it shows, the key seals the document,\n * and the signed document is a new version. A signal that fires before the\n * seal leaves nothing signed. Fires `onSigned`. Rejects `permission-denied`\n * for a field you may not sign (`canSign`), or without `doc.sign.certify`\n * to certify, `invalid-input` without a key, `not-found`,\n * `operation-cancelled`.\n */\n sign(input: SignFieldInput, options?: OperationOptions): Promise<SignatureCompleteResult>;\n /**\n * Signing in two steps, the first: resolves the digest for your key to sign,\n * and keeps the document from changing until `completeSignature()` or\n * `cancelPending()`. Rejects like `sign()`.\n */\n prepareSignature(\n input: PrepareSignatureInput,\n options?: OperationOptions,\n ): Promise<PreparedSignature>;\n /** Signing in two steps, the second: the key's CMS seals the document. Fires `onSigned`. Rejects `not-found` for a signing this session didn't prepare. */\n completeSignature(\n signingId: string,\n cms: Uint8Array,\n options?: OperationOptions,\n ): Promise<SignatureCompleteResult>;\n /** Give up a signature prepared in two steps, so the document can be changed again. */\n cancelPending(options?: OperationOptions): Promise<void>;\n /**\n * Draw a mark into a field without signing. Fires `onFilled`. Rejects\n * `permission-denied` for a field you may not fill in (`canFill`),\n * `conflict` on a signed field.\n */\n fillField(field: FormFieldRef, mark: Mark, options?: OperationOptions): Promise<void>;\n /** Take a drawn mark out of a field. Fires `onCleared`. Rejects like `fillField()`. */\n clearField(field: FormFieldRef, options?: OperationOptions): Promise<void>;\n /**\n * Do what a click with an armed mark does: in a field, sign, fill or ask\n * (`onSignRequested`), by `mode`; anywhere else, place it as a stamp.\n * Rejects like the verb it runs.\n */\n placeMark(\n mark: Mark,\n target: { field: FormFieldRef } | StampPlacement,\n options?: OperationOptions,\n ): Promise<PlaceMarkResult>;\n /** Make a field the target, where the next mark the person picks goes; `null` clears. Fires `onTargetChanged`. */\n setTarget(field: FormFieldRef | null): void;\n /** Ask your UI to show a signed field's details, as clicking it does. Fires `onInspectionRequested`. */\n requestInspection(field: FormFieldRef): void;\n\n // ── checking ──\n /** Read the signatures again; resolves the snapshot. */\n refresh(options?: OperationOptions): Promise<SignatureSnapshot | null>;\n /**\n * Check every signature again and resolve the verdicts. Unsaved changes\n * count, so the verdict is the one the downloaded file will get;\n * `until: 'persisted'` checks the file as it was opened. Fires `onValidated`.\n */\n validate(options?: SignatureValidateOptions): Promise<readonly SignatureVerdict[]>;\n /** Check one signed field. Rejects `not-found` for an unsigned or unknown field. */\n validateField(\n field: SignatureFieldAddress,\n options?: SignatureValidateOptions,\n ): Promise<SignatureVerdict>;\n /** What changed after a signature or a version of the file, rule by rule. */\n analyzeChanges(input: AnalyzeInput, options?: OperationOptions): Promise<ChangeAnalysis>;\n /**\n * The exact bytes of the file version a signature covers. Rejects\n * `permission-denied` without `doc.download`, `not-found` for an unsigned\n * field.\n */\n readRevision(\n target: SignatureFieldAddress | { revisionIndex: number },\n options?: OperationOptions,\n ): Promise<Uint8Array>;\n\n // ── permissions ──\n /**\n * Whether signing this field is allowed: `doc.sign`, or a `fields:sign`\n * permission for its group. `false` for a field the form doesn't have. A\n * per-call key or two-step signing needs no `key` setting.\n */\n canSign(field: FormFieldRef): boolean;\n /**\n * Whether drawing a mark into this field without signing is allowed:\n * `doc.forms.fill`, or a `fields:fill` permission for its group.\n */\n canFill(field: FormFieldRef): boolean;\n /** Whether a certification may be offered: the `allowCertify` setting and `doc.sign.certify`. */\n canCertify(): boolean;\n /** Whether the signed bytes may be read: `doc.download`. */\n canReadRevision(): boolean;\n\n // ── events ──\n /** A field was signed, whoever signed it; fires once the facts show the sealed field. */\n readonly onSigned: EventHook<SignatureSignedEvent>;\n /** A mark was drawn into a field. */\n readonly onFilled: EventHook<SignatureFilledEvent>;\n /** A drawn mark was taken out of a field. */\n readonly onCleared: EventHook<SignatureClearedEvent>;\n /** The signatures were checked. */\n readonly onValidated: EventHook<SignatureValidatedEvent>;\n /** What the signatures allow changed. */\n readonly onProtectionChanged: EventHook<SignatureProtectionChangedEvent>;\n /** A change would break a signature once saved. */\n readonly onInvalidationPredicted: EventHook<SignatureInvalidationPredictedEvent>;\n /** A field became the target, or the target was cleared. */\n readonly onTargetChanged: EventHook<SignatureTargetChangedEvent>;\n /** In `'ask'` mode, a mark was dropped on a field. */\n readonly onSignRequested: EventHook<SignatureSignRequestedEvent>;\n /** A signed field was clicked. */\n readonly onInspectionRequested: EventHook<SignatureInspectionRequestedEvent>;\n}\n"],"mappings":";;;AAKA,MAAa,iBAAiB,sBAA2C,aAAa;CACpF,MAAM;CAGN,UAAU;EACR,MAAM;EACN,kBAAkB;EAClB,mBAAmB;EACnB,eAAe;EACf,WAAW;EACX,YAAY;EACZ,WAAW;EACX,SAAS;EACT,UAAU;EACV,eAAe;EACf,gBAAgB;EAChB,cAAc;CAChB;AACF,CAAC;;;;ACiED,MAAa,qBAAwC;CACnD,KAAK;CACL,MAAM;CACN,OAAO;CACP,cAAc;AAChB;;AA2CA,MAAa,0BAA0B;;AAEvC,MAAa,sBAAsB;AACnC,MAAa,qBAAqB;;AAGlC,MAAa,cAAc,UACzB,MAAM,SAAA,aAA8B,aAAa;;;;;;;;AAoBnD,SAAgB,aACd,WACA,QACa;CACb,OAAO,UACJ,QAAQ,YAAY,QAAQ,SAAS,uBAAuB,CAAC,CAC7D,KAAK,YAAY;EAChB,MAAM,MAAM,OAAO,QAAQ,UAAU,MAAM,cAAc,QAAQ,EAAE;EACnE,OAAO;GACL,WAAW,QAAQ;GACnB,MAAM,QAAQ;GACd;GACA,YAAY,IAAI,QAAQ,UAAU,WAAW,KAAK,MAAM,WAAW;GACnE,UAAU,IAAI,MAAM,UAAU,WAAW,KAAK,MAAM,UAAU,KAAK;EACrE;CACF,CAAC;AACL"}
|