Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
192 commits
Select commit Hold shift + click to select a range
9ac1c2b
first push
Nov 11, 2022
0f36246
add /web-ui subscription path
Nov 11, 2022
f5123b4
add-nodes working, mostly
Nov 14, 2022
6a5b154
add folder, add node, take new. All in one baby
Nov 15, 2022
7036eb1
fix ?: -> ?.
Nov 15, 2022
7e9263f
updated through edit node
Nov 17, 2022
aec23fe
update post code review
Nov 17, 2022
ac030fb
fix json conversion after sur change
Nov 17, 2022
8ad4a97
fix conversion in json parsing
Nov 17, 2022
65cea84
fixing mar for state-0. whoopsie
Nov 17, 2022
d3fee42
small updates +
Nov 17, 2022
8a5471c
small fixes, correct for -> everywhere(! this time)
Nov 17, 2022
7292036
fix for json parsing for
Nov 17, 2022
bbeecbd
pushing reperm - dejs next
Nov 18, 2022
cbac449
working thru reperm but I gotta fix reperm
Nov 21, 2022
2e16e7a
fixing for action instead of poke - whoopsie
Nov 21, 2022
f79d6a1
WIP add json spec
vcavallo Nov 21, 2022
7cff92d
Update json spec
vcavallo Nov 21, 2022
ffcff96
Fix dupes in json spec
vcavallo Nov 21, 2022
4b73cfc
Adding color commentary
rabsef-bicrym Nov 22, 2022
f15cf88
Merge pull request #1 from dalten-collective/add-json-spec
rabsef-bicrym Nov 22, 2022
58fcbb9
updating scries and marks and json
Nov 22, 2022
1cfeb17
Merge branch 'develop' of https://github.com/dalten-collective/trove …
Nov 22, 2022
5ef1479
update for new spaces, also start transition (more json to come)
Nov 23, 2022
5c9e280
fixing json further, checking marks
Nov 23, 2022
5c47e82
fixed json-spec documentation
Nov 23, 2022
6b1070a
calling out permission object and node object
Nov 23, 2022
3a217e4
more updates to spec
Nov 23, 2022
9b98d62
all admin, node pokes completed
Nov 23, 2022
f438fba
update thru all folder/file actions, need repeat and reperm
Nov 23, 2022
af08f07
smol fixes
Nov 23, 2022
3d43cec
smol fixes 2
Nov 23, 2022
f4dde47
smol fixes 3
Nov 23, 2022
876cb94
everything documented
Nov 23, 2022
0b745f3
no op settling after testing local functions
Nov 24, 2022
76ba8f6
change subscription pattern, add tests
Nov 28, 2022
d0737c7
correcting for test comments
Nov 29, 2022
fd38b4f
hotfix for empty lists of paths on to-cher
Nov 29, 2022
5aebc2d
formatting + convenience change
Nov 29, 2022
17e9be5
trove: fix ordering of /x/folder/perms/rest and /x/folder/rest in pat…
Dec 13, 2022
8c3d508
trove: fix mark on trove-teams (from trove-team, typo)
Dec 13, 2022
b1f97db
trove: small fixes
Dec 13, 2022
300996e
Add trove app
sethfork Dec 13, 2022
0aee376
Move assets, scripts, media
sethfork Dec 14, 2022
7e157e0
Scaffold store, subs, state, scries, pokes
sethfork Dec 14, 2022
9d69b42
Move index.html
vcavallo Dec 14, 2022
ad61dc4
Merge pull request #1 from vcavallo/fix-vite-setup
sethfork Dec 14, 2022
0e85a80
Comment/move code to get app running
vcavallo Dec 14, 2022
7fbe22b
Merge pull request #2 from vcavallo/get-app-running
vcavallo Dec 14, 2022
f878fef
Continue wiring store; remove dupes
sethfork Dec 14, 2022
c43955c
Use consistent naming convention
sethfork Dec 14, 2022
f76c073
Merge pull request #3 from sethfork/wire-store
sethfork Dec 14, 2022
135103b
Add todo.md
vcavallo Dec 14, 2022
04e19f9
Update todo
vcavallo Dec 14, 2022
1db90bb
Handle scries; get useTrove hook working
sethfork Dec 14, 2022
508e703
Merge pull request #4 from sethfork/wire-store
sethfork Dec 14, 2022
30ad848
Hydrate initial trove state
sethfork Dec 14, 2022
8a4dc81
Merge pull request #5 from sethfork/wire-store
sethfork Dec 14, 2022
981cade
Accept an event handler for subscription
sethfork Dec 14, 2022
1cb417e
Hydrate hosts
sethfork Dec 14, 2022
6ad6501
trove: fix null
rabsef-bicrym Dec 14, 2022
691d445
Wire sub handler, get pokes working
sethfork Dec 15, 2022
84a059c
trove: add /tree/host/space/rest scry for UI
Dec 15, 2022
30e5244
trove: fix tree scry - * instead of @.
Dec 15, 2022
0fbf7cd
trove: encoding of scry paths to allow pure @t
Dec 15, 2022
8a1ccaa
trove: tree is recursive now
Dec 15, 2022
18afeb7
trove: json refactor for library
Dec 15, 2022
917add6
trove: change subfolders to children
Dec 15, 2022
8bf4869
trove: for local troves, allow mods to add/edit folders/files.
Dec 15, 2022
8d78f12
trove: add type/face convention to team scry
Dec 15, 2022
2c9bc0f
Refactor; tie subs to actions
sethfork Dec 16, 2022
68c428f
Maybe add tilde in utils
vcavallo Dec 16, 2022
8905b17
Merge pull request #7 from sethfork/vc-ref-sub-actions
sethfork Dec 16, 2022
202b484
Use store as primary location for async actions
sethfork Dec 16, 2022
3ee5a90
Fix default args; remove cb scries from useTrove
sethfork Dec 16, 2022
56eef5e
trove: add pairs to teams scry
Dec 16, 2022
2b7bb38
trove: add scry key to scry data in teams, allowing pairs to function
Dec 16, 2022
6337db8
trove: change tree to use chop-wood, reduce overhead data to FE
Dec 16, 2022
ec88147
Wire poke / sub handler; support multi-onFact acts
sethfork Dec 16, 2022
11ca86a
trove: server overwrites client suggestions re by and time
Dec 16, 2022
ef4cead
Hydrate on init fact; add multi async fact helper
sethfork Dec 16, 2022
cfa3fde
Get new state from proper key on fact/scry
sethfork Dec 16, 2022
e0c1a7d
Merge trove states with tree shape scry; misc imps
sethfork Dec 17, 2022
43c1693
Merge pull request #6 from sethfork/refactor-sub-actions
sethfork Dec 17, 2022
de9365a
trove: sanity check folders, correct typo in remove folders
Dec 22, 2022
e00fc67
Checkpoint pre-demo
sethfork Dec 23, 2022
2c5a794
trove: hoon-agent update
Dec 23, 2022
e4b6bb8
Fix postinstall module build
sethfork Dec 23, 2022
fd496d4
Merge remote-tracking branch 'origin/pre-demo' into rb/update-agent
Dec 23, 2022
cf2e0b1
Temp disable storage module
sethfork Dec 23, 2022
8a97e68
Add useAirlock hook
sethfork Dec 23, 2022
2b434de
Fix vite
sethfork Dec 23, 2022
ba714d1
Fix pkg link
sethfork Dec 23, 2022
d3f7dc3
Merge branch 'develop' of github.com:dalten-collective/trove into mer…
vcavallo Dec 23, 2022
4d13918
Get subscription and forked vite working
vcavallo Dec 23, 2022
5bd20b2
Merge branch 'pre-demo' into rb/update-agent
Dec 23, 2022
686c169
Merge pull request #10 from sethfork/rb/update-agent
sethfork Dec 23, 2022
d29784f
Merge pull request #11 from sethfork/merge-trove
sethfork Dec 23, 2022
e4a0384
Checkpoint some stuff
sethfork Dec 23, 2022
82ef3f2
Fix ThemeProvider import, LocationBar styling
sethfork Dec 24, 2022
1e6baa6
Support fullscreen; dynamic group name; styling
sethfork Dec 24, 2022
cbc9b52
Support grid view w images/docs; misc improvements
sethfork Dec 26, 2022
2d5ac01
Improve image previews, view switching, uploads
sethfork Dec 27, 2022
626f110
Merge pull request #9 from sethfork/pre-demo
sethfork Dec 27, 2022
5c4155b
Update json-spec.md
rabsef-bicrym Dec 29, 2022
ecabafd
Update json-spec.md
rabsef-bicrym Dec 29, 2022
fb0360d
Add manifest, assets
sethfork Jan 2, 2023
0e6fef5
Merge branch 'develop' of github.com:dalten-collective/trove into dev…
vcavallo Jan 2, 2023
3e3fad6
Remove, archive unused components
sethfork Jan 2, 2023
b32b4ac
Merge pull request #12 from sethfork/add-manifest-assets
sethfork Jan 4, 2023
60c6292
Add small repo changes
sethfork Jan 4, 2023
c34d622
Add features, improvements, refactors; pre-glob ch
sethfork Jan 4, 2023
b2020fe
Remove debugger
sethfork Jan 4, 2023
fa7f125
Improve build, load time, code splitting,
sethfork Jan 4, 2023
ee52d99
Add bundle analyzer; remove page load helmet
sethfork Jan 4, 2023
bb9c21a
Remove unnecessary build script env hard-coding
sethfork Jan 4, 2023
43f3024
Remove unused modules
sethfork Jan 4, 2023
85dc627
Remove hardcoded ship; use smaller evt err log
sethfork Jan 4, 2023
746d6bf
Refactor; remove symlinks; improve build, lib
sethfork Jan 4, 2023
c5ef100
Remove symlink
sethfork Jan 4, 2023
7f5e2da
Remove unused public, build, manifest files
sethfork Jan 4, 2023
e508981
Pre glob changes
sethfork Jan 4, 2023
e5cdf0b
trove: add mar files required for glob, update desk.docket-0
Jan 5, 2023
4183bed
Create HOW-TO-GLOB.md
rabsef-bicrym Jan 5, 2023
6b819f4
Commit glob instructions
sethfork Jan 5, 2023
9bf8698
Fix build issues; disable some manual chunking
sethfork Jan 5, 2023
d1ac8b1
Edit glob instructions
sethfork Jan 5, 2023
934174f
Add css mar to desk
sethfork Jan 5, 2023
9d27ac7
Merge branch 'develop' into pre-moon-alpha-0.0.1
sethfork Jan 5, 2023
694788c
trove: update docket for glob, image, website, color.
Jan 5, 2023
b9708ca
Debugging non-local
sethfork Jan 5, 2023
a7647f6
Re-enable error handler
sethfork Jan 5, 2023
85e303a
Get new path on certain facts
sethfork Jan 6, 2023
cd64ca3
Refresh form state on path change
sethfork Jan 6, 2023
82075c3
Fix dupe selectedPath
sethfork Jan 6, 2023
c93f514
Fix file uploads, misc improvements
sethfork Jan 17, 2023
a1abab2
Merge pull request #14 from sethfork/file-uploads-s3
sethfork Jan 17, 2023
79a3748
Merge pull request #13 from sethfork/pre-moon-alpha-0.0.1
sethfork Jan 17, 2023
aef9289
Change default port to 8080
sethfork Jan 17, 2023
cd13aed
Make selectors more forgiving
sethfork Jan 17, 2023
78fea31
Remove log
sethfork Jan 17, 2023
0c1c3ef
Toggle lazy loading
sethfork Jan 18, 2023
ab5ca96
trove: fix move-folder for base-directory case
Jan 18, 2023
c92e941
Fix init form action, s3 upload path, cred status
sethfork Jan 19, 2023
b499991
Merge pull request #15 from sethfork/debug-remote-build
sethfork Jan 19, 2023
200e3ab
Fix pokeform ref (#16)
sethfork Jan 19, 2023
ace53f9
Merge branch 'develop' of github.com:sethfork/trove into develop
vcavallo Jan 20, 2023
b3288ca
fe: sanity-check a poke
vcavallo Jan 20, 2023
b34ea85
fe: WIP always scry all on any response
vcavallo Jan 23, 2023
9d249af
fe: WIP add path-based navigation; use scratched-out popover menus
vcavallo Jan 23, 2023
595d8cc
fe: fix child-building in flatNest
vcavallo Jan 23, 2023
d7efcd6
fe: WIP show folders in file list
vcavallo Jan 24, 2023
bc18c83
Make persisted state keys more uniform (#17)
sethfork Jan 25, 2023
47a837d
trove: add move-node json output
Jan 26, 2023
9413861
Merge branch 'develop' of github.com:sethfork/trove into develop
vcavallo Jan 26, 2023
2b4d07d
Merge branch 'develop' into vue-version
vcavallo Jan 26, 2023
b39a84b
trove: oops
Jan 26, 2023
d21f835
Merge branch 'develop' of github.com:sethfork/trove into vue-version
vcavallo Jan 26, 2023
3ca4de0
trove: replace head with rear (not like that)
Jan 26, 2023
18c6447
fe: WIP move delete nodes folders
vcavallo Jan 26, 2023
26c64a6
Merge branch 'develop' of github.com:sethfork/trove into vue-version
vcavallo Jan 26, 2023
36028d4
fe: fix path tray to properly work with root (hack, needs refactor)
vcavallo Jan 26, 2023
ed7b532
fe: customize space selector
vcavallo Jan 27, 2023
96a5ce2
fe: fix tree styles; move path tray over
vcavallo Jan 27, 2023
93885c6
fe: add flowbite, filetypes; non-table browser
vcavallo Jan 27, 2023
e4667fe
fe: fix "folder empty" view; add icons for filetypes
vcavallo Jan 27, 2023
adacc27
fe: add inline new folder form
vcavallo Jan 27, 2023
c11407c
fe: add s3 subscription; disable button if not configured
vcavallo Jan 27, 2023
2aa203e
fe: sketch out file dropper
vcavallo Jan 27, 2023
0e56e9b
fe: add intial s3 uploader
vcavallo Jan 27, 2023
1d2d9d4
fe: fix: reset upload button after closing
vcavallo Jan 27, 2023
3db2518
fe: fix acls in s3 upload
vcavallo Jan 27, 2023
4b568fc
fe: fix file modal
vcavallo Jan 27, 2023
d4d405e
fe: fix folder context menu
vcavallo Jan 27, 2023
0ffe9df
fe: don't allow moving a folder into itself
vcavallo Jan 27, 2023
a847369
fe: add public link copy for files
vcavallo Jan 27, 2023
65d85f5
fe: use gear icon for actions context menu
vcavallo Jan 27, 2023
bada664
trove: globbed
Jan 27, 2023
b24855c
grove: update for groups
Mar 16, 2023
06e81cc
grove: remove extraneous cruft.
Mar 16, 2023
223919f
grove: like a g6.
Mar 16, 2023
dac3d56
grove: clean house
Mar 16, 2023
a02c129
ui: g-ify t-ish letters
vcavallo Mar 17, 2023
068cca1
grove: fix state-0 mark
Mar 17, 2023
631f7c4
Merge branch 'rb/grove' into rework-ui-for-grove
vcavallo Mar 17, 2023
c8ef9b2
ui: WIP naively grep/sed, change default spat
vcavallo Mar 17, 2023
c282715
ui: add alpha warning and love letter
vcavallo Mar 17, 2023
ca7f2a0
ui: fix for many groups; fix title
vcavallo Mar 17, 2023
a84ef61
grove: small changes for FE
Mar 18, 2023
6912261
grove: fix strange kick error, pathing issues
Mar 18, 2023
4799c2b
grove: change trail behavior in add-folder to avoid double-nesting
Mar 18, 2023
5b7ea98
ui: add searchable select for group
vcavallo Apr 12, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
145 changes: 145 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test
.env.*
!.env.sample

# parcel-bundler cache (https://parceljs.org/)
.cache

# Next.js build output
.next

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

.DS_Store

# Hide developer ships
/comets
/ships
/globs

# Hide urbit repo
/urbit

.env
.env.moon1
.env.moon2
!.env.local-example
build

# logs
app/realmlog.txt

app.dev.json

# Storybook
storybook-static

ships

.eslintcache

release/app/dist
release/build
.holium/dll

.idea
*.css.d.ts
*.sass.d.ts
*.scss.d.ts

.docs/archive
Empty file added .gitmodules
Empty file.
7 changes: 7 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
trailingComma: 'es5',
tabWidth: 2,
semi: true,
singleQuote: true,
printWidth: 81,
};
21 changes: 0 additions & 21 deletions LICENSE

This file was deleted.

7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
# trove
A file browser for groups

<img width="920" alt="image" src="https://user-images.githubusercontent.com/6413077/200551579-32fd32ce-7247-4074-bb05-b00aa8d96102.png">
<img width="920" alt="image" src="https://user-images.githubusercontent.com/6413077/200551624-1a35b63c-1446-4b26-af22-7181242a2f72.png">
# Grove
The original. Accept no substitutions.
23 changes: 23 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# TODO

## Minimum-Visible Progress (MVP lol)

- [ ] handle initial subscription response to fully-hydrate state
- [ ] Map current sidebar folders to state folders (just root for now)
- [ ] Map current main view files to state files (just root for now)
- [ ] poke to create a file at root level (dummy URL, no S3 yet)
- [ ] handle above, updating state to add file in root folder
- [ ] poke to remove a file at root level
- [ ] handle above, updating state to remove file in root folder
- [ ] poke to editing a file at root level
- [ ] handle above, updating state to edit file in root folder
- [ ] poke to create a folder
- [ ] handle above, updating state with new folder
- [ ] poke to move a file from root level to folder
- [ ] handle above, updating state to move file from root to folder

## Future Optimizations

- [ ] move async actions/effects out of store
- [ ] split store into namespaces/smaller zustand stores

4 changes: 4 additions & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules/
package-lock.json
yarn.lock
.env
26 changes: 26 additions & 0 deletions app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Vite/Vue3/Typescript/Tailwind/Urbit template

With typed Vuex store, CompositionAPI and `setup`-style script tags.

To install this elsewhere:

```
npx degit vcavallo/vite-vue-urbit-template#vue3-typed-store your-project-name
cd your-project-name

npm install
```

Then:

- Define a .env file, copied from env.example
- Set the port based on your running fakeship
- Set the desk name to the name of your desk
- Check out `src/components/Start.vue`
- There are some example actions, mutations, getters in `src/store/`
- Make sure to update `src/api/airlock.ts`'s `path` entry to match your desk's
- Update the history function in `src/router/index.ts`
implementation
- `npm run serve`
- Visit the URL that the vite server output shows (probably `localhost:3000`)
- Log in with your `+code`
3 changes: 3 additions & 0 deletions app/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: ["@vue/cli-plugin-babel/preset"],
};
2 changes: 2 additions & 0 deletions app/env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
VITE_URBIT_TARGET='http://localhost:8080'
VITE_URBIT_DESK='desk-name'
18 changes: 18 additions & 0 deletions app/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no, maximum-scale=1.0,">
<title>Grove</title>
</head>
<body>
<noscript>
<strong>We're sorry but doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>

<script type="module" src="/src/main.js"></script>

</body>
</html>
49 changes: 49 additions & 0 deletions app/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"name": "vite-vue3-urbit-template",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vite --host",
"build": "vite build",
"preview": "vite preview"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.259.0",
"@aws-sdk/s3-request-presigner": "^3.259.0",
"@urbit/api": "^2.1.0",
"@urbit/http-api": "^2.1.0",
"click-outside-vue3": "^4.0.1",
"core-js": "^3.8.3",
"flowbite": "^1.6.3",
"lodash": "^4.17.21",
"md5": "^2.3.0",
"vue": "^3.2.25",
"vue-router": "^4.1.6",
"vue-select": "^4.0.0-beta.6",
"vue3-treeview": "^0.4.1",
"vuex": "^4.0.0"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.4.0",
"@typescript-eslint/parser": "^5.4.0",
"@urbit/vite-plugin-urbit": "^0.8.0",
"@vitejs/plugin-vue": "^2.3.1",
"@vue/cli-plugin-babel": "~5.0.0",
"@vue/cli-plugin-eslint": "~5.0.0",
"@vue/cli-plugin-router": "~5.0.0",
"@vue/cli-plugin-typescript": "~5.0.0",
"@vue/cli-plugin-vuex": "~5.0.0",
"@vue/cli-service": "~5.0.0",
"@vue/eslint-config-typescript": "^9.1.0",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-vue": "^8.0.3",
"prettier": "^2.4.1",
"prettier-plugin-tailwindcss": "^0.1.5",
"typescript": "~4.5.5",
"vitawind": "^2.2.4",
"vite": "^2.9.9",
"vue-tsc": "^0.29.8"
}
}
6 changes: 6 additions & 0 deletions app/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
9 changes: 9 additions & 0 deletions app/src/App.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<template>
<div class="h-full bg-stone-100">
<router-view class="container mx-auto" />
</div>
</template>

<script setup lang="ts">
</script>

30 changes: 30 additions & 0 deletions app/src/api/airlock.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import urbitAPI from "./urbitAPI";

interface onSubNumber {
(subNumber: number): void;
}


export function openAirlockTo(
agent: string,
onEvent,
onSubNumber: onSubNumber
) {
urbitAPI
.subscribe({
app: agent,
path: "/web-ui", // TODO: set to your endpoint
event: (data) => {
onEvent(data);
},
})
.then((sub: number) => {
onSubNumber(sub);
});
}

export function closeAirlock(subscription: number, onClose) {
urbitAPI.unsubscribe(subscription).then(() => {
onClose;
});
}
Loading