sdk

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 5, 2026 License: MIT Imports: 4 Imported by: 0

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

View Source
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.

View Source
const (
	OperationCreate  = entity.OperationCreate
	OperationRenew   = entity.OperationRenew
	OperationAmend   = entity.OperationAmend
	OperationCancel  = entity.OperationCancel
	OperationPreview = entity.OperationPreview
)

Operation type constants.

View Source
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.

View Source
const (
	RecipientStatusPending   = entity.RecipientStatusPending
	RecipientStatusSent      = entity.RecipientStatusSent
	RecipientStatusDelivered = entity.RecipientStatusDelivered
	RecipientStatusSigned    = entity.RecipientStatusSigned
	RecipientStatusDeclined  = entity.RecipientStatusDeclined
)

Recipient status constants.

View Source
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

View Source
var (
	EnvironmentProd        = entity.EnvironmentProd
	EnvironmentDev         = entity.EnvironmentDev
	ParseEnvironment       = entity.ParseEnvironment
	EnvironmentFromSandbox = entity.EnvironmentFromSandbox
)

Environment constants and helpers

View Source
var (
	NewTableValue = entity.NewTableValue
	Cell          = entity.Cell
	CellWithSpan  = entity.CellWithSpan
	EmptyCell     = entity.EmptyCell
)

Table constructors.

View Source
var (
	NewListValue   = entity.NewListValue
	ListItemValue  = entity.ListItemValue
	ListItemNested = entity.ListItemNested
)

List constructors.

View Source
var BoolValue = entity.BoolValue

BoolValue creates a boolean InjectableValue.

View Source
var DefaultDesignTokens = pdfrenderer.DefaultDesignTokens

DefaultDesignTokens returns the default design tokens for PDF rendering.

View Source
var ImageValue = entity.ImageValue

ImageValue creates an image InjectableValue.

View Source
var ListValueData = entity.ListValueData

ListValueData creates a list InjectableValue.

New creates a new Engine with default configuration.

View Source
var NewWithConfig = bootstrap.NewWithConfig

NewWithConfig creates a new Engine that loads config from the given file path.

View Source
var NumberValue = entity.NumberValue

NumberValue creates a numeric InjectableValue.

View Source
var StringValue = entity.StringValue

StringValue creates a string InjectableValue.

View Source
var TableValueData = entity.TableValueData

TableValueData creates a table InjectableValue.

View Source
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

type Engine = bootstrap.Engine

Engine is the main entry point for doc-assembly. Create with New(), register extensions, then call Run().

type Environment

type Environment = entity.Environment

Environment types

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 GroupConfig

type GroupConfig = port.GroupConfig

Registry types

type InitFunc

type InitFunc = port.InitFunc

InitFunc is called once before all injectors on each render request.

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 Injector

type Injector = port.Injector

Injector resolves injectable values during document rendering.

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 ListItem

type ListItem = entity.ListItem

ListItem represents an item in a list (can be nested).

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 ListValue

type ListValue = entity.ListValue

ListValue represents a list with items.

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 ProviderError

type ProviderError = port.ProviderError

SigningProvider types

type ProviderFormat

type ProviderFormat = port.ProviderFormat

WorkspaceInjectableProvider types

type ProviderGroup

type ProviderGroup = port.ProviderGroup

WorkspaceInjectableProvider 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 RecipientResult

type RecipientResult = port.RecipientResult

SigningProvider 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 SignatureField

type SignatureField = port.SignatureField

PDF Renderer types

type SignatureFieldPosition

type SignatureFieldPosition = port.SignatureFieldPosition

SigningProvider types

type SignerRoleValue

type SignerRoleValue = port.SignerRoleValue

PDF Renderer types

type SigningProvider

type SigningProvider = port.SigningProvider

SigningProvider handles document signing via an external provider.

type SigningRecipient

type SigningRecipient = port.SigningRecipient

SigningProvider types

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 StorageRequest

type StorageRequest = port.StorageRequest

StorageAdapter request types

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 TableCell

type TableCell = entity.TableCell

TableCell represents a single cell in a table.

type TableColumn

type TableColumn = entity.TableColumn

TableColumn defines a column in a table.

type TableRow

type TableRow = entity.TableRow

TableRow is a row of cells.

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 ValueType

type ValueType = entity.ValueType

ValueType identifies the type of an InjectableValue.

type WebhookEvent

type WebhookEvent = port.WebhookEvent

SigningProvider types

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL