Used to check for browser translation.
用于检测浏览器翻译。
ブラウザの翻訳を検出する
API Reference

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

did

string

The DID of the blocklet creating the project.

type

PublishType

The type of project, either 'resource' or 'pack'.

blockletDid

string

The DID of the blocklet to be published.

blockletTitle

string

A title for the publishing project.

componentDid

string

(Optional) The DID of the component if the project is for a specific component.

tenantScope

string

(Optional) The scope of the tenant, such as 'public'.

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

did

string

The DID of the blocklet that owns the project.

projectId

string

The ID of the project to update.

blockletTitle

string

(Optional) The new title for the blocklet project.

blockletDescription

string

(Optional) The new description for the blocklet project.

blockletIntroduction

string

(Optional) A detailed introduction or readme for the project.

autoUpload

boolean

(Optional) Enable or disable automatic uploads for new releases.

possibleSameStore

boolean

(Optional) Flag to indicate if the project might be published to the same store.

blockletSupport

string

(Optional) URL for support resources.

blockletCommunity

string

(Optional) URL for the community page.

blockletHomepage

string

(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

did

string

The DID of the blocklet that owns the project.

projectId

string

The ID of the project to delete.

messageId

string

(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

did

string

The DID of the blocklet that owns the project.

projectId

string

The ID of the project to create the release for.

releaseId

string

(Optional) A unique ID for the release; one will be generated if not provided.

blockletDid

string

The DID of the blocklet being released.

blockletVersion

string

The version number for this release (e.g., '1.0.0').

blockletTitle

string

The title for this release.

blockletDescription

string

A short description for this release.

blockletLogo

string

URL to the blocklet's logo.

blockletIntroduction

string

A detailed introduction or changelog for the release.

blockletScreenshots

string[]

An array of URLs for screenshots.

note

string

Internal notes for the release.

status

string

The status of the release, either 'draft' or 'published'.

blockletComponents

string[]

A list of component DIDs included in this release.

uploadedResource

string

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

did

string

The DID of the blocklet that owns the project.

projectId

string

The ID of the project.

releaseId

string

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

did

string

The DID of the blocklet that owns the project.

projectId

string

The project ID.

releaseId

string

The release ID.

componentDid

string

The component DID the resources belong to.

resources

string[]

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.