when-free.openapps.xyz

Source

This app’s code and revision history are public. Download a copy or explore the files below.

Public
The app’s code and revision history are public.
Owned app · rev 2315d847681e
Run it yourself
Take the whole tree and run it on your own machine. The download needs no account. Cloning needs a sign-in.
Download .zip
bounded clone 3e1cb86700a5e96238d7a2f1
A copy you download is not bounded. The guarantees this app runs under - declared egress, proven invariants, writes that fail closed - live in the runtime serving this page, not in the files. What you get is auditable source you can read and run, with no runtime guarantees attached.
← All files
policy-tests/votes.json
{
  "version": "1",
  "name": "answers: only their author changes them, only while the poll is open; owners can remove them",
  "actors": { "Olga": "olga_guest", "Pat": "pat_guest", "Sam": "sam_guest", "Eve": "eve_guest" },
  "constants": { "BOUNDED_PUBLIC_PRINCIPAL_API": "api_principal" },
  "steps": [
    { "op": "setTime", "epoch": 1800000000 },
    { "op": "as", "who": "Olga" },
    { "op": "setMany", "writes": [
      { "path": "polls/pollAAAAAAAAAAAAAAAA", "data": { "title": "Lunch", "timezone": "UTC", "options": "[{\"id\":\"o1\",\"start\":1800100000}]", "closed": false, "createdBy": "$Olga", "createdAt": 1800000000 } },
      { "path": "polls/pollAAAAAAAAAAAAAAAA/joins/olga_guest", "data": { "at": 1800000000 } },
      { "path": "polls/pollAAAAAAAAAAAAAAAA/owners/olga_guest", "data": { "at": 1800000000 } },
      { "path": "pollkeys/pollAAAAAAAAAAAAAAAA", "data": { "key": "ownerkeyownerkeyownerkey" } }
    ] },

    { "op": "as", "who": "Eve" },
    { "op": "set", "path": "polls/pollAAAAAAAAAAAAAAAA/votes/v_eve", "data": { "name": "Eve", "answers": "{}", "by": "$Eve", "updatedAt": 1800000000 }, "shouldFail": true },

    { "op": "as", "who": "Pat" },
    { "op": "set", "path": "polls/pollAAAAAAAAAAAAAAAA/joins/pat_guest", "data": { "at": 1800000000 } },
    { "op": "set", "path": "polls/pollAAAAAAAAAAAAAAAA/votes/v_pat", "data": { "name": "Pat", "answers": "{\"o1\":\"yes\"}", "by": "$Sam", "updatedAt": 1800000000 }, "shouldFail": true },
    { "op": "set", "path": "polls/pollAAAAAAAAAAAAAAAA/votes/v_pat", "data": { "name": "", "answers": "{\"o1\":\"yes\"}", "by": "$Pat", "updatedAt": 1800000000 }, "shouldFail": true },
    { "op": "set", "path": "polls/pollAAAAAAAAAAAAAAAA/votes/v_pat", "data": { "name": "Pat", "answers": "{\"o1\":\"yes\"}", "by": "$Pat", "updatedAt": 1800000100 }, "shouldFail": true },
    { "op": "set", "path": "polls/pollAAAAAAAAAAAAAAAA/votes/v_pat", "data": { "name": "Pat", "answers": "{\"o1\":\"yes\"}", "by": "$Pat", "updatedAt": 1800000000 } },
    { "op": "set", "path": "polls/pollAAAAAAAAAAAAAAAA/votes/v_pat", "data": { "name": "Pat", "answers": "{\"o1\":\"maybe\"}", "updatedAt": 1800000000 } },

    { "op": "as", "who": "Sam" },
    { "op": "set", "path": "polls/pollAAAAAAAAAAAAAAAA/joins/sam_guest", "data": { "at": 1800000000 } },
    { "op": "read", "path": "polls/pollAAAAAAAAAAAAAAAA/votes/v_pat" },
    { "op": "set", "path": "polls/pollAAAAAAAAAAAAAAAA/votes/v_pat", "data": { "name": "Pat", "answers": "{\"o1\":\"no\"}", "updatedAt": 1800000000 }, "shouldFail": true },
    { "op": "delete", "path": "polls/pollAAAAAAAAAAAAAAAA/votes/v_pat", "shouldFail": true },
    { "op": "set", "path": "polls/pollAAAAAAAAAAAAAAAA/votes/v_sam", "data": { "name": "Sam", "answers": "{\"o1\":\"yes\"}", "by": "$Sam", "updatedAt": 1800000000 } },

    { "op": "as", "who": "Olga" },
    { "op": "set", "path": "polls/pollAAAAAAAAAAAAAAAA", "data": { "closed": true } },

    { "op": "as", "who": "Pat" },
    { "op": "set", "path": "polls/pollAAAAAAAAAAAAAAAA/votes/v_pat", "data": { "name": "Pat", "answers": "{\"o1\":\"no\"}", "updatedAt": 1800000000 }, "shouldFail": true },
    { "op": "set", "path": "polls/pollAAAAAAAAAAAAAAAA/votes/v_pat2", "data": { "name": "Pat", "answers": "{}", "by": "$Pat", "updatedAt": 1800000000 }, "shouldFail": true },

    { "op": "as", "who": "Olga" },
    { "op": "delete", "path": "polls/pollAAAAAAAAAAAAAAAA/votes/v_sam" },
    { "op": "expect", "expr": "get(/polls/pollAAAAAAAAAAAAAAAA/votes/v_sam) == null" },
    { "op": "expect", "expr": "get(/polls/pollAAAAAAAAAAAAAAAA/votes/v_pat).answers == '{\"o1\":\"maybe\"}'" }
  ]
}

Change history

Quality pass: comments, CSV export, share the final time, calendar menu, fixes
2315d84768 · 5 hours ago
Bounded source sync
145324066b · 1 day ago
Bounded source sync
ad9b674dac · 1 day ago
Bounded source sync
e5b69608f3 · 1 day ago
Bounded source sync
a1685914b0 · 1 day ago
Bounded source sync
7108f42d4d · 1 day ago
Bounded source sync
ffb51b672e · 1 day ago
Bounded source sync
23b5d0c53b · 1 day ago