cURL
curl --request GET \ --url https://api.example.com/v1/organizations/{organizationId}/projects/{projectId}/packages/draft
{ "components": [ { "id": "<string>", "name": "<string>", "version": 123, "status": "<string>", "content": "<string>" } ], "dependencies": [ {} ] }
Preview what would be included in a new package
Show properties
{ "components": [ { "id": "comp123", "name": "Button", "version": null, "status": "draft", "content": "const body = (props) => { ... }" }, { "id": "comp124", "name": "Card", "version": 2, "status": "modified", "content": "const body = (props) => { ... }" }, { "id": "comp125", "name": "Header", "version": 1, "status": "published", "content": "const body = (props) => { ... }" } ], "dependencies": [ { "projectId": "proj456", "version": "2.0.0" } ] }
draft
null
modified
n
n+1
published
// Check draft state const draftResponse = await fetch( 'https://api.metabind.ai/v1/organizations/org123/projects/proj456/packages/draft', { headers: { 'Authorization': 'Bearer YOUR_API_KEY' } } ); const draft = await draftResponse.json(); // Count components by status const draftComponents = draft.components.filter(c => c.status === 'draft'); const modifiedComponents = draft.components.filter(c => c.status === 'modified'); console.log(`Creating package will:`); console.log(`- Publish ${draftComponents.length} new components`); console.log(`- Update ${modifiedComponents.length} existing components`);
curl -X GET "https://api.metabind.ai/v1/organizations/org123/projects/proj456/packages/draft" \ -H "Authorization: Bearer YOUR_API_KEY"