@rfany/rf 0.12.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/rf.mjs +6 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rfany/rf",
3
- "version": "0.12.0",
3
+ "version": "0.13.0",
4
4
  "description": "rollforward's command line for people: what its page does, from a shell or a desktop agent, as you",
5
5
  "license": "MIT",
6
6
  "repository": { "type": "git", "url": "git+https://github.com/spoj/rollforward.git", "directory": "cli" },
package/rf.mjs CHANGED
@@ -114,6 +114,8 @@ Admins:
114
114
  rf people [--set FILE|-] [-n] [--force] everyone as lines of ROLE EMAIL, each with a comment; --set sets the roles of the people
115
115
  listed and adds new ones, removing no one
116
116
  rf user add EMAIL [admin] | role EMAIL admin|user [--force] | disable EMAIL | enable EMAIL | signout EMAIL | remove EMAIL
117
+ rf egress [add|remove HOST] the hosts runs may reach beyond package registries, GitHub and documentation sites, such as
118
+ api.example.com or *.example.org; admins add and remove them
117
119
  rf connection set NAME TYPE an outside system runs reach as their runner, by a login each person makes: graph,
118
120
  Microsoft 365, or databricks, Azure Databricks, as each person adds what their login
119
121
  offers; websites are rf site's
@@ -658,6 +660,10 @@ else if (cmd === 'comment' && args.length === 2) {
658
660
  for (const e of b.entries) console.log(` ${when(e.at)} ${e.op === 'done' ? `run ${e.run} failed: ${e.error}`
659
661
  : `${e.by} ${e.op === 'comment' ? `says: ${e.text.split('\n')[0].slice(0, 200)}` : e.op === 'upload' ? `uploads ${e.file}` : `${e.op === 'close' ? 'closes' : 'abandons'} it`}`}`);
660
662
  }
663
+ } else if (cmd === 'egress' && (!args.length || (args.length === 2 && ['add', 'remove'].includes(args[0])))) {
664
+ let hosts = await (await api('/egress')).json();
665
+ if (args.length) hosts = await (await post('/egress', { hosts: args[0] === 'add' ? [...new Set([...hosts, args[1]])] : hosts.filter(h => h !== args[1]) }, 'PUT')).json();
666
+ console.log(hosts.join('\n'));
661
667
  } else if (cmd === 'people' && args.length <= 1) {
662
668
  // People as lines to edit and set: ROLE EMAIL for everyone, owner|member EMAIL-OR-GROUP for a workspace, each with a comment.
663
669
  const ws = args[0] === undefined ? undefined : await workspaceNamed(args[0]);