@wirecat/notion-cli 0.1.0 → 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/CHANGELOG.md +69 -0
- package/README.md +14 -4
- package/contracts/wirecat.json +698 -1
- package/dist/bin/notion.js +2 -2
- package/dist/bundle/{all-profiles-OETMCOLN.js → all-profiles-4IONYZB6.js} +10 -10
- package/dist/bundle/{anthropic-5Y3O2TYM.js → anthropic-OXF74J4P.js} +6 -6
- package/dist/bundle/{app-server-IVWBIVHC.js → app-server-M2VF6ABM.js} +61 -52
- package/dist/bundle/{bun-EO636SAD.js → bun-DLA6QRLL.js} +2 -2
- package/dist/bundle/{bun-sqlite-C2T7QJ2M.js → bun-sqlite-F4BYLW3F.js} +7 -7
- package/dist/bundle/{chunk-QBC23NHD.js → chunk-2MHMKNWD.js} +1 -1
- package/dist/bundle/{chunk-TSCIIXN3.js → chunk-4KUJTSHG.js} +2 -2
- package/dist/bundle/{chunk-24FAYAML.js → chunk-4TQVZXOV.js} +3 -3
- package/dist/bundle/{chunk-FF4DDBCB.js → chunk-5LBJNTEJ.js} +6 -6
- package/dist/bundle/chunk-5UA2TYMI.js +29 -0
- package/dist/bundle/{chunk-DIM5YWBU.js → chunk-5XP4KQ2F.js} +1 -1
- package/dist/bundle/{chunk-WM7663C2.js → chunk-6GN7KU7X.js} +9 -9
- package/dist/bundle/chunk-6JBLIQQN.js +16 -0
- package/dist/bundle/{chunk-CLG2ISQH.js → chunk-7NF3V5L2.js} +4 -4
- package/dist/bundle/{chunk-TR7R5DL4.js → chunk-7NGFGFE5.js} +12 -63
- package/dist/bundle/{chunk-YA4LSSDZ.js → chunk-7NVPM55S.js} +2913 -2371
- package/dist/bundle/{chunk-XC5CKHX2.js → chunk-7YZPBAQX.js} +1 -1
- package/dist/bundle/{chunk-RSIS7BR7.js → chunk-AYU5TFDU.js} +21 -21
- package/dist/bundle/{chunk-64D5VUZ4.js → chunk-BEPFGITI.js} +68 -64
- package/dist/bundle/{chunk-HRTIRRXR.js → chunk-CBGBFAYJ.js} +41 -6
- package/dist/bundle/{chunk-QC3KOJT4.js → chunk-CDGZZNGY.js} +6 -6
- package/dist/bundle/{chunk-JK44XO2S.js → chunk-CIVXTBJY.js} +56 -56
- package/dist/bundle/{chunk-OWJDC4CB.js → chunk-COH7OEER.js} +14 -13
- package/dist/bundle/{chunk-XL2HXHP3.js → chunk-D6RCRBDH.js} +2 -2
- package/dist/bundle/{chunk-47R43UVJ.js → chunk-EQPAZ33O.js} +19 -19
- package/dist/bundle/{chunk-AE2KQ37N.js → chunk-EY6S7FV3.js} +6 -6
- package/dist/bundle/chunk-FEMHUSGO.js +88 -0
- package/dist/bundle/{chunk-NLDYZBTC.js → chunk-FSJHASRQ.js} +1146 -2555
- package/dist/bundle/chunk-GBFEEHQC.js +385 -0
- package/dist/bundle/{chunk-IQWEJEB5.js → chunk-GCCPFKSU.js} +26264 -21086
- package/dist/bundle/{chunk-RDZ7SVBZ.js → chunk-GK4GLPG2.js} +3 -3
- package/dist/bundle/{chunk-B2XKEEFX.js → chunk-GSNE7OB4.js} +4 -4
- package/dist/bundle/{chunk-UWW24JQF.js → chunk-HTKSCSJU.js} +4 -4
- package/dist/bundle/{chunk-7FII4DCE.js → chunk-IJMFG7HB.js} +7 -7
- package/dist/bundle/{chunk-WVZFXI36.js → chunk-JIRRF6BM.js} +4 -4
- package/dist/bundle/{chunk-ST2UC7FS.js → chunk-JODE2XED.js} +31 -27
- package/dist/bundle/{chunk-CWVAYQXI.js → chunk-K5I64ZVI.js} +9 -9
- package/dist/bundle/chunk-KFVDL2QS.js +146 -0
- package/dist/bundle/{chunk-JKIN5TOU.js → chunk-KL3P5TQK.js} +4 -4
- package/dist/bundle/chunk-L62XTC7N.js +726 -0
- package/dist/bundle/chunk-L6H7PY4X.js +170 -0
- package/dist/bundle/{chunk-F6MLJ3V5.js → chunk-LIQMUDIZ.js} +2 -2
- package/dist/bundle/{chunk-HWRKURQH.js → chunk-M2EEIYBU.js} +2 -2
- package/dist/bundle/chunk-M6DGZ2O6.js +823 -0
- package/dist/bundle/chunk-MGUEZYFA.js +5546 -0
- package/dist/bundle/{chunk-UWIA2G6Q.js → chunk-MRA62W5K.js} +404 -537
- package/dist/bundle/{chunk-XYIT2XB3.js → chunk-MVA5HVKL.js} +20 -0
- package/dist/bundle/{chunk-GA3URWIF.js → chunk-NO2LIHWA.js} +1 -1
- package/dist/bundle/{chunk-ESZT4WW3.js → chunk-OCDJ4FFA.js} +4 -4
- package/dist/bundle/{chunk-B4B65XIO.js → chunk-OI5DWZJG.js} +3 -3
- package/dist/bundle/chunk-P3P6DA6K.js +259 -0
- package/dist/bundle/chunk-QX3TPFEX.js +1977 -0
- package/dist/bundle/{chunk-EU5WCOMQ.js → chunk-R6SDRSZK.js} +76 -35
- package/dist/bundle/{chunk-K5TWMQSY.js → chunk-RMJMID5D.js} +8 -8
- package/dist/bundle/{chunk-RLSFOR2D.js → chunk-SGBS5QCU.js} +4 -4
- package/dist/bundle/{chunk-3D3PFXBP.js → chunk-T5UNSFES.js} +10 -15
- package/dist/bundle/{chunk-RAZKIHGH.js → chunk-TFNRCCGR.js} +4 -4
- package/dist/bundle/{chunk-WK3OSDNV.js → chunk-TJCPTRYD.js} +7 -7
- package/dist/bundle/{chunk-BWICUW7W.js → chunk-TXONV3HW.js} +2 -2
- package/dist/bundle/{chunk-AQZO3ITW.js → chunk-TZ2QJ53V.js} +2 -2
- package/dist/bundle/{chunk-35K5T6WV.js → chunk-UKE3CGHK.js} +1 -1
- package/dist/bundle/{chunk-7N5QB6NL.js → chunk-UROEWCOG.js} +5 -3
- package/dist/bundle/chunk-WHJWURZB.js +335 -0
- package/dist/bundle/{chunk-R6ZM45NF.js → chunk-WU3XHGOB.js} +185 -57
- package/dist/bundle/{chunk-2YR3RYT4.js → chunk-WZEEEQGC.js} +3 -3
- package/dist/bundle/{chunk-B2WFKFYL.js → chunk-XCTOCVMW.js} +20 -116
- package/dist/bundle/chunk-XFLCVHSQ.js +50 -0
- package/dist/bundle/{chunk-EGTBL3MJ.js → chunk-Y5LAJWR5.js} +1 -1
- package/dist/bundle/{chunk-66PL7P4C.js → chunk-YAPDU3SV.js} +1 -1
- package/dist/bundle/{chunk-WWMB4UHF.js → chunk-YFWLHTNO.js} +1 -1
- package/dist/bundle/{chunk-KHOVVPLC.js → chunk-YGCI3DHS.js} +1 -1
- package/dist/bundle/{chunk-4GC5DBHW.js → chunk-Z53LYX4M.js} +3 -3
- package/dist/bundle/{chunk-EPAZ7DJB.js → chunk-ZC6ZQQ55.js} +48 -45
- package/dist/bundle/command-contract-UBXS6NHI.js +38 -0
- package/dist/bundle/{command-server-entry-A66DJ3MH.js → command-server-entry-2SORMVRM.js} +27 -24
- package/dist/bundle/decode-5O7IEFPN.js +297 -0
- package/dist/bundle/{dispatch-FEKU5UXC.js → dispatch-YHQX6FEJ.js} +8 -8
- package/dist/bundle/{dist-YFKABFFF.js → dist-ILNOLGYN.js} +1 -1
- package/dist/bundle/{echarts-XD2JSWU4.js → echarts-ARLMVQC7.js} +2 -2
- package/dist/bundle/{embed-F3HYGAF7.js → embed-FUDUKQ3K.js} +7 -7
- package/dist/bundle/{embedder-GSEDDUH7.js → embedder-HDRV7GX3.js} +10 -10
- package/dist/bundle/{failure-HDJLR2YJ.js → failure-JHXICWIL.js} +3 -3
- package/dist/bundle/first-run-BGEFTXOE.js +29 -0
- package/dist/bundle/first-screen-F5F3VS6Y.js +38 -0
- package/dist/bundle/{instructions-NZGJ4FW5.js → instructions-MEFIKCDI.js} +1 -1
- package/dist/bundle/{mcp-VFIOZDVY.js → mcp-VMS6PBCU.js} +2 -2
- package/dist/bundle/mdast-util-from-markdown-R66F4HZA.js +1958 -0
- package/dist/bundle/mdast-util-gfm-LN2ELINH.js +2699 -0
- package/dist/bundle/meeting-combined-HNSS3FQY.js +24 -0
- package/dist/bundle/meeting-model-REZVYGQW.js +26 -0
- package/dist/bundle/meeting-semantic-R4CSLVRG.js +22 -0
- package/dist/bundle/micromark-extension-gfm-5X7YT43T.js +1838 -0
- package/dist/bundle/{node-RPKPDYQS.js → node-MAQALPLA.js} +2 -2
- package/dist/bundle/{node-sqlite-KH2UUYVO.js → node-sqlite-J7IJYNBO.js} +8 -8
- package/dist/bundle/notion.js +14 -14
- package/dist/bundle/{oauth-NKAI7TQD.js → oauth-AMV4YGJD.js} +8 -8
- package/dist/bundle/{open-WSAEAA2V.js → open-AB27MTGR.js} +6 -6
- package/dist/bundle/{openai-JPVDGHG5.js → openai-D77MU5XV.js} +31 -29
- package/dist/bundle/{process-5ZFVKOQX.js → process-SIOWTRJ6.js} +1 -1
- package/dist/bundle/{program-M3D56D6T.js → program-QC5MX4ZJ.js} +7533 -1997
- package/dist/bundle/{prompt-FROYQ5LV.js → prompt-W77YDHA6.js} +6 -6
- package/dist/bundle/{recognize-NYCHQMCX.js → recognize-3JAXQQ36.js} +5 -5
- package/dist/bundle/{remote-4OERF3Z4.js → remote-PSOJXCXO.js} +11 -11
- package/dist/bundle/{rerank-TEGXFUWY.js → rerank-EE44ZTGL.js} +8 -8
- package/dist/bundle/{schemas-MZNNOEYN.js → schemas-LBYUMBC6.js} +2 -2
- package/dist/bundle/{serve-HLYYBAXY.js → serve-XJMGAMFW.js} +10 -10
- package/dist/bundle/{server-D5OYNEUW.js → server-ASU6CP5R.js} +53 -44
- package/dist/bundle/server-WSPQ5EOA.js +72 -0
- package/dist/bundle/services-PT4PA4J6.js +588 -0
- package/dist/bundle/{sqlite-runtime-H2S5RR2F.js → sqlite-runtime-YHXRTVXE.js} +7 -7
- package/dist/bundle/{state-OPOXCDZL.js → state-T6ZKFWGD.js} +7 -7
- package/dist/bundle/{store-NHMXEJPD.js → store-3MUCZEI3.js} +20 -14
- package/dist/bundle/{store-Y3KRLCJ7.js → store-E5EE25FY.js} +30 -21
- package/dist/bundle/store-maintenance-command-ZZ55BBBG.js +63 -0
- package/dist/commands/api.d.ts.map +1 -1
- package/dist/commands/api.js +13 -4
- package/dist/commands/api.js.map +1 -1
- package/dist/commands/documents.d.ts +10 -1
- package/dist/commands/documents.d.ts.map +1 -1
- package/dist/commands/documents.js +175 -5
- package/dist/commands/documents.js.map +1 -1
- package/dist/commands/library.d.ts +10 -0
- package/dist/commands/library.d.ts.map +1 -0
- package/dist/commands/library.js +470 -0
- package/dist/commands/library.js.map +1 -0
- package/dist/commands/session.d.ts.map +1 -1
- package/dist/commands/session.js +4 -3
- package/dist/commands/session.js.map +1 -1
- package/dist/config.d.ts +19 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +73 -5
- package/dist/config.js.map +1 -1
- package/dist/context.d.ts +8 -0
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +15 -3
- package/dist/context.js.map +1 -1
- package/dist/generated/types.d.ts +485 -375
- package/dist/generated/types.d.ts.map +1 -1
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +1 -0
- package/dist/identity.js.map +1 -1
- package/dist/knowledge.d.ts +27 -0
- package/dist/knowledge.d.ts.map +1 -0
- package/dist/knowledge.js +87 -0
- package/dist/knowledge.js.map +1 -0
- package/dist/library.d.ts +44 -0
- package/dist/library.d.ts.map +1 -0
- package/dist/library.js +149 -0
- package/dist/library.js.map +1 -0
- package/dist/notion/client.d.ts +4 -1
- package/dist/notion/client.d.ts.map +1 -1
- package/dist/notion/client.js +5 -2
- package/dist/notion/client.js.map +1 -1
- package/dist/notion/errors.d.ts +5 -0
- package/dist/notion/errors.d.ts.map +1 -1
- package/dist/notion/errors.js +33 -1
- package/dist/notion/errors.js.map +1 -1
- package/dist/notion/reads.d.ts +4 -0
- package/dist/notion/reads.d.ts.map +1 -1
- package/dist/notion/writes.d.ts +40 -0
- package/dist/notion/writes.d.ts.map +1 -0
- package/dist/notion/writes.js +112 -0
- package/dist/notion/writes.js.map +1 -0
- package/dist/program.js +2 -2
- package/dist/program.js.map +1 -1
- package/dist/sync/cursor.d.ts +93 -0
- package/dist/sync/cursor.d.ts.map +1 -1
- package/dist/sync/cursor.js +63 -2
- package/dist/sync/cursor.js.map +1 -1
- package/dist/sync/files.d.ts +87 -0
- package/dist/sync/files.d.ts.map +1 -0
- package/dist/sync/files.js +31 -0
- package/dist/sync/files.js.map +1 -0
- package/dist/sync/markdown.d.ts +4 -1
- package/dist/sync/markdown.d.ts.map +1 -1
- package/dist/sync/markdown.js +8 -6
- package/dist/sync/markdown.js.map +1 -1
- package/dist/sync/source.d.ts +6 -59
- package/dist/sync/source.d.ts.map +1 -1
- package/dist/sync/source.js +650 -271
- 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 +18 -1
- package/dist/bundle/command-contract-6G5DC2FN.js +0 -35
- package/dist/bundle/decode-7XOFRAAT.js +0 -163
- package/dist/bundle/first-run-TXNTIUSP.js +0 -28
- package/dist/bundle/first-screen-JZPJND7J.js +0 -33
- package/dist/bundle/server-LWZGVMNW.js +0 -62
- package/dist/bundle/store-maintenance-command-D4W7WSLQ.js +0 -53
- package/dist/commands/comments.d.ts +0 -3
- package/dist/commands/comments.d.ts.map +0 -1
- package/dist/commands/comments.js +0 -114
- package/dist/commands/comments.js.map +0 -1
- package/dist/sample/comments.d.ts +0 -61
- package/dist/sample/comments.d.ts.map +0 -1
- package/dist/sample/comments.js +0 -39
- package/dist/sample/comments.js.map +0 -1
- package/dist/sample/records.d.ts +0 -16
- package/dist/sample/records.d.ts.map +0 -1
- package/dist/sample/records.js +0 -22
- package/dist/sample/records.js.map +0 -1
- package/dist/sample/transport.d.ts +0 -42
- package/dist/sample/transport.d.ts.map +0 -1
- package/dist/sample/transport.js +0 -153
- package/dist/sample/transport.js.map +0 -1
- /package/dist/bundle/{chunk-ZI3YTXSF.js → chunk-SHTHNBHG.js} +0 -0
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
snapshotProjectAnnotations,
|
|
9
9
|
storeDamageReport,
|
|
10
10
|
storeHealth
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-EQPAZ33O.js";
|
|
12
12
|
import {
|
|
13
13
|
note
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-HTKSCSJU.js";
|
|
15
15
|
import {
|
|
16
16
|
ADDED_KINDS,
|
|
17
17
|
ALWAYS_SHOWN,
|
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
CALLBACK_PREFIX,
|
|
20
20
|
CATALOG_QUERY,
|
|
21
21
|
COMPANY_TYPE_MEANINGS,
|
|
22
|
+
CRM_CHANGES,
|
|
22
23
|
CRM_LINK_MODES,
|
|
23
24
|
DECISION_ACTIONS,
|
|
24
25
|
DECISION_TTL_MS,
|
|
@@ -32,6 +33,7 @@ import {
|
|
|
32
33
|
IDENTITY_LINK_SIGNALS,
|
|
33
34
|
IDENTITY_SPLIT_KIND,
|
|
34
35
|
IMPORTED_DOCUMENT_QUERY,
|
|
36
|
+
LINK_WEAKNESSES,
|
|
35
37
|
MAIL_FINDINGS_KIND,
|
|
36
38
|
MEETING_ROW_KINDS,
|
|
37
39
|
MENTION_QUERY,
|
|
@@ -95,17 +97,17 @@ import {
|
|
|
95
97
|
validateEvidenceFindings,
|
|
96
98
|
waitingPointer,
|
|
97
99
|
withoutField
|
|
98
|
-
} from "./chunk-
|
|
100
|
+
} from "./chunk-7NVPM55S.js";
|
|
101
|
+
import "./chunk-T5UNSFES.js";
|
|
102
|
+
import "./chunk-M6DGZ2O6.js";
|
|
103
|
+
import "./chunk-6JBLIQQN.js";
|
|
99
104
|
import {
|
|
100
105
|
BUSINESS_KINDS,
|
|
101
106
|
CLOSED_STATES,
|
|
102
107
|
FACT_STATUSES,
|
|
103
|
-
FACT_TYPES,
|
|
104
108
|
MEMORY_KINDS,
|
|
105
109
|
MEMORY_SCOPES,
|
|
106
110
|
MEMORY_STATUSES,
|
|
107
|
-
PAYMENT_DIRECTIONS,
|
|
108
|
-
PAYMENT_STATES,
|
|
109
111
|
PRIORITY_LABELS,
|
|
110
112
|
SOURCE_REVIEW_CAUSES,
|
|
111
113
|
SOURCE_REVIEW_KIND,
|
|
@@ -119,7 +121,6 @@ import {
|
|
|
119
121
|
journalMarkPath,
|
|
120
122
|
markStoreDamaged,
|
|
121
123
|
organization,
|
|
122
|
-
paymentTitle,
|
|
123
124
|
priorityLabel,
|
|
124
125
|
priorityOf,
|
|
125
126
|
priorityOption,
|
|
@@ -128,28 +129,34 @@ import {
|
|
|
128
129
|
readHealthMark,
|
|
129
130
|
readJournalMark,
|
|
130
131
|
recordDeepCheck,
|
|
131
|
-
reminder
|
|
132
|
+
reminder
|
|
133
|
+
} from "./chunk-QX3TPFEX.js";
|
|
134
|
+
import "./chunk-UROEWCOG.js";
|
|
135
|
+
import "./chunk-5UA2TYMI.js";
|
|
136
|
+
import {
|
|
137
|
+
FACT_TYPES,
|
|
138
|
+
PAYMENT_DIRECTIONS,
|
|
139
|
+
PAYMENT_STATES,
|
|
140
|
+
paymentTitle,
|
|
132
141
|
validatePayment
|
|
133
|
-
} from "./chunk-
|
|
134
|
-
import "./chunk-
|
|
135
|
-
import "./chunk-
|
|
136
|
-
import "./chunk-WK3OSDNV.js";
|
|
137
|
-
import "./chunk-ZI3YTXSF.js";
|
|
142
|
+
} from "./chunk-FSJHASRQ.js";
|
|
143
|
+
import "./chunk-TJCPTRYD.js";
|
|
144
|
+
import "./chunk-SHTHNBHG.js";
|
|
138
145
|
import {
|
|
139
146
|
storePath
|
|
140
|
-
} from "./chunk-
|
|
147
|
+
} from "./chunk-M2EEIYBU.js";
|
|
141
148
|
import {
|
|
142
149
|
openCache
|
|
143
|
-
} from "./chunk-
|
|
150
|
+
} from "./chunk-EY6S7FV3.js";
|
|
144
151
|
import {
|
|
145
152
|
PRAGMAS
|
|
146
|
-
} from "./chunk-
|
|
147
|
-
import "./chunk-
|
|
148
|
-
import "./chunk-
|
|
149
|
-
import "./chunk-
|
|
153
|
+
} from "./chunk-2MHMKNWD.js";
|
|
154
|
+
import "./chunk-AYU5TFDU.js";
|
|
155
|
+
import "./chunk-6GN7KU7X.js";
|
|
156
|
+
import "./chunk-MVA5HVKL.js";
|
|
150
157
|
import "./chunk-Y5E2WNWB.js";
|
|
151
|
-
import "./chunk-
|
|
152
|
-
import "./chunk-
|
|
158
|
+
import "./chunk-LIQMUDIZ.js";
|
|
159
|
+
import "./chunk-Y5LAJWR5.js";
|
|
153
160
|
import "./chunk-ZVVMGPBJ.js";
|
|
154
161
|
export {
|
|
155
162
|
ADDED_KINDS,
|
|
@@ -160,6 +167,7 @@ export {
|
|
|
160
167
|
CATALOG_QUERY,
|
|
161
168
|
CLOSED_STATES,
|
|
162
169
|
COMPANY_TYPE_MEANINGS,
|
|
170
|
+
CRM_CHANGES,
|
|
163
171
|
CRM_LINK_MODES,
|
|
164
172
|
DECISION_ACTIONS,
|
|
165
173
|
DECISION_TTL_MS,
|
|
@@ -175,6 +183,7 @@ export {
|
|
|
175
183
|
IDENTITY_LINK_SIGNALS,
|
|
176
184
|
IDENTITY_SPLIT_KIND,
|
|
177
185
|
IMPORTED_DOCUMENT_QUERY,
|
|
186
|
+
LINK_WEAKNESSES,
|
|
178
187
|
MAIL_FINDINGS_KIND,
|
|
179
188
|
MEETING_ROW_KINDS,
|
|
180
189
|
MEMORY_KINDS,
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
addStoreMaintenanceCommands,
|
|
5
|
+
buildStems,
|
|
6
|
+
storeMaintenanceCommands,
|
|
7
|
+
storeSummary
|
|
8
|
+
} from "./chunk-BEPFGITI.js";
|
|
9
|
+
import "./chunk-XCTOCVMW.js";
|
|
10
|
+
import "./chunk-L62XTC7N.js";
|
|
11
|
+
import "./chunk-Z53LYX4M.js";
|
|
12
|
+
import "./chunk-D6RCRBDH.js";
|
|
13
|
+
import "./chunk-EH6ZEJGT.js";
|
|
14
|
+
import "./chunk-GCCPFKSU.js";
|
|
15
|
+
import "./chunk-CIVXTBJY.js";
|
|
16
|
+
import "./chunk-FEMHUSGO.js";
|
|
17
|
+
import "./chunk-OCDJ4FFA.js";
|
|
18
|
+
import "./chunk-NO2LIHWA.js";
|
|
19
|
+
import "./chunk-TFNRCCGR.js";
|
|
20
|
+
import "./chunk-P3P6DA6K.js";
|
|
21
|
+
import "./chunk-GBFEEHQC.js";
|
|
22
|
+
import "./chunk-L6H7PY4X.js";
|
|
23
|
+
import "./chunk-OI5DWZJG.js";
|
|
24
|
+
import "./chunk-MRA62W5K.js";
|
|
25
|
+
import "./chunk-IJMFG7HB.js";
|
|
26
|
+
import "./chunk-4TQVZXOV.js";
|
|
27
|
+
import "./chunk-WHJWURZB.js";
|
|
28
|
+
import "./chunk-7YZPBAQX.js";
|
|
29
|
+
import "./chunk-EQPAZ33O.js";
|
|
30
|
+
import "./chunk-HTKSCSJU.js";
|
|
31
|
+
import "./chunk-7NVPM55S.js";
|
|
32
|
+
import "./chunk-T5UNSFES.js";
|
|
33
|
+
import "./chunk-M6DGZ2O6.js";
|
|
34
|
+
import "./chunk-6JBLIQQN.js";
|
|
35
|
+
import "./chunk-QX3TPFEX.js";
|
|
36
|
+
import "./chunk-UROEWCOG.js";
|
|
37
|
+
import "./chunk-5UA2TYMI.js";
|
|
38
|
+
import "./chunk-FSJHASRQ.js";
|
|
39
|
+
import "./chunk-K5I64ZVI.js";
|
|
40
|
+
import "./chunk-WZEEEQGC.js";
|
|
41
|
+
import "./chunk-TJCPTRYD.js";
|
|
42
|
+
import "./chunk-5LBJNTEJ.js";
|
|
43
|
+
import "./chunk-JIRRF6BM.js";
|
|
44
|
+
import "./chunk-YAPDU3SV.js";
|
|
45
|
+
import "./chunk-SHTHNBHG.js";
|
|
46
|
+
import "./chunk-CDGZZNGY.js";
|
|
47
|
+
import "./chunk-D72URWJE.js";
|
|
48
|
+
import "./chunk-M2EEIYBU.js";
|
|
49
|
+
import "./chunk-EY6S7FV3.js";
|
|
50
|
+
import "./chunk-2MHMKNWD.js";
|
|
51
|
+
import "./chunk-AYU5TFDU.js";
|
|
52
|
+
import "./chunk-6GN7KU7X.js";
|
|
53
|
+
import "./chunk-MVA5HVKL.js";
|
|
54
|
+
import "./chunk-Y5E2WNWB.js";
|
|
55
|
+
import "./chunk-LIQMUDIZ.js";
|
|
56
|
+
import "./chunk-Y5LAJWR5.js";
|
|
57
|
+
import "./chunk-ZVVMGPBJ.js";
|
|
58
|
+
export {
|
|
59
|
+
addStoreMaintenanceCommands,
|
|
60
|
+
buildStems,
|
|
61
|
+
storeMaintenanceCommands,
|
|
62
|
+
storeSummary
|
|
63
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/commands/api.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/commands/api.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAUnC,eAAO,MAAM,UAAU,2BAAwB,CAAA;AA8J/C,eAAO,MAAM,UAAU,QAAO,OAc7B,CAAA"}
|
package/dist/commands/api.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { APIResponseError } from "@notionhq/client";
|
|
2
2
|
import { CliError } from "@wirecat/cli-base";
|
|
3
3
|
import { annotate } from "@wirecat/cli-base/commands";
|
|
4
|
-
import { checkApiBody, checkApiParameter, generatedApiCommand, httpApiExecutor, itemOf, listOf, NO_EFFECTS, outputFor, queryTerms, renderAnswer, termField, terminalAsker, withQuery, } from "@wirecat/cli-core/cli";
|
|
4
|
+
import { checkApiBody, checkApiParameter, generatedApiCommand, httpApiExecutor, httpApiRequest, itemOf, listOf, NO_EFFECTS, outputFor, parseApiJson, queryTerms, renderAnswer, termField, terminalAsker, withQuery, } from "@wirecat/cli-core/cli";
|
|
5
5
|
import { guardedWrite, guardFor, keyedGuard, levelFor, newOperationId } from "@wirecat/cli-core/sends";
|
|
6
6
|
import { Command } from "commander";
|
|
7
|
-
import { permissions } from "../config.js";
|
|
7
|
+
import { DELETE_KEY, deletesByBody, permissions } from "../config.js";
|
|
8
8
|
import { contextOf, notionFetchFor, tokenOf } from "../context.js";
|
|
9
9
|
import { operations } from "../generated/manifest.js";
|
|
10
10
|
import { excluded, NOTION_VERSION } from "../generated/metadata.js";
|
|
@@ -14,13 +14,15 @@ import { failureOf } from "../notion/errors.js";
|
|
|
14
14
|
const CLI = IDENTITY.command;
|
|
15
15
|
export const NOTION_API = `https://${API_HOST}`;
|
|
16
16
|
const keyOf = (operation) => `api.${operation.command}`;
|
|
17
|
+
/** The keys each run's raw call checks besides its own, set from its body before the write is guarded. */
|
|
18
|
+
const bodyKeys = new WeakMap();
|
|
17
19
|
/** Every write's one path, as the comments sample's: the level for `api.<operation>` refuses or asks once. */
|
|
18
20
|
const guardedApiWrite = async (command, operation, send) => {
|
|
19
21
|
const { settings, env, renderer, run } = contextOf(command);
|
|
20
22
|
const key = keyOf(operation);
|
|
21
23
|
const operationId = newOperationId();
|
|
22
24
|
const levelOfKey = (one) => levelFor(settings.permissions, one, permissions.defaults).level;
|
|
23
|
-
const guard = keyedGuard((ask) => guardFor(IDENTITY, { ...settings, sendsPerHour: Number.MAX_SAFE_INTEGER, permissionDefaults: permissions.defaults }, renderer.warn, env, ask), terminalAsker(command), levelOfKey, []);
|
|
25
|
+
const guard = keyedGuard((ask) => guardFor(IDENTITY, { ...settings, sendsPerHour: Number.MAX_SAFE_INTEGER, permissionDefaults: permissions.defaults }, renderer.warn, env, ask), terminalAsker(command), levelOfKey, bodyKeys.get(command) ?? []);
|
|
24
26
|
const request = { chatId: null, kind: "edit", key, operationId };
|
|
25
27
|
guard.refuse(request);
|
|
26
28
|
try {
|
|
@@ -54,7 +56,7 @@ const notionRefusal = (status, answer) => {
|
|
|
54
56
|
}));
|
|
55
57
|
return failed instanceof CliError ? failed : undefined;
|
|
56
58
|
};
|
|
57
|
-
const
|
|
59
|
+
const http = httpApiExecutor({
|
|
58
60
|
service: "Notion",
|
|
59
61
|
baseUrl: NOTION_API,
|
|
60
62
|
fetch: notionFetchFor,
|
|
@@ -63,6 +65,13 @@ const execute = httpApiExecutor({
|
|
|
63
65
|
read: (command, _operation, send) => contextOf(command).run(() => send()),
|
|
64
66
|
failure: (status, answer) => notionRefusal(status, answer),
|
|
65
67
|
});
|
|
68
|
+
/** A call that deletes, by its operation or its body, also checks `documents.delete`, as `documents delete` does. */
|
|
69
|
+
const execute = (command, operation, input) => {
|
|
70
|
+
const body = httpApiRequest(operation, input, NOTION_API).body;
|
|
71
|
+
const parsed = body === undefined ? undefined : parseApiJson(body);
|
|
72
|
+
bodyKeys.set(command, deletesByBody(operation.command, parsed) ? [DELETE_KEY] : []);
|
|
73
|
+
return http(command, operation, input);
|
|
74
|
+
};
|
|
66
75
|
/** The schemas are 0.5 MB of code, loaded only once an `api` command is about to check its input. */
|
|
67
76
|
let schemas;
|
|
68
77
|
const loadSchemas = async () => {
|
package/dist/commands/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/commands/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE5C,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AACrD,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,MAAM,EACN,MAAM,EACN,UAAU,EACV,SAAS,EACT,UAAU,EACV,YAAY,EACZ,SAAS,EACT,aAAa,EACb,SAAS,GACV,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AACtG,OAAO,EAAE,OAAO,EAAE,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AS,GAAG,mBAAmB,CAAC;QACpC,UAAU;QACV,WAAW,EAAE,6EAA6E;QAC1F,cAAc;QACd,SAAS;QACT,OAAO;KACR,CAAC,CAAA;IACF,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,OAAO,CAAC,KAAK,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,CAAC,WAAW,CAC3E,uEAAuE,CACxE,CAAA;IACD,GAAG,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,CAAA;IACvD,KAAK,MAAM,KAAK,IAAI,SAAS,CAAC,QAAQ;QAAE,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,CAAA;IAC5F,OAAO,GAAG,CAAA;AACZ,CAAC,CAAA"}
|
|
@@ -1,3 +1,12 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
|
-
|
|
2
|
+
/** `documents get`: one page live, beside the shared commands that read the local copy. */
|
|
3
|
+
export declare const getCommand: () => Command;
|
|
4
|
+
/** `documents create`: a new page under a page the token can see. */
|
|
5
|
+
export declare const createCommand: () => Command;
|
|
6
|
+
/** `documents update`: the page's whole text replaced. */
|
|
7
|
+
export declare const updateCommand: () => Command;
|
|
8
|
+
/** `documents delete`: to Notion's trash, from where `documents restore` brings it back. */
|
|
9
|
+
export declare const deleteCommand: () => Command;
|
|
10
|
+
/** `documents restore`: back from Notion's trash. */
|
|
11
|
+
export declare const restoreCommand: () => Command;
|
|
3
12
|
//# sourceMappingURL=documents.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"documents.d.ts","sourceRoot":"","sources":["../../src/commands/documents.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"documents.d.ts","sourceRoot":"","sources":["../../src/commands/documents.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAUnC,2FAA2F;AAC3F,eAAO,MAAM,UAAU,eAyCjB,CAAA;AAiHN,qEAAqE;AACrE,eAAO,MAAM,aAAa,eA0BpB,CAAA;AAEN,0DAA0D;AAC1D,eAAO,MAAM,aAAa,eAmCpB,CAAA;AAeN,4FAA4F;AAC5F,eAAO,MAAM,aAAa,eAMrB,CAAA;AAEL,qDAAqD;AACrD,eAAO,MAAM,cAAc,eAGoE,CAAA"}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { closeSync, constants, fstatSync, openSync, readFileSync, realpathSync } from "node:fs";
|
|
2
|
+
import { CliError, visibleControls } from "@wirecat/cli-base";
|
|
2
3
|
import { annotate } from "@wirecat/cli-base/commands";
|
|
3
|
-
import { answerEntity, itemOf, outputFor, REMOTE_READ, renderAnswer } from "@wirecat/cli-core/cli";
|
|
4
|
+
import { answerEntity, bufferedInput, commandPath, itemOf, MAX_BUFFERED_INPUT, outputFor, REMOTE_READ, REMOTE_WRITE, renderAnswer, terminalAsker, } from "@wirecat/cli-core/cli";
|
|
5
|
+
import { guardedWrite, guardFor, keyedGuard, levelFor, newOperationId, refusedPlace } from "@wirecat/cli-core/sends";
|
|
4
6
|
import { Command } from "commander";
|
|
5
|
-
import {
|
|
7
|
+
import { DELETE_KEY, PAGE_WRITE_KEYS, permissions } from "../config.js";
|
|
8
|
+
import { contextOf, notionWritesFor, tokenOf, withNotion } from "../context.js";
|
|
6
9
|
import { IDENTITY } from "../identity.js";
|
|
7
10
|
import { notionId } from "../notion/ids.js";
|
|
8
11
|
import { documentSchema } from "../notion/notion.js";
|
|
9
12
|
const CLI = IDENTITY.command;
|
|
10
|
-
|
|
13
|
+
/** `documents get`: one page live, beside the shared commands that read the local copy. */
|
|
14
|
+
export const getCommand = () => answerEntity(annotate(new Command("get"), {
|
|
11
15
|
effects: REMOTE_READ,
|
|
12
16
|
offline: false,
|
|
13
17
|
examples: [
|
|
@@ -37,5 +41,171 @@ const getCommand = () => answerEntity(annotate(new Command("get"), {
|
|
|
37
41
|
if (issues.length > 0 && output.format !== "json" && output.format !== "jsonl")
|
|
38
42
|
output.renderer.warn(`the page is incomplete: ${why}`);
|
|
39
43
|
});
|
|
40
|
-
|
|
44
|
+
/**
|
|
45
|
+
* Every page write's one path, as the template's sample (WC-PERM-13): the level of the command's key and of each
|
|
46
|
+
* extra key refuses or asks once, the send journal records the attempt and never its content (WC-PERM-17), and the
|
|
47
|
+
* answer carries `operation_id` (WC-OUT-10). cli-core has already answered `--dry-run` and refused under
|
|
48
|
+
* `WCNOTION_READ_ONLY`. Never retried: a write that got no answer is `outcome_unknown` (WC-LIFE-9).
|
|
49
|
+
*/
|
|
50
|
+
const write = async (command, extra, act) => {
|
|
51
|
+
const context = contextOf(command);
|
|
52
|
+
const { settings, env, renderer } = context;
|
|
53
|
+
const path = commandPath(command);
|
|
54
|
+
const key = path.replaceAll(" ", ".");
|
|
55
|
+
const token = tokenOf(command);
|
|
56
|
+
const operationId = newOperationId();
|
|
57
|
+
const levelOf = (one) => levelFor(settings.permissions, one, permissions.defaults).level;
|
|
58
|
+
const guard = keyedGuard((ask) => guardFor(IDENTITY,
|
|
59
|
+
// Notion limits its own rate, so this guard keeps the levels and the journal, not a send cap.
|
|
60
|
+
{ ...settings, sendsPerHour: Number.MAX_SAFE_INTEGER, permissionDefaults: permissions.defaults }, renderer.warn, env, ask), terminalAsker(command), levelOf, [...(PAGE_WRITE_KEYS[path] ?? []), ...extra]);
|
|
61
|
+
const request = { chatId: null, kind: "edit", key, operationId };
|
|
62
|
+
guard.refuse(request);
|
|
63
|
+
try {
|
|
64
|
+
const done = await guardedWrite(guard, request, () => context.run((events) => act(notionWritesFor(command, token, events))));
|
|
65
|
+
return { operationId, done };
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
if (error instanceof CliError && error.code === "outcome_unknown")
|
|
69
|
+
throw new CliError("outcome_unknown", error.message, { ...error.details, operation_id: operationId });
|
|
70
|
+
throw error;
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
const realOf = (path) => {
|
|
74
|
+
try {
|
|
75
|
+
return realpathSync(path);
|
|
76
|
+
}
|
|
77
|
+
catch {
|
|
78
|
+
return undefined;
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
const refusedFile = (file) => new CliError("validation_error", `${file} is not read: only a regular file goes to Notion, never a link, a system file, a credential file, a ` +
|
|
82
|
+
"browser profile or a WireCat folder", { reason: "file.refused-place", sent: false });
|
|
83
|
+
/**
|
|
84
|
+
* One open, then every check on what was opened: a link as the last part is refused (O_NOFOLLOW), so the path
|
|
85
|
+
* cannot be swapped between the check and the read, and a FIFO does not block the open (O_NONBLOCK). An agent steered
|
|
86
|
+
* by a page's text must not publish a key, the process's environment or another tool's settings into Notion.
|
|
87
|
+
* cli-core's readUpload checks the path and reads it later, so it is not used here.
|
|
88
|
+
*/
|
|
89
|
+
const readOwnFile = (file, env) => {
|
|
90
|
+
const outside = (path) => path !== undefined && refusedPlace(path, IDENTITY, env);
|
|
91
|
+
if (outside(file))
|
|
92
|
+
throw refusedFile(file);
|
|
93
|
+
let fd;
|
|
94
|
+
try {
|
|
95
|
+
fd = openSync(file, constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0) | (constants.O_NONBLOCK ?? 0));
|
|
96
|
+
}
|
|
97
|
+
catch (error) {
|
|
98
|
+
const code = error.code;
|
|
99
|
+
if (code === "ELOOP" || code === "EMLINK")
|
|
100
|
+
throw refusedFile(file);
|
|
101
|
+
throw new CliError("validation_error", `${file}: ${code === "ENOENT" ? "no such file" : "it cannot be read"}`, {
|
|
102
|
+
sent: false,
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
try {
|
|
106
|
+
// On Linux the open descriptor names the file it really is, whatever happened to the path since the check.
|
|
107
|
+
const opened = process.platform === "linux" ? realOf(`/proc/self/fd/${fd}`) : undefined;
|
|
108
|
+
if (!fstatSync(fd).isFile() || outside(opened))
|
|
109
|
+
throw refusedFile(file);
|
|
110
|
+
return readFileSync(fd, "utf8");
|
|
111
|
+
}
|
|
112
|
+
finally {
|
|
113
|
+
closeSync(fd);
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
/** The page's new text: `--text`, or `--file`, where `-` is stdin. */
|
|
117
|
+
const markdownOf = async (command, args, required) => {
|
|
118
|
+
if (args.text !== undefined && args.file !== undefined)
|
|
119
|
+
throw new CliError("validation_error", "give the text with --text or --file, not both", { sent: false });
|
|
120
|
+
if (args.text !== undefined)
|
|
121
|
+
return args.text;
|
|
122
|
+
if (args.file === "-") {
|
|
123
|
+
const { environment } = contextOf(command);
|
|
124
|
+
const input = await bufferedInput(environment.stdin ?? process.stdin, {
|
|
125
|
+
maxBytes: MAX_BUFFERED_INPUT,
|
|
126
|
+
...(environment.signal ? { signal: environment.signal } : {}),
|
|
127
|
+
});
|
|
128
|
+
return input.toString("utf8");
|
|
129
|
+
}
|
|
130
|
+
if (args.file !== undefined)
|
|
131
|
+
return readOwnFile(args.file, contextOf(command).env);
|
|
132
|
+
if (required)
|
|
133
|
+
throw new CliError("validation_error", "give the page's new text with --text or --file", { sent: false });
|
|
134
|
+
return undefined;
|
|
135
|
+
};
|
|
136
|
+
const TEXT_OPTIONS = {
|
|
137
|
+
text: "the text, as Notion-flavoured Markdown",
|
|
138
|
+
file: "read the text from this file; - reads stdin",
|
|
139
|
+
};
|
|
140
|
+
/** `documents create`: a new page under a page the token can see. */
|
|
141
|
+
export const createCommand = () => annotate(new Command("create"), {
|
|
142
|
+
effects: REMOTE_WRITE,
|
|
143
|
+
offline: false,
|
|
144
|
+
examples: [
|
|
145
|
+
`${CLI} personal documents create --parent PAGE_ID --title "Meeting notes" --text "Discussed the roadmap"`,
|
|
146
|
+
`${CLI} personal documents create --parent https://www.notion.so/Projects-0123456789abcdef0123456789abcdef --file notes.md`,
|
|
147
|
+
`${CLI} personal documents create --parent PAGE_ID --file notes.md --dry-run`,
|
|
148
|
+
],
|
|
149
|
+
})
|
|
150
|
+
.summary("create a Notion page under another page")
|
|
151
|
+
.description("create a Notion page under another page, from Notion-flavoured Markdown. With no --title, Notion takes the " +
|
|
152
|
+
"text's first # heading as the title")
|
|
153
|
+
.requiredOption("--parent <id>", "the parent page's id or its Notion link")
|
|
154
|
+
.option("--title <title>", "the page's title")
|
|
155
|
+
.option("--text <text>", TEXT_OPTIONS.text)
|
|
156
|
+
.option("--file <file>", TEXT_OPTIONS.file)
|
|
157
|
+
.action(async function (args) {
|
|
158
|
+
const parent = notionId(args.parent);
|
|
159
|
+
const markdown = await markdownOf(this, args, false);
|
|
160
|
+
const { operationId, done } = await write(this, [], (notion) => notion.create({ parent, title: args.title, ...(markdown === undefined ? {} : { markdown }) }));
|
|
161
|
+
renderAnswer(this, outputFor(this), itemOf({ operation_id: operationId, page: done }));
|
|
162
|
+
});
|
|
163
|
+
/** `documents update`: the page's whole text replaced. */
|
|
164
|
+
export const updateCommand = () => annotate(new Command("update"), {
|
|
165
|
+
effects: REMOTE_WRITE,
|
|
166
|
+
offline: false,
|
|
167
|
+
examples: [
|
|
168
|
+
`${CLI} personal documents update PAGE_ID --file notes.md`,
|
|
169
|
+
`${CLI} personal documents update PAGE_ID --text "# Plan" --dry-run`,
|
|
170
|
+
`${CLI} personal documents update PAGE_ID --file page.md --allow-deleting-content`,
|
|
171
|
+
],
|
|
172
|
+
})
|
|
173
|
+
.summary("replace a Notion page's text")
|
|
174
|
+
.description("replace a Notion page's whole text with Notion-flavoured Markdown. A child page or database whose tag the new " +
|
|
175
|
+
"text leaves out is refused unless --allow-deleting-content is given, which asks as documents delete does")
|
|
176
|
+
.argument("<page>", "the page's id or its Notion link")
|
|
177
|
+
.option("--text <text>", TEXT_OPTIONS.text)
|
|
178
|
+
.option("--file <file>", TEXT_OPTIONS.file)
|
|
179
|
+
.option("--allow-deleting-content", "let Notion delete the child pages and databases the new text leaves out")
|
|
180
|
+
.action(async function (page, args) {
|
|
181
|
+
const id = notionId(page);
|
|
182
|
+
const markdown = (await markdownOf(this, args, true)) ?? "";
|
|
183
|
+
const allow = args.allowDeletingContent === true;
|
|
184
|
+
const { operationId, done } = await write(this, allow ? [DELETE_KEY] : [], (notion) => notion.replace(id, markdown, allow));
|
|
185
|
+
const output = outputFor(this);
|
|
186
|
+
// Notion applied the text but left part of it out or changed it; its codes say what kind, never whose text.
|
|
187
|
+
if (done.warnings.length > 0 && output.format !== "json" && output.format !== "jsonl")
|
|
188
|
+
output.renderer.warn(`Notion changed or left out part of the text: ${done.warnings.join(", ")}`);
|
|
189
|
+
renderAnswer(this, output, itemOf({ operation_id: operationId, page: { id: done.id }, warnings: done.warnings }));
|
|
190
|
+
});
|
|
191
|
+
const trashCommand = (name, inTrash) => annotate(new Command(name), {
|
|
192
|
+
effects: REMOTE_WRITE,
|
|
193
|
+
offline: false,
|
|
194
|
+
examples: [`${CLI} personal documents ${name} PAGE_ID`, `${CLI} personal documents ${name} PAGE_ID --dry-run`],
|
|
195
|
+
})
|
|
196
|
+
.argument("<page>", "the page's id or its Notion link")
|
|
197
|
+
.action(async function (page) {
|
|
198
|
+
const id = notionId(page);
|
|
199
|
+
const { operationId, done } = await write(this, [], (notion) => notion.trash(id, inTrash));
|
|
200
|
+
renderAnswer(this, outputFor(this), itemOf({ operation_id: operationId, page: done }));
|
|
201
|
+
});
|
|
202
|
+
/** `documents delete`: to Notion's trash, from where `documents restore` brings it back. */
|
|
203
|
+
export const deleteCommand = () => trashCommand("delete", true)
|
|
204
|
+
.summary("move a Notion page to the trash")
|
|
205
|
+
.description("move a Notion page, with the pages under it, to Notion's trash; documents restore brings it back. Notion's API " +
|
|
206
|
+
"deletes nothing for good. Asks first, as the profile's documents.delete permission says");
|
|
207
|
+
/** `documents restore`: back from Notion's trash. */
|
|
208
|
+
export const restoreCommand = () => trashCommand("restore", false)
|
|
209
|
+
.summary("bring a Notion page back from the trash")
|
|
210
|
+
.description("bring a Notion page back from Notion's trash, where documents delete put it");
|
|
41
211
|
//# sourceMappingURL=documents.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"documents.js","sourceRoot":"","sources":["../../src/commands/documents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"documents.js","sourceRoot":"","sources":["../../src/commands/documents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAC/F,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AACrD,OAAO,EACL,YAAY,EACZ,aAAa,EACb,WAAW,EACX,MAAM,EACN,kBAAkB,EAClB,SAAS,EACT,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,aAAa,GACd,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AACpH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AACvE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC/E,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAC3C,OAAO,EAAiB,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAGnE,MAAM,GAAG,GAAG,QAAQ,CAAC,OAAO,CAAA;AAE5B,2FAA2F;AAC3F,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,EAAE,CAC7B,YAAY,CACV,QAAQ,CAAC,IAAI,OAAO,CAAC,KA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E,CAChC,YAAY,CAAC,QAAQ,EAAE,IAAI,CAAC;KACzB,OAAO,CAAC,iCAAiC,CAAC;KAC1C,WAAW,CACV,iHAAiH;IAC/G,yFAAyF,CAC5F,CAAA;AAEL,qDAAqD;AACrD,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,EAAE,CACjC,YAAY,CAAC,SAAS,EAAE,KAAK,CAAC;KAC3B,OAAO,CAAC,yCAAyC,CAAC;KAClD,WAAW,CAAC,6EAA6E,CAAC,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type DocumentWords } from "@wirecat/cli-core/documents/cli";
|
|
2
|
+
import { Command } from "commander";
|
|
3
|
+
export declare const NOTION_WORDS: DocumentWords;
|
|
4
|
+
/**
|
|
5
|
+
* cli-core's shared `folders`, `sync`, `status`, `documents`, `search`, `catalog` and knowledge groups over Notion and
|
|
6
|
+
* the shared store, with notion's own `folders browse`, `documents get` and `documents add`. The ports take no command,
|
|
7
|
+
* so each run's command is caught as it starts; an MCP server builds the tree anew for every call.
|
|
8
|
+
*/
|
|
9
|
+
export declare const libraryCommands: () => Command[];
|
|
10
|
+
//# sourceMappingURL=library.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"library.d.ts","sourceRoot":"","sources":["../../src/commands/library.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,iCAAiC,CAAA;AAEzF,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAqCnC,eAAO,MAAM,YAAY,EAAE,aAkB1B,CAAA;AAuCD;;;;GAIG;AACH,eAAO,MAAM,eAAe,QAAO,OAAO,EA2azC,CAAA"}
|