本页为英文技术参考;字段、编号与支持状态直接来自同一契约源。中文学习路线见 开发文档。
Themes
Inspect themes, preview a prepared theme and commit or revert it through Host appearance ownership. Preview is a temporary visible effect, not merely a query.
Contract: nexa.themes/100. API index.
Typical sequence
Prepare the selected theme, preview the returned plan if desired, then commit it or revert the preview registration. Edit theme options using the current revision.
Behavior and limits
A failed candidate should not erase the last valid appearance. Resource and migration routes remain unmapped where listed; Theme.ReleaseResource must not be used as a generic blob-release mechanism.
The recorded Host maps 15 of 15 operations in this group. A mapping is subject to permission, phase, scope, platform and business preconditions. Host snapshot identifies the source revision; negotiate against the actual installed Host.
Operations
List · Read · Prepare · Preview · Commit · Revert · ReadOptions · SaveOptions · ResetOptions · ImportOptions · ExportOptions · MigrateOptions · ListResources · ReadResource · ReleaseResource
List
PageRequest → Page<ThemeSummary> (wrapper, item)
| Property | Contract |
|---|---|
| Local SDK method ID | 1 |
| Kind | Query |
| Permission | nexa.themes.read |
| Legal phases | Initialize, PostInitialize, Checkup, Finalize, Active |
| Idempotency | ReadOnly |
| Host status | Mapped in recorded snapshot |
Request fields
| Field | Type | Meaning |
|---|---|---|
Cursor | string? | Opaque continuation or observation cursor. Reuse only in the issuing query/scope; absence and invalidity are different. Nullable; omission is distinct from an empty value. No implicit default is promised by this type. |
Limit | long | Requested bound on returned items. The Host may impose a smaller domain-specific limit. |
Successful result
Read Items and continue with NextCursor while preserving the original query. An absent cursor ends the sequence; an invalid cursor is an error.
Failure and retry
Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. A read-only classification does not bypass budgets or guarantee a failed request can be retried indefinitely. Preserve structured errors; see recovery guidance.
C binding (call fragment; the caller supplies the encoded request and buffers):
nx_Themes_List(&reply, request, &options);The next resume receives the reply. Check nx_reply_success before nx_Themes_List_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.
Read
| Property | Contract |
|---|---|
| Local SDK method ID | 2 |
| Kind | Query |
| Permission | nexa.themes.read |
| Legal phases | Initialize, PostInitialize, Checkup, Finalize, Active |
| Idempotency | ReadOnly |
| Host status | Mapped in recorded snapshot |
Request fields
| Field | Type | Meaning |
|---|---|---|
Id | EntityId | Identity in this model’s domain. Use the identity issued or declared for this object, not a display name or filesystem path. |
Successful result
Decode the exact output model after Success. Preserve its identities, revision and schema metadata for subsequent domain operations.
Failure and retry
Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. A read-only classification does not bypass budgets or guarantee a failed request can be retried indefinitely. Preserve structured errors; see recovery guidance.
C binding (call fragment; the caller supplies the encoded request and buffers):
nx_Themes_Read(&reply, request, &options);The next resume receives the reply. Check nx_reply_success before nx_Themes_Read_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.
Prepare
EntityRequest → ThemePreparation
| Property | Contract |
|---|---|
| Local SDK method ID | 3 |
| Kind | Query |
| Permission | nexa.themes.read |
| Legal phases | Initialize, PostInitialize, Checkup, Finalize, Active |
| Idempotency | ReadOnly |
| Host status | Mapped in recorded snapshot |
Request fields
| Field | Type | Meaning |
|---|---|---|
Id | EntityId | Identity in this model’s domain. Use the identity issued or declared for this object, not a display name or filesystem path. |
Successful result
Decode the exact output model after Success. Preserve its identities, revision and schema metadata for subsequent domain operations.
Failure and retry
Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. A read-only classification does not bypass budgets or guarantee a failed request can be retried indefinitely. Preserve structured errors; see recovery guidance.
C binding (call fragment; the caller supplies the encoded request and buffers):
nx_Themes_Prepare(&reply, request, &options);The next resume receives the reply. Check nx_reply_success before nx_Themes_Prepare_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.
Preview
| Property | Contract |
|---|---|
| Local SDK method ID | 4 |
| Kind | Mutation |
| Permission | nexa.themes.write |
| Legal phases | Active |
| Idempotency | RequiredKey |
| Host status | Mapped in recorded snapshot |
Returns a registration for the temporary preview. Retain it for Revert; the preview itself does not mean the theme is durably selected.
Request fields
| Field | Type | Meaning |
|---|---|---|
Plan | EntityId | Identity or revision in this model’s domain; preserve ownership and exact spelling. |
ExpectedRevision | Revision | Revision observed before this change. Preserve it exactly; a mismatch requires re-reading and reconciling the target. |
ConfirmationToken | string? | Domain value named by this field; additional accepted values and bounds are determined by the operation and Host policy. Nullable; omission is distinct from an empty value. No implicit default is promised by this type. |
Successful result
Retain the registration identity for the permitted update/release operation. Staged registrations become visible only at group activation.
Failure and retry
Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. Supply a key for the intended effect and retain that key and inputs while resolving an uncertain reply. Do not retry with changed inputs under the same key. Re-read after revision conflicts; cancellation does not prove rollback. Preserve structured errors; see recovery guidance.
C binding (call fragment; the caller supplies the encoded request and buffers):
nx_Themes_Preview(&reply, request, &options);The next resume receives the reply. Check nx_reply_success before nx_Themes_Preview_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.
Commit
| Property | Contract |
|---|---|
| Local SDK method ID | 5 |
| Kind | Operation |
| Permission | nexa.themes.write |
| Legal phases | Active |
| Idempotency | RequiredKey |
| Host status | Mapped in recorded snapshot |
Request fields
| Field | Type | Meaning |
|---|---|---|
Plan | EntityId | Identity or revision in this model’s domain; preserve ownership and exact spelling. |
ExpectedRevision | Revision | Revision observed before this change. Preserve it exactly; a mismatch requires re-reading and reconciling the target. |
ConfirmationToken | string? | Domain value named by this field; additional accepted values and bounds are determined by the operation and Host policy. Nullable; omission is distinct from an empty value. No implicit default is promised by this type. |
Successful result
Work has been admitted. Read or watch the owned operation through Tasks to establish its terminal result; admission is not completion.
Failure and retry
Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. Supply a key for the intended effect and retain that key and inputs while resolving an uncertain reply. Do not retry with changed inputs under the same key. Re-read after revision conflicts; cancellation does not prove rollback. Preserve structured errors; see recovery guidance.
C binding (call fragment; the caller supplies the encoded request and buffers):
nx_Themes_Commit(&reply, request, &options);The next resume receives the reply. Check nx_reply_success before nx_Themes_Commit_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.
Revert
| Property | Contract |
|---|---|
| Local SDK method ID | 6 |
| Kind | Mutation |
| Permission | nexa.themes.write |
| Legal phases | Active |
| Idempotency | RequiredKey |
| Host status | Mapped in recorded snapshot |
Request fields
| Field | Type | Meaning |
|---|---|---|
Registration | RegistrationRef | Structured RegistrationRef value; follow its linked field contract. |
Successful result
There is no result payload beyond the encoded Empty model. Check Success; an empty failure value is not successful completion.
Failure and retry
Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. Supply a key for the intended effect and retain that key and inputs while resolving an uncertain reply. Do not retry with changed inputs under the same key. Re-read after revision conflicts; cancellation does not prove rollback. Preserve structured errors; see recovery guidance.
C binding (call fragment; the caller supplies the encoded request and buffers):
nx_Themes_Revert(&reply, request, &options);The next resume receives the reply. Check nx_reply_success before nx_Themes_Revert_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.
ReadOptions
| Property | Contract |
|---|---|
| Local SDK method ID | 7 |
| Kind | Query |
| Permission | nexa.themes.read |
| Legal phases | Initialize, PostInitialize, Checkup, Finalize, Active |
| Idempotency | ReadOnly |
| Host status | Mapped in recorded snapshot |
Request fields
| Field | Type | Meaning |
|---|---|---|
Id | EntityId | Identity in this model’s domain. Use the identity issued or declared for this object, not a display name or filesystem path. |
Successful result
Decode the exact output model after Success. Preserve its identities, revision and schema metadata for subsequent domain operations.
Failure and retry
Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. A read-only classification does not bypass budgets or guarantee a failed request can be retried indefinitely. Preserve structured errors; see recovery guidance.
C binding (call fragment; the caller supplies the encoded request and buffers):
nx_Themes_ReadOptions(&reply, request, &options);The next resume receives the reply. Check nx_reply_success before nx_Themes_ReadOptions_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.
SaveOptions
ThemeOptionChange → ThemeOptions
| Property | Contract |
|---|---|
| Local SDK method ID | 8 |
| Kind | Mutation |
| Permission | nexa.themes.write |
| Legal phases | Active |
| Idempotency | RequiredKey |
| Host status | Mapped in recorded snapshot |
Request fields
| Field | Type | Meaning |
|---|---|---|
Options | ThemeOptions | Structured ThemeOptions value; follow its linked field contract. |
ExpectedRevision | Revision | Revision observed before this change. Preserve it exactly; a mismatch requires re-reading and reconciling the target. |
Successful result
Decode the exact output model after Success. Preserve its identities, revision and schema metadata for subsequent domain operations.
Failure and retry
Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. Supply a key for the intended effect and retain that key and inputs while resolving an uncertain reply. Do not retry with changed inputs under the same key. Re-read after revision conflicts; cancellation does not prove rollback. Preserve structured errors; see recovery guidance.
C binding (call fragment; the caller supplies the encoded request and buffers):
nx_Themes_SaveOptions(&reply, request, &options);The next resume receives the reply. Check nx_reply_success before nx_Themes_SaveOptions_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.
ResetOptions
| Property | Contract |
|---|---|
| Local SDK method ID | 9 |
| Kind | Mutation |
| Permission | nexa.themes.write |
| Legal phases | Active |
| Idempotency | RequiredKey |
| Host status | Mapped in recorded snapshot |
Request fields
| Field | Type | Meaning |
|---|---|---|
Id | EntityId | Identity in this model’s domain. Use the identity issued or declared for this object, not a display name or filesystem path. |
Successful result
Decode the exact output model after Success. Preserve its identities, revision and schema metadata for subsequent domain operations.
Failure and retry
Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. Supply a key for the intended effect and retain that key and inputs while resolving an uncertain reply. Do not retry with changed inputs under the same key. Re-read after revision conflicts; cancellation does not prove rollback. Preserve structured errors; see recovery guidance.
C binding (call fragment; the caller supplies the encoded request and buffers):
nx_Themes_ResetOptions(&reply, request, &options);The next resume receives the reply. Check nx_reply_success before nx_Themes_ResetOptions_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.
ImportOptions
| Property | Contract |
|---|---|
| Local SDK method ID | 10 |
| Kind | Operation |
| Permission | nexa.themes.write |
| Legal phases | Active |
| Idempotency | RequiredKey |
| Host status | Mapped in recorded snapshot |
Request fields
| Field | Type | Meaning |
|---|---|---|
Theme | EntityId | Identity or revision in this model’s domain; preserve ownership and exact spelling. |
File | FileRef | Structured FileRef value; follow its linked field contract. |
Successful result
Work has been admitted. Read or watch the owned operation through Tasks to establish its terminal result; admission is not completion.
Failure and retry
Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. Supply a key for the intended effect and retain that key and inputs while resolving an uncertain reply. Do not retry with changed inputs under the same key. Re-read after revision conflicts; cancellation does not prove rollback. Preserve structured errors; see recovery guidance.
C binding (call fragment; the caller supplies the encoded request and buffers):
nx_Themes_ImportOptions(&reply, request, &options);The next resume receives the reply. Check nx_reply_success before nx_Themes_ImportOptions_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.
ExportOptions
| Property | Contract |
|---|---|
| Local SDK method ID | 11 |
| Kind | Operation |
| Permission | nexa.themes.write |
| Legal phases | Active |
| Idempotency | RequiredKey |
| Host status | Mapped in recorded snapshot |
Request fields
| Field | Type | Meaning |
|---|---|---|
Theme | EntityId | Identity or revision in this model’s domain; preserve ownership and exact spelling. |
File | FileRef | Structured FileRef value; follow its linked field contract. |
Successful result
Work has been admitted. Read or watch the owned operation through Tasks to establish its terminal result; admission is not completion.
Failure and retry
Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. Supply a key for the intended effect and retain that key and inputs while resolving an uncertain reply. Do not retry with changed inputs under the same key. Re-read after revision conflicts; cancellation does not prove rollback. Preserve structured errors; see recovery guidance.
C binding (call fragment; the caller supplies the encoded request and buffers):
nx_Themes_ExportOptions(&reply, request, &options);The next resume receives the reply. Check nx_reply_success before nx_Themes_ExportOptions_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.
MigrateOptions
ThemeOptionChange → OperationRef
| Property | Contract |
|---|---|
| Local SDK method ID | 12 |
| Kind | Operation |
| Permission | nexa.themes.write |
| Legal phases | Active |
| Idempotency | RequiredKey |
| Host status | Mapped in recorded snapshot |
Validate and persist the supplied typed option values against the current theme manifest’s options schema and version. The operation uses the same owner revision and renderer-effect path as SaveOptions; it does not translate legacy configuration key names. Unknown or incompatible options are rejected and missing options retain compatible existing values/defaults. A successful Tasks result contains current ThemeOptions.
Request fields
| Field | Type | Meaning |
|---|---|---|
Options | ThemeOptions | Structured ThemeOptions value; follow its linked field contract. |
ExpectedRevision | Revision | Revision observed before this change. Preserve it exactly; a mismatch requires re-reading and reconciling the target. |
Successful result
Work has been admitted. Read or watch the owned operation through Tasks to establish its terminal result; admission is not completion.
Failure and retry
Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. Supply a key for the intended effect and retain that key and inputs while resolving an uncertain reply. Do not retry with changed inputs under the same key. Re-read after revision conflicts; cancellation does not prove rollback. Preserve structured errors; see recovery guidance.
C binding (call fragment; the caller supplies the encoded request and buffers):
nx_Themes_MigrateOptions(&reply, request, &options);The next resume receives the reply. Check nx_reply_success before nx_Themes_MigrateOptions_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.
ListResources
EntityRequest → Page<ThemeResource> (wrapper, item)
| Property | Contract |
|---|---|
| Local SDK method ID | 13 |
| Kind | Query |
| Permission | nexa.themes.read |
| Legal phases | Initialize, PostInitialize, Checkup, Finalize, Active |
| Idempotency | ReadOnly |
| Host status | Mapped in recorded snapshot |
Copy resources explicitly declared as asset(...) in the current theme appearance. User-granted external files are not delegated to plugins. The owner verifies the source revision, containment and resource format, with limits of 128 resources, 16 MiB per item and 32 MiB total. Returned ThemeResource values and blobs belong to the calling load.
Request fields
| Field | Type | Meaning |
|---|---|---|
Id | EntityId | Identity in this model’s domain. Use the identity issued or declared for this object, not a display name or filesystem path. |
Successful result
Read Items and continue with NextCursor while preserving the original query. An absent cursor ends the sequence; an invalid cursor is an error.
Failure and retry
Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. A read-only classification does not bypass budgets or guarantee a failed request can be retried indefinitely. Preserve structured errors; see recovery guidance.
C binding (call fragment; the caller supplies the encoded request and buffers):
nx_Themes_ListResources(&reply, request, &options);The next resume receives the reply. Check nx_reply_success before nx_Themes_ListResources_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.
ReadResource
| Property | Contract |
|---|---|
| Local SDK method ID | 14 |
| Kind | Query |
| Permission | nexa.themes.read |
| Legal phases | Initialize, PostInitialize, Checkup, Finalize, Active |
| Idempotency | ReadOnly |
| Host status | Mapped in recorded snapshot |
Resolve an exact ThemeResource returned by ListResources to its owned BlobRef. A forged resource, another caller’s blob or a released resource is rejected. The returned bytes are an immutable copy, independent of a later theme reload.
Request fields
| Field | Type | Meaning |
|---|---|---|
Theme | EntityId | Identity or revision in this model’s domain; preserve ownership and exact spelling. |
Name | string | Domain value named by this field; additional accepted values and bounds are determined by the operation and Host policy. |
Data | BlobRef | Structured BlobRef value; follow its linked field contract. |
Successful result
The Host retains bytes under an opaque, owned blob handle. It is not the bytes themselves and is not portable across loads.
Failure and retry
Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. A read-only classification does not bypass budgets or guarantee a failed request can be retried indefinitely. Preserve structured errors; see recovery guidance.
C binding (call fragment; the caller supplies the encoded request and buffers):
nx_Themes_ReadResource(&reply, request, &options);The next resume receives the reply. Check nx_reply_success before nx_Themes_ReadResource_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.
ReleaseResource
| Property | Contract |
|---|---|
| Local SDK method ID | 15 |
| Kind | Mutation |
| Permission | nexa.themes.write |
| Legal phases | Active |
| Idempotency | RequiredKey |
| Host status | Mapped in recorded snapshot |
Release an owned theme blob and zero its retained bytes. Release is explicit and single-use; reads after release fail. Plugin retirement also releases retained application blobs.
Request fields
| Field | Type | Meaning |
|---|---|---|
Token | Guid | Opaque Host-issued handle token. Keep it with its owner and resource type. |
LoadInstanceId | Guid | Identity of the admitted load that owns this handle; it is not portable to a replacement load. |
Size | long | Domain value named by this field; additional accepted values and bounds are determined by the operation and Host policy. |
Sha256 | string | Domain value named by this field; additional accepted values and bounds are determined by the operation and Host policy. |
Successful result
There is no result payload beyond the encoded Empty model. Check Success; an empty failure value is not successful completion.
Failure and retry
Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. Supply a key for the intended effect and retain that key and inputs while resolving an uncertain reply. Do not retry with changed inputs under the same key. Re-read after revision conflicts; cancellation does not prove rollback. Preserve structured errors; see recovery guidance.
C binding (call fragment; the caller supplies the encoded request and buffers):
nx_Themes_ReleaseResource(&reply, request, &options);The next resume receives the reply. Check nx_reply_success before nx_Themes_ReleaseResource_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.
来源: NexaCL-Plugin-SDK · Apache-2.0.