notas 26.5.0 → 26.5.1

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 CHANGED
@@ -56,8 +56,8 @@ notas notion version
56
56
 
57
57
  ## Skills
58
58
 
59
- | Skill | Description |
60
- |-------|-------------|
59
+ | Skill | Description |
60
+ | ---------- | --------------------------------------------------------------------------------------------------------- |
61
61
  | **notion** | Reference guide for the notas CLI Notion provider — pages, databases, blocks, users, comments, and search |
62
62
 
63
63
  ### Claude Code
package/bin/install.js CHANGED
@@ -1,9 +1,10 @@
1
- import https from "https";
1
+ import { Buffer } from "node:buffer";
2
+ import { execSync } from "child_process";
2
3
  import fs from "fs";
4
+ import https from "https";
5
+ import { createRequire } from "module";
3
6
  import path from "path";
4
- import { execSync } from "child_process";
5
7
  import { fileURLToPath } from "url";
6
- import { createRequire } from "module";
7
8
 
8
9
  const require = createRequire(import.meta.url);
9
10
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
@@ -11,53 +12,53 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url));
11
12
  const REPO = "circlesac/notas-cli";
12
13
 
13
14
  const PLATFORMS = {
14
- "darwin-x64": { artifact: "notas-darwin-x64", ext: ".tar.gz" },
15
- "darwin-arm64": { artifact: "notas-darwin-arm64", ext: ".tar.gz" },
16
- "linux-x64": { artifact: "notas-linux-x64", ext: ".tar.gz" },
17
- "linux-arm64": { artifact: "notas-linux-arm64", ext: ".tar.gz" },
15
+ "darwin-x64": { artifact: "notas-darwin-x64", ext: ".tar.gz" },
16
+ "darwin-arm64": { artifact: "notas-darwin-arm64", ext: ".tar.gz" },
17
+ "linux-x64": { artifact: "notas-linux-x64", ext: ".tar.gz" },
18
+ "linux-arm64": { artifact: "notas-linux-arm64", ext: ".tar.gz" }
18
19
  };
19
20
 
20
21
  function download(url) {
21
- return new Promise((resolve, reject) => {
22
- https.get(url, (res) => {
23
- if (res.statusCode === 302 || res.statusCode === 301) {
24
- return download(res.headers.location).then(resolve).catch(reject);
25
- }
26
- if (res.statusCode !== 200) return reject(new Error(`HTTP ${res.statusCode}`));
27
- const chunks = [];
28
- res.on("data", (c) => chunks.push(c));
29
- res.on("end", () => resolve(Buffer.concat(chunks)));
30
- res.on("error", reject);
31
- });
32
- });
22
+ return new Promise((resolve, reject) => {
23
+ https.get(url, (res) => {
24
+ if (res.statusCode === 302 || res.statusCode === 301) {
25
+ return download(res.headers.location).then(resolve).catch(reject);
26
+ }
27
+ if (res.statusCode !== 200) return reject(new Error(`HTTP ${res.statusCode}`));
28
+ const chunks = [];
29
+ res.on("data", (c) => chunks.push(c));
30
+ res.on("end", () => resolve(Buffer.concat(chunks)));
31
+ res.on("error", reject);
32
+ });
33
+ });
33
34
  }
34
35
 
35
36
  const nativeDir = path.join(__dirname, "native");
36
37
  const binPath = path.join(nativeDir, "notas");
37
38
 
38
39
  if (!fs.existsSync(binPath)) {
39
- const { version } = require("../package.json");
40
- if (version) {
41
- const platform = `${process.platform}-${process.arch}`;
42
- const info = PLATFORMS[platform];
43
- if (!info) {
44
- console.error(`Unsupported platform: ${platform}`);
45
- process.exit(1);
46
- }
47
-
48
- const { artifact, ext } = info;
49
- const url = `https://github.com/${REPO}/releases/download/v${version}/${artifact}${ext}`;
50
- console.info(`Downloading notas v${version} for ${platform}...`);
51
-
52
- const data = await download(url);
53
- fs.mkdirSync(nativeDir, { recursive: true });
54
-
55
- const tmp = path.join(nativeDir, `tmp${ext}`);
56
- fs.writeFileSync(tmp, data);
57
- execSync(`tar xzf "${tmp}"`, { cwd: nativeDir });
58
- fs.unlinkSync(tmp);
59
-
60
- fs.chmodSync(binPath, 0o755);
61
- console.info("Installed successfully.");
62
- }
40
+ const { version } = require("../package.json");
41
+ if (version) {
42
+ const platform = `${process.platform}-${process.arch}`;
43
+ const info = PLATFORMS[platform];
44
+ if (!info) {
45
+ console.error(`Unsupported platform: ${platform}`);
46
+ process.exit(1);
47
+ }
48
+
49
+ const { artifact, ext } = info;
50
+ const url = `https://github.com/${REPO}/releases/download/v${version}/${artifact}${ext}`;
51
+ console.info(`Downloading notas v${version} for ${platform}...`);
52
+
53
+ const data = await download(url);
54
+ fs.mkdirSync(nativeDir, { recursive: true });
55
+
56
+ const tmp = path.join(nativeDir, `tmp${ext}`);
57
+ fs.writeFileSync(tmp, data);
58
+ execSync(`tar xzf "${tmp}"`, { cwd: nativeDir });
59
+ fs.unlinkSync(tmp);
60
+
61
+ fs.chmodSync(binPath, 0o755);
62
+ console.info("Installed successfully.");
63
+ }
63
64
  }
package/package.json CHANGED
@@ -42,5 +42,5 @@
42
42
  "type-check": "npx tsc --noEmit"
43
43
  },
44
44
  "type": "module",
45
- "version": "26.5.0"
45
+ "version": "26.5.1"
46
46
  }
@@ -15,11 +15,11 @@ notas notion db list # List all databases
15
15
 
16
16
  ## Global Flags
17
17
 
18
- | Flag | Alias | Description |
19
- |------|-------|-------------|
20
- | `--workspace` | `-w` | Select workspace (when multiple configured) |
21
- | `--json` | | Output as JSON |
22
- | `--plain` | | Output as tab-separated plain text |
18
+ | Flag | Alias | Description |
19
+ | ------------- | ----- | ------------------------------------------- |
20
+ | `--workspace` | `-w` | Select workspace (when multiple configured) |
21
+ | `--json` | | Output as JSON |
22
+ | `--plain` | | Output as tab-separated plain text |
23
23
 
24
24
  ## Authentication
25
25
 
@@ -65,6 +65,7 @@ notas notion pages restore <page-id>
65
65
  ```
66
66
 
67
67
  Stdin support:
68
+
68
69
  ```bash
69
70
  cat notes.md | notas notion pages create <parent-id> --title "From File" --stdio
70
71
  ```
@@ -90,6 +91,7 @@ notas notion blocks delete <block-id>
90
91
  Block types: `paragraph`, `heading_1`, `heading_2`, `heading_3`, `bulleted_list_item`, `numbered_list_item`, `to_do`, `toggle`, `code`, `quote`, `callout`, `divider`, `bookmark`
91
92
 
92
93
  Stdin support:
94
+
93
95
  ```bash
94
96
  cat code.py | notas notion blocks append <page-id> --type code --language python --stdio
95
97
  ```
@@ -134,16 +136,19 @@ notas notion api PATCH /v1/pages/<id> --body '{"archived":true}'
134
136
  ## Common Workflows
135
137
 
136
138
  ### Create a page with content from a file
139
+
137
140
  ```bash
138
141
  cat document.md | notas notion pages create <parent-id> --title "My Doc" --stdio
139
142
  ```
140
143
 
141
144
  ### Query a database and pipe to jq
145
+
142
146
  ```bash
143
147
  notas notion db query <db-id> --json | jq '.results[].properties.Name.title[0].plain_text'
144
148
  ```
145
149
 
146
150
  ### Append multiple blocks from a script
151
+
147
152
  ```bash
148
153
  notas notion blocks append <page-id> --type heading_1 --text "Section Title"
149
154
  notas notion blocks append <page-id> --text "Paragraph content"
@@ -151,6 +156,7 @@ cat snippet.py | notas notion blocks append <page-id> --type code --language pyt
151
156
  ```
152
157
 
153
158
  ### Search and get page content
159
+
154
160
  ```bash
155
161
  PAGE_ID=$(notas notion search "meeting notes" --json | jq -r '.results[0].id')
156
162
  notas notion blocks list $PAGE_ID --recursive --plain