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