|
| 1 | +--- |
| 2 | +title: Document |
| 3 | +description: Document protocol schemas |
| 4 | +--- |
| 5 | + |
| 6 | +# Document |
| 7 | + |
| 8 | +<Callout type="info"> |
| 9 | +**Source:** `packages/spec/src/data/document.zod.ts` |
| 10 | +</Callout> |
| 11 | + |
| 12 | +## TypeScript Usage |
| 13 | + |
| 14 | +```typescript |
| 15 | +import { DocumentSchema, DocumentTemplateSchema, DocumentVersionSchema, ESignatureConfigSchema } from '@objectstack/spec/data'; |
| 16 | +import type { Document, DocumentTemplate, DocumentVersion, ESignatureConfig } from '@objectstack/spec/data'; |
| 17 | + |
| 18 | +// Validate data |
| 19 | +const result = DocumentSchema.parse(data); |
| 20 | +``` |
| 21 | + |
| 22 | +--- |
| 23 | + |
| 24 | +## Document |
| 25 | + |
| 26 | +### Properties |
| 27 | + |
| 28 | +| Property | Type | Required | Description | |
| 29 | +| :--- | :--- | :--- | :--- | |
| 30 | +| **id** | `string` | ✅ | Document ID | |
| 31 | +| **name** | `string` | ✅ | Document name | |
| 32 | +| **description** | `string` | optional | Document description | |
| 33 | +| **fileType** | `string` | ✅ | File MIME type | |
| 34 | +| **fileSize** | `number` | ✅ | File size in bytes | |
| 35 | +| **category** | `string` | optional | Document category | |
| 36 | +| **tags** | `string[]` | optional | Document tags | |
| 37 | +| **versioning** | `object` | optional | Version control | |
| 38 | +| **template** | `object` | optional | Document template | |
| 39 | +| **eSignature** | `object` | optional | E-signature config | |
| 40 | +| **access** | `object` | optional | Access control | |
| 41 | +| **metadata** | `Record<string, any>` | optional | Custom metadata | |
| 42 | + |
| 43 | +--- |
| 44 | + |
| 45 | +## DocumentTemplate |
| 46 | + |
| 47 | +### Properties |
| 48 | + |
| 49 | +| Property | Type | Required | Description | |
| 50 | +| :--- | :--- | :--- | :--- | |
| 51 | +| **id** | `string` | ✅ | Template ID | |
| 52 | +| **name** | `string` | ✅ | Template name | |
| 53 | +| **description** | `string` | optional | Template description | |
| 54 | +| **fileUrl** | `string` | ✅ | Template file URL | |
| 55 | +| **fileType** | `string` | ✅ | File MIME type | |
| 56 | +| **placeholders** | `object[]` | ✅ | Template placeholders | |
| 57 | + |
| 58 | +--- |
| 59 | + |
| 60 | +## DocumentVersion |
| 61 | + |
| 62 | +### Properties |
| 63 | + |
| 64 | +| Property | Type | Required | Description | |
| 65 | +| :--- | :--- | :--- | :--- | |
| 66 | +| **versionNumber** | `number` | ✅ | Version number | |
| 67 | +| **createdAt** | `number` | ✅ | Creation timestamp | |
| 68 | +| **createdBy** | `string` | ✅ | Creator user ID | |
| 69 | +| **size** | `number` | ✅ | File size in bytes | |
| 70 | +| **checksum** | `string` | ✅ | File checksum | |
| 71 | +| **downloadUrl** | `string` | ✅ | Download URL | |
| 72 | +| **isLatest** | `boolean` | optional | Is latest version | |
| 73 | + |
| 74 | +--- |
| 75 | + |
| 76 | +## ESignatureConfig |
| 77 | + |
| 78 | +### Properties |
| 79 | + |
| 80 | +| Property | Type | Required | Description | |
| 81 | +| :--- | :--- | :--- | :--- | |
| 82 | +| **provider** | `Enum<'docusign' \| 'adobe-sign' \| 'hellosign' \| 'custom'>` | ✅ | E-signature provider | |
| 83 | +| **enabled** | `boolean` | optional | E-signature enabled | |
| 84 | +| **signers** | `object[]` | ✅ | Document signers | |
| 85 | +| **expirationDays** | `number` | optional | Expiration days | |
| 86 | +| **reminderDays** | `number` | optional | Reminder interval days | |
| 87 | + |
0 commit comments