Types & Enums
This section provides a comprehensive reference for all TypeScript types and enumerations (enums) utilized across the Blocklet SDK. Understanding these definitions is fundamental for effectively interacting with Blocklet Server, managing data, and building robust decentralized applications.
For details on the SDK's core functionalities that leverage these types, refer to the Core Services section.
Enumerations#
Enums define a set of named constants, making your code more readable and less prone to errors when dealing with specific states or categories.
StatusCodeMap#
Represents common status codes for RPC responses.
Name | Value | Description |
---|---|---|
|
| Operation successful. |
|
| Blocklet not found. |
|
| Blocklet not purchased. |
|
| Access forbidden. |
|
| Internal server error. |
|
| Request timed out. |
BlockletStatusMap#
Defines the lifecycle statuses of a Blocklet.
Name | Value | Description |
---|---|---|
|
| Blocklet added. |
|
| Blocklet is downloading. |
|
| Blocklet has been downloaded. |
|
| Blocklet is installing. |
|
| Blocklet has been installed. |
|
| Blocklet is starting. |
|
| Blocklet is running. |
|
| Blocklet is stopping. |
|
| Blocklet has been stopped. |
|
| An error occurred with the Blocklet. |
|
| Blocklet is upgrading. |
|
| Blocklet is restarting. |
|
| Blocklet data is corrupted. |
|
| Blocklet is waiting. |
|
| Blocklet has been deleted. |
|
| Blocklet status is unknown. |
BlockletSourceMap#
Indicates where a Blocklet originated from.
Name | Value | Description |
---|---|---|
|
| From a Blocklet Store registry. |
|
| From local storage. |
|
| Uploaded by user. |
|
| From a direct URL. |
|
| Custom source. |
HeaderMatchTypeMap#
Specifies how HTTP headers should be matched in routing rules.
Name | Value | Description |
---|---|---|
|
| Exact match. |
|
| Partial match. |
|
| Regular expression match. |
BackendServiceTypeMap#
Defines the type of backend service for routing.
Name | Value | Description |
---|---|---|
|
| Daemon service. |
|
| Blocklet service. |
|
| Redirect to another URL. |
|
| No backend service. |
|
| General proxy. |
|
| Direct response. |
|
| URL rewrite. |
|
| Internal component. |
PublishTypeMap#
Defines the type of publication for projects.
Name | Value | Description |
---|---|---|
|
| Resource publication. |
|
| Pack publication. |
ReleaseStatusMap#
Defines the status of a project release.
Name | Value | Description |
---|---|---|
|
| Release is a draft. |
|
| Release is published. |
NotificationAttachmentTypeMap#
Defines the various types of attachments that can be included in a notification.
Name | Value | Description |
---|---|---|
|
| Digital asset attachment. |
|
| Verifiable Credential attachment. |
|
| Token attachment. |
|
| Plain text attachment. |
|
| Image attachment. |
|
| Visual divider. |
|
| Blockchain transaction details. |
|
| Decentralized application (DApp) link. |
|
| General URL link. |
|
| A section containing other attachments. |
NotificationSourceMap#
Defines the source of a notification.
Name | Value | Description |
---|---|---|
|
| Notification originated from the system. |
|
| Notification originated from a Blocklet component. |
NotificationTypeMap#
Defines the general type of a notification for display or processing purposes.
Name | Value | Description |
---|---|---|
|
| Standard informative notification. |
|
| Connection-related notification (e.g., DID Connect). |
|
| Notification for a feed item. |
|
| Welcome or greeting notification. |
|
| Generic passthrough notification. |
NotificationSeverityMap#
Defines the severity level of a notification.
Name | Value | Description |
---|---|---|
|
| Informational message. |
|
| Success message. |
|
| Error message. |
|
| Warning message. |
ActivityTypeEnumMap#
Defines types of user activities within the notification system.
Name | Value | Description |
---|---|---|
|
| User activity is a comment. |
|
| User activity is a like. |
|
| User activity is a follow. |
|
| User activity is a tip/donation. |
|
| User activity is a mention. |
|
| User activity is an assignment. |
|
| User activity is an un-assignment. |
Types#
Types define the structure of data objects used throughout the Blocklet SDK. They are crucial for understanding the data models when making API calls or processing responses.
TNodeState#
Represents the overall state of the Blocklet Server.
Property | Type | Description |
---|---|---|
|
| Decentralized Identifier of the server. |
|
| Public key of the server. |
|
| Version of the Blocklet Server. |
|
| Name of the Blocklet Server. |
|
| Description of the Blocklet Server. |
|
| Port the server is running on. |
|
| Indicates if the server has been initialized. |
|
| Information about the server's owner wallet. |
|
| Timestamp of server creation. |
|
| Current operational status of the server. |
|
| List of connected Blocklet Stores. |
|
| Disk usage threshold for alerts. |
|
| List of trusted passports. |
|
| Runtime configuration of the server. |
TBlockletState#
Describes the current state and configuration of a specific Blocklet instance.
Property | Type | Description |
---|---|---|
|
| Metadata of the Blocklet. |
|
| Current status of the Blocklet (e.g., |
|
| Timestamp when the Blocklet was created. |
|
| Timestamp when the Blocklet was installed. |
|
| Environmental configurations for the Blocklet. |
|
| Runtime configurations for the Blocklet. |
|
| Disk usage information for the Blocklet. |
|
| Runtime performance metrics (CPU, memory). |
|
| The port the Blocklet is exposed on. |
|
| States of child components. |
|
| The URL path where the Blocklet is mounted. |
|
| User-configurable settings for the Blocklet. |
|
| The DID of the Blocklet application. |
|
| Indicates if Docker is enabled for the Blocklet. |
TBlockletMeta#
Contains descriptive information about a Blocklet, typically found in its blocklet.yml
or package.json
.
Property | Type | Description |
---|---|---|
|
| The DID of the Blocklet. |
|
| The package name of the Blocklet. |
|
| The version of the Blocklet. |
|
| A brief description of the Blocklet. |
|
| Display title of the Blocklet. |
|
| Defines the external interfaces (e.g., web, API endpoints). |
|
| Author information. |
|
| Project homepage URL. |
|
| URL to the Blocklet's logo. |
|
| Features and capabilities supported by the Blocklet. |
|
| Environment variables the Blocklet uses. |
|
| System requirements for running the Blocklet. |
|
| Docker-specific metadata if applicable. |
TConfigEntry#
Represents a key-value configuration entry, often used for environment variables or settings.
Property | Type | Description |
---|---|---|
|
| The configuration key. |
|
| The configuration value. |
|
| Indicates if the configuration is mandatory. |
|
| A description of the configuration entry. |
|
| If true, the value should be treated as sensitive. |
|
| If true, the config is user-defined. |
|
| If true, the config is shared across components. |
TUserInfo#
Details information about a user on the Blocklet Server.
Property | Type | Description |
---|---|---|
|
| The DID of the user. |
|
| The public key of the user. |
|
| The role assigned to the user. |
|
| URL to the user's avatar image. |
|
| The full name of the user. |
|
| The email address of the user. |
|
| Indicates if the user account is approved. |
|
| Timestamp of user creation. |
|
| Timestamp of the user's last login. |
|
| List of connected external accounts. |
|
| Tags associated with the user. |
|
| Indicates if the user's email is verified. |
|
| Indicates if the user's phone is verified. |
|
| Additional user metadata like bio, location, etc. |
|
| User's physical address. |
TNotification#
Represents a notification object that can be sent to users or channels.
Property | Type | Description |
---|---|---|
|
| The DID of the sender. |
|
| The DID of the primary receiver. |
|
| The title of the notification. |
|
| The main body/description of the notification. |
|
| A primary action associated with the notification. |
|
| The type of entity the notification relates to. |
|
| The ID of the entity the notification relates to. |
|
| Indicates if the notification has been read. |
|
| Timestamp of notification creation. |
|
| Unique identifier for the notification. |
|
| The severity level ( |
|
| The source of the notification ( |
|
| List of attachments included in the notification. |
|
| List of actions users can take from the notification. |
|
| The DID of the component sending the notification. |
|
| The type of notification ( |
|
| Detailed information about all receivers. |
|
| Generic data associated with the notification. |
|
| Specific type for feed notifications. |
|
| Statistics related to notification delivery. |
|
| Activity details for activity-based notifications. |
|
| Information about the actor in activity notifications. |
TRoutingSite#
Defines a routing configuration for a specific domain.
Property | Type | Description |
---|---|---|
|
| Unique identifier for the routing site. |
|
| The primary domain for this site. |
|
| Aliases for the domain. |
|
| A list of routing rules for this site. |
|
| Indicates if the site is protected. |
|
| List of allowed CORS origins. |
TAccessKey#
Represents an access key for authenticating API requests.
Property | Type | Description |
---|---|---|
|
| The public ID of the access key. |
|
| The public key associated with the access key. |
|
| A human-readable remark for the key. |
|
| The passport DID associated with the key's permissions. |
|
| Timestamp of key creation. |
|
| Timestamp of last update. |
|
| Timestamp of last usage. |
|
| The DID of the creator. |
|
| The authentication type (e.g., |
|
| The DID of the component the key is for. |
|
| The type of resource the key can access. |
|
| The ID of the resource the key can access. |
|
| Timestamp when the key expires. |
TProject#
Represents a Blocklet project, used for development and publishing.
Property | Type | Description |
---|---|---|
|
| Unique identifier for the project. |
|
| The type of publication ( |
|
| The DID of the Blocklet associated with the project. |
|
| The version of the Blocklet. |
|
| Display title of the Blocklet in the project. |
|
| Description of the Blocklet. |
|
| URL to the Blocklet's logo. |
|
| Timestamp of project creation. |
|
| Timestamp of last update. |
|
| The component DID associated with the project. |
|
| List of connected Blocklet Stores. |
|
| The tenant scope of the project. |
|
| Indicates if automatic upload is enabled. |
|
| List of connected endpoints. |
TRelease#
Represents a specific release version of a Blocklet project.
Property | Type | Description |
---|---|---|
|
| Unique identifier for the release. |
|
| The ID of the parent project. |
|
| The DID of the Blocklet for this release. |
|
| The version of the Blocklet for this release. |
|
| Display title for this release. |
|
| Release notes/changelog. |
|
| List of files included in the release. |
|
| The status of the release ( |
|
| Timestamp of release creation. |
|
| Timestamp of last update. |
|
| List of components included in this release. |
|
| IDs of stores where this release is published. |
|
| URL or path to the uploaded resource. |
|
| Docker configuration for the Blocklet. |
TBlockletSecurityRule#
Defines a security rule for Blocklet access and response headers.
Property | Type | Description |
---|---|---|
|
| Unique identifier for the rule. |
|
| URL path pattern for the rule. |
|
| The component DID to which the rule applies. |
|
| Priority of the rule (lower is higher priority). |
|
| ID of the linked response header policy. |
|
| ID of the linked access policy. |
|
| Indicates if the rule is active. |
|
| An optional remark for the rule. |
|
| Details of the associated access policy. |
|
| Details of the associated response header policy. |
TWebhookEndpointState#
Represents the state of a registered Webhook endpoint.
Property | Type | Description |
---|---|---|
|
| Unique identifier for the webhook endpoint. |
|
| The API version used by the endpoint. |
|
| The URL where webhook events are sent. |
|
| A description of the endpoint. |
|
| List of event types enabled for this endpoint. |
|
| Additional metadata. |
|
| Current status of the endpoint. |
|
| Timestamp of creation. |
|
| Timestamp of last update. |
These definitions provide the building blocks for understanding and interacting with the Blocklet SDK's various functionalities. By familiarizing yourself with these types, you can ensure your applications handle data correctly and robustly.
To see how these types are used in practice, proceed to the GraphQL Client section for examples of data querying and manipulation.