205 lines
7.7 KiB
Markdown
205 lines
7.7 KiB
Markdown
# @signature.digital/interfaces
|
||
|
||
Core TypeScript interfaces for the signature.digital contract management system. 📋
|
||
|
||
This package provides **200+ interfaces and types** covering every aspect of digital contract management – from basic contract structure to eIDAS-compliant signatures, identity verification, and legal compliance.
|
||
|
||
## Install
|
||
|
||
```bash
|
||
pnpm add @signature.digital/interfaces
|
||
```
|
||
|
||
## Usage
|
||
|
||
```typescript
|
||
import type {
|
||
IPortableContract,
|
||
IRole,
|
||
IInvolvedParty,
|
||
IParagraph,
|
||
TContractStatus,
|
||
} from '@signature.digital/interfaces';
|
||
```
|
||
|
||
## Module Structure
|
||
|
||
The package is organized into focused modules:
|
||
|
||
| Module | Description |
|
||
|--------|-------------|
|
||
| `types.ts` | Foundation type aliases (90+ types) |
|
||
| `terms.ts` | Financial, time, and obligation terms |
|
||
| `signature.ts` | Signature data structures and fields |
|
||
| `identity.ts` | Identity verification system |
|
||
| `legal.ts` | TSA timestamps, blockchain anchoring, compliance |
|
||
| `versioning.ts` | Semantic versioning and change tracking |
|
||
| `collaboration.ts` | Comments, suggestions, presence |
|
||
| `lifecycle.ts` | Status workflow, audit logs, retention |
|
||
| `attachments.ts` | Exhibits, schedules, document bundles |
|
||
| `pdf.ts` | PDF generation configuration |
|
||
| `contract.ts` | Main `IPortableContract` interface |
|
||
|
||
## Type Categories
|
||
|
||
### 📋 Contract Classification
|
||
|
||
```typescript
|
||
type TContractCategory = 'employment' | 'service' | 'sales' | 'lease' | 'license' | 'partnership' | 'confidentiality' | 'financial' | 'real_estate' | 'intellectual_property' | 'government' | 'construction' | 'healthcare' | 'insurance' | 'other';
|
||
|
||
type TContractType = 'employment_full_time' | 'employment_part_time' | 'employment_minijob' | ... | string;
|
||
|
||
type TContractStatus = 'draft' | 'internal_review' | 'legal_review' | 'negotiation' | 'pending_approval' | 'pending_signature' | 'partially_signed' | 'signed' | 'executed' | 'active' | 'suspended' | 'renewal_pending' | 'expired' | 'terminated' | 'superseded' | 'cancelled' | 'voided';
|
||
```
|
||
|
||
### ✍️ Signature Types
|
||
|
||
```typescript
|
||
type TSignatureType = 'drawn' | 'typed' | 'click' | 'digital' | 'qualified' | 'biometric';
|
||
type TSignatureLegalLevel = 'simple' | 'advanced' | 'qualified';
|
||
type TSignatureStatus = 'pending' | 'captured' | 'verified' | 'timestamped' | 'complete' | 'revoked' | 'expired';
|
||
```
|
||
|
||
### 🪪 Identity Verification
|
||
|
||
```typescript
|
||
type TIdentityVerificationMethod = 'none' | 'email' | 'sms' | 'knowledge' | 'document_upload' | 'document_nfc' | 'document_ocr' | 'biometric_facial' | 'video_ident' | 'bankid' | 'eid' | 'third_party_idp';
|
||
type TVerificationConfidence = 'none' | 'low' | 'medium' | 'high' | 'verified';
|
||
type TIdentityDocumentType = 'passport' | 'national_id' | 'drivers_license' | 'residence_permit' | 'travel_document' | 'other';
|
||
```
|
||
|
||
### 💰 Financial Types
|
||
|
||
```typescript
|
||
type TPaymentFrequency = 'one_time' | 'daily' | 'weekly' | 'bi_weekly' | 'semi_monthly' | 'monthly' | 'bi_monthly' | 'quarterly' | 'semi_annually' | 'annually' | 'on_demand' | 'upon_completion' | 'milestone_based' | 'custom';
|
||
type TPaymentMethod = 'bank_transfer' | 'sepa_direct_debit' | 'credit_card' | 'check' | 'cash' | 'paypal' | 'crypto' | 'escrow' | 'letter_of_credit' | 'other';
|
||
```
|
||
|
||
### ⏱️ Time & Duration
|
||
|
||
```typescript
|
||
type TDurationUnit = 'hours' | 'days' | 'weeks' | 'months' | 'years' | 'indefinite';
|
||
type TRenewalType = 'none' | 'manual' | 'auto_renew' | 'evergreen' | 'option_to_renew';
|
||
type TTerminationReason = 'breach_of_contract' | 'mutual_agreement' | 'convenience' | 'non_performance' | 'insolvency' | 'force_majeure' | 'regulatory_change' | 'merger_acquisition' | 'other';
|
||
```
|
||
|
||
### ⚖️ Legal Compliance
|
||
|
||
```typescript
|
||
type TTimestampMethod = 'tsa' | 'blockchain' | 'qualified_tsa';
|
||
type TBlockchainNetwork = 'bitcoin' | 'ethereum' | 'polygon' | 'arbitrum' | 'optimism' | 'hyperledger' | 'private';
|
||
type THashAlgorithm = 'SHA-256' | 'SHA-384' | 'SHA-512' | 'Keccak-256';
|
||
type TSignatureAlgorithm = 'RSA-SHA256' | 'RSA-SHA384' | 'RSA-SHA512' | 'ECDSA-P256' | 'ECDSA-P384' | 'Ed25519';
|
||
```
|
||
|
||
## Key Interfaces
|
||
|
||
### IPortableContract
|
||
|
||
The main contract interface that ties everything together:
|
||
|
||
```typescript
|
||
interface IPortableContract {
|
||
id: string;
|
||
title: string;
|
||
context: string;
|
||
metadata: IContractMetadata;
|
||
availableRoles: IRole[];
|
||
involvedParties: IInvolvedParty[];
|
||
paragraphs: IParagraph[];
|
||
variables: IVariable[];
|
||
signatureFields: ISignatureField[];
|
||
financialTerms: IFinancialTerms;
|
||
timeTerms: ITimeTerms;
|
||
obligationTerms: IObligationTerms;
|
||
priorContracts: IPriorContractReference[];
|
||
attachments: IContractAttachment[];
|
||
versionHistory: IVersionHistory;
|
||
collaborators: ICollaborator[];
|
||
commentThreads: ICommentThread[];
|
||
suggestions: ISuggestion[];
|
||
lifecycle: IDocumentLifecycle;
|
||
auditLog: IAuditLog;
|
||
pdfConfig?: IPdfGenerationConfig;
|
||
// ... timestamps, organization, integrations
|
||
}
|
||
```
|
||
|
||
### ISignature
|
||
|
||
Complete signature with data, metadata, and verification:
|
||
|
||
```typescript
|
||
interface ISignature {
|
||
id: string;
|
||
signatureType: TSignatureType;
|
||
legalLevel: TSignatureLegalLevel;
|
||
data: TSignatureData; // Discriminated union
|
||
metadata: ISignatureMetadata;
|
||
consents: IConsent[];
|
||
auditTrail: ISignatureAuditEntry[];
|
||
status: TSignatureStatus;
|
||
}
|
||
```
|
||
|
||
### IIdentityVerificationResult
|
||
|
||
Full identity verification outcome:
|
||
|
||
```typescript
|
||
interface IIdentityVerificationResult {
|
||
id: string;
|
||
status: TIdentityVerificationStatus;
|
||
confidence: TVerificationConfidence;
|
||
confidenceScore: number;
|
||
methodsAttempted: TIdentityVerificationMethod[];
|
||
verifiedIdentity?: IVerifiedIdentity;
|
||
documentVerification?: IIdentityDocument;
|
||
facialVerification?: IFacialVerification;
|
||
thirdPartyVerification?: IThirdPartyVerification;
|
||
// ... timestamps, failures, audit trail
|
||
}
|
||
```
|
||
|
||
## Factory Functions
|
||
|
||
Each module provides factory functions for creating properly initialized objects:
|
||
|
||
```typescript
|
||
import {
|
||
createEmptyContract,
|
||
createRole,
|
||
createParagraph,
|
||
createEmptyFinancialTerms,
|
||
createInitialVersion,
|
||
createCommentThread,
|
||
createDefaultPdfConfig,
|
||
// ... 30+ factory functions
|
||
} from '@signature.digital/interfaces';
|
||
```
|
||
|
||
## Dependencies
|
||
|
||
- `@tsclass/tsclass` – Business entity types (`TContact`, `IAddress`, `IPdf`, etc.)
|
||
|
||
## License and Legal Information
|
||
|
||
This repository contains open-source code licensed under the MIT License. A copy of the license can be found in the [LICENSE](../LICENSE) file.
|
||
|
||
**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
|
||
|
||
### Trademarks
|
||
|
||
This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH or third parties, and are not included within the scope of the MIT license granted herein.
|
||
|
||
Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines or the guidelines of the respective third-party owners, and any usage must be approved in writing. Third-party trademarks used herein are the property of their respective owners and used only in a descriptive manner, e.g. for an implementation of an API or similar.
|
||
|
||
### Company Information
|
||
|
||
Task Venture Capital GmbH
|
||
Registered at District Court Bremen HRB 35230 HB, Germany
|
||
|
||
For any legal inquiries or further information, please contact us via email at hello@task.vc.
|
||
|
||
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.
|