|
| 1 | +--- |
| 2 | +title: Package Artifact |
| 3 | +description: Package Artifact format protocol schemas |
| 4 | +--- |
| 5 | + |
| 6 | +{/* ⚠️ AUTO-GENERATED — DO NOT EDIT. Run build-docs.ts to regenerate. Hand-written docs go in content/docs/guides/. */} |
| 7 | + |
| 8 | +# Package Artifact Format Protocol |
| 9 | + |
| 10 | +Defines the standard structure of a package artifact (.tgz) produced by |
| 11 | +`os plugin build`. The marketplace uses these schemas to validate, store, |
| 12 | +and distribute package artifacts. |
| 13 | + |
| 14 | +## Artifact Internal Structure |
| 15 | + |
| 16 | +``` |
| 17 | +├── manifest.json ← ManifestSchema serialized |
| 18 | +├── metadata/ ← 30+ metadata types (JSON) |
| 19 | +│ ├── objects/ ← *.object.json |
| 20 | +│ ├── views/ ← *.view.json |
| 21 | +│ ├── pages/ ← *.page.json |
| 22 | +│ ├── flows/ ← *.flow.json |
| 23 | +│ ├── dashboards/ ← *.dashboard.json |
| 24 | +│ ├── permissions/ ← *.permission.json |
| 25 | +│ ├── agents/ ← *.agent.json |
| 26 | +│ └── ... ← Other metadata types |
| 27 | +├── assets/ ← Static resources |
| 28 | +├── data/ ← Seed data (DatasetSchema serialized) |
| 29 | +├── locales/ ← i18n translation files |
| 30 | +├── checksums.json ← SHA256 checksum per file |
| 31 | +└── signature.sig ← RSA-SHA256 package signature |
| 32 | +``` |
| 33 | + |
| 34 | +## Architecture Alignment |
| 35 | + |
| 36 | +- **Salesforce**: Managed Package .zip with metadata components |
| 37 | +- **npm**: .tgz with package.json + contents |
| 38 | +- **Helm**: Chart .tgz with Chart.yaml + templates |
| 39 | +- **VS Code**: .vsix (zip) with extension manifest + assets |
| 40 | + |
| 41 | +<Callout type="info"> |
| 42 | +**Source:** `packages/spec/src/kernel/package-artifact.zod.ts` |
| 43 | +</Callout> |
| 44 | + |
| 45 | +## TypeScript Usage |
| 46 | + |
| 47 | +```typescript |
| 48 | +import { PackageArtifactSchema, ArtifactChecksumSchema, ArtifactSignatureSchema } from '@objectstack/spec/kernel'; |
| 49 | +import type { PackageArtifact, ArtifactChecksum, ArtifactSignature } from '@objectstack/spec/kernel'; |
| 50 | + |
| 51 | +// Validate artifact metadata |
| 52 | +const result = PackageArtifactSchema.parse(data); |
| 53 | +``` |
| 54 | + |
| 55 | +--- |
| 56 | + |
| 57 | +## PackageArtifact |
| 58 | + |
| 59 | +### Properties |
| 60 | + |
| 61 | +| Property | Type | Required | Description | |
| 62 | +| :--- | :--- | :--- | :--- | |
| 63 | +| **formatVersion** | `string` | ✅ | Artifact format version (e.g. "1.0") | |
| 64 | +| **packageId** | `string` | ✅ | Package identifier from manifest | |
| 65 | +| **version** | `string` | ✅ | Package version from manifest | |
| 66 | +| **format** | `Enum<'tgz' \| 'zip'>` | ✅ | Archive format of the artifact | |
| 67 | +| **size** | `integer` | optional | Total artifact file size in bytes | |
| 68 | +| **builtAt** | `string` | ✅ | ISO 8601 build timestamp | |
| 69 | +| **builtWith** | `string` | optional | Build tool identifier | |
| 70 | +| **files** | `Object[]` | optional | List of files in the artifact | |
| 71 | +| **metadataCategories** | `string[]` | optional | Metadata categories included | |
| 72 | +| **checksums** | `Object` | optional | SHA256 checksums for integrity | |
| 73 | +| **signature** | `Object` | optional | Digital signature for authenticity | |
| 74 | + |
| 75 | + |
| 76 | +--- |
| 77 | + |
| 78 | +## ArtifactChecksum |
| 79 | + |
| 80 | +### Properties |
| 81 | + |
| 82 | +| Property | Type | Required | Description | |
| 83 | +| :--- | :--- | :--- | :--- | |
| 84 | +| **algorithm** | `Enum<'sha256' \| 'sha384' \| 'sha512'>` | ✅ | Hash algorithm used | |
| 85 | +| **files** | `Record<string, string>` | ✅ | File path to hash value mapping | |
| 86 | + |
| 87 | + |
| 88 | +--- |
| 89 | + |
| 90 | +## ArtifactSignature |
| 91 | + |
| 92 | +### Properties |
| 93 | + |
| 94 | +| Property | Type | Required | Description | |
| 95 | +| :--- | :--- | :--- | :--- | |
| 96 | +| **algorithm** | `Enum<'RSA-SHA256' \| 'RSA-SHA384' \| 'RSA-SHA512' \| 'ECDSA-SHA256'>` | ✅ | Signing algorithm | |
| 97 | +| **publicKeyRef** | `string` | ✅ | Public key reference for verification | |
| 98 | +| **signature** | `string` | ✅ | Base64-encoded signature | |
| 99 | +| **signedAt** | `string` | optional | Signing timestamp | |
| 100 | +| **signedBy** | `string` | optional | Signer identity | |
| 101 | + |
| 102 | + |
| 103 | +--- |
| 104 | + |
| 105 | +## MetadataCategory |
| 106 | + |
| 107 | +### Allowed Values |
| 108 | + |
| 109 | +* `objects` |
| 110 | +* `views` |
| 111 | +* `pages` |
| 112 | +* `flows` |
| 113 | +* `dashboards` |
| 114 | +* `permissions` |
| 115 | +* `agents` |
| 116 | +* `reports` |
| 117 | +* `actions` |
| 118 | +* `translations` |
| 119 | +* `themes` |
| 120 | +* `datasets` |
| 121 | +* `apis` |
| 122 | +* `triggers` |
| 123 | +* `workflows` |
| 124 | + |
| 125 | + |
| 126 | +--- |
0 commit comments