@breadstone/archipel-mcp 0.0.53 → 0.0.55
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/data/guides/ai-image-generation.md +96 -0
- package/data/guides/ai-realtime-voice.md +69 -464
- package/data/guides/ai-text-generation.md +95 -622
- package/data/guides/index.md +3 -1
- package/data/guides/intelligence-prompts-warm-up.md +138 -0
- package/data/packages/platform-intelligence/api/Class.AnthropicIntelligenceProviderAdapter.md +78 -0
- package/data/packages/platform-intelligence/api/Class.DefaultIntelligencePromptPolicyAdapter.md +54 -0
- package/data/packages/platform-intelligence/api/Class.GatewayIntelligenceProviderAdapter.md +78 -0
- package/data/packages/platform-intelligence/api/Class.GoogleIntelligenceProviderAdapter.md +78 -0
- package/data/packages/platform-intelligence/api/Class.GrokIntelligenceProviderAdapter.md +78 -0
- package/data/packages/platform-intelligence/api/Class.IntelligenceAgent.md +95 -0
- package/data/packages/platform-intelligence/api/Class.IntelligenceAgentFactory.md +11 -23
- package/data/packages/platform-intelligence/api/Class.IntelligenceEmbeddingGenerator.md +25 -21
- package/data/packages/platform-intelligence/api/Class.IntelligenceHealthIndicator.md +11 -7
- package/data/packages/platform-intelligence/api/Class.IntelligenceLanguageGenerator.md +159 -0
- package/data/packages/platform-intelligence/api/Class.IntelligenceMediaGenerator.md +60 -38
- package/data/packages/platform-intelligence/api/Class.IntelligenceModule.md +2 -2
- package/data/packages/platform-intelligence/api/Class.IntelligencePromptExecutor.md +88 -0
- package/data/packages/platform-intelligence/api/Class.IntelligencePromptPolicyPort.md +48 -0
- package/data/packages/platform-intelligence/api/Class.IntelligenceProviderAssetUploader.md +21 -15
- package/data/packages/platform-intelligence/api/Class.IntelligenceProviderDiagnostics.md +55 -0
- package/data/packages/platform-intelligence/api/Class.IntelligenceProviderError.md +14 -4
- package/data/packages/platform-intelligence/api/Class.IntelligenceProviderRegistry.md +68 -0
- package/data/packages/platform-intelligence/api/Class.IntelligenceRealtimeError.md +9 -9
- package/data/packages/platform-intelligence/api/Class.IntelligenceRealtimeMeteringPort.md +2 -2
- package/data/packages/platform-intelligence/api/Class.IntelligenceRealtimeSessionFactory.md +12 -12
- package/data/packages/platform-intelligence/api/Class.IntelligenceRealtimeSessionPort.md +18 -18
- package/data/packages/platform-intelligence/api/Class.IntelligenceReranker.md +58 -0
- package/data/packages/platform-intelligence/api/Class.IntelligenceToolBase.md +14 -16
- package/data/packages/platform-intelligence/api/Class.IntelligenceToolRegistry.md +10 -14
- package/data/packages/platform-intelligence/api/Class.MiMoIntelligenceProviderAdapter.md +78 -0
- package/data/packages/platform-intelligence/api/Class.OpenAIIntelligenceProviderAdapter.md +102 -0
- package/data/packages/platform-intelligence/api/Function.createAnthropicAdvisor20260301Tool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createAnthropicBash20241022Tool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createAnthropicBash20250124Tool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createAnthropicCodeExecution20250522Tool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createAnthropicCodeExecution20250825Tool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createAnthropicCodeExecution20260120Tool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createAnthropicComputer20241022Tool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createAnthropicComputer20250124Tool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createAnthropicComputer20251124Tool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createAnthropicMemory20250818Tool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createAnthropicTextEditor20241022Tool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createAnthropicTextEditor20250124Tool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createAnthropicTextEditor20250429Tool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createAnthropicTextEditor20250728Tool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createAnthropicToolSearchBM2520251119Tool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createAnthropicToolSearchRegex20251119Tool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createAnthropicWebFetch20250910Tool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createAnthropicWebFetch20260209Tool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createAnthropicWebSearch20250305Tool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createAnthropicWebSearch20260209Tool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createGoogleCodeExecutionTool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createGoogleEnterpriseWebSearchTool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createGoogleFileSearchTool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createGoogleGoogleMapsTool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createGoogleGoogleSearchTool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createGoogleUrlContextTool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createGoogleVertexRagStoreTool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createGrokCodeExecutionTool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createGrokFileSearchTool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createGrokMcpServerTool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createGrokViewImageTool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createGrokViewXVideoTool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createGrokWebSearchTool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createGrokXSearchTool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createIntelligenceJsonSchema.md +31 -0
- package/data/packages/platform-intelligence/api/Function.createIntelligenceTool.md +2 -2
- package/data/packages/platform-intelligence/api/Function.createMimoCustomTool.md +5 -5
- package/data/packages/platform-intelligence/api/Function.createOpenAIApplyPatchTool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createOpenAICodeInterpreterTool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createOpenAICustomTool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createOpenAIFileSearchTool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createOpenAIImageGenerationTool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createOpenAILocalShellTool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createOpenAIMcpTool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createOpenAIShellTool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createOpenAIToolSearchTool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createOpenAIWebSearchPreviewTool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.createOpenAIWebSearchTool.md +1 -1
- package/data/packages/platform-intelligence/api/Function.defineIntelligenceTool.md +31 -0
- package/data/packages/platform-intelligence/api/Function.intelligencePrompt.md +31 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceAgentConfiguration.md +70 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceEmbeddingBatchOptions.md +124 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceEmbeddingBatchResult.md +70 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceEmbeddingOptions.md +114 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceEmbeddingResult.md +70 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceFileUploadOptions.md +102 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceFileUploadResult.md +60 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceGeneratedFile.md +40 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceGenerationStepStartEvent.md +50 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceImageGenerationOptions.md +170 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceImageGenerationResult.md +60 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceLanguageCompletion.md +141 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceLanguageGenerationOptions.md +234 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceLanguageStream.md +50 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceModelReference.md +34 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceModelRequestOptions.md +52 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceModelStatus.md +30 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceModuleOptions.md +43 -25
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceObjectStream.md +56 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligencePrompt.md +50 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligencePromptDefinition.md +145 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligencePromptEffectivePolicy.md +30 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligencePromptExecutionContext.md +20 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligencePromptExecutionPolicy.md +70 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligencePromptExecutionResult.md +127 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligencePromptInvocation.md +49 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligencePromptPolicyRequest.md +60 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligencePromptRenderContext.md +26 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceProviderAdapter.md +73 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceProviderConfiguration.md +10 -10
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceProviderLoadRequest.md +40 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceProviderProbeResult.md +70 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceRealtimeAudioFormat.md +3 -3
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceRealtimeCloseEvent.md +4 -4
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceRealtimeModuleOptions.md +9 -21
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceRealtimeSessionConfiguration.md +11 -11
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceRealtimeSessionOptions.md +11 -11
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceRealtimeToolDefinition.md +5 -5
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceRealtimeTranscriptionConfiguration.md +4 -4
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceRealtimeTurnDetectionConfiguration.md +5 -5
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceRealtimeUsage.md +10 -10
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceRequestOptions.md +98 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceRerankingOptions.md +140 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceRerankingResult.md +50 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceSkillUploadOptions.md +94 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceSkillUploadResult.md +80 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceSpeechGenerationOptions.md +164 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceSpeechGenerationResult.md +50 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceStreamingTranscriptionOptions.md +139 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceTool.md +7 -10
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceToolCall.md +40 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceToolDefinition.md +91 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceToolExecutionEndEvent.md +50 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceToolExecutionStartEvent.md +30 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceToolRegistry.md +4 -4
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceTranscriptionOptions.md +114 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceTranscriptionResult.md +84 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceTranscriptionStream.md +97 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceUsage.md +40 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceVideoGenerationOptions.md +229 -0
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceVideoGenerationResult.md +50 -0
- package/data/packages/platform-intelligence/api/TypeAlias.IIntelligenceModelMessage.md +43 -0
- package/data/packages/platform-intelligence/api/TypeAlias.IIntelligencePromptModelRequirement.md +25 -0
- package/data/packages/platform-intelligence/api/TypeAlias.IIntelligenceSchema.md +70 -0
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceCapability.md +14 -0
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceDefaultModels.md +14 -0
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceJsonValue.md +22 -0
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligencePromptCapability.md +20 -0
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligencePromptDefinitionConfiguration.md +29 -0
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligencePromptGenerationOptions.md +16 -0
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligencePromptLatency.md +14 -0
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligencePromptMode.md +14 -0
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligencePromptQuality.md +14 -0
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligencePromptReasoning.md +14 -0
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceProviderName.md +1 -1
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceProviderOptions.md +14 -0
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceProviderProbeStatus.md +14 -0
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceProviderToolOptions.md +17 -0
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceRealtimeClientEvent.md +1 -1
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceRealtimeMetadataValue.md +1 -1
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceRealtimeMeteringEvent.md +1 -1
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceRealtimeServerEvent.md +1 -1
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceRealtimeStatus.md +1 -1
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceRequestTimeouts.md +14 -0
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceToolChoice.md +21 -0
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceToolOutput.md +22 -0
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceToolSet.md +14 -0
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceTranscriptionStreamPart.md +46 -0
- package/data/packages/platform-intelligence/api/Variable.AI_GATEWAY_API_KEY.md +14 -0
- package/data/packages/platform-intelligence/api/Variable.AI_GATEWAY_BASE_URL.md +14 -0
- package/data/packages/platform-intelligence/api/Variable.AI_GATEWAY_CONFIG_ENTRIES.md +14 -0
- package/data/packages/platform-intelligence/api/Variable.INTELLIGENCE_API_KEY.md +1 -1
- package/data/packages/platform-intelligence/api/Variable.INTELLIGENCE_BASE_URL.md +1 -1
- package/data/packages/platform-intelligence/api/Variable.INTELLIGENCE_MAX_OUTPUT_TOKENS.md +1 -1
- package/data/packages/platform-intelligence/api/Variable.INTELLIGENCE_MODEL.md +1 -1
- package/data/packages/platform-intelligence/api/Variable.INTELLIGENCE_PROVIDER.md +2 -2
- package/data/packages/platform-intelligence/api/Variable.INTELLIGENCE_TEMPERATURE.md +1 -1
- package/data/packages/platform-intelligence/api/Variable.INTELLIGENCE_TOP_P.md +1 -1
- package/data/packages/platform-intelligence/api/Variable.IntelligenceCapabilityNames.md +40 -0
- package/data/packages/platform-intelligence/api/Variable.IntelligenceProviderNames.md +2 -0
- package/data/packages/platform-intelligence/api/Variable.PLATFORM_INTELLIGENCE_CONFIG_ENTRIES.md +1 -1
- package/data/packages/platform-intelligence/api/index.md +98 -30
- package/package.json +1 -1
- package/data/packages/index.md +0 -8
- package/data/packages/platform-analytics/index.md +0 -209
- package/data/packages/platform-authentication/index.md +0 -725
- package/data/packages/platform-blob-storage/index.md +0 -416
- package/data/packages/platform-bootstrap/index.md +0 -162
- package/data/packages/platform-caching/index.md +0 -167
- package/data/packages/platform-configuration/index.md +0 -226
- package/data/packages/platform-core/index.md +0 -504
- package/data/packages/platform-cryptography/index.md +0 -142
- package/data/packages/platform-database/index.md +0 -337
- package/data/packages/platform-documents/index.md +0 -255
- package/data/packages/platform-esigning/index.md +0 -710
- package/data/packages/platform-feature-flags/index.md +0 -103
- package/data/packages/platform-health/index.md +0 -141
- package/data/packages/platform-intelligence/api/Class.IntelligenceStructuredGenerator.md +0 -70
- package/data/packages/platform-intelligence/api/Class.IntelligenceTelemetryRegistry.md +0 -44
- package/data/packages/platform-intelligence/api/Class.IntelligenceTextGenerator.md +0 -138
- package/data/packages/platform-intelligence/api/Function.createProviderOptions.md +0 -39
- package/data/packages/platform-intelligence/api/Function.loadAnthropicLanguageModel.md +0 -26
- package/data/packages/platform-intelligence/api/Function.loadGoogleLanguageModel.md +0 -26
- package/data/packages/platform-intelligence/api/Function.loadGoogleRealtimeModel.md +0 -25
- package/data/packages/platform-intelligence/api/Function.loadGrokLanguageModel.md +0 -26
- package/data/packages/platform-intelligence/api/Function.loadGrokRealtimeModel.md +0 -25
- package/data/packages/platform-intelligence/api/Function.loadMimoLanguageModel.md +0 -26
- package/data/packages/platform-intelligence/api/Function.loadOpenAILanguageModel.md +0 -26
- package/data/packages/platform-intelligence/api/Function.loadOpenAIRealtimeModel.md +0 -25
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceCompletionUsage.md +0 -46
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceTextCompletion.md +0 -168
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceTextGenerationOptions.md +0 -144
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceTextGenerator.md +0 -78
- package/data/packages/platform-intelligence/api/Interface.IIntelligenceTextStreamingOptions.md +0 -170
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceLanguageModelLoader.md +0 -24
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceLanguageModelLoaders.md +0 -14
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceRealtimeModelLoader.md +0 -25
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceRealtimeModelLoaders.md +0 -14
- package/data/packages/platform-intelligence/api/TypeAlias.IntelligenceTextStream.md +0 -14
- package/data/packages/platform-intelligence/index.md +0 -549
- package/data/packages/platform-logging/index.md +0 -150
- package/data/packages/platform-mailing/index.md +0 -470
- package/data/packages/platform-mapping/index.md +0 -123
- package/data/packages/platform-mcp/index.md +0 -335
- package/data/packages/platform-openapi/index.md +0 -207
- package/data/packages/platform-payments/index.md +0 -610
- package/data/packages/platform-queue/index.md +0 -192
- package/data/packages/platform-reporting/index.md +0 -233
- package/data/packages/platform-resources/index.md +0 -137
- package/data/packages/platform-telemetry/index.md +0 -262
|
@@ -1,710 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: platform-esigning
|
|
3
|
-
description: Provider-agnostic e-signing infrastructure with support for DocuSign, Adobe Sign, Dropbox Sign, and a built-in internal provider.
|
|
4
|
-
order: 5
|
|
5
|
-
tags: [esigning, docusign, adobe-sign, dropbox-sign, digital-signatures, ports-and-adapters, webhooks, health]
|
|
6
|
-
package: '@breadstone/archipel-platform-esigning'
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
# platform-esigning
|
|
10
|
-
|
|
11
|
-
Provider-agnostic e-signing infrastructure for NestJS. Exposes a unified `EsigningClientPort` abstraction with an internal provider out of the box and prepared entry points for DocuSign, Adobe Sign, and Dropbox Sign. Optionally tracks signing request state via the `EsigningPersistencePort`.
|
|
12
|
-
|
|
13
|
-
**Package:** `@breadstone/archipel-platform-esigning`
|
|
14
|
-
|
|
15
|
-
<InstallTabs />
|
|
16
|
-
|
|
17
|
-
## Architecture
|
|
18
|
-
|
|
19
|
-
```mermaid
|
|
20
|
-
graph TD
|
|
21
|
-
Core["@breadstone/archipel-platform-esigning<br/><i>Port, models, errors, module, service</i>"]
|
|
22
|
-
Internal["InternalEsigningProvider<br/><i>Built-in in-memory provider</i>"]
|
|
23
|
-
DocuSign["@breadstone/archipel-platform-esigning/docusign<br/><i>DocuSign config</i>"]
|
|
24
|
-
AdobeSign["@breadstone/archipel-platform-esigning/adobe-sign<br/><i>Adobe Sign config</i>"]
|
|
25
|
-
DropboxSign["@breadstone/archipel-platform-esigning/dropbox-sign<br/><i>Dropbox Sign config</i>"]
|
|
26
|
-
|
|
27
|
-
Internal -->|implements| Core
|
|
28
|
-
DocuSign -.->|implements| Core
|
|
29
|
-
AdobeSign -.->|implements| Core
|
|
30
|
-
DropboxSign -.->|implements| Core
|
|
31
|
-
|
|
32
|
-
DocuSign -.-|requires| DS["docusign-esign"]
|
|
33
|
-
AdobeSign -.-|requires| AS["adobe-sign SDK"]
|
|
34
|
-
DropboxSign -.-|requires| DBS["@dropbox/sign"]
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
Solid lines indicate shipped implementations. Dashed lines indicate provider entry points prepared for implementation. Each provider SDK is an **optional peer dependency** — install only the one you need.
|
|
38
|
-
|
|
39
|
-
---
|
|
40
|
-
|
|
41
|
-
## Quick Start
|
|
42
|
-
|
|
43
|
-
### 1. Register with the internal provider
|
|
44
|
-
|
|
45
|
-
```typescript
|
|
46
|
-
import { Module } from '@nestjs/common';
|
|
47
|
-
import { EsigningModule, InternalEsigningProvider } from '@breadstone/archipel-platform-esigning';
|
|
48
|
-
|
|
49
|
-
@Module({
|
|
50
|
-
imports: [
|
|
51
|
-
EsigningModule.register({
|
|
52
|
-
provider: InternalEsigningProvider,
|
|
53
|
-
}),
|
|
54
|
-
],
|
|
55
|
-
})
|
|
56
|
-
export class AppModule {}
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
### 2. Register with an external provider
|
|
60
|
-
|
|
61
|
-
```typescript
|
|
62
|
-
import { Module } from '@nestjs/common';
|
|
63
|
-
import { EsigningModule } from '@breadstone/archipel-platform-esigning';
|
|
64
|
-
import { DOCUSIGN_CONFIG_ENTRIES } from '@breadstone/archipel-platform-esigning/docusign';
|
|
65
|
-
|
|
66
|
-
@Module({
|
|
67
|
-
imports: [
|
|
68
|
-
EsigningModule.register({
|
|
69
|
-
provider: DocuSignClient, // your EsigningClientPort implementation
|
|
70
|
-
configEntries: DOCUSIGN_CONFIG_ENTRIES,
|
|
71
|
-
persistence: PrismaEsigningAdapter, // optional
|
|
72
|
-
isGlobal: false,
|
|
73
|
-
}),
|
|
74
|
-
],
|
|
75
|
-
})
|
|
76
|
-
export class AppModule {}
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
### Switching providers
|
|
80
|
-
|
|
81
|
-
Replace the imports — no other code change needed:
|
|
82
|
-
|
|
83
|
-
```typescript
|
|
84
|
-
import { ADOBE_SIGN_CONFIG_ENTRIES } from '@breadstone/archipel-platform-esigning/adobe-sign';
|
|
85
|
-
|
|
86
|
-
EsigningModule.register({
|
|
87
|
-
provider: AdobeSignClient,
|
|
88
|
-
configEntries: ADOBE_SIGN_CONFIG_ENTRIES,
|
|
89
|
-
});
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
---
|
|
93
|
-
|
|
94
|
-
## Module Configuration
|
|
95
|
-
|
|
96
|
-
### IEsigningModuleOptions
|
|
97
|
-
|
|
98
|
-
| Property | Type | Required | Default | Description |
|
|
99
|
-
| --------------- | ----------------------------------------------------- | -------- | ------- | --------------------------------------------------------- |
|
|
100
|
-
| `provider` | `Type<EsigningClientPort>` | **Yes** | — | Provider implementation (e.g. `InternalEsigningProvider`) |
|
|
101
|
-
| `configEntries` | `ReadonlyArray<Omit<IConfigRegistryEntry, 'module'>>` | No | `[]` | Provider-specific config entries |
|
|
102
|
-
| `persistence` | `Type<EsigningPersistencePort>` | No | — | Signing request state tracking (e.g. Prisma adapter) |
|
|
103
|
-
| `isGlobal` | `boolean` | No | `false` | Register as a global module |
|
|
104
|
-
|
|
105
|
-
---
|
|
106
|
-
|
|
107
|
-
## E-Signing Providers
|
|
108
|
-
|
|
109
|
-
### Internal (built-in)
|
|
110
|
-
|
|
111
|
-
The `InternalEsigningProvider` manages signing requests in-memory. Suitable for development, testing, or simple self-managed signing workflows.
|
|
112
|
-
|
|
113
|
-
> **Capacity limit:** The internal provider enforces a maximum of **10,000** stored signing requests. Attempts to create beyond this limit throw an error. Use an external provider for production workloads.
|
|
114
|
-
|
|
115
|
-
```typescript
|
|
116
|
-
import { InternalEsigningProvider } from '@breadstone/archipel-platform-esigning';
|
|
117
|
-
|
|
118
|
-
EsigningModule.register({
|
|
119
|
-
provider: InternalEsigningProvider,
|
|
120
|
-
});
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
::: tip Internal Provider
|
|
124
|
-
The internal provider also exposes a `completeSigner()` method that allows the consuming application to programmatically complete a signer's step — useful for self-hosted signing UIs.
|
|
125
|
-
:::
|
|
126
|
-
|
|
127
|
-
### DocuSign
|
|
128
|
-
|
|
129
|
-
**Subpath:** `@breadstone/archipel-platform-esigning/docusign`
|
|
130
|
-
|
|
131
|
-
| Variable | Description | Required |
|
|
132
|
-
| --------------------------- | ---------------------------------------------------- | -------- |
|
|
133
|
-
| `DOCUSIGN_INTEGRATION_KEY` | DocuSign integration key (client ID) | Yes |
|
|
134
|
-
| `DOCUSIGN_SECRET_KEY` | DocuSign secret key (client secret) | Yes |
|
|
135
|
-
| `DOCUSIGN_ACCOUNT_ID` | DocuSign account ID | Yes |
|
|
136
|
-
| `DOCUSIGN_BASE_URL` | DocuSign base URL (e.g. `https://demo.docusign.net`) | Yes |
|
|
137
|
-
| `DOCUSIGN_WEBHOOK_HMAC_KEY` | DocuSign webhook HMAC key | No |
|
|
138
|
-
|
|
139
|
-
```typescript
|
|
140
|
-
import { DOCUSIGN_CONFIG_ENTRIES } from '@breadstone/archipel-platform-esigning/docusign';
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
### Adobe Sign
|
|
144
|
-
|
|
145
|
-
**Subpath:** `@breadstone/archipel-platform-esigning/adobe-sign`
|
|
146
|
-
|
|
147
|
-
| Variable | Description | Required |
|
|
148
|
-
| ------------------------------ | --------------------------------------------- | -------- |
|
|
149
|
-
| `ADOBE_SIGN_INTEGRATION_KEY` | Adobe Sign integration key | Yes |
|
|
150
|
-
| `ADOBE_SIGN_CLIENT_SECRET` | Adobe Sign client secret | Yes |
|
|
151
|
-
| `ADOBE_SIGN_BASE_URL` | Adobe Sign base URL | Yes |
|
|
152
|
-
| `ADOBE_SIGN_WEBHOOK_CLIENT_ID` | Adobe Sign webhook client ID for verification | Yes |
|
|
153
|
-
|
|
154
|
-
```typescript
|
|
155
|
-
import { ADOBE_SIGN_CONFIG_ENTRIES } from '@breadstone/archipel-platform-esigning/adobe-sign';
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
### Dropbox Sign
|
|
159
|
-
|
|
160
|
-
**Subpath:** `@breadstone/archipel-platform-esigning/dropbox-sign`
|
|
161
|
-
|
|
162
|
-
| Variable | Description | Required |
|
|
163
|
-
| ----------------------------- | --------------------------- | -------- |
|
|
164
|
-
| `DROPBOX_SIGN_API_KEY` | Dropbox Sign API key | Yes |
|
|
165
|
-
| `DROPBOX_SIGN_CLIENT_ID` | Dropbox Sign client ID | Yes |
|
|
166
|
-
| `DROPBOX_SIGN_WEBHOOK_SECRET` | Dropbox Sign webhook secret | No |
|
|
167
|
-
|
|
168
|
-
```typescript
|
|
169
|
-
import { DROPBOX_SIGN_CONFIG_ENTRIES } from '@breadstone/archipel-platform-esigning/dropbox-sign';
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
---
|
|
173
|
-
|
|
174
|
-
## EsigningClientPort
|
|
175
|
-
|
|
176
|
-
All providers implement this abstract contract. Inject `EsigningClientPort` in services to stay provider-agnostic:
|
|
177
|
-
|
|
178
|
-
```typescript
|
|
179
|
-
abstract class EsigningClientPort {
|
|
180
|
-
abstract readonly providerId: string;
|
|
181
|
-
abstract createSigningRequest(request: ICreateSigningRequest): Promise<ISigningRequest>;
|
|
182
|
-
abstract createSigningSession(request: ICreateSigningSessionRequest): Promise<ISigningSession>;
|
|
183
|
-
abstract getSigningRequest(signingRequestId: string): Promise<ISigningRequest>;
|
|
184
|
-
abstract getSignedDocuments(signingRequestId: string): Promise<Array<ISignedDocument>>;
|
|
185
|
-
abstract cancelSigningRequest(signingRequestId: string, reason?: string): Promise<void>;
|
|
186
|
-
abstract verifyWebhook(
|
|
187
|
-
payload: string | Buffer,
|
|
188
|
-
signature: string,
|
|
189
|
-
headers?: Record<string, string>,
|
|
190
|
-
): Promise<IEsigningWebhookEvent>;
|
|
191
|
-
}
|
|
192
|
-
```
|
|
193
|
-
|
|
194
|
-
### Usage in services
|
|
195
|
-
|
|
196
|
-
```typescript
|
|
197
|
-
import { EsigningClientPort } from '@breadstone/archipel-platform-esigning';
|
|
198
|
-
|
|
199
|
-
@Injectable()
|
|
200
|
-
export class ContractService {
|
|
201
|
-
constructor(private readonly _esigning: EsigningClientPort) {}
|
|
202
|
-
|
|
203
|
-
public async sendForSigning(contract: Contract): Promise<string> {
|
|
204
|
-
const signingRequest = await this._esigning.createSigningRequest({
|
|
205
|
-
subject: `Contract: ${contract.title}`,
|
|
206
|
-
documents: [
|
|
207
|
-
{
|
|
208
|
-
name: 'contract.pdf',
|
|
209
|
-
contentType: 'application/pdf',
|
|
210
|
-
content: contract.pdfBuffer,
|
|
211
|
-
order: 1,
|
|
212
|
-
},
|
|
213
|
-
],
|
|
214
|
-
signers: [
|
|
215
|
-
{
|
|
216
|
-
email: contract.signerEmail,
|
|
217
|
-
name: contract.signerName,
|
|
218
|
-
role: 'signer',
|
|
219
|
-
order: 1,
|
|
220
|
-
},
|
|
221
|
-
],
|
|
222
|
-
});
|
|
223
|
-
return signingRequest.signingRequestId;
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
```
|
|
227
|
-
|
|
228
|
-
### Create Signing Request
|
|
229
|
-
|
|
230
|
-
```typescript
|
|
231
|
-
const signingRequest = await this._esigning.createSigningRequest({
|
|
232
|
-
subject: 'NDA Agreement',
|
|
233
|
-
message: 'Please sign this NDA at your earliest convenience.',
|
|
234
|
-
documents: [{ name: 'nda.pdf', contentType: 'application/pdf', content: pdfBuffer, order: 1 }],
|
|
235
|
-
signers: [{ email: 'alice@example.com', name: 'Alice', role: 'signer', order: 1 }],
|
|
236
|
-
fields: [
|
|
237
|
-
{
|
|
238
|
-
type: 'signature',
|
|
239
|
-
signerId: '...', // resolved after creation
|
|
240
|
-
documentId: '...',
|
|
241
|
-
pageNumber: 1,
|
|
242
|
-
positionX: 100,
|
|
243
|
-
positionY: 500,
|
|
244
|
-
width: 200,
|
|
245
|
-
height: 50,
|
|
246
|
-
required: true,
|
|
247
|
-
},
|
|
248
|
-
],
|
|
249
|
-
expiresInHours: 72,
|
|
250
|
-
});
|
|
251
|
-
// → ISigningRequest
|
|
252
|
-
```
|
|
253
|
-
|
|
254
|
-
### Create Signing Session
|
|
255
|
-
|
|
256
|
-
```typescript
|
|
257
|
-
const session = await this._esigning.createSigningSession({
|
|
258
|
-
signingRequestId: 'sr_abc123',
|
|
259
|
-
signerId: 'sgn_xyz789',
|
|
260
|
-
returnUrl: 'https://app.example.com/signing/complete',
|
|
261
|
-
});
|
|
262
|
-
// → ISigningSession { signingUrl, expiresAt, ... }
|
|
263
|
-
```
|
|
264
|
-
|
|
265
|
-
### Get Signing Request Status
|
|
266
|
-
|
|
267
|
-
```typescript
|
|
268
|
-
const request = await this._esigning.getSigningRequest('sr_abc123');
|
|
269
|
-
// → ISigningRequest { status, signers, documents, ... }
|
|
270
|
-
```
|
|
271
|
-
|
|
272
|
-
### Get Signed Documents
|
|
273
|
-
|
|
274
|
-
```typescript
|
|
275
|
-
const documents = await this._esigning.getSignedDocuments('sr_abc123');
|
|
276
|
-
// → ISignedDocument[] { documentId, content, contentType, sizeInBytes, ... }
|
|
277
|
-
```
|
|
278
|
-
|
|
279
|
-
### Cancel Signing Request
|
|
280
|
-
|
|
281
|
-
```typescript
|
|
282
|
-
await this._esigning.cancelSigningRequest('sr_abc123', 'Contract terms changed.');
|
|
283
|
-
```
|
|
284
|
-
|
|
285
|
-
### Verify Webhook
|
|
286
|
-
|
|
287
|
-
```typescript
|
|
288
|
-
const event = await this._esigning.verifyWebhook(rawBody, signatureHeader, request.headers);
|
|
289
|
-
// → IEsigningWebhookEvent { eventType, signingRequestId, ... }
|
|
290
|
-
// The optional third parameter passes HTTP headers for timestamp/nonce validation
|
|
291
|
-
```
|
|
292
|
-
|
|
293
|
-
---
|
|
294
|
-
|
|
295
|
-
## EsigningService
|
|
296
|
-
|
|
297
|
-
The `EsigningService` wraps `EsigningClientPort` and adds optional persistence tracking via `EsigningPersistencePort`:
|
|
298
|
-
|
|
299
|
-
```typescript
|
|
300
|
-
import { EsigningService } from '@breadstone/archipel-platform-esigning';
|
|
301
|
-
|
|
302
|
-
@Injectable()
|
|
303
|
-
export class ContractWorkflowService {
|
|
304
|
-
constructor(private readonly _esigning: EsigningService) {}
|
|
305
|
-
|
|
306
|
-
public async initiateSigningFlow(contractId: string): Promise<ISigningRequest> {
|
|
307
|
-
// Automatically persists via EsigningPersistencePort (if registered)
|
|
308
|
-
return this._esigning.createSigningRequest({ ... });
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
```
|
|
312
|
-
|
|
313
|
-
All methods on `EsigningService` mirror `EsigningClientPort` and additionally invoke the persistence port when registered:
|
|
314
|
-
|
|
315
|
-
| Method | Persistence Hook |
|
|
316
|
-
| ---------------------- | --------------------------------- |
|
|
317
|
-
| `createSigningRequest` | `onSigningRequestCreated()` |
|
|
318
|
-
| `cancelSigningRequest` | `onSigningRequestCancelled()` |
|
|
319
|
-
| `verifyWebhook` | `onSigningRequestStatusChanged()` |
|
|
320
|
-
| `createSigningSession` | — |
|
|
321
|
-
| `getSigningRequest` | — |
|
|
322
|
-
| `getSignedDocuments` | — |
|
|
323
|
-
|
|
324
|
-
---
|
|
325
|
-
|
|
326
|
-
## Ports (Contracts)
|
|
327
|
-
|
|
328
|
-
### EsigningPersistencePort
|
|
329
|
-
|
|
330
|
-
Tracks signing request state changes. Optional — when not provided, signing still works but state is not persisted.
|
|
331
|
-
|
|
332
|
-
```typescript
|
|
333
|
-
abstract class EsigningPersistencePort {
|
|
334
|
-
abstract onSigningRequestCreated(signingRequest: ISigningRequest): Promise<void>;
|
|
335
|
-
abstract onSigningRequestStatusChanged(signingRequestId: string, status: string): Promise<void>;
|
|
336
|
-
abstract onSigningRequestCancelled(signingRequestId: string): Promise<void>;
|
|
337
|
-
}
|
|
338
|
-
```
|
|
339
|
-
|
|
340
|
-
### Real-World Adapter: Prisma
|
|
341
|
-
|
|
342
|
-
```typescript
|
|
343
|
-
@Injectable()
|
|
344
|
-
export class PrismaEsigningAdapter extends EsigningPersistencePort {
|
|
345
|
-
private readonly _prisma: PrismaService;
|
|
346
|
-
|
|
347
|
-
constructor(prisma: PrismaService) {
|
|
348
|
-
super();
|
|
349
|
-
this._prisma = prisma;
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
public async onSigningRequestCreated(signingRequest: ISigningRequest): Promise<void> {
|
|
353
|
-
await this._prisma.signingRequest.create({
|
|
354
|
-
data: {
|
|
355
|
-
externalId: signingRequest.signingRequestId,
|
|
356
|
-
provider: 'docusign',
|
|
357
|
-
subject: signingRequest.subject,
|
|
358
|
-
status: signingRequest.status,
|
|
359
|
-
createdAt: signingRequest.createdAt,
|
|
360
|
-
},
|
|
361
|
-
});
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
public async onSigningRequestStatusChanged(signingRequestId: string, status: string): Promise<void> {
|
|
365
|
-
await this._prisma.signingRequest.update({
|
|
366
|
-
where: { externalId: signingRequestId },
|
|
367
|
-
data: { status, updatedAt: new Date() },
|
|
368
|
-
});
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
public async onSigningRequestCancelled(signingRequestId: string): Promise<void> {
|
|
372
|
-
await this._prisma.signingRequest.update({
|
|
373
|
-
where: { externalId: signingRequestId },
|
|
374
|
-
data: { status: 'cancelled', cancelledAt: new Date() },
|
|
375
|
-
});
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
```
|
|
379
|
-
|
|
380
|
-
---
|
|
381
|
-
|
|
382
|
-
## Normalized Types
|
|
383
|
-
|
|
384
|
-
All providers map their native API responses into these shared interfaces.
|
|
385
|
-
|
|
386
|
-
### ISigningRequest
|
|
387
|
-
|
|
388
|
-
| Field | Type | Description |
|
|
389
|
-
| ------------------ | --------------------------------- | -------------------------------------------- |
|
|
390
|
-
| `signingRequestId` | `string` | Provider-specific signing request identifier |
|
|
391
|
-
| `status` | `SigningRequestStatus` | Current lifecycle status |
|
|
392
|
-
| `subject` | `string` | Subject or title |
|
|
393
|
-
| `message` | `string?` | Optional message for signers |
|
|
394
|
-
| `signers` | `ReadonlyArray<ISigner>` | Participating signers |
|
|
395
|
-
| `documents` | `ReadonlyArray<ISigningDocument>` | Included documents |
|
|
396
|
-
| `fields` | `ReadonlyArray<ISigningField>` | Fields across documents |
|
|
397
|
-
| `createdAt` | `Date` | Creation timestamp |
|
|
398
|
-
| `updatedAt` | `Date` | Last update timestamp |
|
|
399
|
-
| `expiresAt` | `Date?` | Expiration timestamp |
|
|
400
|
-
| `providerMetadata` | `Record<string, unknown>?` | Provider-specific raw metadata |
|
|
401
|
-
|
|
402
|
-
### ISigner
|
|
403
|
-
|
|
404
|
-
| Field | Type | Description |
|
|
405
|
-
| ---------- | -------------- | ----------------------------------- |
|
|
406
|
-
| `signerId` | `string` | Provider-specific signer identifier |
|
|
407
|
-
| `email` | `string` | Email address |
|
|
408
|
-
| `name` | `string` | Display name |
|
|
409
|
-
| `role` | `SignerRole` | Role in the signing process |
|
|
410
|
-
| `status` | `SignerStatus` | Current status |
|
|
411
|
-
| `order` | `number` | Routing order (signing sequence) |
|
|
412
|
-
|
|
413
|
-
### ISigningDocument
|
|
414
|
-
|
|
415
|
-
| Field | Type | Description |
|
|
416
|
-
| ------------- | --------- | ------------------------------------- |
|
|
417
|
-
| `documentId` | `string` | Provider-specific document identifier |
|
|
418
|
-
| `name` | `string` | Display name |
|
|
419
|
-
| `contentType` | `string` | MIME type |
|
|
420
|
-
| `sizeInBytes` | `number?` | File size in bytes |
|
|
421
|
-
| `pageCount` | `number?` | Number of pages |
|
|
422
|
-
| `order` | `number` | Order within the signing request |
|
|
423
|
-
|
|
424
|
-
### ISigningField
|
|
425
|
-
|
|
426
|
-
| Field | Type | Description |
|
|
427
|
-
| ------------ | ------------------ | -------------------------------------- |
|
|
428
|
-
| `fieldId` | `string` | Provider-specific field identifier |
|
|
429
|
-
| `type` | `SigningFieldType` | Field type (signature, initials, etc.) |
|
|
430
|
-
| `signerId` | `string` | Associated signer identifier |
|
|
431
|
-
| `documentId` | `string` | Document this field is placed on |
|
|
432
|
-
| `pageNumber` | `number` | Page number (1-based) |
|
|
433
|
-
| `positionX` | `number` | X-coordinate in points |
|
|
434
|
-
| `positionY` | `number` | Y-coordinate in points |
|
|
435
|
-
| `width` | `number` | Width in points |
|
|
436
|
-
| `height` | `number` | Height in points |
|
|
437
|
-
| `required` | `boolean` | Whether the field is required |
|
|
438
|
-
| `value` | `string?` | Current value, if filled |
|
|
439
|
-
|
|
440
|
-
### ISignedDocument
|
|
441
|
-
|
|
442
|
-
| Field | Type | Description |
|
|
443
|
-
| ------------------ | -------- | ----------------------------- |
|
|
444
|
-
| `documentId` | `string` | Provider-specific document ID |
|
|
445
|
-
| `signingRequestId` | `string` | Parent signing request ID |
|
|
446
|
-
| `name` | `string` | Display name |
|
|
447
|
-
| `contentType` | `string` | MIME type |
|
|
448
|
-
| `content` | `Buffer` | Signed document content |
|
|
449
|
-
| `sizeInBytes` | `number` | File size in bytes |
|
|
450
|
-
|
|
451
|
-
### ISigningSession
|
|
452
|
-
|
|
453
|
-
| Field | Type | Description |
|
|
454
|
-
| ------------------ | -------- | ------------------------------ |
|
|
455
|
-
| `sessionId` | `string` | Session identifier |
|
|
456
|
-
| `signingRequestId` | `string` | Parent signing request ID |
|
|
457
|
-
| `signerId` | `string` | Signer this session belongs to |
|
|
458
|
-
| `signingUrl` | `string` | URL to redirect signer to |
|
|
459
|
-
| `expiresAt` | `Date` | Session expiration timestamp |
|
|
460
|
-
|
|
461
|
-
### IEsigningWebhookEvent
|
|
462
|
-
|
|
463
|
-
| Field | Type | Description |
|
|
464
|
-
| ------------------ | ------------------ | --------------------------------- |
|
|
465
|
-
| `eventId` | `string` | Provider-specific event ID |
|
|
466
|
-
| `eventType` | `WebhookEventType` | Normalized event type |
|
|
467
|
-
| `signingRequestId` | `string` | Related signing request ID |
|
|
468
|
-
| `signerId` | `string?` | Related signer ID (if applicable) |
|
|
469
|
-
| `occurredAt` | `Date` | Event timestamp |
|
|
470
|
-
| `rawPayload` | `unknown` | Provider-specific raw payload |
|
|
471
|
-
|
|
472
|
-
---
|
|
473
|
-
|
|
474
|
-
## Status & Role Enums
|
|
475
|
-
|
|
476
|
-
### SigningRequestStatus
|
|
477
|
-
|
|
478
|
-
```typescript
|
|
479
|
-
const SigningRequestStatuses = {
|
|
480
|
-
Draft: 'draft',
|
|
481
|
-
Sent: 'sent',
|
|
482
|
-
InProgress: 'in-progress',
|
|
483
|
-
Completed: 'completed',
|
|
484
|
-
Declined: 'declined',
|
|
485
|
-
Cancelled: 'cancelled',
|
|
486
|
-
Expired: 'expired',
|
|
487
|
-
Voided: 'voided',
|
|
488
|
-
} as const;
|
|
489
|
-
|
|
490
|
-
type SigningRequestStatus =
|
|
491
|
-
| 'draft'
|
|
492
|
-
| 'sent'
|
|
493
|
-
| 'in-progress'
|
|
494
|
-
| 'completed'
|
|
495
|
-
| 'declined'
|
|
496
|
-
| 'cancelled'
|
|
497
|
-
| 'expired'
|
|
498
|
-
| 'voided';
|
|
499
|
-
```
|
|
500
|
-
|
|
501
|
-
### SignerStatus
|
|
502
|
-
|
|
503
|
-
```typescript
|
|
504
|
-
const SignerStatuses = {
|
|
505
|
-
Pending: 'pending',
|
|
506
|
-
Sent: 'sent',
|
|
507
|
-
Delivered: 'delivered',
|
|
508
|
-
Signed: 'signed',
|
|
509
|
-
Declined: 'declined',
|
|
510
|
-
Expired: 'expired',
|
|
511
|
-
} as const;
|
|
512
|
-
|
|
513
|
-
type SignerStatus = 'pending' | 'sent' | 'delivered' | 'signed' | 'declined' | 'expired';
|
|
514
|
-
```
|
|
515
|
-
|
|
516
|
-
### SignerRole
|
|
517
|
-
|
|
518
|
-
```typescript
|
|
519
|
-
const SignerRoles = {
|
|
520
|
-
Signer: 'signer',
|
|
521
|
-
CarbonCopy: 'carbon-copy',
|
|
522
|
-
InPersonSigner: 'in-person-signer',
|
|
523
|
-
Approver: 'approver',
|
|
524
|
-
Witness: 'witness',
|
|
525
|
-
} as const;
|
|
526
|
-
|
|
527
|
-
type SignerRole = 'signer' | 'carbon-copy' | 'in-person-signer' | 'approver' | 'witness';
|
|
528
|
-
```
|
|
529
|
-
|
|
530
|
-
### SigningFieldType
|
|
531
|
-
|
|
532
|
-
```typescript
|
|
533
|
-
const SigningFieldTypes = {
|
|
534
|
-
Signature: 'signature',
|
|
535
|
-
Initials: 'initials',
|
|
536
|
-
DateSigned: 'date-signed',
|
|
537
|
-
Text: 'text',
|
|
538
|
-
Checkbox: 'checkbox',
|
|
539
|
-
Name: 'name',
|
|
540
|
-
Email: 'email',
|
|
541
|
-
Company: 'company',
|
|
542
|
-
Title: 'title',
|
|
543
|
-
} as const;
|
|
544
|
-
|
|
545
|
-
type SigningFieldType =
|
|
546
|
-
| 'signature'
|
|
547
|
-
| 'initials'
|
|
548
|
-
| 'date-signed'
|
|
549
|
-
| 'text'
|
|
550
|
-
| 'checkbox'
|
|
551
|
-
| 'name'
|
|
552
|
-
| 'email'
|
|
553
|
-
| 'company'
|
|
554
|
-
| 'title';
|
|
555
|
-
```
|
|
556
|
-
|
|
557
|
-
### WebhookEventType
|
|
558
|
-
|
|
559
|
-
```typescript
|
|
560
|
-
const WebhookEventTypes = {
|
|
561
|
-
SigningRequestCompleted: 'signing-request.completed',
|
|
562
|
-
SigningRequestDeclined: 'signing-request.declined',
|
|
563
|
-
SigningRequestVoided: 'signing-request.voided',
|
|
564
|
-
SigningRequestExpired: 'signing-request.expired',
|
|
565
|
-
SigningRequestSent: 'signing-request.sent',
|
|
566
|
-
SignerCompleted: 'signer.completed',
|
|
567
|
-
SignerDeclined: 'signer.declined',
|
|
568
|
-
SignerSent: 'signer.sent',
|
|
569
|
-
SignerDelivered: 'signer.delivered',
|
|
570
|
-
} as const;
|
|
571
|
-
```
|
|
572
|
-
|
|
573
|
-
---
|
|
574
|
-
|
|
575
|
-
## Error Classes
|
|
576
|
-
|
|
577
|
-
| Error | Code | Description |
|
|
578
|
-
| ----------------------------- | ----------------------------- | ------------------------------------- |
|
|
579
|
-
| `EsigningError` | Custom `code` property | Base error for all e-signing failures |
|
|
580
|
-
| `SigningProviderError` | `SIGNING_PROVIDER_ERROR` | Provider-level operation failed |
|
|
581
|
-
| `SigningRequestNotFoundError` | `SIGNING_REQUEST_NOT_FOUND` | Signing request not found |
|
|
582
|
-
| `WebhookVerificationError` | `WEBHOOK_VERIFICATION_FAILED` | Webhook signature verification failed |
|
|
583
|
-
|
|
584
|
-
```typescript
|
|
585
|
-
import {
|
|
586
|
-
EsigningError,
|
|
587
|
-
SigningProviderError,
|
|
588
|
-
SigningRequestNotFoundError,
|
|
589
|
-
WebhookVerificationError,
|
|
590
|
-
} from '@breadstone/archipel-platform-esigning';
|
|
591
|
-
```
|
|
592
|
-
|
|
593
|
-
---
|
|
594
|
-
|
|
595
|
-
## Implementing a Custom Provider
|
|
596
|
-
|
|
597
|
-
To implement a new e-signing provider, extend `EsigningClientPort`:
|
|
598
|
-
|
|
599
|
-
```typescript
|
|
600
|
-
import { Injectable } from '@nestjs/common';
|
|
601
|
-
import { EsigningClientPort } from '@breadstone/archipel-platform-esigning';
|
|
602
|
-
import type {
|
|
603
|
-
ICreateSigningRequest,
|
|
604
|
-
ICreateSigningSessionRequest,
|
|
605
|
-
IEsigningWebhookEvent,
|
|
606
|
-
ISignedDocument,
|
|
607
|
-
ISigningRequest,
|
|
608
|
-
ISigningSession,
|
|
609
|
-
} from '@breadstone/archipel-platform-esigning';
|
|
610
|
-
|
|
611
|
-
@Injectable()
|
|
612
|
-
export class DocuSignClient extends EsigningClientPort {
|
|
613
|
-
public readonly providerId = 'docusign';
|
|
614
|
-
|
|
615
|
-
public async createSigningRequest(request: ICreateSigningRequest): Promise<ISigningRequest> {
|
|
616
|
-
// DocuSign eSignature REST API implementation
|
|
617
|
-
}
|
|
618
|
-
|
|
619
|
-
public async createSigningSession(request: ICreateSigningSessionRequest): Promise<ISigningSession> {
|
|
620
|
-
// Create recipient view URL
|
|
621
|
-
}
|
|
622
|
-
|
|
623
|
-
public async getSigningRequest(signingRequestId: string): Promise<ISigningRequest> {
|
|
624
|
-
// Get envelope status
|
|
625
|
-
}
|
|
626
|
-
|
|
627
|
-
public async getSignedDocuments(signingRequestId: string): Promise<Array<ISignedDocument>> {
|
|
628
|
-
// Download completed documents
|
|
629
|
-
}
|
|
630
|
-
|
|
631
|
-
public async cancelSigningRequest(signingRequestId: string, reason?: string): Promise<void> {
|
|
632
|
-
// Void envelope
|
|
633
|
-
}
|
|
634
|
-
|
|
635
|
-
public async verifyWebhook(
|
|
636
|
-
payload: string | Buffer,
|
|
637
|
-
signature: string,
|
|
638
|
-
headers?: Record<string, string>,
|
|
639
|
-
): Promise<IEsigningWebhookEvent> {
|
|
640
|
-
// Verify HMAC and normalize Connect event
|
|
641
|
-
// Use headers for timestamp/nonce validation if required by the provider
|
|
642
|
-
}
|
|
643
|
-
}
|
|
644
|
-
|
|
645
|
-
// Register
|
|
646
|
-
EsigningModule.register({
|
|
647
|
-
provider: DocuSignClient,
|
|
648
|
-
configEntries: DOCUSIGN_CONFIG_ENTRIES,
|
|
649
|
-
});
|
|
650
|
-
```
|
|
651
|
-
|
|
652
|
-
---
|
|
653
|
-
|
|
654
|
-
## Health Check
|
|
655
|
-
|
|
656
|
-
The `EsigningHealthIndicator` verifies that an `EsigningClientPort` is injected. If no e-signing client is registered, it reports `disabled: true`. Import it from the `/health` subpath:
|
|
657
|
-
|
|
658
|
-
```typescript
|
|
659
|
-
import { EsigningHealthIndicator } from '@breadstone/archipel-platform-esigning/health';
|
|
660
|
-
import { HealthModule } from '@breadstone/archipel-platform-health';
|
|
661
|
-
|
|
662
|
-
@Module({
|
|
663
|
-
imports: [
|
|
664
|
-
EsigningModule.register({ /* ... */ }),
|
|
665
|
-
HealthModule.withIndicators([EsigningHealthIndicator]),
|
|
666
|
-
],
|
|
667
|
-
})
|
|
668
|
-
export class AppModule {}
|
|
669
|
-
```
|
|
670
|
-
|
|
671
|
-
| Key | Check | Dependencies |
|
|
672
|
-
| --- | ----- | ------------ |
|
|
673
|
-
| `esigning` | `up` if `EsigningClientPort` injected, else `disabled` | `@Optional() EsigningClientPort` |
|
|
674
|
-
|
|
675
|
-
---
|
|
676
|
-
|
|
677
|
-
## Exports Summary
|
|
678
|
-
|
|
679
|
-
| Export | Type | Description |
|
|
680
|
-
| ------------------------------ | ------------- | --------------------------------------------------- |
|
|
681
|
-
| `EsigningModule` | NestJS Module | Main module with `register()` |
|
|
682
|
-
| `EsigningService` | Service | Application service wrapping provider + persistence |
|
|
683
|
-
| `EsigningClientPort` | Port | Abstract provider contract |
|
|
684
|
-
| `EsigningPersistencePort` | Port | Optional state tracking contract |
|
|
685
|
-
| `InternalEsigningProvider` | Provider | Built-in in-memory implementation |
|
|
686
|
-
| `IEsigningModuleOptions` | Interface | Module configuration options |
|
|
687
|
-
| `ISigningRequest` | Interface | Signing request model |
|
|
688
|
-
| `ISigningSession` | Interface | Signing session/link model |
|
|
689
|
-
| `ISignedDocument` | Interface | Signed document model |
|
|
690
|
-
| `ISigner` | Interface | Signer model |
|
|
691
|
-
| `ISigningDocument` | Interface | Document model |
|
|
692
|
-
| `ISigningField` | Interface | Field definition model |
|
|
693
|
-
| `IEsigningWebhookEvent` | Interface | Normalized webhook event |
|
|
694
|
-
| `ICreateSigningRequest` | Interface | Signing request creation input |
|
|
695
|
-
| `ICreateSigningSessionRequest` | Interface | Session creation input |
|
|
696
|
-
| `SigningRequestStatuses` | Constant | Signing request status values |
|
|
697
|
-
| `SignerStatuses` | Constant | Signer status values |
|
|
698
|
-
| `SignerRoles` | Constant | Signer role values |
|
|
699
|
-
| `SigningFieldTypes` | Constant | Signing field type values |
|
|
700
|
-
| `WebhookEventTypes` | Constant | Webhook event type values |
|
|
701
|
-
| `EsigningError` | Error | Base error class |
|
|
702
|
-
| `SigningProviderError` | Error | Provider-level error |
|
|
703
|
-
| `SigningRequestNotFoundError` | Error | Not found error |
|
|
704
|
-
| `WebhookVerificationError` | Error | Webhook verification error |
|
|
705
|
-
| `ESIGNING_PROVIDER` | Token | DI token for provider |
|
|
706
|
-
| `ESIGNING_PROVIDER_OPTIONS` | Token | DI token for provider options |
|
|
707
|
-
| `ESIGNING_API_KEY` | Config Key | Generic API key config |
|
|
708
|
-
| `ESIGNING_WEBHOOK_SECRET` | Config Key | Generic webhook secret config |
|
|
709
|
-
| `ESIGNING_API_BASE_URL` | Config Key | Generic base URL config |
|
|
710
|
-
| `EsigningHealthIndicator` | Health | E-signing readiness check (`/health` subpath) |
|