@bitefoundry/onenote 0.3.0 → 0.4.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/LICENSE +21 -21
- package/README.md +202 -169
- package/docs/API.md +132 -114
- package/docs/MCP.md +139 -130
- package/docs/NPM.md +180 -172
- package/docs/openapi.yaml +327 -320
- package/package.json +50 -50
package/docs/openapi.yaml
CHANGED
|
@@ -1,320 +1,327 @@
|
|
|
1
|
-
openapi: 3.1.0
|
|
2
|
-
info:
|
|
3
|
-
title: OneNote CLI Local HTTP API (@bitefoundry/onenote)
|
|
4
|
-
version: 0.1.0
|
|
5
|
-
description: >
|
|
6
|
-
Local HTTP JSON API exposed by `onenote serve` (default `127.0.0.1:8793`).
|
|
7
|
-
All `/v1/onenote/*` routes are also mirrored under `/onenote/*`.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
- name:
|
|
287
|
-
in: query
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
1
|
+
openapi: 3.1.0
|
|
2
|
+
info:
|
|
3
|
+
title: OneNote CLI Local HTTP API (@bitefoundry/onenote)
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
description: >
|
|
6
|
+
Local HTTP JSON API exposed by `onenote serve` (default `127.0.0.1:8793`).
|
|
7
|
+
All `/v1/onenote/*` routes are also mirrored under `/onenote/*`.
|
|
8
|
+
Every route except `/health` needs the API key (`Authorization: Bearer` or
|
|
9
|
+
`x-api-key`); a loopback server without `--api-key` / `ONENOTE_API_KEY`
|
|
10
|
+
generates one and prints it on stderr. Requests with a `Host` outside the
|
|
11
|
+
allow-list get 421, and requests with an `Origin` not listed with
|
|
12
|
+
`--cors-origin` get 403.
|
|
13
|
+
servers:
|
|
14
|
+
- url: http://127.0.0.1:8793
|
|
15
|
+
components:
|
|
16
|
+
securitySchemes:
|
|
17
|
+
bearerAuth:
|
|
18
|
+
type: http
|
|
19
|
+
scheme: bearer
|
|
20
|
+
schemas:
|
|
21
|
+
ResourceDownloadResult:
|
|
22
|
+
type: object
|
|
23
|
+
required: [ok, path, file_name, mime_type, size_bytes, is_image]
|
|
24
|
+
properties:
|
|
25
|
+
ok: { type: boolean }
|
|
26
|
+
path: { type: string }
|
|
27
|
+
file_name: { type: string }
|
|
28
|
+
mime_type: { type: string }
|
|
29
|
+
size_bytes: { type: integer, format: int64 }
|
|
30
|
+
is_image: { type: boolean }
|
|
31
|
+
paths:
|
|
32
|
+
/health:
|
|
33
|
+
get:
|
|
34
|
+
summary: Health check
|
|
35
|
+
responses:
|
|
36
|
+
'200':
|
|
37
|
+
description: Service status
|
|
38
|
+
/v1/whoami:
|
|
39
|
+
get:
|
|
40
|
+
summary: Return signed-in Microsoft 365 profile
|
|
41
|
+
security:
|
|
42
|
+
- bearerAuth: []
|
|
43
|
+
responses:
|
|
44
|
+
'200':
|
|
45
|
+
description: User profile
|
|
46
|
+
/v1/onenote/notebooks:
|
|
47
|
+
get:
|
|
48
|
+
summary: List OneNote notebooks
|
|
49
|
+
security:
|
|
50
|
+
- bearerAuth: []
|
|
51
|
+
parameters:
|
|
52
|
+
- name: include_teams
|
|
53
|
+
in: query
|
|
54
|
+
schema: { type: boolean, default: false }
|
|
55
|
+
- name: refresh
|
|
56
|
+
in: query
|
|
57
|
+
schema: { type: boolean, default: false }
|
|
58
|
+
- name: offline
|
|
59
|
+
in: query
|
|
60
|
+
schema: { type: boolean, default: false }
|
|
61
|
+
responses:
|
|
62
|
+
'200':
|
|
63
|
+
description: Notebook list
|
|
64
|
+
post:
|
|
65
|
+
summary: Create a OneNote notebook
|
|
66
|
+
security:
|
|
67
|
+
- bearerAuth: []
|
|
68
|
+
requestBody:
|
|
69
|
+
required: true
|
|
70
|
+
content:
|
|
71
|
+
application/json:
|
|
72
|
+
schema:
|
|
73
|
+
type: object
|
|
74
|
+
required: [name]
|
|
75
|
+
properties:
|
|
76
|
+
name: { type: string }
|
|
77
|
+
group_id: { type: string }
|
|
78
|
+
site_id: { type: string }
|
|
79
|
+
responses:
|
|
80
|
+
'201':
|
|
81
|
+
description: Created notebook
|
|
82
|
+
/v1/onenote/sections:
|
|
83
|
+
get:
|
|
84
|
+
summary: List OneNote sections
|
|
85
|
+
security:
|
|
86
|
+
- bearerAuth: []
|
|
87
|
+
parameters:
|
|
88
|
+
- name: notebook
|
|
89
|
+
in: query
|
|
90
|
+
schema: { type: string }
|
|
91
|
+
- name: refresh
|
|
92
|
+
in: query
|
|
93
|
+
schema: { type: boolean, default: false }
|
|
94
|
+
- name: offline
|
|
95
|
+
in: query
|
|
96
|
+
schema: { type: boolean, default: false }
|
|
97
|
+
responses:
|
|
98
|
+
'200':
|
|
99
|
+
description: Section list
|
|
100
|
+
post:
|
|
101
|
+
summary: Create a OneNote section
|
|
102
|
+
security:
|
|
103
|
+
- bearerAuth: []
|
|
104
|
+
requestBody:
|
|
105
|
+
required: true
|
|
106
|
+
content:
|
|
107
|
+
application/json:
|
|
108
|
+
schema:
|
|
109
|
+
type: object
|
|
110
|
+
required: [notebook, name]
|
|
111
|
+
properties:
|
|
112
|
+
notebook: { type: string }
|
|
113
|
+
name: { type: string }
|
|
114
|
+
responses:
|
|
115
|
+
'201':
|
|
116
|
+
description: Created section
|
|
117
|
+
/v1/onenote/pages:
|
|
118
|
+
get:
|
|
119
|
+
summary: List OneNote pages in a section
|
|
120
|
+
security:
|
|
121
|
+
- bearerAuth: []
|
|
122
|
+
parameters:
|
|
123
|
+
- name: section
|
|
124
|
+
in: query
|
|
125
|
+
required: true
|
|
126
|
+
schema: { type: string }
|
|
127
|
+
- name: limit
|
|
128
|
+
in: query
|
|
129
|
+
schema: { type: integer, default: 50 }
|
|
130
|
+
- name: refresh
|
|
131
|
+
in: query
|
|
132
|
+
schema: { type: boolean, default: false }
|
|
133
|
+
- name: offline
|
|
134
|
+
in: query
|
|
135
|
+
schema: { type: boolean, default: false }
|
|
136
|
+
responses:
|
|
137
|
+
'200':
|
|
138
|
+
description: Page summaries
|
|
139
|
+
post:
|
|
140
|
+
summary: Create a top-level OneNote page from Markdown
|
|
141
|
+
security:
|
|
142
|
+
- bearerAuth: []
|
|
143
|
+
requestBody:
|
|
144
|
+
required: true
|
|
145
|
+
content:
|
|
146
|
+
application/json:
|
|
147
|
+
schema:
|
|
148
|
+
type: object
|
|
149
|
+
required: [section, title]
|
|
150
|
+
properties:
|
|
151
|
+
section: { type: string }
|
|
152
|
+
title: { type: string }
|
|
153
|
+
markdown: { type: string }
|
|
154
|
+
level: { type: integer, minimum: 0, maximum: 0, default: 0 }
|
|
155
|
+
image_paths:
|
|
156
|
+
type: array
|
|
157
|
+
items: { type: string }
|
|
158
|
+
responses:
|
|
159
|
+
'200':
|
|
160
|
+
description: Created page summary
|
|
161
|
+
'400':
|
|
162
|
+
description: Invalid input, including a nonzero page level
|
|
163
|
+
/v1/onenote/pages/{page}:
|
|
164
|
+
get:
|
|
165
|
+
summary: Read a OneNote page detail (blocks, Markdown, resources)
|
|
166
|
+
security:
|
|
167
|
+
- bearerAuth: []
|
|
168
|
+
parameters:
|
|
169
|
+
- name: page
|
|
170
|
+
in: path
|
|
171
|
+
required: true
|
|
172
|
+
schema: { type: string }
|
|
173
|
+
- name: section
|
|
174
|
+
in: query
|
|
175
|
+
schema: { type: string }
|
|
176
|
+
- name: offline
|
|
177
|
+
in: query
|
|
178
|
+
schema: { type: boolean, default: false }
|
|
179
|
+
responses:
|
|
180
|
+
'200':
|
|
181
|
+
description: Page detail
|
|
182
|
+
patch:
|
|
183
|
+
summary: Surgically replace a block or update page title/body
|
|
184
|
+
security:
|
|
185
|
+
- bearerAuth: []
|
|
186
|
+
parameters:
|
|
187
|
+
- name: page
|
|
188
|
+
in: path
|
|
189
|
+
required: true
|
|
190
|
+
schema: { type: string }
|
|
191
|
+
requestBody:
|
|
192
|
+
required: true
|
|
193
|
+
content:
|
|
194
|
+
application/json:
|
|
195
|
+
schema:
|
|
196
|
+
type: object
|
|
197
|
+
properties:
|
|
198
|
+
block_id: { type: string }
|
|
199
|
+
title: { type: string }
|
|
200
|
+
markdown: { type: string }
|
|
201
|
+
expected_content: { type: string }
|
|
202
|
+
force: { type: boolean, default: false }
|
|
203
|
+
section: { type: string }
|
|
204
|
+
responses:
|
|
205
|
+
'200':
|
|
206
|
+
description: Updated page detail
|
|
207
|
+
delete:
|
|
208
|
+
summary: Delete a OneNote page
|
|
209
|
+
security:
|
|
210
|
+
- bearerAuth: []
|
|
211
|
+
parameters:
|
|
212
|
+
- name: page
|
|
213
|
+
in: path
|
|
214
|
+
required: true
|
|
215
|
+
schema: { type: string }
|
|
216
|
+
- name: section
|
|
217
|
+
in: query
|
|
218
|
+
schema: { type: string }
|
|
219
|
+
responses:
|
|
220
|
+
'200':
|
|
221
|
+
description: Deletion result
|
|
222
|
+
/v1/onenote/pages/{page}/append:
|
|
223
|
+
post:
|
|
224
|
+
summary: Append Markdown and optional images to a page
|
|
225
|
+
security:
|
|
226
|
+
- bearerAuth: []
|
|
227
|
+
parameters:
|
|
228
|
+
- name: page
|
|
229
|
+
in: path
|
|
230
|
+
required: true
|
|
231
|
+
schema: { type: string }
|
|
232
|
+
requestBody:
|
|
233
|
+
required: true
|
|
234
|
+
content:
|
|
235
|
+
application/json:
|
|
236
|
+
schema:
|
|
237
|
+
type: object
|
|
238
|
+
required: [markdown]
|
|
239
|
+
properties:
|
|
240
|
+
markdown: { type: string }
|
|
241
|
+
images:
|
|
242
|
+
type: array
|
|
243
|
+
items: { type: string }
|
|
244
|
+
description: Alias of `image_paths` (do not send both keys in the same request).
|
|
245
|
+
image_paths:
|
|
246
|
+
type: array
|
|
247
|
+
items: { type: string }
|
|
248
|
+
section: { type: string }
|
|
249
|
+
responses:
|
|
250
|
+
'200':
|
|
251
|
+
description: Updated page detail
|
|
252
|
+
'400':
|
|
253
|
+
description: Invalid input, including specifying both `images` and `image_paths`
|
|
254
|
+
/v1/onenote/pages/{page}/todo:
|
|
255
|
+
post:
|
|
256
|
+
summary: Set or toggle a OneNote checkbox on a block (also served at `/pages/{page}/toggle-todo`)
|
|
257
|
+
security:
|
|
258
|
+
- bearerAuth: []
|
|
259
|
+
parameters:
|
|
260
|
+
- name: page
|
|
261
|
+
in: path
|
|
262
|
+
required: true
|
|
263
|
+
schema: { type: string }
|
|
264
|
+
requestBody:
|
|
265
|
+
required: true
|
|
266
|
+
content:
|
|
267
|
+
application/json:
|
|
268
|
+
schema:
|
|
269
|
+
type: object
|
|
270
|
+
properties:
|
|
271
|
+
block_id: { type: string }
|
|
272
|
+
index: { type: integer, minimum: 0 }
|
|
273
|
+
completed: { type: boolean }
|
|
274
|
+
expected_content: { type: string }
|
|
275
|
+
force: { type: boolean, default: false }
|
|
276
|
+
section: { type: string }
|
|
277
|
+
responses:
|
|
278
|
+
'200':
|
|
279
|
+
description: Updated page detail
|
|
280
|
+
/v1/onenote/search:
|
|
281
|
+
get:
|
|
282
|
+
summary: Full-text search across cached OneNote pages
|
|
283
|
+
security:
|
|
284
|
+
- bearerAuth: []
|
|
285
|
+
parameters:
|
|
286
|
+
- name: q
|
|
287
|
+
in: query
|
|
288
|
+
required: true
|
|
289
|
+
schema: { type: string }
|
|
290
|
+
- name: section
|
|
291
|
+
in: query
|
|
292
|
+
schema: { type: string }
|
|
293
|
+
- name: limit
|
|
294
|
+
in: query
|
|
295
|
+
schema: { type: integer, default: 30 }
|
|
296
|
+
- name: refresh
|
|
297
|
+
in: query
|
|
298
|
+
schema: { type: boolean, default: false }
|
|
299
|
+
responses:
|
|
300
|
+
'200':
|
|
301
|
+
description: Search hits
|
|
302
|
+
/v1/onenote/resources/download:
|
|
303
|
+
post:
|
|
304
|
+
summary: Download an embedded OneNote image or file attachment (also served at `/pages/{page}/resources/download`)
|
|
305
|
+
security:
|
|
306
|
+
- bearerAuth: []
|
|
307
|
+
requestBody:
|
|
308
|
+
required: true
|
|
309
|
+
content:
|
|
310
|
+
application/json:
|
|
311
|
+
schema:
|
|
312
|
+
type: object
|
|
313
|
+
required: [page]
|
|
314
|
+
properties:
|
|
315
|
+
page: { type: string }
|
|
316
|
+
index: { type: integer, minimum: 0 }
|
|
317
|
+
url: { type: string }
|
|
318
|
+
out: { type: string }
|
|
319
|
+
out_dir: { type: string }
|
|
320
|
+
section: { type: string }
|
|
321
|
+
responses:
|
|
322
|
+
'200':
|
|
323
|
+
description: Downloaded resource metadata
|
|
324
|
+
content:
|
|
325
|
+
application/json:
|
|
326
|
+
schema:
|
|
327
|
+
$ref: '#/components/schemas/ResourceDownloadResult'
|