Documentation
¶
Overview ¶
Package sdk provides the public API for doc-assembly.
Use sdk.New() to create an Engine, register extensions, and call Run():
engine := sdk.New() engine.RegisterInjector(myInjector) engine.SetMapper(myMapper) engine.Run()
For custom configuration:
engine := sdk.NewWithConfig("settings/app.yaml")
engine.Run()
Run database migrations:
engine := sdk.New() engine.RunMigrations()
Index ¶
- Constants
- Variables
- type AuthenticateRequest
- type CleanupProviderDocumentRequest
- type CleanupProviderDocumentResult
- type CompletedRecipient
- type DocumentCompletedEvent
- type DocumentCompletedHandler
- type DocumentStatus
- type Engine
- type Environment
- type FilteredWorkspaceInjectableProvider
- type FindProviderDocumentRequest
- type FormatConfig
- type GetAttemptRecipientEmbeddedURLRequest
- type GetAttemptRecipientEmbeddedURLResult
- type GetInjectablesResult
- type GetProviderDocumentStatusRequest
- type GroupConfig
- type InitFunc
- type InjectableDataType
- type InjectableValue
- type Injector
- type InjectorContext
- type InjectorResult
- type InternalTemplateContext
- type InternalTemplateContextSearchAdapter
- type InternalTemplateContextSearchParams
- type ListItem
- type ListSchema
- type ListSchemaProvider
- type ListStyles
- type ListSymbol
- type ListValue
- type MapperContext
- type NotificationAttachment
- type NotificationProvider
- type NotificationRequest
- type OperationType
- type ParseWebhookRequest
- type ProcessInfo
- type ProcessResolver
- type ProviderCapabilities
- type ProviderDocumentResult
- type ProviderDocumentStatusResult
- type ProviderError
- type ProviderFormat
- type ProviderGroup
- type ProviderInjectable
- type PublicDocumentAccessAuthenticator
- type PublicDocumentAccessClaims
- type RecipientResult
- type RecipientStatus
- type RecipientStatusResult
- type RequestMapper
- type ResolveFunc
- type ResolveInjectablesRequest
- type ResolveInjectablesResult
- type SignatureField
- type SignatureFieldPosition
- type SignerRoleValue
- type SigningProvider
- type SigningRecipient
- type SigningSessionAuthClaims
- type SigningSessionAuthenticateRequest
- type SigningSessionAuthenticator
- type StorageAdapter
- type StorageRequest
- type StorageUploadRequest
- type SubmitAttemptDocumentRequest
- type SubmitAttemptDocumentResult
- type TableCell
- type TableColumn
- type TableRow
- type TableSchemaProvider
- type TableStyles
- type TableValue
- type TemplateResolver
- type TemplateResolverRequest
- type TypstDesignTokens
- type ValueType
- type WebhookEvent
- type WebhookHandler
- type WorkspaceInjectableProvider
Constants ¶
const ( ValueTypeString = entity.ValueTypeString ValueTypeNumber = entity.ValueTypeNumber ValueTypeBool = entity.ValueTypeBool ValueTypeTime = entity.ValueTypeTime ValueTypeTable = entity.ValueTypeTable ValueTypeImage = entity.ValueTypeImage ValueTypeList = entity.ValueTypeList )
Value type constants.
const ( OperationCreate = entity.OperationCreate OperationRenew = entity.OperationRenew OperationAmend = entity.OperationAmend OperationCancel = entity.OperationCancel OperationPreview = entity.OperationPreview )
Operation type constants.
const ( DocumentStatusDraft = entity.DocumentStatusDraft DocumentStatusAwaitingInput = entity.DocumentStatusAwaitingInput DocumentStatusPreparingSignature = entity.DocumentStatusPreparingSignature DocumentStatusReadyToSign = entity.DocumentStatusReadyToSign DocumentStatusSigning = entity.DocumentStatusSigning DocumentStatusCompleted = entity.DocumentStatusCompleted DocumentStatusDeclined = entity.DocumentStatusDeclined DocumentStatusCancelled = entity.DocumentStatusCancelled DocumentStatusInvalidated = entity.DocumentStatusInvalidated DocumentStatusError = entity.DocumentStatusError )
Document status constants.
const ( RecipientStatusPending = entity.RecipientStatusPending RecipientStatusSent = entity.RecipientStatusSent RecipientStatusDelivered = entity.RecipientStatusDelivered RecipientStatusSigned = entity.RecipientStatusSigned RecipientStatusDeclined = entity.RecipientStatusDeclined )
Recipient status constants.
const SystemWorkspaceCode = "SYS_WRKSP"
SystemWorkspaceCode is the canonical code for the tenant/system workspace. Consumers should use this constant instead of hardcoding the workspace code.
Variables ¶
var ( EnvironmentProd = entity.EnvironmentProd EnvironmentDev = entity.EnvironmentDev ParseEnvironment = entity.ParseEnvironment EnvironmentFromSandbox = entity.EnvironmentFromSandbox )
Environment constants and helpers
var ( NewTableValue = entity.NewTableValue Cell = entity.Cell CellWithSpan = entity.CellWithSpan EmptyCell = entity.EmptyCell )
Table constructors.
var ( NewListValue = entity.NewListValue ListItemValue = entity.ListItemValue ListItemNested = entity.ListItemNested )
List constructors.
var BoolValue = entity.BoolValue
BoolValue creates a boolean InjectableValue.
var DefaultDesignTokens = pdfrenderer.DefaultDesignTokens
DefaultDesignTokens returns the default design tokens for PDF rendering.
var ImageValue = entity.ImageValue
ImageValue creates an image InjectableValue.
var ListValueData = entity.ListValueData
ListValueData creates a list InjectableValue.
var New = bootstrap.New
New creates a new Engine with default configuration.
var NewWithConfig = bootstrap.NewWithConfig
NewWithConfig creates a new Engine that loads config from the given file path.
var NumberValue = entity.NumberValue
NumberValue creates a numeric InjectableValue.
var StringValue = entity.StringValue
StringValue creates a string InjectableValue.
var TableValueData = entity.TableValueData
TableValueData creates a table InjectableValue.
var TimeValue = entity.TimeValue
TimeValue creates a time InjectableValue.
Functions ¶
This section is empty.
Types ¶
type AuthenticateRequest ¶
type AuthenticateRequest = port.AuthenticateRequest
PublicDocumentAccessAuthenticator request type
type CleanupProviderDocumentRequest ¶
type CleanupProviderDocumentRequest = port.CleanupProviderDocumentRequest
SigningProvider types
type CleanupProviderDocumentResult ¶
type CleanupProviderDocumentResult = port.CleanupProviderDocumentResult
SigningProvider types
type CompletedRecipient ¶
type CompletedRecipient = port.CompletedRecipient
CompletedRecipient holds signer information within a completed document event.
type DocumentCompletedEvent ¶
type DocumentCompletedEvent = port.DocumentCompletedEvent
DocumentCompletedEvent carries data about a completed document.
type DocumentCompletedHandler ¶
type DocumentCompletedHandler = port.DocumentCompletedHandler
DocumentCompletedHandler is the callback invoked when a document reaches COMPLETED status. Return an error to trigger automatic retry.
type DocumentStatus ¶
type DocumentStatus = entity.DocumentStatus
DocumentStatus represents the lifecycle state of a document.
type Engine ¶
Engine is the main entry point for doc-assembly. Create with New(), register extensions, then call Run().
type FilteredWorkspaceInjectableProvider ¶
type FilteredWorkspaceInjectableProvider = port.FilteredWorkspaceInjectableProvider
FilteredWorkspaceInjectableProvider optionally supplies only requested injectable definitions.
type FindProviderDocumentRequest ¶
type FindProviderDocumentRequest = port.FindProviderDocumentRequest
SigningProvider types
type FormatConfig ¶
type FormatConfig = entity.FormatConfig
FormatConfig controls how injectable values are formatted.
type GetAttemptRecipientEmbeddedURLRequest ¶
type GetAttemptRecipientEmbeddedURLRequest = port.GetAttemptRecipientEmbeddedURLRequest
SigningProvider types
type GetAttemptRecipientEmbeddedURLResult ¶
type GetAttemptRecipientEmbeddedURLResult = port.GetAttemptRecipientEmbeddedURLResult
SigningProvider types
type GetInjectablesResult ¶
type GetInjectablesResult = port.GetInjectablesResult
WorkspaceInjectableProvider types
type GetProviderDocumentStatusRequest ¶
type GetProviderDocumentStatusRequest = port.GetProviderDocumentStatusRequest
SigningProvider types
type InjectableDataType ¶
type InjectableDataType = entity.InjectableDataType
InjectableDataType identifies the data type of an injectable definition.
type InjectableValue ¶
type InjectableValue = entity.InjectableValue
InjectableValue wraps a typed value (string, number, table, etc.).
type InjectorContext ¶
type InjectorContext = entity.InjectorContext
InjectorContext provides context for injector execution (workspace, operation, etc.).
type InjectorResult ¶
type InjectorResult = entity.InjectorResult
InjectorResult holds the resolved value from an injector.
type InternalTemplateContext ¶
type InternalTemplateContext = port.InternalTemplateContext
InternalTemplateContext is the full context resolved for internal create.
type InternalTemplateContextSearchAdapter ¶
type InternalTemplateContextSearchAdapter = port.InternalTemplateContextSearchAdapter
InternalTemplateContextSearchAdapter exposes full context search to resolvers.
type InternalTemplateContextSearchParams ¶
type InternalTemplateContextSearchParams = port.InternalTemplateContextSearchParams
InternalTemplateContextSearchParams are filters for full context search.
type ListSchema ¶
type ListSchema = entity.ListSchema
ListSchema defines the schema for a list injectable.
type ListSchemaProvider ¶
type ListSchemaProvider = port.ListSchemaProvider
ListSchemaProvider can be implemented by Injector to expose list schema.
type ListStyles ¶
type ListStyles = entity.ListStyles
ListStyles controls list rendering appearance.
type ListSymbol ¶
type ListSymbol = entity.ListSymbol
ListSymbol identifies the bullet/number style.
type MapperContext ¶
type MapperContext = port.MapperContext
MapperContext provides request context to the mapper.
type NotificationAttachment ¶
type NotificationAttachment = port.NotificationAttachment
NotificationProvider types
type NotificationProvider ¶
type NotificationProvider = port.NotificationProvider
NotificationProvider sends notifications (email, etc.).
type NotificationRequest ¶
type NotificationRequest = port.NotificationRequest
NotificationProvider types
type OperationType ¶
type OperationType = entity.OperationType
OperationType identifies the document operation (create, renew, amend, etc.).
type ParseWebhookRequest ¶
type ParseWebhookRequest = port.ParseWebhookRequest
SigningProvider request types
type ProcessInfo ¶
type ProcessInfo = port.ProcessInfo
ProcessInfo describes a process available for a tenant.
type ProcessResolver ¶
type ProcessResolver = port.ProcessResolver
ProcessResolver provides process discovery and validation.
type ProviderCapabilities ¶
type ProviderCapabilities = port.ProviderCapabilities
SigningProvider types
type ProviderDocumentResult ¶
type ProviderDocumentResult = port.ProviderDocumentResult
SigningProvider types
type ProviderDocumentStatusResult ¶
type ProviderDocumentStatusResult = port.ProviderDocumentStatusResult
SigningProvider types
type ProviderInjectable ¶
type ProviderInjectable = port.ProviderInjectable
WorkspaceInjectableProvider types
type PublicDocumentAccessAuthenticator ¶
type PublicDocumentAccessAuthenticator = port.PublicDocumentAccessAuthenticator
PublicDocumentAccessAuthenticator provides custom auth for /public/doc/:documentId.
type PublicDocumentAccessClaims ¶
type PublicDocumentAccessClaims = port.PublicDocumentAccessClaims
PublicDocumentAccessAuthenticator types
type RecipientStatus ¶
type RecipientStatus = entity.RecipientStatus
RecipientStatus represents the signing state of a recipient.
type RecipientStatusResult ¶
type RecipientStatusResult = port.RecipientStatusResult
SigningProvider types
type RequestMapper ¶
type RequestMapper = port.RequestMapper
RequestMapper transforms incoming render requests before processing.
type ResolveFunc ¶
type ResolveFunc = port.ResolveFunc
ResolveFunc resolves a single injectable value.
type ResolveInjectablesRequest ¶
type ResolveInjectablesRequest = port.ResolveInjectablesRequest
WorkspaceInjectableProvider types
type ResolveInjectablesResult ¶
type ResolveInjectablesResult = port.ResolveInjectablesResult
WorkspaceInjectableProvider types
type SignatureFieldPosition ¶
type SignatureFieldPosition = port.SignatureFieldPosition
SigningProvider types
type SigningProvider ¶
type SigningProvider = port.SigningProvider
SigningProvider handles document signing via an external provider.
type SigningSessionAuthClaims ¶
type SigningSessionAuthClaims = port.SigningSessionAuthClaims
SigningSessionAuthenticator types
type SigningSessionAuthenticateRequest ¶
type SigningSessionAuthenticateRequest = port.SigningSessionAuthenticateRequest
SigningSessionAuthenticator request type
type SigningSessionAuthenticator ¶
type SigningSessionAuthenticator = port.SigningSessionAuthenticator
SigningSessionAuthenticator provides custom auth for /api/v1/signing-sessions/:documentId.
type StorageAdapter ¶
type StorageAdapter = port.StorageAdapter
StorageAdapter handles file storage (local, S3, etc.).
type StorageUploadRequest ¶
type StorageUploadRequest = port.StorageUploadRequest
StorageAdapter request types
type SubmitAttemptDocumentRequest ¶
type SubmitAttemptDocumentRequest = port.SubmitAttemptDocumentRequest
SigningProvider types
type SubmitAttemptDocumentResult ¶
type SubmitAttemptDocumentResult = port.SubmitAttemptDocumentResult
SigningProvider types
type TableSchemaProvider ¶
type TableSchemaProvider = port.TableSchemaProvider
TableSchemaProvider can be implemented by Injector to expose table column schema.
type TableStyles ¶
type TableStyles = entity.TableStyles
TableStyles controls table rendering appearance.
type TableValue ¶
type TableValue = entity.TableValue
TableValue represents tabular data with columns and rows.
type TemplateResolver ¶
type TemplateResolver = port.TemplateResolver
TemplateResolver allows custom internal template version selection.
type TemplateResolverRequest ¶
type TemplateResolverRequest = port.TemplateResolverRequest
TemplateResolverRequest provides context for custom template resolution.
type TypstDesignTokens ¶
type TypstDesignTokens = pdfrenderer.TypstDesignTokens
TypstDesignTokens controls fonts, colors, spacing, and heading styles in Typst PDF output.
type WebhookHandler ¶
type WebhookHandler = port.WebhookHandler
WebhookHandler parses incoming webhook events from a signing provider.
type WorkspaceInjectableProvider ¶
type WorkspaceInjectableProvider = port.WorkspaceInjectableProvider
WorkspaceInjectableProvider supplies workspace-specific injectable definitions.