-
Notifications
You must be signed in to change notification settings - Fork 1
Add Object Storage and File Attachment Protocol schemas #383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,34 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| title: Object Storage | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| description: Object Storage protocol schemas | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Object Storage | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <Callout type="info"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| **Source:** `packages/spec/src/integration/object-storage.zod.ts` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| **Source:** `packages/spec/src/integration/object-storage.zod.ts` | |
| **Source:** `packages/spec/src/system/object-storage.zod.ts` |
Copilot
AI
Jan 30, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file documents a MultipartUploadConfig schema that does not match the one defined in the actual source code. The integration layer already has a MultipartUploadConfigSchema defined in packages/spec/src/integration/connector/file-storage.zod.ts with different properties (partSize, maxConcurrentParts, threshold). This documentation file appears to be incorrectly created and should be removed, as the proper documentation for the system-level MultipartUploadConfig is already in content/docs/references/system/object-storage.mdx.
| <Callout type="info"> | |
| **Source:** `packages/spec/src/integration/object-storage.zod.ts` | |
| </Callout> | |
| ## TypeScript Usage | |
| ```typescript | |
| import { MultipartUploadConfigSchema } from '@objectstack/spec/integration'; | |
| import type { MultipartUploadConfig } from '@objectstack/spec/integration'; | |
| // Validate data | |
| const result = MultipartUploadConfigSchema.parse(data); | |
| ``` | |
| --- | |
| ## MultipartUploadConfig | |
| ### Properties | |
| | Property | Type | Required | Description | | |
| | :--- | :--- | :--- | :--- | | |
| | **enabled** | `boolean` | optional | Enable multipart uploads | | |
| | **partSize** | `number` | optional | Part size in bytes (min 5MB) | | |
| | **maxConcurrentParts** | `number` | optional | Maximum concurrent part uploads | | |
| | **threshold** | `number` | optional | File size threshold for multipart upload in bytes | | |
| <Callout type="warning"> | |
| This integration-level documentation for `MultipartUploadConfig` has been deprecated. | |
| The canonical reference for the system-level object storage configuration (including multipart uploads) is available at: | |
| - [`System / Object Storage` reference](../system/object-storage) | |
| Please refer to that page for the up-to-date schema and properties. | |
| </Callout> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,240 @@ | ||
| --- | ||
| title: Object Storage | ||
| description: Object Storage protocol schemas | ||
| --- | ||
|
|
||
| # Object Storage | ||
|
|
||
| <Callout type="info"> | ||
| **Source:** `packages/spec/src/system/object-storage.zod.ts` | ||
| </Callout> | ||
|
|
||
| ## TypeScript Usage | ||
|
|
||
| ```typescript | ||
| import { AccessControlConfigSchema, BucketConfigSchema, LifecycleActionSchema, LifecyclePolicyConfigSchema, LifecyclePolicyRuleSchema, MultipartUploadConfigSchema, ObjectMetadataSchema, ObjectStorageConfigSchema, PresignedUrlConfigSchema, StorageAclSchema, StorageClassSchema, StorageConnectionSchema, StorageProviderSchema } from '@objectstack/spec/system'; | ||
| import type { AccessControlConfig, BucketConfig, LifecycleAction, LifecyclePolicyConfig, LifecyclePolicyRule, MultipartUploadConfig, ObjectMetadata, ObjectStorageConfig, PresignedUrlConfig, StorageAcl, StorageClass, StorageConnection, StorageProvider } from '@objectstack/spec/system'; | ||
|
|
||
| // Validate data | ||
| const result = AccessControlConfigSchema.parse(data); | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## AccessControlConfig | ||
|
|
||
| ### Properties | ||
|
|
||
| | Property | Type | Required | Description | | ||
| | :--- | :--- | :--- | :--- | | ||
| | **acl** | `Enum<'private' \| 'public_read' \| 'public_read_write' \| 'authenticated_read' \| 'bucket_owner_read' \| 'bucket_owner_full_control'>` | optional | Default access control level | | ||
| | **allowedOrigins** | `string[]` | optional | CORS allowed origins | | ||
| | **allowedMethods** | `Enum<'GET' \| 'PUT' \| 'POST' \| 'DELETE' \| 'HEAD'>[]` | optional | CORS allowed HTTP methods | | ||
| | **allowedHeaders** | `string[]` | optional | CORS allowed headers | | ||
| | **exposeHeaders** | `string[]` | optional | CORS exposed headers | | ||
| | **maxAge** | `number` | optional | CORS preflight cache duration in seconds | | ||
| | **corsEnabled** | `boolean` | optional | Enable CORS configuration | | ||
| | **publicAccess** | `object` | optional | Public access control | | ||
| | **allowedIps** | `string[]` | optional | Allowed IP addresses/CIDR blocks | | ||
| | **blockedIps** | `string[]` | optional | Blocked IP addresses/CIDR blocks | | ||
|
|
||
| --- | ||
|
|
||
| ## BucketConfig | ||
|
|
||
| ### Properties | ||
|
|
||
| | Property | Type | Required | Description | | ||
| | :--- | :--- | :--- | :--- | | ||
| | **name** | `string` | ✅ | Bucket identifier in ObjectStack (snake_case) | | ||
| | **label** | `string` | ✅ | Display label | | ||
| | **bucketName** | `string` | ✅ | Actual bucket/container name in storage provider | | ||
| | **region** | `string` | optional | Storage region (e.g., us-east-1, westus) | | ||
| | **provider** | `Enum<'s3' \| 'azure_blob' \| 'gcs' \| 'minio' \| 'r2' \| 'spaces' \| 'wasabi' \| 'backblaze' \| 'local'>` | ✅ | Storage provider | | ||
| | **endpoint** | `string` | optional | Custom endpoint URL (for S3-compatible providers) | | ||
| | **pathStyle** | `boolean` | optional | Use path-style URLs (for S3-compatible providers) | | ||
| | **versioning** | `boolean` | optional | Enable object versioning | | ||
| | **encryption** | `object` | optional | Server-side encryption configuration | | ||
| | **accessControl** | `object` | optional | Access control configuration | | ||
| | **lifecyclePolicy** | `object` | optional | Lifecycle policy configuration | | ||
| | **multipartConfig** | `object` | optional | Multipart upload configuration | | ||
| | **tags** | `Record<string, string>` | optional | Bucket tags for organization | | ||
| | **description** | `string` | optional | Bucket description | | ||
| | **enabled** | `boolean` | optional | Enable this bucket | | ||
|
|
||
| --- | ||
|
|
||
| ## LifecycleAction | ||
|
|
||
| Lifecycle policy action type | ||
|
|
||
| ### Allowed Values | ||
|
|
||
| * `transition` | ||
| * `delete` | ||
| * `abort` | ||
|
|
||
| --- | ||
|
|
||
| ## LifecyclePolicyConfig | ||
|
|
||
| ### Properties | ||
|
|
||
| | Property | Type | Required | Description | | ||
| | :--- | :--- | :--- | :--- | | ||
| | **enabled** | `boolean` | optional | Enable lifecycle policies | | ||
| | **rules** | `object[]` | optional | Lifecycle rules | | ||
|
|
||
| --- | ||
|
|
||
| ## LifecyclePolicyRule | ||
|
|
||
| ### Properties | ||
|
|
||
| | Property | Type | Required | Description | | ||
| | :--- | :--- | :--- | :--- | | ||
| | **id** | `string` | ✅ | Rule identifier | | ||
| | **enabled** | `boolean` | optional | Enable this rule | | ||
| | **action** | `Enum<'transition' \| 'delete' \| 'abort'>` | ✅ | Action to perform | | ||
| | **prefix** | `string` | optional | Object key prefix filter (e.g., "uploads/") | | ||
| | **tags** | `Record<string, string>` | optional | Object tag filters | | ||
| | **daysAfterCreation** | `number` | optional | Days after object creation | | ||
| | **daysAfterModification** | `number` | optional | Days after last modification | | ||
| | **targetStorageClass** | `Enum<'standard' \| 'intelligent' \| 'infrequent_access' \| 'glacier' \| 'deep_archive'>` | optional | Target storage class for transition action | | ||
|
|
||
| --- | ||
|
|
||
| ## MultipartUploadConfig | ||
|
|
||
| ### Properties | ||
|
|
||
| | Property | Type | Required | Description | | ||
| | :--- | :--- | :--- | :--- | | ||
| | **enabled** | `boolean` | optional | Enable multipart uploads | | ||
| | **partSize** | `number` | optional | Part size in bytes (min 5MB, max 5GB) | | ||
| | **maxParts** | `number` | optional | Maximum number of parts (max 10,000) | | ||
| | **threshold** | `number` | optional | File size threshold to trigger multipart upload (bytes) | | ||
| | **maxConcurrent** | `number` | optional | Maximum concurrent part uploads | | ||
| | **abortIncompleteAfterDays** | `number` | optional | Auto-abort incomplete uploads after N days | | ||
|
|
||
| --- | ||
|
|
||
| ## ObjectMetadata | ||
|
|
||
| ### Properties | ||
|
|
||
| | Property | Type | Required | Description | | ||
| | :--- | :--- | :--- | :--- | | ||
| | **contentType** | `string` | ✅ | MIME type (e.g., image/jpeg, application/pdf) | | ||
| | **contentLength** | `number` | ✅ | File size in bytes | | ||
| | **contentEncoding** | `string` | optional | Content encoding (e.g., gzip) | | ||
| | **contentDisposition** | `string` | optional | Content disposition header | | ||
| | **contentLanguage** | `string` | optional | Content language | | ||
| | **cacheControl** | `string` | optional | Cache control directives | | ||
| | **etag** | `string` | optional | Entity tag for versioning/caching | | ||
| | **lastModified** | `string` | optional | Last modification timestamp | | ||
| | **versionId** | `string` | optional | Object version identifier | | ||
| | **storageClass** | `Enum<'standard' \| 'intelligent' \| 'infrequent_access' \| 'glacier' \| 'deep_archive'>` | optional | Storage class/tier | | ||
| | **encryption** | `object` | optional | Server-side encryption configuration | | ||
| | **custom** | `Record<string, string>` | optional | Custom user-defined metadata | | ||
|
|
||
| --- | ||
|
|
||
| ## ObjectStorageConfig | ||
|
|
||
| ### Properties | ||
|
|
||
| | Property | Type | Required | Description | | ||
| | :--- | :--- | :--- | :--- | | ||
| | **name** | `string` | ✅ | Storage configuration identifier | | ||
| | **label** | `string` | ✅ | Display label | | ||
| | **provider** | `Enum<'s3' \| 'azure_blob' \| 'gcs' \| 'minio' \| 'r2' \| 'spaces' \| 'wasabi' \| 'backblaze' \| 'local'>` | ✅ | Primary storage provider | | ||
| | **connection** | `object` | ✅ | Connection credentials | | ||
| | **buckets** | `object[]` | optional | Configured buckets | | ||
| | **defaultBucket** | `string` | optional | Default bucket name for operations | | ||
| | **enabled** | `boolean` | optional | Enable this storage configuration | | ||
| | **description** | `string` | optional | Configuration description | | ||
|
|
||
| --- | ||
|
|
||
| ## PresignedUrlConfig | ||
|
|
||
| ### Properties | ||
|
|
||
| | Property | Type | Required | Description | | ||
| | :--- | :--- | :--- | :--- | | ||
| | **operation** | `Enum<'get' \| 'put' \| 'delete' \| 'head'>` | ✅ | Allowed operation | | ||
| | **expiresIn** | `number` | ✅ | Expiration time in seconds (max 7 days) | | ||
| | **contentType** | `string` | optional | Required content type for PUT operations | | ||
| | **maxSize** | `number` | optional | Maximum file size in bytes for PUT operations | | ||
| | **responseContentType** | `string` | optional | Override content-type for GET operations | | ||
| | **responseContentDisposition** | `string` | optional | Override content-disposition for GET operations | | ||
|
|
||
| --- | ||
|
|
||
| ## StorageAcl | ||
|
|
||
| Storage access control level | ||
|
|
||
| ### Allowed Values | ||
|
|
||
| * `private` | ||
| * `public_read` | ||
| * `public_read_write` | ||
| * `authenticated_read` | ||
| * `bucket_owner_read` | ||
| * `bucket_owner_full_control` | ||
|
|
||
| --- | ||
|
|
||
| ## StorageClass | ||
|
|
||
| Storage class/tier for cost optimization | ||
|
|
||
| ### Allowed Values | ||
|
|
||
| * `standard` | ||
| * `intelligent` | ||
| * `infrequent_access` | ||
| * `glacier` | ||
| * `deep_archive` | ||
|
|
||
| --- | ||
|
|
||
| ## StorageConnection | ||
|
|
||
| ### Properties | ||
|
|
||
| | Property | Type | Required | Description | | ||
| | :--- | :--- | :--- | :--- | | ||
| | **accessKeyId** | `string` | optional | AWS access key ID or MinIO access key | | ||
| | **secretAccessKey** | `string` | optional | AWS secret access key or MinIO secret key | | ||
| | **sessionToken** | `string` | optional | AWS session token for temporary credentials | | ||
| | **accountName** | `string` | optional | Azure storage account name | | ||
| | **accountKey** | `string` | optional | Azure storage account key | | ||
| | **sasToken** | `string` | optional | Azure SAS token | | ||
| | **projectId** | `string` | optional | GCP project ID | | ||
| | **credentials** | `string` | optional | GCP service account credentials JSON | | ||
| | **endpoint** | `string` | optional | Custom endpoint URL | | ||
| | **region** | `string` | optional | Default region | | ||
| | **useSSL** | `boolean` | optional | Use SSL/TLS for connections | | ||
| | **timeout** | `number` | optional | Connection timeout in milliseconds | | ||
|
|
||
| --- | ||
|
|
||
| ## StorageProvider | ||
|
|
||
| Storage provider type | ||
|
|
||
| ### Allowed Values | ||
|
|
||
| * `s3` | ||
| * `azure_blob` | ||
| * `gcs` | ||
| * `minio` | ||
| * `r2` | ||
| * `spaces` | ||
| * `wasabi` | ||
| * `backblaze` | ||
| * `local` | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The removal of the
MultipartUploadConfigsection from this file is correct, as it was previously documenting the schema frompackages/spec/src/integration/connector/file-storage.zod.ts. However, the import statement on line 15 still includesMultipartUploadConfigSchemaandMultipartUploadConfig, which should be removed from the imports if this section has been deleted.