~/bend-docscommunity

store/plan.bend checks

raw source on the hub · import cswap-bend-cli@0.1.0.0/store/plan.bend as Plan

5 imports
import Base
import ../json.bend as Json
import ../act.bend as Act
import ./base.bend as SBase
import ./seq.bend as SSeq

Types

type Prof source · line 11 · raw

Data

What the oracle answered: nothing usable, or an account uuid with an optional address and organization.

type Plan source · line 57 · raw

Data

Should the stored credential's owner be looked up, and with which token?

type Verdict source · line 112 · raw

Data

type SlotPlan source · line 195 · raw

Data

Where a new identity goes: its slot, the slot of another account to displace (archived, never deleted) and the old slot of the same account when it moves.

Definitions

def opt_str source · line 15 · raw

@+rec:0x0717344745a30ebad1f19045228e8f18/json.Json -> @+key:String -> Maybe<&2, String>

def org_uuid_of source · line 18 · raw

@+o:Maybe<&2, 0x0717344745a30ebad1f19045228e8f18/json.Json> -> Maybe<&2, String>

def prof3b source · line 25 · raw

@+empty:Bool -> @+uuid:String -> @+email:Maybe<&2, String> -> @+org:Maybe<&2, String> -> Prof

def prof3 source · line 32 · raw

@+uuid:String -> @+email:Maybe<&2, String> -> @+org:Maybe<&2, String> -> Prof

def prof2 source · line 35 · raw

@+acct:Maybe<&2, 0x0717344745a30ebad1f19045228e8f18/json.Json> -> @+org:Maybe<&2, String> -> Prof

def profile_of source · line 43 · raw

@+j:0x0717344745a30ebad1f19045228e8f18/json.Json -> Prof

oauth.fetch_oauth_profile's reading of the response body.

def profile_of_res source · line 46 · raw

@r:Result<&2, &2, String, 0x0717344745a30ebad1f19045228e8f18/json.Json> -> Prof

def profile_of_text source · line 53 · raw

@+body:String -> Prof

def expires_s source · line 62 · raw

@+ms:String -> Maybe<&2, U32>

The access token's expiry in whole seconds (expiresAt is epoch ms).

def token_of source · line 65 · raw

@+creds:0x0717344745a30ebad1f19045228e8f18/json.Json -> String

def expiry_text source · line 68 · raw

@+m:Maybe<&2, 0x0717344745a30ebad1f19045228e8f18/json.Json> -> Maybe<&2, U32>

def expiry_of source · line 75 · raw

@+creds:0x0717344745a30ebad1f19045228e8f18/json.Json -> Maybe<&2, U32>

def plan5 source · line 78 · raw

@+expired:Bool -> @+token:String -> Plan

def plan4 source · line 85 · raw

@+token:String -> @+expiry:Maybe<&2, U32> -> @+now:U32 -> Plan

def plan3b source · line 92 · raw

@+empty:Bool -> @+token:String -> @+expiry:Maybe<&2, U32> -> @+now:U32 -> Plan

def plan3 source · line 99 · raw

@+token:String -> @+expiry:Maybe<&2, U32> -> @+now:U32 -> Plan

def plan_res source · line 102 · raw

@r:Result<&2, &2, String, 0x0717344745a30ebad1f19045228e8f18/json.Json> -> @+now:U32 -> Plan

def plan_for source · line 109 · raw

@+creds:String -> @+now:U32 -> Plan

def bad_uuid source · line 117 · raw

@+email:String -> @+seen:String -> @+want:String -> String

def bad_email source · line 122 · raw

@+email:String -> @+seen:String -> String

def bad_org source · line 127 · raw

@+email:String -> @+seen:String -> @+want:String -> String

def org_verdict2 source · line 132 · raw

@+same:Bool -> @+email:String -> @+seen:String -> @+want:String -> Verdict

def org_verdict source · line 139 · raw

@+email:String -> @+want:String -> @+org:Maybe<&2, String> -> Verdict

def then_org source · line 147 · raw

@+v:Verdict -> @+email:String -> @+want:String -> @+org:Maybe<&2, String> -> Verdict

Only a clean identity match goes on to the organization check.

def sel.v source · line 154 · raw

@+c:Bool -> @+x:Verdict -> @+y:Verdict -> Verdict

def ident_by_email2 source · line 161 · raw

@+empty:Bool -> @+email:String -> @+seen:String -> Verdict

def ident_by_email source · line 168 · raw

@+email:String -> @+seen:String -> Verdict

def ident_verdict2 source · line 171 · raw

@+no_uuid:Bool -> @+email:String -> @+acct_uuid:String -> @+uuid:String -> @+pemail:Maybe<&2, String> -> Verdict

def ident_verdict source · line 178 · raw

@+email:String -> @+acct_uuid:String -> @+uuid:String -> @+pemail:Maybe<&2, String> -> Verdict

def judge source · line 184 · raw

@+email:String -> @+org:String -> @+acct_uuid:String -> @+p:Prof -> Verdict

Does the credential's owner match (email, org, accountUuid)? Uuid first, then the address only when no uuid is on file; the org is checked either way. None from the oracle is "unresolvable", never "wrong".

def sel.m source · line 199 · raw

@+c:Bool -> @+x:Maybe<&2, String> -> @+y:Maybe<&2, String> -> Maybe<&2, String>

def differs source · line 206 · raw

@+m:Maybe<&2, String> -> @+num:String -> Maybe<&2, String>

def occupied2 source · line 213 · raw

@+same:Bool -> @+assume_yes:Bool -> @+num:String -> @+other:String -> SlotPlan

def occupied source · line 222 · raw

@+rec:Maybe<&2, 0x0717344745a30ebad1f19045228e8f18/json.Json> -> @+email:String -> @+org:String -> @+assume_yes:Bool -> @+num:String -> SlotPlan

def with_migrate source · line 229 · raw

@+p:SlotPlan -> @+m:Maybe<&2, String> -> SlotPlan

def plan_slot2 source · line 236 · raw

@+n:U32 -> @+seq:0x0717344745a30ebad1f19045228e8f18/json.Json -> @+email:String -> @+org:String -> @+assume_yes:Bool -> SlotPlan

def plan_slot1 source · line 240 · raw

@+low:Bool -> @+n:U32 -> @+seq:0x0717344745a30ebad1f19045228e8f18/json.Json -> @+email:String -> @+org:String -> @+assume_yes:Bool -> SlotPlan

def plan_slot source · line 247 · raw

@+slot:Maybe<&2, U32> -> @+seq:0x0717344745a30ebad1f19045228e8f18/json.Json -> @+email:String -> @+org:String -> @+assume_yes:Bool -> SlotPlan

def with_kind source · line 256 · raw

@+api_key:Bool -> @+rec:0x0717344745a30ebad1f19045228e8f18/json.Json -> 0x0717344745a30ebad1f19045228e8f18/json.Json

def token_record source · line 263 · raw

@+email:String -> @+ts:String -> @+api_key:Bool -> 0x0717344745a30ebad1f19045228e8f18/json.Json

def with_alias2 source · line 267 · raw

@+empty:Bool -> @+alias:String -> @+rec:0x0717344745a30ebad1f19045228e8f18/json.Json -> 0x0717344745a30ebad1f19045228e8f18/json.Json

def with_alias source · line 274 · raw

@+alias:String -> @+rec:0x0717344745a30ebad1f19045228e8f18/json.Json -> 0x0717344745a30ebad1f19045228e8f18/json.Json

def setup_token_creds source · line 278 · raw

@+token:String -> String

{"claudeAiOauth": {"accessToken": T, "scopes": ["user:inference"]}}, as json.dumps writes it.

def token_config source · line 283 · raw

@+email:String -> String

The config backup add-token synthesizes.

def default_email source · line 287 · raw

@+api_key:Bool -> @+slot:U32 -> String

def kind_label source · line 290 · raw

@+api_key:Bool -> String

def kind_name source · line 293 · raw

@+api_key:Bool -> String

def kind_title source · line 296 · raw

@+api_key:Bool -> String

def ActM source · line 300 · raw

@-A:Type -> Type

do ActM<A>: blocks (the do-notation needs the monad's name defined here).

def ActM.pure source · line 303 · raw

@-A:Type -> @x:A -> 0x0717344745a30ebad1f19045228e8f18/act.of(A)

def ActM.bind source · line 306 · raw

@-A:Type -> @-B:Type -> @m:0x0717344745a30ebad1f19045228e8f18/act.of(A) -> @f:(@_:A -> 0x0717344745a30ebad1f19045228e8f18/act.of(B)) -> 0x0717344745a30ebad1f19045228e8f18/act.of(B)