@dasl/fisl 0.1.0 → 0.2.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.
- package/README.md +234 -50
- package/dist/cli.js +73 -20
- package/dist/src/atproto.d.ts +1 -1
- package/dist/src/atproto.js +21 -5
- package/dist/src/cid-core.d.ts +1 -1
- package/dist/src/cid.js +9 -4
- package/dist/src/fetch.js +102 -41
- package/dist/src/fisl/client.js +10 -2
- package/dist/src/fisl/server.js +1 -1
- package/dist/src/index/ingest.d.ts +7 -1
- package/dist/src/index/ingest.js +10 -1
- package/dist/src/index/jetstream.js +24 -2
- package/dist/src/index/pds.d.ts +2 -1
- package/dist/src/index/pds.js +33 -6
- package/dist/src/index/sqlite.js +36 -11
- package/dist/src/index/store.d.ts +3 -1
- package/dist/src/index/store.js +16 -1
- package/dist/src/index/verify.js +13 -4
- package/dist/src/publish.js +12 -3
- package/dist/src/rasl/server.js +4 -1
- package/dist/src/record.js +1 -1
- package/dist/src/serve.js +10 -1
- package/package.json +2 -3
- package/CLI.md +0 -111
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dasl/fisl",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Publish, index, serve and fetch content by DASL CID, with FISL and ATFISL",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -28,8 +28,7 @@
|
|
|
28
28
|
"fisl": "dist/cli.js"
|
|
29
29
|
},
|
|
30
30
|
"files": [
|
|
31
|
-
"dist"
|
|
32
|
-
"CLI.md"
|
|
31
|
+
"dist"
|
|
33
32
|
],
|
|
34
33
|
"scripts": {
|
|
35
34
|
"build": "rm -rf dist && tsc -p tsconfig.build.json && cp src/*-core.js src/*-core.d.ts dist/src/ && chmod +x dist/cli.js",
|
package/CLI.md
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
# fisl CLI
|
|
2
|
-
|
|
3
|
-
The `fisl` command line tool publishes, indexes, serves, and fetches content by DASL CID. The [@dasl/fisl](README.md) package includes both the CLI and the library for FISL and ATFISL operations.
|
|
4
|
-
|
|
5
|
-
The installed CLI requires Node.js 22.13 or later. Repository development and tests use Node 24 or later.
|
|
6
|
-
|
|
7
|
-
## Install
|
|
8
|
-
|
|
9
|
-
Install from npm:
|
|
10
|
-
|
|
11
|
-
```sh
|
|
12
|
-
npm install -g @dasl/fisl
|
|
13
|
-
fisl help
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
Or run it without a global install:
|
|
17
|
-
|
|
18
|
-
```sh
|
|
19
|
-
npx @dasl/fisl help
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
From a checkout, install and build the package at the repository root:
|
|
23
|
-
|
|
24
|
-
```sh
|
|
25
|
-
npm install
|
|
26
|
-
npm run build
|
|
27
|
-
npm run fisl -w @dasl/fisl -- help
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
To install the workspace command globally after the build, run `npm link` inside `packages/lib/`.
|
|
31
|
-
|
|
32
|
-
## Commands
|
|
33
|
-
|
|
34
|
-
```sh
|
|
35
|
-
# Print the DASL CID of files
|
|
36
|
-
fisl cid photo.jpg
|
|
37
|
-
|
|
38
|
-
# Log in with an app password
|
|
39
|
-
export FISL_HANDLE=alice.bsky.social FISL_APP_PASSWORD=xxxx-xxxx-xxxx-xxxx
|
|
40
|
-
|
|
41
|
-
# Announce that a file is at a URL
|
|
42
|
-
fisl publish photo.jpg --url https://example.com/photo.jpg --expires 2026-12-31T00:00:00Z
|
|
43
|
-
|
|
44
|
-
# Publish many records, one {"cid", ...record} object per line
|
|
45
|
-
fisl publish --jsonl records.jsonl
|
|
46
|
-
|
|
47
|
-
# List and remove records
|
|
48
|
-
fisl list alice.bsky.social
|
|
49
|
-
fisl unpublish bafkrei...
|
|
50
|
-
|
|
51
|
-
# Serve a directory at /.well-known/rasl/{cid} and announce every file
|
|
52
|
-
fisl serve ./public --port 8080 --public-url https://files.example.com --publish
|
|
53
|
-
|
|
54
|
-
# Run an indexer that follows every dev.fisl.at commit on Jetstream
|
|
55
|
-
fisl indexer --port 8000 --db fisl-index.sqlite
|
|
56
|
-
|
|
57
|
-
# Or index selected repos, read from their PDS every 60 seconds
|
|
58
|
-
fisl indexer --source pds --did alice.bsky.social --did did:plc:...
|
|
59
|
-
|
|
60
|
-
# Look up and fetch by CID
|
|
61
|
-
export FISL_INDEXER=http://localhost:8000
|
|
62
|
-
fisl resolve bafkrei...
|
|
63
|
-
fisl get bafkrei... -o photo.jpg
|
|
64
|
-
fisl get bafkrei... --did alice.bsky.social
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
`fisl get` uses `https` URLs and `rasl://` URLs. To allow plain `http`, add `--allow-http`. To allow hosts on loopback or private networks, add `--allow-private`. It skips URL schemes it does not know, such as `radiroh://`.
|
|
68
|
-
|
|
69
|
-
With `--output`, the CLI streams the download into a temporary file beside the destination. It replaces the destination only after the bytes match the CID.
|
|
70
|
-
|
|
71
|
-
## Configuration
|
|
72
|
-
|
|
73
|
-
The CLI reads these environment variables. A command-line flag overrides the variable.
|
|
74
|
-
|
|
75
|
-
| Variable | Used by | Flag |
|
|
76
|
-
| --- | --- | --- |
|
|
77
|
-
| `FISL_HANDLE` | `publish`, `list`, ... | `--handle` |
|
|
78
|
-
| `FISL_APP_PASSWORD` | `publish`, `unpublish` | `--password` |
|
|
79
|
-
| `FISL_INDEXER` | `resolve`, `get` | `--indexer` |
|
|
80
|
-
|
|
81
|
-
The CLI does not read a `.env` file by itself. Node.js can load one with `--env-file`. Example `.env`:
|
|
82
|
-
|
|
83
|
-
```sh
|
|
84
|
-
FISL_HANDLE=alice.bsky.social
|
|
85
|
-
FISL_APP_PASSWORD=xxxx-xxxx-xxxx-xxxx
|
|
86
|
-
FISL_INDEXER=http://localhost:8000
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
Do not commit this file. It holds a secret. Add `.env` to your `.gitignore`.
|
|
90
|
-
|
|
91
|
-
To load it, pass the flag to Node.js:
|
|
92
|
-
|
|
93
|
-
```sh
|
|
94
|
-
NODE_OPTIONS="--env-file=$HOME/.config/fisl/.env" fisl publish photo.jpg --url https://example.com/photo.jpg
|
|
95
|
-
|
|
96
|
-
# Or, from a checkout, in packages/lib/
|
|
97
|
-
node --env-file=.env cli.ts publish photo.jpg --url https://example.com/photo.jpg
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
Variables already set in your shell take priority over the file.
|
|
101
|
-
|
|
102
|
-
## Test
|
|
103
|
-
|
|
104
|
-
After building the package, run these commands from the repository root:
|
|
105
|
-
|
|
106
|
-
```sh
|
|
107
|
-
npm test -w @dasl/fisl
|
|
108
|
-
node scripts/check-pack.mjs
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
The package test installs the tarball outside the workspace. It tests the installed executable and the library exports.
|