ntn 0.1.35 → 0.3.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 +84 -1
- package/dist/ntn-darwin-arm64/ntn +0 -0
- package/dist/ntn-linux-x64/ntn +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -34,6 +34,86 @@ ntn workers list
|
|
|
34
34
|
ntn workers deploy
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
+
The public Notion API is available under the `api` command namespace:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
ntn api ls
|
|
41
|
+
ntn api v1/pages --spec -X POST
|
|
42
|
+
ntn api v1/pages --docs -X POST
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
`ntn api` is currently a beta command. For now it only works with Notion
|
|
46
|
+
integration tokens provided via `NOTION_API_TOKEN`.
|
|
47
|
+
|
|
48
|
+
There is also a beta convenience wrapper for the File Uploads API:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
ntn files create < file.png
|
|
52
|
+
ntn files create --external-url https://example.com/photo.png
|
|
53
|
+
ntn files get <upload-id>
|
|
54
|
+
ntn files list
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
`ntn files` currently uses the same public API auth path as `ntn api`, so it
|
|
58
|
+
also requires a Notion integration token in `NOTION_API_TOKEN`.
|
|
59
|
+
|
|
60
|
+
`ntn files create` is intentionally quiet on success. For byte uploads it only
|
|
61
|
+
shows a progress bar when stderr is a TTY.
|
|
62
|
+
|
|
63
|
+
## Public API request syntax
|
|
64
|
+
|
|
65
|
+
`ntn api` supports inline request inputs:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
# Direct JSON body
|
|
69
|
+
ntn api v1/pages -d '{"parent":{"page_id":"abc123"}}'
|
|
70
|
+
|
|
71
|
+
# JSON body string assignment
|
|
72
|
+
ntn api v1/pages parent[page_id]=abc123
|
|
73
|
+
|
|
74
|
+
# Typed JSON assignment
|
|
75
|
+
ntn api v1/pages archived:=true properties[count]:=10
|
|
76
|
+
|
|
77
|
+
# Query params and headers
|
|
78
|
+
ntn api v1/users page_size==100 Accept:application/json
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Supported forms:
|
|
82
|
+
|
|
83
|
+
- `Header:Value` for request headers
|
|
84
|
+
- `name==value` for query params
|
|
85
|
+
- `path=value` for JSON string body fields
|
|
86
|
+
- `path:=json` for typed JSON body fields
|
|
87
|
+
|
|
88
|
+
Body paths support nested objects and arrays:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
ntn api v1/pages \
|
|
92
|
+
parent[page_id]=abc123 \
|
|
93
|
+
children[][paragraph][rich_text][0][text][content]=Hello
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Method selection stays simple:
|
|
97
|
+
|
|
98
|
+
- `GET` by default
|
|
99
|
+
- `POST` automatically when stdin JSON, `--data`, or inline body fields are present
|
|
100
|
+
- `-X/--method` always wins
|
|
101
|
+
|
|
102
|
+
Shell completion can also suggest public API paths and, for `-X/--method`, only
|
|
103
|
+
the methods supported by the selected path.
|
|
104
|
+
|
|
105
|
+
Use exactly one request-body source at a time: stdin JSON, `--data`, or inline
|
|
106
|
+
body fields.
|
|
107
|
+
|
|
108
|
+
See [docs/PUBLIC_API_REQUESTS.md](docs/PUBLIC_API_REQUESTS.md) for the full
|
|
109
|
+
reference, including:
|
|
110
|
+
|
|
111
|
+
- the complete inline parser syntax
|
|
112
|
+
- body path and array rules
|
|
113
|
+
- multipart upload behavior
|
|
114
|
+
- `ls`, `--spec`, and `--docs`
|
|
115
|
+
- verbose logging and environment variables
|
|
116
|
+
|
|
37
117
|
## Building from source
|
|
38
118
|
|
|
39
119
|
Clone the repository and install [mise](https://mise.jdx.dev/), which manages
|
|
@@ -63,4 +143,7 @@ See [this page](https://claude.ai/public/artifacts/56976778-e51d-4e76-b400-c3c00
|
|
|
63
143
|
|
|
64
144
|
## Documentation
|
|
65
145
|
|
|
66
|
-
See the `docs/` directory for additional documentation
|
|
146
|
+
See the `docs/` directory for additional documentation:
|
|
147
|
+
|
|
148
|
+
- `docs/PUBLIC_API_REQUESTS.md` for the complete `ntn api` request reference
|
|
149
|
+
- `docs/HIDDEN.md` for hidden commands and flags not shown in `--help` output
|
|
Binary file
|
package/dist/ntn-linux-x64/ntn
CHANGED
|
Binary file
|