iRetail PRO store node 1.0.0-m1: updates

13 операций

← Вся документация · Источник: контракты, openapi/store-v1.yaml на коммите 8000474.

Справочники на английском — на языке контрактов, из которых они созданы.

← iRetail PRO store node 1.0.0-m1

Операции

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 · Право store.read

Параметры

Имя Где Тип Описание
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).

Ответы

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 · Право release.manage

Параметры

Имя Где Тип Описание
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).

Тело запроса обязательный

Ответы

  • 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 · Право store.read

Параметры

Имя Где Тип Описание
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 обязательный query "cashier" | "manager" | "gateway" The app; 400 bad_request (field app) for another.
platform обязательный 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.

Ответы

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

Параметры

Имя Где Тип Описание
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).

Тело запроса обязательный

Ответы

  • 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 · Право release.manage

Параметры

Имя Где Тип Описание
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).

Тело запроса обязательный

Ответы

  • 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 · Право release.read

Параметры

Имя Где Тип Описание
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.

Ответы

  • 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 · Право release.read

Параметры

Имя Где Тип Описание
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).

Ответы

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 · Право release.manage

Параметры

Имя Где Тип Описание
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).

Тело запроса обязательный

Ответы

  • 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 · Право release.manage

Параметры

Имя Где Тип Описание
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).

Тело запроса обязательный

  • application/x-tar string (binary)

Ответы

  • 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 · Право release.read

Параметры

Имя Где Тип Описание
version обязательный 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).

Ответы

  • 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 · Право release.manage

Параметры

Имя Где Тип Описание
version обязательный 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).

Ответы

  • 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 · Право store.read

Параметры

Имя Где Тип Описание
version обязательный 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).

Ответы

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 · Право store.read

Параметры

Имя Где Тип Описание
version обязательный path string A release's version (spec/RELEASES.md).
name обязательный 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>.

Ответы

  • 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.

Схемы

Error object

Every error response.

error обязательный string Stable code, see spec/API.md.
message обязательный 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 обязательный string
kind обязательный ArtifactValue image, installer, binary or archive; a later release may add a value.
component обязательный ArtifactValue node, console, updater, cashier, manager, gateway or deploy; a later release may add a value.
platform обязательный ArtifactValue linux-x64, linux-arm64, windows-x64, macos-universal, or any for the deployment kit; a later release may add a value.
roles обязательный array of ArtifactValue
sha256 обязательный string
size обязательный 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 обязательный "iretail-release"
format_version обязательный 1
version обязательный string
published_at обязательный string (date-time)
contracts_commit обязательный string
min_node_version обязательный string
artifacts обязательный 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 обязательный ReleaseManifest
signatures обязательный 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 обязательный string
to обязательный 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 обязательный string (uuid)
release обязательный string The version to run.
action обязательный "update" | "rollback"
manifest обязательный ReleaseManifestDocument
window обязательный UpdateWindow | null In the store's time zone; null for at once.
rollout_id обязательный 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 обязательный 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 обязательный integer (int64)

Compatibility object

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

reason обязательный "node_too_old" | "node_too_new"
hub_version обязательный string
min_node_version обязательный string The hub's effective minimum.

StoreUpdate object

running_version обязательный string
previous_version обязательный string | null
target обязательный UpdateTarget | null The store's update target as the hub sent it; null with none.
state обязательный UpdateState
state_since обязательный string (date-time) | null
step обязательный UpdateStep | null
error обязательный string | null
updater обязательный "compose" | "none" Whether an updater runs beside the node (compose) or not (none, the state is manual).
healthz обязательный "ok" | "failing" | null The updater's last probe of GET /healthz; null when nothing probes it.
compatibility обязательный Compatibility | null The hub's refusal while the exchange is refused; null otherwise.
backup обязательный UpdateBackup | null The pre-update archive of the target's attempt; null before the updater reached it.
rehearsal обязательный UpdateRehearsal | null The rehearsal of the target's migrations; null before the updater reached it.
background_tasks обязательный array of BackgroundTask The node's background tasks, by the release that brought each (spec/RELEASES.md, Migrations).
apps обязательный 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 обязательный 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 обязательный "passed" | "failed" | "skipped"
reason обязательный "too_large" | "disk" | "not_permitted" | null Why it was skipped (spec/RELEASES.md, Rehearsal); null otherwise.

BackgroundTask object

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

StoreUpdatePut object

version обязательный string
action обязательный "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 обязательный string (uuid)
version обязательный string
status обязательный "downloading" | "verified" | "failed"
source обязательный "download" | "bundle"
published_at обязательный string (date-time)
min_node_version обязательный string
contracts_commit обязательный string
key_id обязательный string The embedded key whose signature verified.
artifacts обязательный 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 обязательный integer (int64) The artifacts' bytes together.
error обязательный string | null Why it failed, a refusal code of spec/RELEASES.md or source_unreachable or storage_failed; null otherwise.
imported_at обязательный string (date-time)
imported_by обязательный string (uuid) The employee or integration that asked for it.
in_use обязательный 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 обязательный ReleaseManifestDocument

ReleaseDownload object

version обязательный string A version, or latest for what version.json names.

AvailableRelease object

source обязательный string The source's URL.
latest обязательный object | null
held обязательный boolean The node holds the latest version already.
checked_at обязательный string (date-time)

AppUpdate object

action обязательный "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 обязательный "canary" | "current" | "no_installer" | "held" | null For wait, canary; for none, current, no_installer or held; null for update and rollback.
release обязательный string The release the node runs; what the app should run.
manifest_url обязательный string | null For update and rollback; null otherwise.
retry_after_seconds обязательный integer | null For wait, when to ask again (600); null otherwise.
install обязательный "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 обязательный 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 обязательный AppId
platform обязательный ReleasePlatform
version обязательный string The version it runs.
previous_version обязательный string | null The version it keeps for one rollback; null for none.
target_version обязательный string | null The version it is updating to, or that failed; null in idle.
state обязательный AppUpdateState
step обязательный AppUpdateStep | null
error обязательный AppUpdateError | null

AppUpdateClear object

app обязательный AppId
platform обязательный ReleasePlatform
release обязательный string

AppVersionCount object

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

app обязательный AppId
platform обязательный ReleasePlatform
version обязательный string
devices обязательный integer Active devices whose last report runs this version.
failed обязательный integer Of those, the ones failed or rolled back.
silent обязательный 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 обязательный AppId
platform обязательный ReleasePlatform
release обязательный string
state обязательный "offered" | "installed" | "proven" | "held"
since обязательный string (date-time)