-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(access-client): cli and recover (#207)
access-client cli should support #153 changes - [x] improve d1 errors .ie space already registered - [x] tests to validate that register space saves all the delegations and updates isRegistered - [x] setup cmd - [x] whoami cmd - [x] create space cmd - [x] space info - [x] delegate caps - [x] import space from delegation - [x] recover with client - [x] tests migrations actually handles it properly and keeps track of migration already applied - [x] d1 spaces table now stores metadata and the invocation that registered the space - [x] we need some names on the delegations recovered so the user can know what they are, maybe put it in the facts ? - [x] remove duplication on the on `waitForSpaceRecover` and `waitForVoucherRedeem`
- Loading branch information
1 parent
6976ef4
commit 720dafb
Showing
35 changed files
with
1,587 additions
and
1,086 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
packages/access-api/migrations/0001_add_metadata_and_invocation_to_spaces.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
-- Migration number: 0001 2022-11-24T11:52:58.174Z | ||
ALTER TABLE "spaces" | ||
ADD COLUMN "metadata" JSON NOT NULL DEFAULT '"{}"'; | ||
|
||
ALTER TABLE "spaces" | ||
ADD COLUMN "invocation" text NOT NULL; |
3 changes: 3 additions & 0 deletions
3
packages/access-api/migrations/0002_add_delegation_column.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
-- Migration number: 0002 2022-11-29T14:41:37.991Z | ||
ALTER TABLE "spaces" | ||
ADD COLUMN "delegation" text DEFAULT NULL; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,8 +10,8 @@ | |
"lint": "tsc --build && eslint '**/*.{js,ts}' && prettier --check '**/*.{js,ts,yml,json}' --ignore-path ../../.gitignore", | ||
"dev": "scripts/cli.js dev", | ||
"build": "scripts/cli.js build", | ||
"check": "tsc --build", | ||
"test": "pnpm build && tsc --build && ava --timeout 10s" | ||
"test": "pnpm build && mocha --bail --timeout 10s -n no-warnings -n experimental-vm-modules", | ||
"test-watch": "pnpm build && mocha --bail --timeout 10s --watch --parallel -n no-warnings -n experimental-vm-modules --watch-files src,test" | ||
}, | ||
"author": "Hugo Dias <[email protected]> (hugodias.me)", | ||
"license": "(Apache-2.0 OR MIT)", | ||
|
@@ -39,16 +39,18 @@ | |
"@sentry/cli": "2.7.0", | ||
"@types/assert": "^1.5.6", | ||
"@types/git-rev-sync": "^2.0.0", | ||
"@types/node": "^18.11.10", | ||
"@types/mocha": "^10.0.1", | ||
"@types/node": "^18.11.9", | ||
"@types/qrcode": "^1.5.0", | ||
"ava": "^5.1.0", | ||
"better-sqlite3": "8.0.1", | ||
"better-sqlite3": "8.0.0", | ||
"buffer": "^6.0.3", | ||
"dotenv": "^16.0.3", | ||
"esbuild": "^0.15.16", | ||
"git-rev-sync": "^3.0.2", | ||
"hd-scripts": "^3.0.2", | ||
"is-subset": "^0.1.1", | ||
"miniflare": "^2.11.0", | ||
"mocha": "^10.1.0", | ||
"p-wait-for": "^5.0.0", | ||
"process": "^0.11.10", | ||
"readable-stream": "^4.2.0", | ||
|
@@ -66,6 +68,9 @@ | |
"jsx": true | ||
} | ||
}, | ||
"env": { | ||
"mocha": true | ||
}, | ||
"globals": { | ||
"VERSION": "readonly", | ||
"COMMITHASH": "readonly", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.