curl --request POST \
--url https://api.example.com/v1/organizations/{organizationId}/projects/{projectId}/packages \
--header 'Content-Type: application/json' \
--data '
{
"version": "<string>",
"metadata": {
"metadata.description": "<string>",
"metadata.tags": [
"<string>"
]
}
}
'Create a new package, publishing all draft and modified components
curl --request POST \
--url https://api.example.com/v1/organizations/{organizationId}/projects/{projectId}/packages \
--header 'Content-Type: application/json' \
--data '
{
"version": "<string>",
"metadata": {
"metadata.description": "<string>",
"metadata.tags": [
"<string>"
]
}
}
'1.0.0, 2.1.0){
"version": "1.0.0",
"metadata": {
"description": "Initial release with core UI components",
"tags": ["ui", "core"]
}
}
{
"package": {
"id": "pkg123",
"projectId": "proj123",
"version": "1.0.0",
"components": [
{
"id": "comp123",
"name": "ProductCard",
"type": "view",
"version": 1
},
{
"id": "comp124",
"name": "ArticleLayout",
"type": "layout",
"version": 1
}
],
"assets": [...],
"compiled": {...},
"dependencies": [...],
"metadata": {
"author": "user123",
"description": "Initial release with core UI components",
"tags": ["ui", "core"]
},
"createdAt": "2024-03-20T10:00:00Z",
"updatedAt": "2024-03-20T10:00:00Z"
},
"validation": {
"componentChanges": {
"added": ["comp123"],
"updated": ["comp124", "comp125"],
"deleted": []
},
"statusChanges": {
"draft": ["comp123"],
"modified": ["comp124"],
"published": ["comp125"]
},
"versionIncrements": {
"comp123": { "from": null, "to": 1 },
"comp124": { "from": 2, "to": 3 }
}
}
}
{
"error": {
"code": "VERSION_EXISTS",
"message": "Package version 1.0.0 already exists",
"details": {
"version": "1.0.0"
}
}
}
{
"error": {
"code": "INVALID_VERSION",
"message": "Version must follow semantic versioning (MAJOR.MINOR.PATCH)",
"details": {
"provided": "1.0",
"expected": "X.Y.Z format"
}
}
}
{
"error": {
"code": "INVALID_PACKAGE_DEPENDENCY",
"message": "Incompatible package versions",
"details": {
"conflicts": [
{
"package": "core",
"required": {
"by": "[email protected]",
"version": "1.0.0"
},
"provided": {
"by": "[email protected]",
"version": "1.2.0"
}
}
]
}
}
}
{
"error": {
"code": "CIRCULAR_DEPENDENCY",
"message": "Package dependency cycle detected",
"details": {
"cycle": [
"[email protected]",
"[email protected]",
"[email protected]"
]
}
}
}
curl -X POST "https://api.metabind.ai/v1/organizations/org123/projects/proj456/packages" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"version": "1.0.0",
"metadata": {
"description": "Initial release"
}
}'