@wirecat/notion-cli 0.7.0 → 0.8.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/CHANGELOG.md +58 -0
- package/README.md +20 -3
- package/contracts/wirecat.json +238 -2
- package/dist/bin/notion.js +2 -2
- package/dist/bundle/agent-FDS2ENXJ.js +42 -0
- package/dist/bundle/{all-profiles-CKOACXTW.js → all-profiles-MIGUJ6UM.js} +11 -11
- package/dist/bundle/{anthropic-DWBBVTU3.js → anthropic-ZTYBZ7PI.js} +5 -5
- package/dist/bundle/{app-server-BHFYNCDE.js → app-server-MGXJZOJ2.js} +72 -72
- package/dist/bundle/{bun-ICK2XT7J.js → bun-NS5YLOQT.js} +2 -2
- package/dist/bundle/{bun-sqlite-LU5V5Y4A.js → bun-sqlite-EKMD3TXK.js} +6 -6
- package/dist/bundle/{chunk-UYEDQGMI.js → chunk-2BPQNFA5.js} +6 -6
- package/dist/bundle/{chunk-5NFIUY2P.js → chunk-2Q5ATPA6.js} +4 -4
- package/dist/bundle/{chunk-NCCRLAAI.js → chunk-2T76TPDD.js} +3 -3
- package/dist/bundle/{chunk-OCGNOJYD.js → chunk-2TVHFJKV.js} +1 -1
- package/dist/bundle/{chunk-ITWINZ6R.js → chunk-2XWVZDOM.js} +12 -12
- package/dist/bundle/{chunk-IEY7KS6Q.js → chunk-43PCMVTZ.js} +1 -1
- package/dist/bundle/{chunk-KWBLDSRV.js → chunk-53UXHJEO.js} +3 -3
- package/dist/bundle/{chunk-EMIJVLOA.js → chunk-5KL3PQWI.js} +2 -2
- package/dist/bundle/{chunk-SRVTGI3M.js → chunk-5QCPDJLB.js} +2 -2
- package/dist/bundle/{chunk-MB4HXDBT.js → chunk-64KVWK5N.js} +5 -5
- package/dist/bundle/{chunk-ITW26OBI.js → chunk-66M7VFIM.js} +38 -38
- package/dist/bundle/{chunk-QK52ARAU.js → chunk-6BOEXO72.js} +3 -3
- package/dist/bundle/{chunk-ZMKAI3F3.js → chunk-6P7HUUR5.js} +3 -3
- package/dist/bundle/{chunk-LBRTLZHI.js → chunk-77727OQH.js} +197 -155
- package/dist/bundle/{chunk-BXXHUO7Y.js → chunk-7KNBZOLH.js} +13 -13
- package/dist/bundle/{chunk-EUF5JNPG.js → chunk-7YPZPJTB.js} +1 -1
- package/dist/bundle/{chunk-TWY543BS.js → chunk-A5PL2GYK.js} +1 -1
- package/dist/bundle/{chunk-6MQSBWWF.js → chunk-AG34MPVN.js} +1 -1
- package/dist/bundle/{chunk-46JBCXLI.js → chunk-BCO37YUH.js} +327 -6
- package/dist/bundle/{chunk-7COTHS6G.js → chunk-COF6KS7A.js} +6 -6
- package/dist/bundle/{chunk-VXKD533R.js → chunk-CWTTCFDX.js} +995 -610
- package/dist/bundle/{chunk-3T3OAYL4.js → chunk-D2IVASIC.js} +2 -2
- package/dist/bundle/{chunk-PDVXG3T3.js → chunk-D3G375NT.js} +6 -6
- package/dist/bundle/{chunk-3ZSUVFR7.js → chunk-DGZNVYKK.js} +8 -8
- package/dist/bundle/{chunk-FHYV4VWY.js → chunk-DLEAVO2T.js} +7 -7
- package/dist/bundle/{chunk-UQVUXG7H.js → chunk-DW6YAEMZ.js} +10 -10
- package/dist/bundle/{chunk-LEPPRULN.js → chunk-E4FNVLTR.js} +23 -4
- package/dist/bundle/{chunk-VRBEYOJL.js → chunk-E5EYJU5R.js} +1 -1
- package/dist/bundle/{chunk-A3RJ6FD5.js → chunk-E5XATHAF.js} +8 -8
- package/dist/bundle/{chunk-63SW4UXG.js → chunk-EXHTGQR2.js} +1 -1
- package/dist/bundle/{chunk-FO3XY2Y2.js → chunk-EZAVBR47.js} +2 -2
- package/dist/bundle/{chunk-NV7NNL5T.js → chunk-F7DHR4OO.js} +7 -7
- package/dist/bundle/{chunk-4FHKSSXQ.js → chunk-FGWQHNKK.js} +2 -2
- package/dist/bundle/{chunk-B6DJQBZI.js → chunk-FSWLPNJT.js} +5 -5
- package/dist/bundle/{chunk-364ET7LV.js → chunk-GFI3UUIU.js} +1 -1
- package/dist/bundle/{chunk-2OZVCNU5.js → chunk-GGNVBN2S.js} +2 -2
- package/dist/bundle/{chunk-X737FHZP.js → chunk-GPFE4SS7.js} +4 -4
- package/dist/bundle/{chunk-OW5HW3TD.js → chunk-H76WEF2L.js} +6 -6
- package/dist/bundle/{chunk-RNVYNPXT.js → chunk-HPS2YGSZ.js} +1 -1
- package/dist/bundle/{chunk-S5P7THM5.js → chunk-HZ5LRWKH.js} +2 -2
- package/dist/bundle/{chunk-ZGUUP2T3.js → chunk-I5OAVMOI.js} +12 -12
- package/dist/bundle/{chunk-OALFRUMI.js → chunk-I62MWK5L.js} +14 -2
- package/dist/bundle/{chunk-3AKMIKND.js → chunk-IBFCD6TR.js} +17 -17
- package/dist/bundle/{chunk-HJDQTM3T.js → chunk-IL3UYHCR.js} +8 -8
- package/dist/bundle/{chunk-HSVKU4OJ.js → chunk-J4CXJJJU.js} +116 -30
- package/dist/bundle/{chunk-R4JV3VLU.js → chunk-JRZEXLRQ.js} +13 -12
- package/dist/bundle/{chunk-ALAPDLCP.js → chunk-KDPV6YBX.js} +2 -2
- package/dist/bundle/{chunk-BFCRGLOF.js → chunk-KHEISFJO.js} +3 -3
- package/dist/bundle/{chunk-FNESLLZS.js → chunk-KI6OOW6D.js} +8 -1
- package/dist/bundle/{chunk-3DGHBXH2.js → chunk-KPBUJQKT.js} +1 -1
- package/dist/bundle/{chunk-OP2BH55P.js → chunk-LEO5GWPD.js} +3 -3
- package/dist/bundle/{chunk-N3NJPHZB.js → chunk-LKUWH6KU.js} +1 -1
- package/dist/bundle/{chunk-JPGN473W.js → chunk-LYJDZILD.js} +3 -3
- package/dist/bundle/{chunk-JVRBW5LH.js → chunk-M27SMKNH.js} +5 -5
- package/dist/bundle/{chunk-YSF5JBRA.js → chunk-MA6U4XH2.js} +1 -1
- package/dist/bundle/{chunk-64IK7JFO.js → chunk-MC3LAGIW.js} +2 -2
- package/dist/bundle/{chunk-J3DZVB67.js → chunk-MGC2BAD2.js} +1 -1
- package/dist/bundle/{chunk-S35UJBFZ.js → chunk-MLXDGBH4.js} +19 -19
- package/dist/bundle/{chunk-IYZWHCZJ.js → chunk-NQA2STEE.js} +35 -14
- package/dist/bundle/{chunk-2RNJ2JP3.js → chunk-NSBTYJRP.js} +4 -4
- package/dist/bundle/{chunk-REOBWSGV.js → chunk-NSQN4F7H.js} +8 -8
- package/dist/bundle/{chunk-WUNEJRLJ.js → chunk-NVXMWAEV.js} +6 -6
- package/dist/bundle/{chunk-UO4O6WQ4.js → chunk-OZAP4FEG.js} +8 -8
- package/dist/bundle/{chunk-OFMCU3BH.js → chunk-OZZ5PTHG.js} +5 -5
- package/dist/bundle/{chunk-BQ6CXCLP.js → chunk-P4ADIGTL.js} +8 -8
- package/dist/bundle/{chunk-KBY42GKW.js → chunk-PVTW7ZOY.js} +23 -23
- package/dist/bundle/{chunk-PSMRUOII.js → chunk-Q5PNS2K2.js} +3 -3
- package/dist/bundle/{chunk-LVAFTQ45.js → chunk-QQP54EEZ.js} +29 -178
- package/dist/bundle/{chunk-3YXYA6HB.js → chunk-RM4DO2WZ.js} +1 -1
- package/dist/bundle/{chunk-JEZJFQQW.js → chunk-S3SLDYTU.js} +1 -1
- package/dist/bundle/{chunk-RXGX2CZX.js → chunk-S5NFSVNK.js} +63 -63
- package/dist/bundle/{chunk-EWXMIKZN.js → chunk-UE7ST7JC.js} +30 -30
- package/dist/bundle/{chunk-6UZ5D2WP.js → chunk-ULTKZLJV.js} +7 -7
- package/dist/bundle/{chunk-WJFQMOVM.js → chunk-VJ5EF4C7.js} +61 -61
- package/dist/bundle/{chunk-OS4WPXPZ.js → chunk-WBVZVP4T.js} +4 -4
- package/dist/bundle/{chunk-QMNEDK7Z.js → chunk-WDL3QYN2.js} +3 -3
- package/dist/bundle/{chunk-HOO53OYK.js → chunk-WPNY2J2X.js} +16 -16
- package/dist/bundle/{chunk-BFHPT67P.js → chunk-XRA2V4MM.js} +1556 -620
- package/dist/bundle/{chunk-3KOJNZH3.js → chunk-Y6KPZOOD.js} +3 -3
- package/dist/bundle/{chunk-ADCAWRRX.js → chunk-YAYVXHMO.js} +48 -48
- package/dist/bundle/{chunk-DCSPCOPB.js → chunk-YG2FFC2R.js} +9 -9
- package/dist/bundle/{chunk-X5LUHN62.js → chunk-YOZHKJEN.js} +2 -2
- package/dist/bundle/{chunk-VYZ2J7DT.js → chunk-ZKD3TL3O.js} +4 -4
- package/dist/bundle/command-contract-ZGBZCKZP.js +41 -0
- package/dist/bundle/{command-server-entry-F3B2KSPO.js → command-server-entry-ZXB7VUIG.js} +29 -29
- package/dist/bundle/{decode-FDHFF7GC.js → decode-BGLAM2YP.js} +5 -5
- package/dist/bundle/{dispatch-IXKG5Z5Y.js → dispatch-A3WIRXBM.js} +8 -8
- package/dist/bundle/{echarts-PGJPVPA4.js → echarts-ISH62J4E.js} +2 -2
- package/dist/bundle/{embed-U6X7CNNK.js → embed-POZWSFKL.js} +6 -6
- package/dist/bundle/{embedder-3ROL6ROQ.js → embedder-7DIUHQOQ.js} +9 -9
- package/dist/bundle/{failure-IYMRXM2X.js → failure-BBT3B4UY.js} +2 -2
- package/dist/bundle/{first-run-PNVNHGR7.js → first-run-SLMRAWYB.js} +12 -12
- package/dist/bundle/first-screen-CCLGBTQ2.js +41 -0
- package/dist/bundle/{instructions-MJQWRI2D.js → instructions-G5ZGHVFB.js} +1 -1
- package/dist/bundle/{mcp-JNHOSK4L.js → mcp-MQ2L5IIM.js} +2 -2
- package/dist/bundle/meeting-combined-P56K6BUT.js +25 -0
- package/dist/bundle/meeting-model-UY4ABXAZ.js +27 -0
- package/dist/bundle/{meeting-semantic-7WPLMBNT.js → meeting-semantic-VPMFO4FB.js} +6 -6
- package/dist/bundle/{node-3UXNV3CD.js → node-NLJINXVQ.js} +2 -2
- package/dist/bundle/{node-sqlite-ULWDWM3I.js → node-sqlite-LPV27ECD.js} +7 -7
- package/dist/bundle/notes-search-TKP34WJZ.js +64 -0
- package/dist/bundle/notion.js +13 -13
- package/dist/bundle/{oauth-LNUZMA72.js → oauth-SC4HSJ7X.js} +7 -7
- package/dist/bundle/{open-HGHC35M4.js → open-K2JIOWCG.js} +5 -5
- package/dist/bundle/{openai-ISSP57MV.js → openai-MCKQLBZM.js} +18 -18
- package/dist/bundle/{process-PB2WCOR2.js → process-LPVAYRO7.js} +1 -1
- package/dist/bundle/{program-GASBJRMG.js → program-QXA6YXUO.js} +11176 -8685
- package/dist/bundle/{prompt-3VGQVX2B.js → prompt-XWESMSOG.js} +5 -5
- package/dist/bundle/{recognize-7Q2P3NME.js → recognize-TDE6PPXV.js} +4 -4
- package/dist/bundle/{remote-BBAWKVIT.js → remote-OAGPQQVE.js} +11 -11
- package/dist/bundle/{rerank-H4PUS4HV.js → rerank-375AKI4E.js} +7 -7
- package/dist/bundle/{schemas-TTVUADHT.js → schemas-ZE62D6CG.js} +1 -1
- package/dist/bundle/{serve-FZNSKY7R.js → serve-YWCHKQEP.js} +9 -9
- package/dist/bundle/{server-BRRNDW6L.js → server-C4SH5PRK.js} +64 -64
- package/dist/bundle/server-SYGVF5BJ.js +90 -0
- package/dist/bundle/{services-PEU557KZ.js → services-5Z2P4D2K.js} +51 -51
- package/dist/bundle/{sqlite-runtime-4IZJ4YUM.js → sqlite-runtime-KLELNUHI.js} +6 -6
- package/dist/bundle/{state-MX3JVT5Q.js → state-OWEBLXCG.js} +6 -6
- package/dist/bundle/{store-JUT34REM.js → store-F63SKKV7.js} +27 -23
- package/dist/bundle/{store-PP4BPADZ.js → store-IVJXGAX7.js} +21 -21
- package/dist/bundle/store-maintenance-command-YBMOO7XH.js +77 -0
- package/dist/bundle/surface-G3ITURGS.js +76 -0
- package/dist/commands/comments.d.ts +1 -1
- package/dist/commands/comments.d.ts.map +1 -1
- package/dist/commands/comments.js +33 -2
- package/dist/commands/comments.js.map +1 -1
- package/dist/commands/databases.d.ts.map +1 -1
- package/dist/commands/databases.js +3 -2
- package/dist/commands/databases.js.map +1 -1
- package/dist/commands/documents.d.ts +13 -2
- package/dist/commands/documents.d.ts.map +1 -1
- package/dist/commands/documents.js +291 -23
- package/dist/commands/documents.js.map +1 -1
- package/dist/commands/library.d.ts.map +1 -1
- package/dist/commands/library.js +12 -4
- package/dist/commands/library.js.map +1 -1
- package/dist/commands/meetings.d.ts +7 -0
- package/dist/commands/meetings.d.ts.map +1 -0
- package/dist/commands/meetings.js +136 -0
- package/dist/commands/meetings.js.map +1 -0
- package/dist/commands/rows.d.ts +4 -0
- package/dist/commands/rows.d.ts.map +1 -0
- package/dist/commands/rows.js +51 -0
- package/dist/commands/rows.js.map +1 -0
- package/dist/commands/writing.d.ts +2 -1
- package/dist/commands/writing.d.ts.map +1 -1
- package/dist/commands/writing.js +2 -2
- package/dist/commands/writing.js.map +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +12 -2
- package/dist/config.js.map +1 -1
- package/dist/context.d.ts +2 -0
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +2 -0
- package/dist/context.js.map +1 -1
- package/dist/generated/wirecat-config.d.ts.map +1 -1
- package/dist/generated/wirecat-config.js +8 -0
- package/dist/generated/wirecat-config.js.map +1 -1
- package/dist/knowledge.d.ts +18 -1
- package/dist/knowledge.d.ts.map +1 -1
- package/dist/library.d.ts +4 -0
- package/dist/library.d.ts.map +1 -1
- package/dist/library.js +11 -1
- package/dist/library.js.map +1 -1
- package/dist/notion/errors.d.ts.map +1 -1
- package/dist/notion/errors.js +19 -0
- package/dist/notion/errors.js.map +1 -1
- package/dist/notion/meeting-notes.d.ts +10 -0
- package/dist/notion/meeting-notes.d.ts.map +1 -0
- package/dist/notion/meeting-notes.js +196 -0
- package/dist/notion/meeting-notes.js.map +1 -0
- package/dist/notion/notion.d.ts +46 -0
- package/dist/notion/notion.d.ts.map +1 -1
- package/dist/notion/notion.js +105 -14
- package/dist/notion/notion.js.map +1 -1
- package/dist/notion/page-target.d.ts +30 -0
- package/dist/notion/page-target.d.ts.map +1 -0
- package/dist/notion/page-target.js +73 -0
- package/dist/notion/page-target.js.map +1 -0
- package/dist/notion/port.d.ts.map +1 -1
- package/dist/notion/port.js +2 -0
- package/dist/notion/port.js.map +1 -1
- package/dist/notion/properties.d.ts +55 -0
- package/dist/notion/properties.d.ts.map +1 -0
- package/dist/notion/properties.js +280 -0
- package/dist/notion/properties.js.map +1 -0
- package/dist/notion/reads.d.ts +19 -1
- package/dist/notion/reads.d.ts.map +1 -1
- package/dist/notion/reads.js +2 -1
- package/dist/notion/reads.js.map +1 -1
- package/dist/notion/rows.d.ts +14 -0
- package/dist/notion/rows.d.ts.map +1 -0
- package/dist/notion/rows.js +119 -0
- package/dist/notion/rows.js.map +1 -0
- package/dist/notion/writes.d.ts +99 -0
- package/dist/notion/writes.d.ts.map +1 -1
- package/dist/notion/writes.js +278 -67
- package/dist/notion/writes.js.map +1 -1
- package/dist/program.d.ts.map +1 -1
- package/dist/program.js +7 -1
- package/dist/program.js.map +1 -1
- package/dist/sync/comments.d.ts +12 -0
- package/dist/sync/comments.d.ts.map +1 -0
- package/dist/sync/comments.js +47 -0
- package/dist/sync/comments.js.map +1 -0
- package/dist/sync/files.d.ts +7 -1
- package/dist/sync/files.d.ts.map +1 -1
- package/dist/sync/files.js.map +1 -1
- package/dist/sync/from-config.d.ts.map +1 -1
- package/dist/sync/from-config.js +5 -4
- package/dist/sync/from-config.js.map +1 -1
- package/dist/sync/source.d.ts.map +1 -1
- package/dist/sync/source.js +21 -9
- package/dist/sync/source.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/skills/notion-cli/SKILL.md +29 -3
- package/dist/bundle/agent-AILW4JPO.js +0 -42
- package/dist/bundle/command-contract-C2CF4QAH.js +0 -41
- package/dist/bundle/first-screen-DEDD64YH.js +0 -41
- package/dist/bundle/meeting-combined-HEC25QPY.js +0 -25
- package/dist/bundle/meeting-model-R7QPDNZZ.js +0 -27
- package/dist/bundle/notes-search-7PE3E3C7.js +0 -64
- package/dist/bundle/server-CQJ4LKAZ.js +0 -90
- package/dist/bundle/store-maintenance-command-GRFTJBSB.js +0 -77
- package/dist/bundle/surface-FPWES3NY.js +0 -76
- package/dist/bundle/{hast-util-from-html-X2DCPS3T.js → hast-util-from-html-237ZT4C7.js} +3 -3
- package/dist/bundle/{hast-util-to-mdast-3CSMIWK2.js → hast-util-to-mdast-H5COQ6HJ.js} +6 -6
- package/dist/bundle/{mdast-util-gfm-JO7PHUIB.js → mdast-util-gfm-M3K5BNY2.js} +16 -16
- package/dist/bundle/{mdast-util-to-hast-AYJV7KAE.js → mdast-util-to-hast-TSB5MAAV.js} +1 -1
- package/dist/bundle/{mdast-util-to-markdown-DOXGHRI7.js → mdast-util-to-markdown-SG6455IT.js} +10 -10
- package/dist/bundle/{micromark-extension-gfm-PQ7DWZM7.js → micromark-extension-gfm-7SUOOQ3A.js} +3 -3
package/dist/notion/reads.d.ts
CHANGED
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
* - A list answer cut at Notion's 10,000-result cap carries `request_status.type: "incomplete"`; search too.
|
|
13
13
|
*
|
|
14
14
|
* Endpoint pages: https://developers.notion.com/reference/post-search, /query-a-data-source, /retrieve-a-page,
|
|
15
|
-
* /retrieve-a-database, /retrieve-a-block, /get-block-children, /retrieve-page-markdown, /get-self, /get-user
|
|
15
|
+
* /retrieve-a-database, /retrieve-a-block, /get-block-children, /retrieve-page-markdown, /get-self, /get-user,
|
|
16
|
+
* /list-comments.
|
|
16
17
|
*/
|
|
17
18
|
export interface NotionUser {
|
|
18
19
|
object: "user";
|
|
@@ -300,6 +301,21 @@ export interface NotionPageMarkdown {
|
|
|
300
301
|
/** Truncated and unshared blocks alike; a re-fetch of an unshared one is a 404. */
|
|
301
302
|
unknown_block_ids: string[];
|
|
302
303
|
}
|
|
304
|
+
/**
|
|
305
|
+
* An unresolved comment ([comment object](https://developers.notion.com/reference/comment-object)); Notion lists no
|
|
306
|
+
* resolved one ([list comments](https://developers.notion.com/reference/list-comments)).
|
|
307
|
+
*/
|
|
308
|
+
export interface NotionComment {
|
|
309
|
+
object: "comment";
|
|
310
|
+
id: string;
|
|
311
|
+
discussion_id: string;
|
|
312
|
+
created_time: string;
|
|
313
|
+
created_by: NotionUser;
|
|
314
|
+
rich_text: NotionRichText[];
|
|
315
|
+
display_name?: {
|
|
316
|
+
resolved_name?: string | null;
|
|
317
|
+
};
|
|
318
|
+
}
|
|
303
319
|
/** The token's bot user; a personal access token has one too, owned by the person who made it. */
|
|
304
320
|
export interface NotionSelf {
|
|
305
321
|
object: "user";
|
|
@@ -333,6 +349,8 @@ export interface NotionReads {
|
|
|
333
349
|
blockChildren(id: string, startCursor?: string): Promise<NotionList<NotionBlock>>;
|
|
334
350
|
/** `GET /v1/pages/{id}/markdown?markdown_version=v2`; a block id fetches that block's subtree. */
|
|
335
351
|
pageMarkdown(id: string): Promise<NotionPageMarkdown>;
|
|
352
|
+
/** `GET /v1/comments?block_id={id}`, one page of up to 100; 403 when the connection may not read comments. */
|
|
353
|
+
comments(id: string, startCursor?: string): Promise<NotionList<NotionComment>>;
|
|
336
354
|
/**
|
|
337
355
|
* Notion's clock: the `Date` header of its latest answer, in milliseconds, or undefined before any answer. Not a
|
|
338
356
|
* request. The sync compares Notion's timestamps with it, never with this computer's clock.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reads.d.ts","sourceRoot":"","sources":["../../src/notion/reads.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"reads.d.ts","sourceRoot":"","sources":["../../src/notion/reads.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAA;IACd,EAAE,EAAE,MAAM,CAAA;IACV,uCAAuC;IACvC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAiB,SAAQ,UAAU;IAClD,IAAI,CAAC,EAA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AC,EAAE,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAAA;IACjF,kGAAkG;IAClG,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAA;IACrD,8GAA8G;IAC9G,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,CAAA;IAC9E;;;OAGG;IACH,UAAU,CAAC,IAAI,MAAM,GAAG,SAAS,CAAA;CAClC"}
|
package/dist/notion/reads.js
CHANGED
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
* - A list answer cut at Notion's 10,000-result cap carries `request_status.type: "incomplete"`; search too.
|
|
13
13
|
*
|
|
14
14
|
* Endpoint pages: https://developers.notion.com/reference/post-search, /query-a-data-source, /retrieve-a-page,
|
|
15
|
-
* /retrieve-a-database, /retrieve-a-block, /get-block-children, /retrieve-page-markdown, /get-self, /get-user
|
|
15
|
+
* /retrieve-a-database, /retrieve-a-block, /get-block-children, /retrieve-page-markdown, /get-self, /get-user,
|
|
16
|
+
* /list-comments.
|
|
16
17
|
*/
|
|
17
18
|
export {};
|
|
18
19
|
//# sourceMappingURL=reads.js.map
|
package/dist/notion/reads.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reads.js","sourceRoot":"","sources":["../../src/notion/reads.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"reads.js","sourceRoot":"","sources":["../../src/notion/reads.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Client } from "@notionhq/client";
|
|
2
|
+
import type { People, Schema } from "./properties.js";
|
|
3
|
+
/** Option names of a select, multi-select or status property: what a filter like `status:Done` takes. */
|
|
4
|
+
export declare const optionsOf: (property: Record<string, unknown>) => string[] | undefined;
|
|
5
|
+
/** What a row write and a query read before they send: the data source, its schema and the people named. */
|
|
6
|
+
export declare const rowReads: (client: Client) => {
|
|
7
|
+
dataSourceOf: (id: string) => Promise<string>;
|
|
8
|
+
schemaOf: (dataSource: string) => Promise<Schema>;
|
|
9
|
+
peopleOf: ({ me, emails }: {
|
|
10
|
+
me: boolean;
|
|
11
|
+
emails: string[];
|
|
12
|
+
}) => Promise<People>;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=rows.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rows.d.ts","sourceRoot":"","sources":["../../src/notion/rows.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAI9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AA8CrD,yGAAyG;AACzG,eAAO,MAAM,SAAS,aAAc,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAG,MAAM,EAAE,GAAG,SAUxE,CAAA;AAKD,4GAA4G;AAC5G,eAAO,MAAM,QAAQ,WAAY,MAAM;uBAKL,MAAM,KAAG,OAAO,CAAC,MAAM,CAAC;2BAwBpB,MAAM,KAAG,OAAO,CAAC,MAAM,CAAC;+BAUpB;QAAE,EAAE,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,MAAM,EAAE,CAAA;KAAE,KAAG,OAAO,CAAC,MAAM,CAAC;CAsC5F,CAAA"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { CliError, isCliError } from "@wirecat/cli-base";
|
|
2
|
+
import * as v from "valibot";
|
|
3
|
+
import { mapped, NOTION } from "./errors.js";
|
|
4
|
+
// Each wire name is from Notion's reference, linked at its schema; the strict fake in src/testing/fake-notion.ts
|
|
5
|
+
// refuses any other. No wire type leaves this file (WC-ARCH-3).
|
|
6
|
+
const parsed = (schema, value) => {
|
|
7
|
+
const result = v.safeParse(schema, value);
|
|
8
|
+
if (result.success)
|
|
9
|
+
return result.output;
|
|
10
|
+
throw new CliError("invalid_response", `${NOTION}'s answer does not have the documented shape`, {
|
|
11
|
+
reason: "notion.invalid-response",
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
/** [Retrieve a database](https://developers.notion.com/reference/retrieve-database): its data sources. */
|
|
15
|
+
const wireSources = v.looseObject({
|
|
16
|
+
object: v.literal("database"),
|
|
17
|
+
data_sources: v.array(v.looseObject({ id: v.string() })),
|
|
18
|
+
});
|
|
19
|
+
/** [Data source](https://developers.notion.com/reference/data-source): its properties, each with its type's config. */
|
|
20
|
+
const wireSchema = v.looseObject({
|
|
21
|
+
object: v.literal("data_source"),
|
|
22
|
+
properties: v.record(v.string(), v.looseObject({ name: v.string(), type: v.string() })),
|
|
23
|
+
});
|
|
24
|
+
/** [Get self](https://developers.notion.com/reference/get-self): the bot and, for a token a person owns, that person. */
|
|
25
|
+
const wireSelf = v.looseObject({
|
|
26
|
+
object: v.literal("user"),
|
|
27
|
+
id: v.string(),
|
|
28
|
+
bot: v.optional(v.looseObject({
|
|
29
|
+
owner: v.optional(v.looseObject({ type: v.string(), user: v.optional(v.looseObject({ id: v.string() })) })),
|
|
30
|
+
})),
|
|
31
|
+
});
|
|
32
|
+
/** [List all users](https://developers.notion.com/reference/get-users); `person.email` needs the email capability. */
|
|
33
|
+
const wireUsers = v.looseObject({
|
|
34
|
+
object: v.literal("list"),
|
|
35
|
+
results: v.array(v.looseObject({ id: v.string(), person: v.optional(v.looseObject({ email: v.optional(v.string()) })) })),
|
|
36
|
+
has_more: v.boolean(),
|
|
37
|
+
next_cursor: v.nullish(v.string()),
|
|
38
|
+
});
|
|
39
|
+
/** Option names of a select, multi-select or status property: what a filter like `status:Done` takes. */
|
|
40
|
+
export const optionsOf = (property) => {
|
|
41
|
+
const config = property[String(property.type)];
|
|
42
|
+
if (!config || typeof config !== "object")
|
|
43
|
+
return undefined;
|
|
44
|
+
const options = config.options;
|
|
45
|
+
if (!Array.isArray(options))
|
|
46
|
+
return undefined;
|
|
47
|
+
return options.flatMap((option) => option && typeof option === "object" && typeof option.name === "string"
|
|
48
|
+
? [option.name]
|
|
49
|
+
: []);
|
|
50
|
+
};
|
|
51
|
+
/** The users listed to find people by email; a workspace past this many pages is refused, never half-searched. */
|
|
52
|
+
const USER_PAGES = 20;
|
|
53
|
+
/** What a row write and a query read before they send: the data source, its schema and the people named. */
|
|
54
|
+
export const rowReads = (client) => {
|
|
55
|
+
/**
|
|
56
|
+
* The data source a database id names, or the id itself when it is not a database: a data source id is given in
|
|
57
|
+
* place of its database when the database has several. One with several is refused with their ids, never picked.
|
|
58
|
+
*/
|
|
59
|
+
const dataSourceOf = async (id) => {
|
|
60
|
+
let found;
|
|
61
|
+
try {
|
|
62
|
+
found = parsed(wireSources, await mapped(() => client.databases.retrieve({ database_id: id })));
|
|
63
|
+
}
|
|
64
|
+
catch (error) {
|
|
65
|
+
if (isCliError(error) && (error.code === "not_found" || error.details.status === 400))
|
|
66
|
+
return id;
|
|
67
|
+
throw error;
|
|
68
|
+
}
|
|
69
|
+
const [only, ...more] = found.data_sources;
|
|
70
|
+
if (only && more.length === 0)
|
|
71
|
+
return only.id;
|
|
72
|
+
throw new CliError("validation_error", found.data_sources.length === 0
|
|
73
|
+
? "the database has no data source this token can see"
|
|
74
|
+
: `the database has ${found.data_sources.length} data sources: give one of their ids in place of the ` +
|
|
75
|
+
"database, as databases show lists them", {
|
|
76
|
+
reason: "notion.data-source-ambiguous",
|
|
77
|
+
sent: false,
|
|
78
|
+
data_source_ids: found.data_sources.map((source) => source.id),
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
const schemaOf = async (dataSource) => {
|
|
82
|
+
const source = parsed(wireSchema, await mapped(() => client.dataSources.retrieve({ data_source_id: dataSource })));
|
|
83
|
+
return Object.fromEntries(Object.values(source.properties).map((property) => {
|
|
84
|
+
const options = optionsOf(property);
|
|
85
|
+
return [property.name, { name: property.name, type: property.type, ...(options ? { options } : {}) }];
|
|
86
|
+
}));
|
|
87
|
+
};
|
|
88
|
+
const peopleOf = async ({ me, emails }) => {
|
|
89
|
+
const byEmail = new Map();
|
|
90
|
+
let owner;
|
|
91
|
+
if (me) {
|
|
92
|
+
const self = parsed(wireSelf, await mapped(() => client.users.me({})));
|
|
93
|
+
owner = self.bot?.owner?.type === "user" ? self.bot.owner.user?.id : undefined;
|
|
94
|
+
}
|
|
95
|
+
if (emails.length > 0) {
|
|
96
|
+
let cursor;
|
|
97
|
+
let pages = 0;
|
|
98
|
+
let any = false;
|
|
99
|
+
do {
|
|
100
|
+
const page = parsed(wireUsers, await mapped(() => client.users.list({ page_size: 100, ...(cursor ? { start_cursor: cursor } : {}) })));
|
|
101
|
+
for (const user of page.results) {
|
|
102
|
+
const email = user.person?.email?.toLowerCase();
|
|
103
|
+
if (email) {
|
|
104
|
+
any = true;
|
|
105
|
+
byEmail.set(email, user.id);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
cursor = page.has_more ? (page.next_cursor ?? undefined) : undefined;
|
|
109
|
+
pages++;
|
|
110
|
+
} while (cursor && pages < USER_PAGES && emails.some((email) => !byEmail.has(email)));
|
|
111
|
+
if (!any)
|
|
112
|
+
throw new CliError("permission_error", `${NOTION} gave no email addresses: turn on "Read user information including email addresses" in the ` +
|
|
113
|
+
"connection's capabilities, or give a user id", { reason: "notion.restricted", sent: false });
|
|
114
|
+
}
|
|
115
|
+
return { ...(owner ? { me: owner } : {}), byEmail };
|
|
116
|
+
};
|
|
117
|
+
return { dataSourceOf, schemaOf, peopleOf };
|
|
118
|
+
};
|
|
119
|
+
//# sourceMappingURL=rows.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rows.js","sourceRoot":"","sources":["../../src/notion/rows.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACxD,OAAO,K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CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAC;YACrF,IAAI,CAAC,GAAG;gBACN,MAAM,IAAI,QAAQ,CAChB,kBAAkB,EAClB,GAAG,MAAM,6FAA6F;oBACpG,8CAA8C,EAChD,EAAE,MAAM,EAAE,mBAAmB,EAAE,IAAI,EAAE,KAAK,EAAE,CAC7C,CAAA;QACL,CAAC;QACD,OAAO,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,CAAA;IACrD,CAAC,CAAA;IAED,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAA;AAC7C,CAAC,CAAA"}
|
package/dist/notion/writes.d.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import type { Client } from "@notionhq/client";
|
|
2
2
|
import * as v from "valibot";
|
|
3
|
+
/** One part of a targeted edit: `old` as the page has it now, `all` for every place it occurs. */
|
|
4
|
+
export interface TextEdit {
|
|
5
|
+
old: string;
|
|
6
|
+
new: string;
|
|
7
|
+
all?: boolean;
|
|
8
|
+
}
|
|
3
9
|
/** Up to 20 MB goes in one part; above, in parts of 5 to 20 MB, Notion's guide suggesting 10 ([larger files](https://developers.notion.com/guides/data-apis/sending-larger-files)). */
|
|
4
10
|
export declare const SINGLE_PART_BYTES: number;
|
|
5
11
|
export declare const PART_BYTES: number;
|
|
@@ -19,6 +25,28 @@ export declare const pageSchema: v.StrictObjectSchema<{
|
|
|
19
25
|
readonly last_edited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
20
26
|
}, undefined>;
|
|
21
27
|
export type WrittenPage = v.InferOutput<typeof pageSchema>;
|
|
28
|
+
/** Where a page goes: under a page, or into a database or one of its data sources ([move page](https://developers.notion.com/reference/move-page)). */
|
|
29
|
+
export type Destination = {
|
|
30
|
+
page: string;
|
|
31
|
+
} | {
|
|
32
|
+
into: string;
|
|
33
|
+
};
|
|
34
|
+
/** `none` takes the icon or cover away, a https link is an external image, and an emoji is an icon. */
|
|
35
|
+
export type Picture = "none" | {
|
|
36
|
+
url: string;
|
|
37
|
+
} | {
|
|
38
|
+
emoji: string;
|
|
39
|
+
};
|
|
40
|
+
/** A template by `default`, `none`, its id or its name, as `databases show` lists them. */
|
|
41
|
+
export type TemplateChoice = string | undefined;
|
|
42
|
+
/** A row's `--field Name=Value` pairs, in the order given. */
|
|
43
|
+
export type Fields = readonly (readonly [string, string])[];
|
|
44
|
+
export interface Patch {
|
|
45
|
+
fields?: Fields;
|
|
46
|
+
title?: string | undefined;
|
|
47
|
+
icon?: Picture;
|
|
48
|
+
cover?: Picture;
|
|
49
|
+
}
|
|
22
50
|
/** Every Notion write the commands make, each answer checked against its documented shape. */
|
|
23
51
|
export declare const liveWrites: (client: Client) => {
|
|
24
52
|
/** A new page under `parent`; with no title, Notion takes the Markdown's first `# heading`. */
|
|
@@ -37,6 +65,16 @@ export declare const liveWrites: (client: Client) => {
|
|
|
37
65
|
replace: (id: string, markdown: string, allowDeleting: boolean) => Promise<{
|
|
38
66
|
id: string;
|
|
39
67
|
warnings: string[];
|
|
68
|
+
markdown?: string | undefined;
|
|
69
|
+
}>;
|
|
70
|
+
/**
|
|
71
|
+
* Parts of the text replaced where they are, by `update_content`. Notion applies the parts that match and only
|
|
72
|
+
* warns about the rest (`no_match`), so the caller checks every part against the text first.
|
|
73
|
+
*/
|
|
74
|
+
edit: (id: string, edits: readonly TextEdit[], allowDeleting: boolean) => Promise<{
|
|
75
|
+
id: string;
|
|
76
|
+
warnings: string[];
|
|
77
|
+
markdown?: string | undefined;
|
|
40
78
|
}>;
|
|
41
79
|
/** A comment on a page, or a reply in a discussion; Notion takes inline Markdown only ([create a comment](https://developers.notion.com/reference/create-a-comment)). */
|
|
42
80
|
comment: (target: {
|
|
@@ -65,6 +103,67 @@ export declare const liveWrites: (client: Client) => {
|
|
|
65
103
|
type: string;
|
|
66
104
|
};
|
|
67
105
|
}>;
|
|
106
|
+
/**
|
|
107
|
+
* A row in a data source, its values typed by the data source's schema. A template is applied by Notion after the
|
|
108
|
+
* answer, so the row's text is not there yet when this returns ([create a page](https://developers.notion.com/reference/post-page)).
|
|
109
|
+
*/
|
|
110
|
+
createRow: ({ into, fields, title, template, markdown, }: {
|
|
111
|
+
into: string;
|
|
112
|
+
fields: Fields;
|
|
113
|
+
title?: string | undefined;
|
|
114
|
+
template?: TemplateChoice;
|
|
115
|
+
markdown?: string | undefined;
|
|
116
|
+
}) => Promise<{
|
|
117
|
+
page: {
|
|
118
|
+
id: string;
|
|
119
|
+
title: string;
|
|
120
|
+
url: string | null;
|
|
121
|
+
in_trash: boolean;
|
|
122
|
+
last_edited_time: string | null;
|
|
123
|
+
};
|
|
124
|
+
data_source_id: string;
|
|
125
|
+
template_pending: boolean;
|
|
126
|
+
}>;
|
|
127
|
+
/** A page under another page or into a database; Notion moves no database and nothing to the workspace's top. */
|
|
128
|
+
move: (id: string, destination: Destination) => Promise<{
|
|
129
|
+
id: string;
|
|
130
|
+
parent: {
|
|
131
|
+
type: string;
|
|
132
|
+
id: string | undefined;
|
|
133
|
+
};
|
|
134
|
+
}>;
|
|
135
|
+
/**
|
|
136
|
+
* A page's title, a row's values, its icon or its cover, in one update. The title property is found by its type,
|
|
137
|
+
* so a row's is renamed too. A row's values not named keep theirs, and a list given replaces the whole list.
|
|
138
|
+
*/
|
|
139
|
+
patch: (id: string, { fields, title, icon, cover }: Patch) => Promise<{
|
|
140
|
+
id: string;
|
|
141
|
+
title: string;
|
|
142
|
+
url: string | null;
|
|
143
|
+
in_trash: boolean;
|
|
144
|
+
last_edited_time: string | null;
|
|
145
|
+
}>;
|
|
146
|
+
/**
|
|
147
|
+
* A comment this connection posted, changed or deleted. Notion answers 404 for anyone else's
|
|
148
|
+
* ([update a comment](https://developers.notion.com/reference/update-a-comment)), so the comment is read first: the
|
|
149
|
+
* refusal then says why, and the answer keeps the text it had.
|
|
150
|
+
*/
|
|
151
|
+
editComment: (id: string, markdown: string) => Promise<{
|
|
152
|
+
comment: {
|
|
153
|
+
id: string;
|
|
154
|
+
discussion_id: string | null;
|
|
155
|
+
last_edited_time: string | null;
|
|
156
|
+
};
|
|
157
|
+
previous_text: string;
|
|
158
|
+
}>;
|
|
159
|
+
/** Notion keeps no deleted comment: the answer carries its text, the only copy left. */
|
|
160
|
+
deleteComment: (id: string) => Promise<{
|
|
161
|
+
comment: {
|
|
162
|
+
id: string;
|
|
163
|
+
discussion_id: string | null;
|
|
164
|
+
};
|
|
165
|
+
previous_text: string;
|
|
166
|
+
}>;
|
|
68
167
|
/** Notion has no permanent delete in its API: a page goes to the trash and comes back from it ([trash a page](https://developers.notion.com/reference/trash-page)). */
|
|
69
168
|
trash: (id: string, inTrash: boolean) => Promise<{
|
|
70
169
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writes.d.ts","sourceRoot":"","sources":["../../src/notion/writes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAE9C,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"writes.d.ts","sourceRoot":"","sources":["../../src/notion/writes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAE9C,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AA8B5B,kGAAkG;AAClG,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,CAAC,EAAE,OAAO,CAAA;CACd;AA6CD,uLAAuL;AACvL,eAAO,MAAM,iBAAiB,QAAmB,CAAA;AACjD,eAAO,MAAM,UAAU,QAAmB,CAAA;AAS1C,MAAM,WAAW,MAAM;IACrB,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,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