mini_program_contracts library

Classes

ActionNames
Stable wire names for host-dispatched mobile MVP actions.
CallSecureApiActionPayload
Payload for a host-controlled secure API operation.
CapabilityIdListConverter
JSON converter that validates manifest capability IDs.
CapabilityIds
Standard capability IDs used by published mini-program manifests.
FeatureFlagKeys
Utility helpers for feature flag key contract values.
HostActionRequest
Standard request envelope sent from the SDK to a host bridge action handler.
HostActionResult
Standard result envelope returned by the host bridge after handling an action.
MiniProgramCachePolicy
Cache rules declared by a mini-program manifest.
MiniProgramCacheRule
Cache rules declared by a mini-program manifest for one payload class.
MiniProgramCacheRuleConverter
Backward-compatible cache-rule converter for manifest cache policy fields.
MiniProgramCameraPhotoResult
JSON-safe metadata for a photo captured by a trusted host provider.
MiniProgramDateTimeValues
Canonical, timezone-free values exchanged by mini-program date/time fields.
MiniProgramErrorCodes
Stable error code constants shared across contracts, SDK, and hosts.
MiniProgramFallback
Minimal fallback metadata declared by a mini-program manifest.
MiniProgramFileTransferProgress
JSON-safe progress reported by an active upload or download.
MiniProgramFlashlightStatus
JSON-safe state returned by a trusted host flashlight provider.
MiniProgramGalleryImage
JSON-safe metadata for a selected photo held privately by the host.
MiniProgramGalleryResult
One atomic image selection. No native locations or image bytes are exposed.
MiniProgramLocationResult
JSON-safe result returned by a host current-location provider.
MiniProgramManifest
Canonical manifest contract delivered to hosts and the shared SDK.
MiniProgramMapDestination
A known shop/destination, never an arbitrary URL, package, or Intent.
MiniProgramMediaPlaybackSnapshot
JSON-safe playback snapshot. It intentionally contains no URL or headers.
MiniProgramMicrophoneResult
Bounded metadata for an app-owned AAC voice recording. Native locations and audio bytes are deliberately excluded from this contract.
MiniProgramPublisherBackendContract
Provider-neutral Publisher API contract document.
MiniProgramPublisherBackendErrorCodes
Stable provider-neutral Publisher API error codes.
MiniProgramPublisherBackendHeaders
Standard request header names used by Publisher APIs.
MiniProgramPublisherBackendSmokeCase
Provider-neutral smoke-test route.
MiniProgramPublisherBackendSmokeExpectation
Expected provider-neutral smoke-test route behavior.
MiniProgramQrScanResult
JSON-safe result returned by a trusted host QR scanner.
MiniProgramScreenFormatConverter
JSON converter that preserves unknown screen formats as strings.
MiniProgramScreenFormats
Standard mini-program screen document formats.
MiniProgramShareResult
Inert acknowledgement returned after the host opens its system share UI.
OpenMiniProgramScreenActionPayload
OpenNativeScreenActionPayload
Payload for a host-controlled native navigation request.
PopMiniProgramScreenActionPayload
PopToMiniProgramRootActionPayload
PopToMiniProgramScreenActionPayload
ReplaceMiniProgramScreenActionPayload
ResetMiniProgramStackActionPayload
SdkVersionRange
Semver range expression describing which SDK versions a manifest supports.
SdkVersionRangeConverter
Converts between a manifest wire string and SdkVersionRange.
TrackEventActionPayload
Payload for a host-controlled analytics event dispatch.

Enums

Capability
Deprecated enum kept for existing source compatibility.
HostActionStatus
Terminal outcome states for a host-dispatched action.
MiniProgramCacheMode
Contract-level cache behavior for a manifest or screen payload.
MiniProgramFallbackStrategy
Supported fallback behaviors when a mini-program cannot continue normally.
MiniProgramFileTransferDirection
Direction of a publisher file transfer.
MiniProgramFileTransferStatus
Stable lifecycle states reported by file transfers.
MiniProgramLocationAccuracy
Supported current-location accuracy levels.
MiniProgramLocationMode
Supported location access modes.
MiniProgramMapCoordinateSystem
Coordinate reference supplied by the shop/publisher. Providers must honor this value or reject the request; these coordinate systems are not equal.
MiniProgramMapTravelMode
Route planning modes shared by the supported Android adapters.
MiniProgramMediaPlaybackKind
Media category owned by one host playback session.
MiniProgramMediaPlaybackStatus
Stable foreground playback lifecycle exposed to mini-program state.
MiniProgramVibrationEffect
Short system haptic effects; arbitrary durations and repeating patterns are intentionally unavailable. The operating system owns strength and settings.

Extensions

CallSecureApiActionPayloadPatterns on CallSecureApiActionPayload
Adds pattern-matching-related methods to CallSecureApiActionPayload.
CapabilityX on Capability
Deprecated compatibility helpers for old enum-based code.
HostActionRequestPatterns on HostActionRequest
Adds pattern-matching-related methods to HostActionRequest.
HostActionResultPatterns on HostActionResult
Adds pattern-matching-related methods to HostActionResult.
HostActionResultX on HostActionResult
MiniProgramCachePolicyPatterns on MiniProgramCachePolicy
Adds pattern-matching-related methods to MiniProgramCachePolicy.
MiniProgramCacheRulePatterns on MiniProgramCacheRule
Adds pattern-matching-related methods to MiniProgramCacheRule.
MiniProgramCacheRuleX on MiniProgramCacheRule
MiniProgramFallbackPatterns on MiniProgramFallback
Adds pattern-matching-related methods to MiniProgramFallback.
MiniProgramFileTransferDirectionX on MiniProgramFileTransferDirection
Converts a file transfer direction to its wire value.
MiniProgramFileTransferStatusX on MiniProgramFileTransferStatus
Converts a file transfer status to its wire value.
MiniProgramLocationAccuracyX on MiniProgramLocationAccuracy
MiniProgramLocationModeX on MiniProgramLocationMode
MiniProgramManifestPatterns on MiniProgramManifest
Adds pattern-matching-related methods to MiniProgramManifest.
MiniProgramManifestX on MiniProgramManifest
OpenNativeScreenActionPayloadPatterns on OpenNativeScreenActionPayload
Adds pattern-matching-related methods to OpenNativeScreenActionPayload.
SdkVersionRangePatterns on SdkVersionRange
Adds pattern-matching-related methods to SdkVersionRange.
SdkVersionRangeX on SdkVersionRange
TrackEventActionPayloadPatterns on TrackEventActionPayload
Adds pattern-matching-related methods to TrackEventActionPayload.

Constants

miniProgramClipboardMaxTextLength → const int
Maximum plain-text clipboard length across the wire (UTF-16 code units).
miniProgramGalleryMaxImages → const int
Maximum number of images in one gallery selection.
miniProgramQrMaxValueLength → const int
Maximum QR payload length exposed to mini-program live state.

Functions

miniProgramLocationAccuracyFromWire(String value) → MiniProgramLocationAccuracy
miniProgramLocationModeFromWire(String value) → MiniProgramLocationMode
normalizeMiniProgramPhoneNumber(String value) → String
Normalizes an ordinary phone number for a user-controlled system dialer. Rejects schemes, extensions, pauses, USSD/MMI codes and control characters.

Typedefs

CapabilityId = String
Stable wire ID for a host capability.
FeatureFlagKey = String
MiniProgramScreenFormat = String
Stable wire ID for a screen document format.