iRetail PRO store node 1.0.0-m1: updates

13 operations

← All documentation · Source: contracts openapi/store-v1.yaml at 8000474.

← iRetail PRO store node 1.0.0-m1

Operations

GET /v1/update This store's update (spec/RELEASES.md, The store's update) — the running and previous release, the target, its state, the backup's and rehearsal's outcomes, background tasks, the hub's refusal if the exchange is refused, and its apps' versions and offers.

operationId getStoreUpdate · Permission store.read

Parameters

Name In Type Description
IRetail-App header string Which app sends the request, at which version: <app>/<version>, optionally a space and (<platform>), as cashier/1.2.0 (windows-x64) or manager/1.2.0 (web). The register (cashier), the back office and the console (manager) and the device gateway (gateway) send it on every request; a request without it is not one of the apps and is served as the current API, and a device token of an app's kind without it is an app of an unknown version; a header that does not parse counts as absent. The node may refuse an app 426 app_update_required by it, except on the operations marked x-app-update-exempt. Not a security boundary (spec/API.md, Transport; spec/RELEASES.md, Who is asking).

Responses

PUT /v1/update A store with no hub sets its own update target (spec/RELEASES.md, A store with no hub), which its updater applies. 409 owned_by_hub in a store of a chain; 400 bad_version, 400 bad_request (action, window); 404 for a version not held; 409 release_not_verified; 422 release_refused (downgrade).

operationId putStoreUpdate · Permission release.manage

Parameters

Name In Type Description
IRetail-App header string Which app sends the request, at which version: <app>/<version>, optionally a space and (<platform>), as cashier/1.2.0 (windows-x64) or manager/1.2.0 (web). The register (cashier), the back office and the console (manager) and the device gateway (gateway) send it on every request; a request without it is not one of the apps and is served as the current API, and a device token of an app's kind without it is an app of an unknown version; a header that does not parse counts as absent. The node may refuse an app 426 app_update_required by it, except on the operations marked x-app-update-exempt. Not a security boundary (spec/API.md, Transport; spec/RELEASES.md, Who is asking).

Request body required

Responses

  • 200 The store's update with its new target. StoreUpdate
  • 400 Error (spec/API.md). Error
  • 401 Error (spec/API.md). Error
  • 403 Error (spec/API.md). Error
  • 404 Error (spec/API.md). Error
  • 409 Error (spec/API.md). Error
  • 422 Error (spec/API.md). Error
GET /v1/app-update What an app or the gateway should run, by the release the node runs, one device of the store first (spec/RELEASES.md, The apps); the installer comes from this node.

operationId getAppUpdate · Permission store.read

Parameters

Name In Type Description
IRetail-App header string Which app sends the request, at which version: <app>/<version>, optionally a space and (<platform>), as cashier/1.2.0 (windows-x64) or manager/1.2.0 (web). The register (cashier), the back office and the console (manager) and the device gateway (gateway) send it on every request; a request without it is not one of the apps and is served as the current API, and a device token of an app's kind without it is an app of an unknown version; a header that does not parse counts as absent. The node may refuse an app 426 app_update_required by it, except on the operations marked x-app-update-exempt. Not a security boundary (spec/API.md, Transport; spec/RELEASES.md, Who is asking).
app required query "cashier" | "manager" | "gateway" The app; 400 bad_request (field app) for another.
platform required query ReleasePlatform
current query string The app's own version; 400 bad_version when it does not parse. Left out for a first install (spec/RELEASES.md, First install), which is never made to wait.

Responses

POST /v1/app-update/report An app or the gateway reports where its update stands (spec/RELEASES.md, Reporting); kept as the device's Device.app.

A device's token, or an employee's session on a device (403 forbidden, details principal device, for any other). At most 1 KiB (413 payload_too_large) and one accepted report a minute per device (429 too_many_requests, details limit app_report and retry_after). The app must be the device's own (400 bad_request, field app).

operationId postAppUpdateReport

Parameters

Name In Type Description
IRetail-App header string Which app sends the request, at which version: <app>/<version>, optionally a space and (<platform>), as cashier/1.2.0 (windows-x64) or manager/1.2.0 (web). The register (cashier), the back office and the console (manager) and the device gateway (gateway) send it on every request; a request without it is not one of the apps and is served as the current API, and a device token of an app's kind without it is an app of an unknown version; a header that does not parse counts as absent. The node may refuse an app 426 app_update_required by it, except on the operations marked x-app-update-exempt. Not a security boundary (spec/API.md, Transport; spec/RELEASES.md, Who is asking).

Request body required

Responses

  • 204 Kept.
  • 400 Error (spec/API.md). Error
  • 401 Error (spec/API.md). Error
  • 403 Error (spec/API.md). Error
  • 413 Error (spec/API.md). Error
  • 429 Error (spec/API.md). Error
POST /v1/app-update/clear Clear the store's hold of a release for an app and platform after its first device failed it (spec/RELEASES.md, One device first); the next device to ask becomes the first again. 404 when nothing is held.

operationId clearAppUpdateHold · Permission release.manage

Parameters

Name In Type Description
IRetail-App header string Which app sends the request, at which version: <app>/<version>, optionally a space and (<platform>), as cashier/1.2.0 (windows-x64) or manager/1.2.0 (web). The register (cashier), the back office and the console (manager) and the device gateway (gateway) send it on every request; a request without it is not one of the apps and is served as the current API, and a device token of an app's kind without it is an app of an unknown version; a header that does not parse counts as absent. The node may refuse an app 426 app_update_required by it, except on the operations marked x-app-update-exempt. Not a security boundary (spec/API.md, Transport; spec/RELEASES.md, Who is asking).

Request body required

Responses

  • 204 Cleared.
  • 400 Error (spec/API.md). Error
  • 401 Error (spec/API.md). Error
  • 403 Error (spec/API.md). Error
  • 404 Error (spec/API.md). Error
GET /v1/releases The releases a store with no hub holds, the latest version first (spec/RELEASES.md, A store with no hub); 409 owned_by_hub in a store of a chain.

operationId listStoreReleases · Permission release.read

Parameters

Name In Type Description
IRetail-App header string Which app sends the request, at which version: <app>/<version>, optionally a space and (<platform>), as cashier/1.2.0 (windows-x64) or manager/1.2.0 (web). The register (cashier), the back office and the console (manager) and the device gateway (gateway) send it on every request; a request without it is not one of the apps and is served as the current API, and a device token of an app's kind without it is an app of an unknown version; a header that does not parse counts as absent. The node may refuse an app 426 app_update_required by it, except on the operations marked x-app-update-exempt. Not a security boundary (spec/API.md, Transport; spec/RELEASES.md, Who is asking).
limit query integer Page size, 1–200.
after query string Cursor from the previous page.

Responses

  • 200 OK object
  • 401 Error (spec/API.md). Error
  • 403 Error (spec/API.md). Error
  • 409 Error (spec/API.md). Error
GET /v1/releases/available What the source (IRETAIL_RELEASES_URL) offers as its latest release, and whether this store holds it. 409 owned_by_hub in a store of a chain, 409 release_source_missing with downloading off, 503 release_source_unreachable.

operationId getStoreAvailableRelease · Permission release.read

Parameters

Name In Type Description
IRetail-App header string Which app sends the request, at which version: <app>/<version>, optionally a space and (<platform>), as cashier/1.2.0 (windows-x64) or manager/1.2.0 (web). The register (cashier), the back office and the console (manager) and the device gateway (gateway) send it on every request; a request without it is not one of the apps and is served as the current API, and a device token of an app's kind without it is an app of an unknown version; a header that does not parse counts as absent. The node may refuse an app 426 app_update_required by it, except on the operations marked x-app-update-exempt. Not a security boundary (spec/API.md, Transport; spec/RELEASES.md, Who is asking).

Responses

POST /v1/releases/download A store with no hub downloads a release from its source, as the hub does; the manifest is verified before answering (422 release_refused), the artifacts it keeps (roles with store) follow. 409 owned_by_hub in a store of a chain, 409 release_storage_missing without IRETAIL_RELEASES_DIR.

operationId downloadStoreRelease · Permission release.manage

Parameters

Name In Type Description
IRetail-App header string Which app sends the request, at which version: <app>/<version>, optionally a space and (<platform>), as cashier/1.2.0 (windows-x64) or manager/1.2.0 (web). The register (cashier), the back office and the console (manager) and the device gateway (gateway) send it on every request; a request without it is not one of the apps and is served as the current API, and a device token of an app's kind without it is an app of an unknown version; a header that does not parse counts as absent. The node may refuse an app 426 app_update_required by it, except on the operations marked x-app-update-exempt. Not a security boundary (spec/API.md, Transport; spec/RELEASES.md, Who is asking).

Request body required

Responses

  • 200 Already held. Release
  • 202 Downloading; the release turns verified or failed. Release
  • 400 Error (spec/API.md). Error
  • 401 Error (spec/API.md). Error
  • 403 Error (spec/API.md). Error
  • 409 Error (spec/API.md). Error
  • 422 Error (spec/API.md). Error
  • 503 Error (spec/API.md). Error
POST /v1/releases/import A store with no hub imports a release bundle (the raw body, a POSIX tar), verified as it streams, as the hub does; it keeps the artifacts whose roles hold store. 409 owned_by_hub in a store of a chain.

The bundle's rules are the hub's (spec/RELEASES.md, Importing a bundle).

operationId importStoreRelease · Permission release.manage

Parameters

Name In Type Description
IRetail-App header string Which app sends the request, at which version: <app>/<version>, optionally a space and (<platform>), as cashier/1.2.0 (windows-x64) or manager/1.2.0 (web). The register (cashier), the back office and the console (manager) and the device gateway (gateway) send it on every request; a request without it is not one of the apps and is served as the current API, and a device token of an app's kind without it is an app of an unknown version; a header that does not parse counts as absent. The node may refuse an app 426 app_update_required by it, except on the operations marked x-app-update-exempt. Not a security boundary (spec/API.md, Transport; spec/RELEASES.md, Who is asking).

Request body required

  • application/x-tar string (binary)

Responses

  • 200 The same manifest is already held. Release
  • 201 Imported and verified. Release
  • 400 Error (spec/API.md). Error
  • 401 Error (spec/API.md). Error
  • 403 Error (spec/API.md). Error
  • 409 Error (spec/API.md). Error
  • 422 Error (spec/API.md). Error
GET /v1/releases/{version} One release a store with no hub holds, with its signed manifest; 409 owned_by_hub in a store of a chain.

operationId getStoreRelease · Permission release.read

Parameters

Name In Type Description
version required path string A release's version (spec/RELEASES.md).
IRetail-App header string Which app sends the request, at which version: <app>/<version>, optionally a space and (<platform>), as cashier/1.2.0 (windows-x64) or manager/1.2.0 (web). The register (cashier), the back office and the console (manager) and the device gateway (gateway) send it on every request; a request without it is not one of the apps and is served as the current API, and a device token of an app's kind without it is an app of an unknown version; a header that does not parse counts as absent. The node may refuse an app 426 app_update_required by it, except on the operations marked x-app-update-exempt. Not a security boundary (spec/API.md, Transport; spec/RELEASES.md, Who is asking).

Responses

  • 200 OK Release
  • 401 Error (spec/API.md). Error
  • 403 Error (spec/API.md). Error
  • 404 Error (spec/API.md). Error
  • 409 Error (spec/API.md). Error
DELETE /v1/releases/{version} Remove a release and its files; 409 release_in_use while the store runs it, ran it before or its own target names it; 409 owned_by_hub in a store of a chain.

operationId deleteStoreRelease · Permission release.manage

Parameters

Name In Type Description
version required path string A release's version (spec/RELEASES.md).
IRetail-App header string Which app sends the request, at which version: <app>/<version>, optionally a space and (<platform>), as cashier/1.2.0 (windows-x64) or manager/1.2.0 (web). The register (cashier), the back office and the console (manager) and the device gateway (gateway) send it on every request; a request without it is not one of the apps and is served as the current API, and a device token of an app's kind without it is an app of an unknown version; a header that does not parse counts as absent. The node may refuse an app 426 app_update_required by it, except on the operations marked x-app-update-exempt. Not a security boundary (spec/API.md, Transport; spec/RELEASES.md, Who is asking).

Responses

  • 204 Removed.
  • 401 Error (spec/API.md). Error
  • 403 Error (spec/API.md). Error
  • 404 Error (spec/API.md). Error
  • 409 Error (spec/API.md). Error
GET /v1/releases/{version}/manifest The signed manifest of a release this node holds (the one it runs, ran before or is given; at a store with no hub, any it holds verified); for the updater (its token), devices and employees. The caller verifies it with its own embedded keys.

operationId getReleaseManifest · Permission store.read

Parameters

Name In Type Description
version required path string A release's version (spec/RELEASES.md).
IRetail-App header string Which app sends the request, at which version: <app>/<version>, optionally a space and (<platform>), as cashier/1.2.0 (windows-x64) or manager/1.2.0 (web). The register (cashier), the back office and the console (manager) and the device gateway (gateway) send it on every request; a request without it is not one of the apps and is served as the current API, and a device token of an app's kind without it is an app of an unknown version; a header that does not parse counts as absent. The node may refuse an app 426 app_update_required by it, except on the operations marked x-app-update-exempt. Not a security boundary (spec/API.md, Transport; spec/RELEASES.md, Who is asking).

Responses

GET /v1/releases/{version}/artifacts/{name} A file of a release this node holds, verified when it arrived; Range resumes a broken download. The caller checks its size and SHA-256 against the manifest.

operationId getReleaseArtifact · Permission store.read

Parameters

Name In Type Description
version required path string A release's version (spec/RELEASES.md).
name required path string The artifact's name in the manifest.
IRetail-App header string Which app sends the request, at which version: <app>/<version>, optionally a space and (<platform>), as cashier/1.2.0 (windows-x64) or manager/1.2.0 (web). The register (cashier), the back office and the console (manager) and the device gateway (gateway) send it on every request; a request without it is not one of the apps and is served as the current API, and a device token of an app's kind without it is an app of an unknown version; a header that does not parse counts as absent. The node may refuse an app 426 app_update_required by it, except on the operations marked x-app-update-exempt. Not a security boundary (spec/API.md, Transport; spec/RELEASES.md, Who is asking).
Range header string One byte range, bytes=<first>- or bytes=<first>-<last>.

Responses

  • 200 The whole file. string (binary)
  • 206 The range asked for, with Content-Range. string (binary)
  • 401 Error (spec/API.md). Error
  • 403 Error (spec/API.md). Error
  • 404 Error (spec/API.md). Error
  • 416 The range is outside the file.

Schemas

Error object

Every error response.

error required string Stable code, see spec/API.md.
message required string English text for logs.
details object

ReleasePlatform "linux-x64" | "linux-arm64" | "windows-x64" | "macos-universal"

A platform a release ships for (spec/RELEASES.md).

linux-x64 · linux-arm64 · windows-x64 · macos-universal

ArtifactValue string

An artifact's kind, component, platform or role, a token; a later release may add values, which an earlier verifier keeps as written and never needs (spec/RELEASES.md, Values a later release adds).

ReleaseArtifact object

An artifact as the signed manifest lists it (spec/RELEASES.md, The manifest); image, digest and image_id on images only. Fields not named here are signed and ignored, and so are the image fields of a kind this version does not know.

name required string
kind required ArtifactValue image, installer, binary or archive; a later release may add a value.
component required ArtifactValue node, console, updater, cashier, manager, gateway or deploy; a later release may add a value.
platform required ArtifactValue linux-x64, linux-arm64, windows-x64, macos-universal, or any for the deployment kit; a later release may add a value.
roles required array of ArtifactValue
sha256 required string
size required integer (int64)
image string The repository the image is published to.
digest string The image's OCI manifest digest.
image_id string The image's configuration digest, as Docker reports it.

ReleaseManifest object

What is signed (spec/RELEASES.md, What is signed); fields not named here are signed and ignored.

format required "iretail-release"
format_version required 1
version required string
published_at required string (date-time)
contracts_commit required string
min_node_version required string
artifacts required array of ReleaseArtifact

ReleaseManifestDocument object

The signed manifest document; the signature covers "IRM1\n" and the canonical form of manifest (schemas/release-manifest.schema.json).

manifest required ReleaseManifest
signatures required array of object

UpdateWindow object

Local wall-clock hours, from inclusive to exclusive; to before from runs past midnight (spec/RELEASES.md, The window).

from required string
to required string

UpdateState "idle" | "downloading" | "waiting_window" | "applying" | "verifying" | "done" | "failed" | "rolled_back" | "manual"

A store's update state (spec/RELEASES.md, The states).

idle · downloading · waiting_window · applying · verifying · done · failed · rolled_back · manual

UpdateStep "download" | "verify" | "backup" | "rehearse" | "load" | "migrate" | "start" | "check"

The step a failed or rolled back update stopped at.

download · verify · backup · rehearse · load · migrate · start · check

UpdateTarget object

A store's update target, the hub-owned update_target record addressed to that store (spec/RELEASES.md, The target).

store_id required string (uuid)
release required string The version to run.
action required "update" | "rollback"
manifest required ReleaseManifestDocument
window required UpdateWindow | null In the store's time zone; null for at once.
rollout_id required string (uuid) | null The rollout that gave it; null for a store's own target (spec/RELEASES.md, A store with no hub).
ordered_at required string (date-time)
apps_cleared_at string (date-time) | null When a person last cleared the store's held apps for this release; the store clears every hold that began before it (spec/RELEASES.md, One device first). Null when never; absent from a hub before 1.1.
version required integer (int64)

Compatibility object

Why the hub refuses this node (spec/RELEASES.md, Compatibility).

reason required "node_too_old" | "node_too_new"
hub_version required string
min_node_version required string The hub's effective minimum.

StoreUpdate object

running_version required string
previous_version required string | null
target required UpdateTarget | null The store's update target as the hub sent it; null with none.
state required UpdateState
state_since required string (date-time) | null
step required UpdateStep | null
error required string | null
updater required "compose" | "none" Whether an updater runs beside the node (compose) or not (none, the state is manual).
healthz required "ok" | "failing" | null The updater's last probe of GET /healthz; null when nothing probes it.
compatibility required Compatibility | null The hub's refusal while the exchange is refused; null otherwise.
backup required UpdateBackup | null The pre-update archive of the target's attempt; null before the updater reached it.
rehearsal required UpdateRehearsal | null The rehearsal of the target's migrations; null before the updater reached it.
background_tasks required array of BackgroundTask The node's background tasks, by the release that brought each (spec/RELEASES.md, Migrations).
apps required array of AppVersionCount Per app, platform and version, how many of the store's devices run it, failed it and are silent (spec/RELEASES.md, Reporting).
app_offers required array of AppOffer The offers of the release the node runs, one per app and platform (spec/RELEASES.md, One device first).

UpdateBackup "taken" | "failed" | "skipped"

The pre-update archive (spec/BACKUP.md, Before an update); skipped comes only from an updater before 1.1.

taken · failed · skipped

UpdateRehearsal object

outcome required "passed" | "failed" | "skipped"
reason required "too_large" | "disk" | "not_permitted" | null Why it was skipped (spec/RELEASES.md, Rehearsal); null otherwise.

BackgroundTask object

id required string
release required string The release that brought it.
state required "pending" | "running" | "done" | "failed"
done required integer (int64) Batches or rows done, as the task counts them.
total required integer (int64) | null What it has to do in the same unit, when known; null otherwise.
started_at required string (date-time) | null
finished_at required string (date-time) | null
error required string | null A short code, never a log's text; null otherwise.

StoreUpdatePut object

version required string
action required "update" | "rollback"
window UpdateWindow | null In the store's time zone; null for at once; left out, 02:00 to 05:00.

Release object

A release a hub, or a store with no hub, holds (spec/RELEASES.md, The hub's releases, A store with no hub).

id required string (uuid)
version required string
status required "downloading" | "verified" | "failed"
source required "download" | "bundle"
published_at required string (date-time)
min_node_version required string
contracts_commit required string
key_id required string The embedded key whose signature verified.
artifacts required array of object Every artifact at the hub, with its values as written; at a store with no hub, those it keeps (roles with store, of values it knows).
size required integer (int64) The artifacts' bytes together.
error required string | null Why it failed, a refusal code of spec/RELEASES.md or source_unreachable or storage_failed; null otherwise.
imported_at required string (date-time)
imported_by required string (uuid) The employee or integration that asked for it.
in_use required boolean At the hub, the hub or a store runs it, ran it before or is given it, or an unfinished rollout takes it; at a store with no hub, the store runs it, ran it before or its own target names it.
manifest required ReleaseManifestDocument

ReleaseDownload object

version required string A version, or latest for what version.json names.

AvailableRelease object

source required string The source's URL.
latest required object | null
held required boolean The node holds the latest version already.
checked_at required string (date-time)

AppUpdate object

action required "none" | "update" | "rollback" | "wait" update or rollback to the release; wait while the store's first device tries it; none otherwise (spec/RELEASES.md, Asking).
reason required "canary" | "current" | "no_installer" | "held" | null For wait, canary; for none, current, no_installer or held; null for update and rollback.
release required string The release the node runs; what the app should run.
manifest_url required string | null For update and rollback; null otherwise.
retry_after_seconds required integer | null For wait, when to ask again (600); null otherwise.
install required "automatic" | "ask" automatic, or ask for a back office whose store's back_office_updates says so (the console, the hub's office store's); every other app automatic (spec/RELEASES.md, Installing).
installer required object | null For update and rollback, the installer for the app and platform (for the gateway, its archive); null otherwise and when the node holds none.

AppId "cashier" | "manager" | "gateway"

An app that updates itself from its node (spec/RELEASES.md, The apps, The gateway); the manifest's component.

cashier · manager · gateway

AppUpdateState "idle" | "downloading" | "ready" | "waiting" | "installing" | "installed" | "failed" | "rolled_back"

Where an app's update stands (spec/RELEASES.md, Reporting).

idle · downloading · ready · waiting · installing · installed · failed · rolled_back

AppUpdateStep "download" | "verify" | "migrate" | "install" | "start"

The step a failed or rolled back app update stopped at.

download · verify · migrate · install · start

AppUpdateError "malformed" | "unsupported_format" | "unknown_key" | "bad_signature" | "downgrade" | "missing_artifact" | "size_mismatch" | "sha256_mismatch" | "unknown_artifact" | "install_marker" | "source_unreachable" | "storage_failed" | "install_failed" | "start_failed"

Why an app update stopped, one code, never text from outside (spec/RELEASES.md, Reporting).

malformed · unsupported_format · unknown_key · bad_signature · downgrade · missing_artifact · size_mismatch · sha256_mismatch · unknown_artifact · install_marker · source_unreachable · storage_failed · install_failed · start_failed

AppUpdateReport object

At most 1 KiB. step and error are given exactly for failed and rolled_back; target_version except in idle, and equal to version in installed.

app required AppId
platform required ReleasePlatform
version required string The version it runs.
previous_version required string | null The version it keeps for one rollback; null for none.
target_version required string | null The version it is updating to, or that failed; null in idle.
state required AppUpdateState
step required AppUpdateStep | null
error required AppUpdateError | null

AppUpdateClear object

app required AppId
platform required ReleasePlatform
release required string

AppVersionCount object

Counts only, never a device (spec/RELEASES.md, Reporting).

app required AppId
platform required ReleasePlatform
version required string
devices required integer Active devices whose last report runs this version.
failed required integer Of those, the ones failed or rolled back.
silent required integer Of those, the ones whose last report is more than 60 minutes old.

AppOffer object

The offer of the release the node runs for one app and platform (spec/RELEASES.md, One device first); no device named.

app required AppId
platform required ReleasePlatform
release required string
state required "offered" | "installed" | "proven" | "held"
since required string (date-time)