appframe-updater
Programmatic API for driving the Appframe updater system from Node or the browser. It wraps Appframe data handlers and procedures to check for, download, generate, deploy and apply updates across namespaces.
Purpose
Provide a small, typed API on top of Appframe’s updater endpoints and procedures.
Enable CI/CD flows and admin tools to automate update lifecycles (check → download → generate → deploy → apply).
Work with the same
Clienttype as@olenbetong/appframe-datafor consistency and reuse of auth/host configuration.
High‑Level Concepts
Namespace: Logical grouping of updates for an application or domain. Many operations can be scoped to a specific namespace by ID or name.
Transactions: Individual update tasks generated per namespace before deployment. The package exposes helpers for listing transactions when needed.
Procedures: Server-side procedures backing core actions:
generate: Create transactions for one or more namespaces.
deploy: Deploy (publish) generated transactions for a namespace or all.
apply: Apply deployed updates to the target environment.
Client: All functions accept a
Clientfrom@olenbetong/appframe-data. Use the default client in the browser, or create/configure one in Node with a hostname and authentication.
Update Lifecycle (Typical Flow)
checkForUpdates: Ask the server which namespaces have updates available to download.
download: Download update packages for a namespace (optionally retrying on transient errors).
generate: Produce transactions for the namespace(s) you intend to deploy.
deploy: Deploy transactions for the selected namespace(s).
apply: Apply deployed updates. Can be run globally or scoped to a namespace.
You may run a subset of the steps depending on your environment and release process.
Key APIs
checkForUpdates(client): Returns a list of
{ Namespace, Updates }with counts. See: ./checkForUpdates.mddownload(client, namespace): Downloads updates for a specific namespace name. See: ./download.md
generate(client, namespace?): Generates transactions for one or all namespaces. See: ./generate.md
deploy(client, namespace?): Deploys transactions for one or all namespaces. See: ./deploy.md
apply(client, namespace?): Applies updates for one or all namespaces. See: ./apply.md
Utilities and data handlers
createNamespaceDataHandler: Data handler for retrieving namespaces.
getNamespace: Resolve a namespace by ID or name to its canonical record.
dsTransactions exports: Helpers around transactions data access.
Usage
Install:
Set up a client (Node example):
Check and download updates for a namespace:
Generate, deploy, then apply for a single namespace:
Apply everything (no namespace filter):
Notes & Recommendations
Idempotency: Server procedures are designed to be safe to run when nothing is pending; you’ll simply get no‑ops.
Scope: Prefer scoping to a namespace in automated pipelines to avoid unintended cross‑app changes.
Ordering: Typical order is generate → deploy → apply. Download is only required when your updater expects server-side packages.
Errors: Functions throw on HTTP/procedure errors; wrap in try/catch in automation scripts and surface meaningful logs.
Performance:
generatewithout a namespace retrieves all namespaces. Consider providing a specific namespace ID/name in most flows.
Last updated
Was this helpful?