Publishing & Projects
This section details the mutations for managing the entire lifecycle of publishing a blocklet—from project creation and release management to distribution across various stores and endpoints. These operations allow you to programmatically control how your blocklets are developed, versioned, and delivered.
For reading project and release data, see the Publishing & Projects Queries documentation.
Project Management#
These mutations handle the creation, modification, and deletion of publishing projects.
createProject#
Creates a new publishing project for a blocklet or component.
Example
const result = await client.createProject({
input: {
did: 'z8iZpL_3fG9F4mJ2eR1nK8oB7cW6aX9dE5gH',
type: 'pack',
blockletDid: 'z8iZpL_3fG9F4mJ2eR1nK8oB7cW6aX9dE5gH',
blockletTitle: 'My New Blocklet Project',
componentDid: 'z2h9a...',
tenantScope: 'public',
},
});
console.log(result.project);
Parameters
Name | Type | Description |
---|---|---|
|
| The DID of the blocklet creating the project. |
|
| The type of project, either |
|
| The DID of the blocklet to be published. |
|
| A title for the publishing project. |
|
| (Optional) The DID of the component if the project is for a specific component. |
|
| (Optional) The scope of the tenant, such as |
Returns
A ResponseProject
object. See the Types section for details.
Example Response
{
"code": "ok",
"project": {
"id": "z6Mkk...",
"type": "pack",
"blockletDid": "z8iZpL_3fG9F4mJ2eR1nK8oB7cW6aX9dE5gH",
"blockletTitle": "My New Blocklet Project",
"createdAt": "2023-10-27T10:00:00.000Z",
"updatedAt": "2023-10-27T10:00:00.000Z"
}
}
updateProject#
Updates the details of an existing publishing project.
Example
const result = await client.updateProject({
input: {
did: 'z8iZpL_3fG9F4mJ2eR1nK8oB7cW6aX9dE5gH',
projectId: 'z6Mkk...',
blockletTitle: 'My Updated Blocklet Project',
blockletDescription: 'An updated description for my project.',
},
});
console.log(result.project);
Parameters
Name | Type | Description |
---|---|---|
|
| The DID of the blocklet that owns the project. |
|
| The ID of the project to update. |
|
| (Optional) The new title for the blocklet project. |
|
| (Optional) The new description for the blocklet project. |
|
| (Optional) A detailed introduction or readme for the project. |
|
| (Optional) Enable or disable automatic uploads for new releases. |
|
| (Optional) Flag to indicate if the project might be published to the same store. |
|
| (Optional) URL for support resources. |
|
| (Optional) URL for the community page. |
|
| (Optional) URL for the blocklet's homepage. |
Returns
A ResponseProject
object. See the Types section for details.
Example Response
{
"code": "ok",
"project": {
"id": "z6Mkk...",
"blockletTitle": "My Updated Blocklet Project",
"blockletDescription": "An updated description for my project.",
"updatedAt": "2023-10-27T11:00:00.000Z"
}
}
deleteProject#
Permanently deletes a publishing project.
Example
const result = await client.deleteProject({
input: {
did: 'z8iZpL_3fG9F4mJ2eR1nK8oB7cW6aX9dE5gH',
projectId: 'z6Mkk...',
},
});
console.log(result.code);
Parameters
Name | Type | Description |
---|---|---|
|
| The DID of the blocklet that owns the project. |
|
| The ID of the project to delete. |
|
| (Optional) A message ID for tracking the deletion request. |
Returns
A GeneralResponse
object. See the Types section for details.
Example Response
{
"code": "ok"
}
Release Management#
These mutations are used to create and delete releases for your projects.
createRelease#
Creates a new release for a specified project, including all metadata and assets.
Example
const result = await client.createRelease({
input: {
did: 'z8iZpL_3fG9F4mJ2eR1nK8oB7cW6aX9dE5gH',
projectId: 'z6Mkk...',
blockletDid: 'z8iZpL_3fG9F4mJ2eR1nK8oB7cW6aX9dE5gH',
blockletVersion: '1.0.0',
blockletTitle: 'Version 1.0.0 Release',
note: 'Initial release with core features.',
status: 'draft',
},
});
console.log(result.release);
Parameters
Name | Type | Description |
---|---|---|
|
| The DID of the blocklet that owns the project. |
|
| The ID of the project to create the release for. |
|
| (Optional) A unique ID for the release; one will be generated if not provided. |
|
| The DID of the blocklet being released. |
|
| The version number for this release (e.g., '1.0.0'). |
|
| The title for this release. |
|
| A short description for this release. |
|
| URL to the blocklet's logo. |
|
| A detailed introduction or changelog for the release. |
|
| An array of URLs for screenshots. |
|
| Internal notes for the release. |
|
| The status of the release, either |
|
| A list of component DIDs included in this release. |
|
| The identifier for the uploaded resource bundle. |
Returns
A ResponseRelease
object. See the Types section for details.
Example Response
{
"code": "ok",
"release": {
"id": "z8mKk...",
"projectId": "z6Mkk...",
"blockletVersion": "1.0.0",
"blockletTitle": "Version 1.0.0 Release",
"status": "draft"
}
}
deleteRelease#
Deletes a specific release from a project.
Example
const result = await client.deleteRelease({
input: {
did: 'z8iZpL_3fG9F4mJ2eR1nK8oB7cW6aX9dE5gH',
projectId: 'z6Mkk...',
releaseId: 'z8mKk...',
},
});
console.log(result.code);
Parameters
Name | Type | Description |
---|---|---|
|
| The DID of the blocklet that owns the project. |
|
| The ID of the project. |
|
| The ID of the release to delete. |
Returns
A GeneralResponse
object. See the Types section for details.
Example Response
{
"code": "ok"
}
Resource & Store Management#
These mutations manage connections to stores and endpoints for publishing releases.
updateSelectedResources#
Updates the list of resources selected for a specific release and component.
Example
const result = await client.updateSelectedResources({
input: {
did: 'z8iZpL_3fG9F4mJ2eR1nK8oB7cW6aX9dE5gH',
projectId: 'z6Mkk...',
releaseId: 'z8mKk...',
componentDid: 'z2h9a...',
resources: ['resource_id_1', 'resource_id_2'],
},
});
console.log(result.code);
Parameters
Name | Type | Description |
---|---|---|
|
| The DID of the blocklet that owns the project. |
|
| The project ID. |
|
| The release ID. |
|
| The component DID the resources belong to. |
|
| An array of selected resource identifiers. |
Returns
A GeneralResponse
object. See the Types section for details.
Example Response
{
"code": "ok"
}
connectToStore#
Establishes a connection to a blocklet store for publishing.
Example
const result = await client.connectToStore({
input: {
did: 'z8iZpL_3fG9F4mJ2eR1nK8oB7cW6aX9dE5gH',
storeId: 'store_id_123',
storeUrl: 'https://store.arcblock.io',
storeName: 'Official Blocklet Store',
projectId: 'z6Mkk...',
},
});
console.log(result.url);
Returns
A ResponseConnectToStore
object. See the Types section for details.
Example Response
{
"code": "ok",
"url": "https://store.arcblock.io/connect?token=..."
}
disconnectFromStore#
Removes the connection to a blocklet store.
Example
const result = await client.disconnectFromStore({
input: {
did: 'z8iZpL_3fG9F4mJ2eR1nK8oB7cW6aX9dE5gH',
storeId: 'store_id_123',
projectId: 'z6Mkk...',
},
});
console.log(result.code);
Returns
A ResponseDisconnectFromStore
object. See the Types section for details.
Example Response
{
"code": "ok"
}
publishToStore#
Publishes a specific release to a connected blocklet store.
Example
const result = await client.publishToStore({
input: {
did: 'z8iZpL_3fG9F4mJ2eR1nK8oB7cW6aX9dE5gH',
projectId: 'z6Mkk...',
releaseId: 'z8mKk...',
storeId: 'store_id_123',
type: 'pack',
},
});
console.log(result.url);
Returns
A ResponsePublishToStore
object. See the Types section for details.
Example Response
{
"code": "ok",
"url": "https://store.arcblock.io/publish?token=..."
}
addUploadEndpoint#
Adds a new upload endpoint for distributing releases.
Example
const result = await client.addUploadEndpoint({
input: {
teamDid: 'z8iZpL_3fG9F4mJ2eR1nK8oB7cW6aX9dE5gH',
url: 'https://my-endpoint.com/upload',
scope: 'production',
},
});
console.log(result.code);
Returns
A GeneralResponse
object indicating success or failure.
deleteUploadEndpoint#
Removes an existing upload endpoint.
Example
const result = await client.deleteUploadEndpoint({
input: {
teamDid: 'z8iZpL_3fG9F4mJ2eR1nK8oB7cW6aX9dE5gH',
did: 'endpoint_did',
scope: 'production',
},
});
console.log(result.code);
Returns
A GeneralResponse
object indicating success or failure.
connectToEndpoint#
Connects a project to a publishing endpoint, which can be used for automated deployments or distributions.
Example
const result = await client.connectToEndpoint({
input: {
did: 'z8iZpL_3fG9F4mJ2eR1nK8oB7cW6aX9dE5gH',
endpointId: 'endpoint_abc',
projectId: 'z6Mkk...',
},
});
console.log(result.url);
Returns
A ResponseConnectToEndpoint
object containing a URL for completing the connection process.
disconnectFromEndpoint#
Disconnects a project from a publishing endpoint.
Example
const result = await client.disconnectFromEndpoint({
input: {
did: 'z8iZpL_3fG9F4mJ2eR1nK8oB7cW6aX9dE5gH',
endpointId: 'endpoint_abc',
projectId: 'z6Mkk...',
},
});
console.log(result.code);
Returns
A GeneralResponse
object indicating the result of the operation.
publishToEndpoint#
Publishes a specific release to a connected endpoint.
Example
const result = await client.publishToEndpoint({
input: {
did: 'z8iZpL_3fG9F4mJ2eR1nK8oB7cW6aX9dE5gH',
endpointId: 'endpoint_abc',
projectId: 'z6Mkk...',
releaseId: 'z8mKk...',
},
});
console.log(result.url);
Returns
A ResponsePublishToEndpoint
object containing a URL to monitor the publishing status.
Studio Integration#
connectByStudio#
Facilitates a connection with Blocklet Studio for development and management purposes.
Example
const result = await client.connectByStudio({
input: {
did: 'z8iZpL_3fG9F4mJ2eR1nK8oB7cW6aX9dE5gH',
storeId: 'studio_store',
storeUrl: 'https://studio.arcblock.io',
storeName: 'Blocklet Studio',
blockletTitle: 'My Dev Project',
type: 'pack',
},
});
console.log(result.url);
Returns
A ResponseConnectByStudio
object containing a URL to complete the connection process in Blocklet Studio.
This guide covers the core mutations for managing your publishing workflow. For information on data types used in these mutations, please refer to the Types section.