Cred.refresh.post: def of cswap-bend-cli@0.1.0.0 Import: import cswap-bend-cli@0.1.0.0/usage/cred.bend as Cred Lines 238-246 of cswap-bend-cli@0.1.0.0/usage/cred.bend: https://jend.leeeet.dev/read.txt?path=cswap-bend-cli@0.1.0.0/usage/cred.bend&start_line=238&end_line=246 import Base import cswap-bend-cli@0.1.0.0/http.bend as Http import cswap-bend-cli@0.1.0.0/json.bend as Json import cswap-bend-cli@0.1.0.0/clock.bend as Clock import cswap-bend-cli@0.1.0.0/usage/text.bend as UText # refresh: the token endpoint POST of try_refresh_oauth_credentials. Done # carries the rotated credential text; Fail is `invalid_grant`, # `invalid_client`, `no_refresh_token` or `transient`. def refresh.post(+j: Json.Json, +o: Json.Json, +rt: String) -> IO(Result<&2, &2, String, Granted>): do IO>: now : U32 <- Clock.now_s() r : Result<&2, &2, String, Http.Reply> <- Http.request("POST", UText.token_url(), [("Content-Type", "application/json"), ("User-Agent", UText.user_agent())], UText.refresh.body(rt), 10) return grant.result(r, j, o, now) Uses (17): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.bind https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.pure https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Sigma https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/clock.bend&name=now_s https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/http.bend&name=Reply https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/http.bend&name=request https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/json.bend&name=Json https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/usage/cred.bend&name=Granted https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/usage/cred.bend&name=grant.result https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/usage/text.bend&name=refresh.body https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/usage/text.bend&name=token_url https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/usage/text.bend&name=user_agent