Newapp-sdks

@revenexx/app-sdk@1.2.0

Minor Changes

  • 8bfc5f9: c.market reads the market a request is for and the country it ships from (PE-1010).

    The gateway sends the market's ship_from_country (markets app, RAD-246) as X-Revenexx-Market-Country next to X-Revenexx-Market, and sets it itself, so a caller's copy never reaches the App. c.market is { code, country } on every route context; either is null when the gateway did not send it, a country is never read without a market, and a value that is not an upper-case ISO 3166-1 alpha-2 code is ignored. marketFrom(header) and MARKET_HEADERS are exported for code outside a handler.

    An App prints a document's addresses for the sender country: its own sender address when it has one, else c.market.country, else its own fallback.

  • f129c8d: mountTrash gives an entity with trash: true its trash in one call (PE-1022).

    • DELETE <path>/{id} puts a live row into the trash with its live children as one group, recording who and when; on a row already in the trash it deletes for good, children of the group first. guard refuses the trash (409 trash_blocked), blockers refuse the final delete (409 delete_blocked), canDeleteForGood can require its own permission (403 not_permitted).
    • POST <path>/{id}/restore brings back the row and the children of its group; a child whose parent is in the trash is refused (409 parent_in_trash).
    • trash.purge(c) is the scheduled job. It reads trash_retention_days through the gateway (GET /v1/audit/settings, 90 when unset; REVENEXX_AUDIT_SETTINGS_URL overrides the URL) and deletes for good what is older, through the same blockers. A blocked row stays, with its reason in purge_blocked_reason, the column trash: true creates. When the retention cannot be read the run is skipped.
    • createGatewayCounter() counts another App's records through the gateway for a cross-app blocker. A count it cannot get is an unverifiable blocker.

    A check that throws blocks; nothing is deleted for good past a blocker. The PHP SDK has the same as Trash::mount and GatewayCounter.

  • aae9842: The runtime adapter forwards the request's X-Revenexx-Audit to the data plane (PE-1039).

    The gateway signs a short-lived record-history envelope naming the person behind a call and sends it to the App as X-Revenexx-Audit. The runtime adapter now passes it on unchanged with every PostgREST request, the same way X-Revenexx-Market travels, so Baseline can name that person in the record history. The SDK never reads it. A request without one, or with a value that is not one line of visible ASCII, sends no such header and works as before. The remote adapter takes it as audit. c.actor is unchanged.