DBDelve
Dive deep into your data. A fast, native, multi-engine database client written in Rust. Free and open source, no telemetry.
翻译准备中
MeroKit — native Swift SDK for building iOS apps against a remote Calimero node (auth, token refresh, JSON-RPC, admin API, SSO).
翻译准备中
正在加载完整 README。
查看完整 README ↗The native Swift SDK for Calimero 1.0, the confidential cloud. It verifies a
node's TDX attestation, seals every request to it, signs people in with
passkeys, and gives a SwiftUI app its organizations, teams, app instances and
live events. It is the Swift port of
mero-js ≥27 CalimeroClient:
the same methods, the same typed errors, the same retry and failover rules.
1.0.0-rc.10, ci/core-version),
or merod local for development..package(url: "https://github.com/calimero-network/swift-sdk", branch: "master")
| Product | What it is |
|---|---|
MeroKit | CalimeroClient and its generated API facade, the sealed channel, TEE trust, passkeys (SoftPasskey), the app layer protocols (MeroAppBackend, ContextContract). |
MeroAPI | The client generated from core's OpenAPI document: Components.Schemas.*, Operations.*, the types the facade answers. |
MeroKitUI | MeroAppSession, MeroClient, CalimeroAppBackend, PlatformPasskey, the consent page in the system browser. |
MeroKitTestSupport | InMemoryAppBackend, RecordingContextContract, FakeCloudNode + FakeCloud (a node that runs the real sealed channel, and a cluster in memory), MockURLProtocol. |
Before committing, titling a pull request, or releasing, read RELEASING.md: the PR title is the release commit, and the rules are shared by every Calimero repository that ships releases.
import MeroKit
// Development: `cargo run -p merod -- local` (3 nodes, mock attestation).
let client = CalimeroClient(CalimeroClientOptions(
baseUrl: "http://127.0.0.1:2501", nodes: ["http://127.0.0.1:2502"], policy: .development))
try await client.signUp(SoftPasskey(), name: "ada")
// Production: real TDX quotes from a signed mero-tee release ≥ 2.3.109.
let cloud = CalimeroClient(CalimeroClientOptions(baseUrl: nodeURL, policy: .production))
try await cloud.signIn(PlatformPasskey())
let org = try await cloud.orgs.create(name: "Acme").orgId
let app = try await cloud.apps.create(name: "chat", package: "com.calimero.chat", org: org).appId
_ = try await cloud.call(app, "send_message", ["message": "hi"]) // POST /apps/{app}/intents
let page = try await cloud.view(app, "get_messages", [:]) // POST /apps/{app}/views
for try await event in cloud.events(app) { print(event.kind) } // sealed SSE
Every route of the node API is a method of CalimeroClient, grouped as the
OpenAPI document groups them (x-calimero-group): auth, apps, orgs,
consent, ops, packages, deployments (sign-up, deployers,
deployments) and publicApi (public is a keyword). Each takes the path parameters, the JSON body's fields and the query
as labelled arguments and answers the typed success value (import MeroAPI
to name it); a refusal throws the same typed errors as below.
let org = try await cloud.orgs.get(org: orgId) // Operations.OrgGet.Output.Ok.Body.JsonPayload
let invite = try await cloud.orgs.inviteCreate(org: orgId, role: .member, passkey: passkey)
await cloud.useStepUp(PlatformPasskey()) // answers any 412 without a `passkey:`
try await cloud.orgs.delete(org: orgId)
await cloud.useOperatorSigner(try Ed25519OperatorKey(raw: seed)) // answers a 428
Operations the document marks x-calimero-retry-safe (views, and calls
with an idempotencyKey) are retried on a 503 and fail over as call does.
A 412 CONFIRM_REQUIRED is answered with the call's passkey:, else the
client's (useStepUp); a 428 OPERATOR_SIGNATURE_REQUIRED with the call's
operatorSigner:, else the client's (useOperatorSigner). client.api is
swift-openapi-generator's own Client over the same transport.
The facade (Sources/MeroKit/Api/Generated) and MeroAPI
(Sources/MeroAPI/Generated) are generated from
openapi/openapi.json, core's document at the commit
in openapi/source, by
scripts/generate-openapi.sh, and checked in:
refresh [REF] vendors a newer document, check (a CI job) fails on stale
output. MeroKit 1.0 removed the 0.x wrappers (getOrg, invite,
createApp, ...): CHANGELOG.md maps each to its facade
method. call/view (idempotent retries, failover, exact numbers), the
sign-in ceremonies, the event streams and the escape hatches (post,
postConfirmed, ...) are hand-written.
以上为 README 的开头部分。其余内容请阅读原文。 查看完整 README ↗