@revenexx/app-sdk@1.4.0
Minor Changes
9a935bb: Backdating moves into the SDK:
createApp({ backdating })lets a test tenant run a request on a past clock (RAD-311).Opt in with
backdating: true(every POST/PUT/PATCH/DELETE route acceptsatin its body) or{ routes, exclude, strip }(per-route field aliases in precedence order,atappended last; routes never backdated; remove the fields fromc.bodyon a backdated request). The moment is honoured only when thex-revenexx-tenantheader equals thetenant_idclaim of the forwarded identity token and the tenant'sallow_backdatingsetting istrue(or the text"true"); unreadable settings fall back to the declared default, off. Without the gate the field is ignored, unread and unvalidated. With it the moment must be an ISO 8601 date-time with a zone, not in the future and at most 24 months back, else400 backdating_invalid. The whole handler runs on the moment:c.now(),c.clock()and the exportednow(),clock(),backdated();runAt()sets the clock outside a route.backdatingDb(db, ENTITIES)wraps the generated data client and stampscreated_at/updated_aton rows created inside a backdated request, keeping values the caller set. Also exported:parseBackdate,backdatingAllowed,MAX_MONTHS_BACK,BACKDATING_SETTING,BACKDATING_FIELD,BACKDATING_INVALID. Apps that do not opt in are unchanged.