iRetail PRO hub 1.0.0-m5

78 операций

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

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

REST API the node adds in the hub role (spec/SYNC.md): the organization, its stores, the store nodes registered with the hub, the stores' change requests, analytics over the chain (spec/ANALYTICS.md) and dashboards (spec/DASHBOARDS.md). The hub also serves the store API's operations on the records it owns (items, groups, tax rates, promotions, employees, roles, and from M9 suppliers, recipes, expiry rules, loyalty programs, customers, vouchers, gift cards, partners and bonus rules: openapi/store-v1.yaml), with prices, tax codes and deposits per store here, and the chain's transfers, goods in transit and its bonus and partner reports, and from M11 the releases it holds, rollouts in waves and its own update (spec/RELEASES.md). Conventions: spec/API.md; permissions: spec/RBAC.md. Every request from an app carries IRetail-App (components/parameters/IRetailApp, on every path), and the hub may refuse an app 426 app_update_required by it, by its office store's min_app_versions, except on an operation marked x-app-update-exempt (spec/RELEASES.md, Apps and the gateway).

organization 2 операции

The chain.

stores 19 операций

The chain's stores and their prices.

nodes 4 операции

Store nodes registered with the hub.

change-requests 3 операции

Stores' requests for hub-owned changes.

analytics 8 операций

The chain's sales and stock (spec/ANALYTICS.md).

dashboards 4 операции

Pages of tiles over the analytics (spec/DASHBOARDS.md).

network 4 операции

The chain's private WireGuard network (spec/NETWORK.md).

  • PUT /v1/stores/{id}/network The store's own switch for the private network (spec/NETWORK.md); null follows the organization. It reaches the store with its record.
  • GET /v1/network The organization's private network (spec/NETWORK.md).
  • PUT /v1/network Turn the private network on or off, set its subnet (only while off) and the endpoint stores reach the hub at.
  • GET /v1/network/peers Every registered node as a peer of the hub, with its latest handshake as the replicas recorded it.

releases 22 операции

Releases the hub holds, rollouts in waves and the hub's own update (spec/RELEASES.md).

  • GET /v1/releases The releases the hub holds, the latest version first (spec/RELEASES.md, The hub's releases).
  • GET /v1/releases/available What the source (IRETAIL_RELEASES_URL) offers as its latest release, and whether the hub holds it. 409 release_source_missing with downloading off, 503 release_source_unreachable when version.json cannot be read.
  • POST /v1/releases/download Download a release from the source. The manifest is read and verified before answering (422 release_refused); the artifacts follow in the background, each verified as it is stored. 200 for a version already held.
  • POST /v1/releases/import Import a release bundle sent as the raw body (a POSIX tar, manifest.json first, then every artifact). Verified as it streams; 201 verified, 200 for the same manifest again, 409 release_conflict for another manifest of a version held, 422 release_refused with nothing kept.
  • GET /v1/releases/{version} One release the hub holds, with its signed manifest.
  • DELETE /v1/releases/{version} Remove a release and its files from storage; 409 release_in_use while it is in use.
  • GET /v1/rollouts Rollouts, newest first (spec/RELEASES.md, Rollouts).
  • POST /v1/rollouts Start a rollout of a verified release in waves. 409 rollout_active while another is unfinished; 422 invalid_rollout with a reason.
  • GET /v1/rollouts/{id} One rollout with its waves.
  • GET /v1/rollouts/{id}/stores Each store of a rollout with its wave, update state and gate status, in the waves' order.
  • POST /v1/rollouts/{id}/pause Pause a running rollout; the current wave's stores that have not begun applying lose their targets. 409 rollout_state otherwise.
  • POST /v1/rollouts/{id}/resume Resume a paused rollout on its current wave, as a new attempt for the stores not done; the current wave's stores whose apps are held for the release have the hold cleared (apps_cleared_at). 409 rollout_state otherwise.
  • POST /v1/rollouts/{id}/rollback Send every store that took the release back to its previous version, at once. 409 rollout_state from rolling_back or rolled_back, 409 rollout_not_latest for an older rollout, 409 rollout_active while another is unfinished.
  • POST /v1/rollouts/{id}/stores/{store_id}/skip Take a store out of a rollout; a target it has not finished is withdrawn and the gate passes it. 409 rollout_state in completed or rolled_back.
  • POST /v1/rollouts/{id}/stores/{store_id}/clear-apps Clear a store's held apps for the rollout's release (spec/RELEASES.md, One device first) by writing its target again with apps_cleared_at. 409 rollout_state in rolled_back; 404 for a store the rollout does not cover or whose target was withdrawn.
  • GET /v1/app-update What an app of the hub's office store, or the console on a desktop, should run, by the release the hub runs, one device first (spec/RELEASES.md, The apps); as a store's getAppUpdate. A hub that does not hold the release it runs offers no installer.
  • POST /v1/app-update/report An app of the hub's office store, or the console, reports where its update stands (spec/RELEASES.md, Reporting); as a store's postAppUpdateReport.
  • POST /v1/app-update/clear Clear the hub's office store's hold of a release for an app and platform (spec/RELEASES.md, One device first). 404 when nothing is held.
  • GET /v1/releases/{version}/manifest The signed manifest of a release the hub holds verified, for its office store's devices, the console and its updater; the caller verifies it with its own embedded keys. 404 for a release not held or not verified.
  • GET /v1/releases/{version}/artifacts/{name} A file of a release the hub holds verified; Range resumes a broken download. The caller checks its size and SHA-256 against the manifest.
  • GET /v1/hub-update The hub's own update (spec/RELEASES.md, The hub's own update).
  • PUT /v1/hub-update Set the hub's own target, applied by its updater. 404 for a version not held, 409 release_not_verified, 409 stores_incompatible unless forced, 422 release_refused (downgrade) for an earlier version that is not the previous one.

brand 3 операции

Stores' banners over the organization's brand (spec/BRANDS.md); the brand itself is the store API's.

  • GET /v1/stores/{id}/banner A store's banner over the brand, served whether or not the key holds white_label; 404 when the store has none (spec/BRANDS.md).
  • PUT /v1/stores/{id}/banner Set a store's banner, checked as a brand is (422 invalid_brand, 422 brand_contrast); 403 module_disabled without white_label.
  • DELETE /v1/stores/{id}/banner Remove a store's banner, bringing the brand back to it; 403 module_disabled without white_label.

alerts 4 операции

backups 5 операций