@wirecat/notion-cli 0.2.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 +29 -0
- package/README.md +6 -2
- package/contracts/wirecat.json +48 -0
- package/dist/bin/notion.js +2 -2
- package/dist/bundle/{all-profiles-JGYLQZ5C.js → all-profiles-4IONYZB6.js} +10 -10
- package/dist/bundle/{anthropic-S2VSMIKQ.js → anthropic-OXF74J4P.js} +6 -6
- package/dist/bundle/{app-server-SASYDBCA.js → app-server-M2VF6ABM.js} +59 -59
- package/dist/bundle/{bun-LU5LP3JI.js → bun-DLA6QRLL.js} +2 -2
- package/dist/bundle/{bun-sqlite-JBSINB4O.js → bun-sqlite-F4BYLW3F.js} +7 -7
- package/dist/bundle/{chunk-4HWJOU7N.js → chunk-2MHMKNWD.js} +1 -1
- package/dist/bundle/{chunk-SHJQ6JKG.js → chunk-4KUJTSHG.js} +2 -2
- package/dist/bundle/{chunk-SWAOWNKW.js → chunk-4TQVZXOV.js} +3 -3
- package/dist/bundle/{chunk-ODBZNSZ6.js → chunk-5LBJNTEJ.js} +6 -6
- package/dist/bundle/{chunk-SZOVLP44.js → chunk-5UA2TYMI.js} +2 -2
- package/dist/bundle/{chunk-22QQUKWA.js → chunk-5XP4KQ2F.js} +1 -1
- package/dist/bundle/{chunk-4IPURN72.js → chunk-6GN7KU7X.js} +9 -9
- package/dist/bundle/{chunk-X4TIMMKJ.js → chunk-6JBLIQQN.js} +1 -1
- package/dist/bundle/{chunk-4ZTVJHWU.js → chunk-7NF3V5L2.js} +4 -4
- package/dist/bundle/{chunk-OTV53F34.js → chunk-7NGFGFE5.js} +9 -60
- package/dist/bundle/{chunk-VBHETQVV.js → chunk-7NVPM55S.js} +1908 -1013
- package/dist/bundle/{chunk-Z56QFOBR.js → chunk-7YZPBAQX.js} +1 -1
- package/dist/bundle/{chunk-3AL7QUS3.js → chunk-AYU5TFDU.js} +20 -20
- package/dist/bundle/{chunk-FPY6EJ7B.js → chunk-BEPFGITI.js} +55 -55
- package/dist/bundle/{chunk-VCIALTEM.js → chunk-CBGBFAYJ.js} +12 -4
- package/dist/bundle/{chunk-NQWV4WQO.js → chunk-CDGZZNGY.js} +6 -6
- package/dist/bundle/{chunk-DH5PRHT4.js → chunk-CIVXTBJY.js} +13 -13
- package/dist/bundle/{chunk-B26TQZKZ.js → chunk-COH7OEER.js} +14 -13
- package/dist/bundle/{chunk-XF26XKTS.js → chunk-D6RCRBDH.js} +2 -2
- package/dist/bundle/{chunk-YMYUBZWT.js → chunk-EQPAZ33O.js} +17 -17
- package/dist/bundle/{chunk-LAYPFBOM.js → chunk-EY6S7FV3.js} +6 -6
- package/dist/bundle/chunk-FEMHUSGO.js +88 -0
- package/dist/bundle/{chunk-FWVBPRL4.js → chunk-FSJHASRQ.js} +79 -62
- package/dist/bundle/{chunk-TPX2M45D.js → chunk-GBFEEHQC.js} +10 -10
- package/dist/bundle/{chunk-5IYKVRH2.js → chunk-GCCPFKSU.js} +434 -343
- package/dist/bundle/{chunk-3Z4YTSRY.js → chunk-GK4GLPG2.js} +3 -3
- package/dist/bundle/{chunk-GZOUFX3C.js → chunk-GSNE7OB4.js} +4 -4
- package/dist/bundle/{chunk-TSDBSIFM.js → chunk-HTKSCSJU.js} +4 -4
- package/dist/bundle/{chunk-5NFK5EM2.js → chunk-IJMFG7HB.js} +7 -7
- package/dist/bundle/{chunk-D7QSEEYW.js → chunk-JIRRF6BM.js} +4 -4
- package/dist/bundle/{chunk-5RSC54NA.js → chunk-JODE2XED.js} +25 -25
- package/dist/bundle/{chunk-RV64YUQX.js → chunk-K5I64ZVI.js} +9 -9
- package/dist/bundle/{chunk-AOCUKEAX.js → chunk-KL3P5TQK.js} +4 -4
- package/dist/bundle/{chunk-2LWO3PDX.js → chunk-L62XTC7N.js} +11 -11
- package/dist/bundle/{chunk-LLG2POQ7.js → chunk-L6H7PY4X.js} +3 -3
- package/dist/bundle/{chunk-5RDNBG7D.js → chunk-LIQMUDIZ.js} +2 -2
- package/dist/bundle/{chunk-WF4D56CA.js → chunk-M2EEIYBU.js} +2 -2
- package/dist/bundle/{chunk-MZU2YFBZ.js → chunk-M6DGZ2O6.js} +8 -8
- package/dist/bundle/{chunk-FXEJY4OL.js → chunk-MRA62W5K.js} +233 -167
- package/dist/bundle/{chunk-XYIT2XB3.js → chunk-MVA5HVKL.js} +20 -0
- package/dist/bundle/{chunk-YVI5SQPY.js → chunk-NO2LIHWA.js} +1 -1
- package/dist/bundle/{chunk-WCSOH4JS.js → chunk-OCDJ4FFA.js} +4 -4
- package/dist/bundle/{chunk-2F4QQ7WB.js → chunk-OI5DWZJG.js} +3 -3
- package/dist/bundle/{chunk-EUIVXFLJ.js → chunk-P3P6DA6K.js} +6 -6
- package/dist/bundle/{chunk-MY742GAD.js → chunk-QX3TPFEX.js} +37 -37
- package/dist/bundle/{chunk-6RA3EABS.js → chunk-R6SDRSZK.js} +62 -32
- package/dist/bundle/{chunk-5QIQEUOG.js → chunk-RMJMID5D.js} +8 -8
- package/dist/bundle/{chunk-BNPTZ5ZB.js → chunk-SGBS5QCU.js} +4 -4
- package/dist/bundle/{chunk-YNTLT3Z3.js → chunk-T5UNSFES.js} +8 -8
- package/dist/bundle/{chunk-M7S2NDWB.js → chunk-TFNRCCGR.js} +4 -4
- package/dist/bundle/{chunk-B7ON6KPT.js → chunk-TJCPTRYD.js} +7 -7
- package/dist/bundle/{chunk-KM6WHPHI.js → chunk-TXONV3HW.js} +2 -2
- package/dist/bundle/{chunk-NOQ7B5N7.js → chunk-TZ2QJ53V.js} +2 -2
- package/dist/bundle/{chunk-KGERXYTV.js → chunk-UKE3CGHK.js} +1 -1
- package/dist/bundle/{chunk-6EVKHZKN.js → chunk-UROEWCOG.js} +3 -3
- package/dist/bundle/{chunk-WJHZMR2W.js → chunk-WHJWURZB.js} +6 -6
- package/dist/bundle/{chunk-G3EZFRSS.js → chunk-WU3XHGOB.js} +112 -42
- package/dist/bundle/{chunk-2F6VO5HA.js → chunk-WZEEEQGC.js} +3 -3
- package/dist/bundle/{chunk-M3KB25D3.js → chunk-XCTOCVMW.js} +14 -14
- package/dist/bundle/{chunk-FT3LN3HP.js → chunk-Y5LAJWR5.js} +1 -1
- package/dist/bundle/{chunk-ZZ32DXTH.js → chunk-YAPDU3SV.js} +1 -1
- package/dist/bundle/{chunk-HL52XXZX.js → chunk-YFWLHTNO.js} +1 -1
- package/dist/bundle/{chunk-P7CUM5IB.js → chunk-YGCI3DHS.js} +1 -1
- package/dist/bundle/{chunk-KCLOUUYF.js → chunk-Z53LYX4M.js} +3 -3
- package/dist/bundle/{chunk-ZKAEZXUP.js → chunk-ZC6ZQQ55.js} +36 -37
- package/dist/bundle/command-contract-UBXS6NHI.js +38 -0
- package/dist/bundle/{command-server-entry-UFSG7KRO.js → command-server-entry-2SORMVRM.js} +27 -27
- package/dist/bundle/{decode-7LLWTSPT.js → decode-5O7IEFPN.js} +6 -6
- package/dist/bundle/{dispatch-2GY6JIJH.js → dispatch-YHQX6FEJ.js} +8 -8
- package/dist/bundle/{echarts-BXX4OQWC.js → echarts-ARLMVQC7.js} +2 -2
- package/dist/bundle/{embed-JXFNBTKH.js → embed-FUDUKQ3K.js} +7 -7
- package/dist/bundle/{embedder-57YZ44KO.js → embedder-HDRV7GX3.js} +10 -10
- package/dist/bundle/{failure-MYT4HPE3.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-2VECIDXF.js → instructions-MEFIKCDI.js} +1 -1
- package/dist/bundle/{mcp-O6ACR2DX.js → mcp-VMS6PBCU.js} +2 -2
- package/dist/bundle/meeting-combined-HNSS3FQY.js +24 -0
- package/dist/bundle/meeting-model-REZVYGQW.js +26 -0
- package/dist/bundle/{meeting-semantic-ETN3A4BJ.js → meeting-semantic-R4CSLVRG.js} +7 -7
- package/dist/bundle/{node-MPEQSFI3.js → node-MAQALPLA.js} +2 -2
- package/dist/bundle/{node-sqlite-WA32MYSJ.js → node-sqlite-J7IJYNBO.js} +8 -8
- package/dist/bundle/notion.js +14 -14
- package/dist/bundle/{oauth-IAFZG3IR.js → oauth-AMV4YGJD.js} +8 -8
- package/dist/bundle/{open-M3JQUC5G.js → open-AB27MTGR.js} +6 -6
- package/dist/bundle/{openai-HXUEHUSD.js → openai-D77MU5XV.js} +17 -17
- package/dist/bundle/{process-F6TKXWWA.js → process-SIOWTRJ6.js} +1 -1
- package/dist/bundle/{program-Y7JAB6TG.js → program-QC5MX4ZJ.js} +2816 -1645
- package/dist/bundle/{prompt-IMUQLZD2.js → prompt-W77YDHA6.js} +6 -6
- package/dist/bundle/{recognize-2MZAYHAA.js → recognize-3JAXQQ36.js} +5 -5
- package/dist/bundle/{remote-OV4LB6VR.js → remote-PSOJXCXO.js} +11 -11
- package/dist/bundle/{rerank-ZIULUS34.js → rerank-EE44ZTGL.js} +8 -8
- package/dist/bundle/{schemas-DIVZS6TU.js → schemas-LBYUMBC6.js} +2 -2
- package/dist/bundle/{serve-YU7QBP6L.js → serve-XJMGAMFW.js} +10 -10
- package/dist/bundle/{server-LGMNONSB.js → server-ASU6CP5R.js} +51 -51
- package/dist/bundle/server-WSPQ5EOA.js +72 -0
- package/dist/bundle/{services-5WY4DCPJ.js → services-PT4PA4J6.js} +46 -39
- package/dist/bundle/{sqlite-runtime-5MXZDETH.js → sqlite-runtime-YHXRTVXE.js} +7 -7
- package/dist/bundle/{state-LWMZH2KI.js → state-T6ZKFWGD.js} +7 -7
- package/dist/bundle/{store-EPZYV4VW.js → store-3MUCZEI3.js} +20 -18
- package/dist/bundle/{store-QE6FEIZD.js → store-E5EE25FY.js} +24 -20
- 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 +8 -0
- package/dist/commands/documents.d.ts.map +1 -1
- package/dist/commands/documents.js +173 -3
- package/dist/commands/documents.js.map +1 -1
- package/dist/commands/library.d.ts.map +1 -1
- package/dist/commands/library.js +3 -1
- package/dist/commands/library.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 +3 -0
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +3 -0
- 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/notion/errors.d.ts +5 -0
- package/dist/notion/errors.d.ts.map +1 -1
- package/dist/notion/errors.js +7 -0
- package/dist/notion/errors.js.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/sync/cursor.d.ts +12 -0
- package/dist/sync/cursor.d.ts.map +1 -1
- package/dist/sync/files.d.ts +10 -0
- package/dist/sync/files.d.ts.map +1 -1
- package/dist/sync/files.js +19 -0
- package/dist/sync/files.js.map +1 -1
- package/dist/sync/source.d.ts.map +1 -1
- package/dist/sync/source.js +43 -25
- 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 +6 -0
- package/dist/bundle/command-contract-JS5V27NX.js +0 -38
- package/dist/bundle/first-run-3PF7T74J.js +0 -29
- package/dist/bundle/first-screen-7BEROEQR.js +0 -36
- package/dist/bundle/meeting-combined-PPUQ3KBR.js +0 -24
- package/dist/bundle/meeting-model-ZNMYKMCD.js +0 -26
- package/dist/bundle/server-FKQET4ZO.js +0 -71
- package/dist/bundle/store-maintenance-command-ZUUUFCHL.js +0 -62
- /package/dist/bundle/{chunk-VKE77B3F.js → chunk-SHTHNBHG.js} +0 -0
package/dist/config.d.ts
CHANGED
|
@@ -1,4 +1,23 @@
|
|
|
1
1
|
import { type Configuration } from "@wirecat/cli-core/cli";
|
|
2
|
+
/** Deleting child pages through an update is a delete, so it asks as `documents delete` does. */
|
|
3
|
+
export declare const DELETE_KEY = "documents.delete";
|
|
4
|
+
/**
|
|
5
|
+
* The generated operation each page write sends, so denying `api.<operation>` cannot be got round through
|
|
6
|
+
* `documents …`, as gcal-cli does for its event writes.
|
|
7
|
+
*/
|
|
8
|
+
export declare const PAGE_WRITE_KEYS: Record<string, readonly string[]>;
|
|
9
|
+
/**
|
|
10
|
+
* The raw operations whose body can delete, so `documents.delete: deny` holds over `api` too. Found by scanning
|
|
11
|
+
* Notion's OpenAPI document for body fields that trash, erase, archive or remove: `in_trash` (pages, blocks, databases,
|
|
12
|
+
* data sources), `erase_content` and `is_archived` (pages; what `is_archived` does is undocumented, so it counts as a
|
|
13
|
+
* delete), `allow_deleting_content` (Markdown updates), and a data source property set to `null`, which removes it
|
|
14
|
+
* with its values ([update a data source](https://developers.notion.com/reference/update-a-data-source)).
|
|
15
|
+
*/
|
|
16
|
+
export declare const TRASHING_OPERATIONS: readonly ["patch-page", "update-page-markdown", "update-a-block", "update-database", "update-a-data-source"];
|
|
17
|
+
/** Every operation that deletes by its method (a block, which may be a page, a comment, a view): always a delete. */
|
|
18
|
+
export declare const DELETING_OPERATIONS: readonly string[];
|
|
19
|
+
/** A raw call that deletes: by its operation, or by a body that trashes, erases, archives or removes content. */
|
|
20
|
+
export declare const deletesByBody: (operation: string, body: unknown) => boolean;
|
|
2
21
|
/** Each command is checked against its own path (`notes.list`); add the keys a command checks inside itself. */
|
|
3
22
|
export declare const permissions: import("@wirecat/cli-core/cli").CommandPermissions;
|
|
4
23
|
export declare const configuration: Configuration;
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAmC,MAAM,uBAAuB,CAAA;AAI3F,gHAAgH;AAChH,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAmC,MAAM,uBAAuB,CAAA;AAI3F,iGAAiG;AACjG,eAAO,MAAM,UAAU,qBAAqB,CAAA;AAE5C;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAK7D,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,YAC9B,YAAY,EACZ,sBAAsB,EACtB,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,CACd,CAAA;AAGV,qHAAqH;AACrH,eAAO,MAAM,mBAAmB,EAAE,SAAS,MAAM,EAET,CAAA;AAUxC,iHAAiH;AACjH,eAAO,MAAM,aAAa,cAAe,MAAM,QAAQ,OAAO,KAAG,OAiBhE,CAAA;AAED,gHAAgH;AAChH,eAAO,MAAM,WAAW,oDAuBtB,CAAA;AAEF,eAAO,MAAM,aAAa,EAAE,aAAsD,CAAA"}
|
package/dist/config.js
CHANGED
|
@@ -1,13 +1,81 @@
|
|
|
1
1
|
import { commandPermissions, settingsFor } from "@wirecat/cli-core/cli";
|
|
2
2
|
import { operations } from "./generated/manifest.js";
|
|
3
3
|
import { IDENTITY } from "./identity.js";
|
|
4
|
+
/** Deleting child pages through an update is a delete, so it asks as `documents delete` does. */
|
|
5
|
+
export const DELETE_KEY = "documents.delete";
|
|
6
|
+
/**
|
|
7
|
+
* The generated operation each page write sends, so denying `api.<operation>` cannot be got round through
|
|
8
|
+
* `documents …`, as gcal-cli does for its event writes.
|
|
9
|
+
*/
|
|
10
|
+
export const PAGE_WRITE_KEYS = {
|
|
11
|
+
"documents create": ["api.post-page"],
|
|
12
|
+
"documents update": ["api.update-page-markdown"],
|
|
13
|
+
"documents delete": ["api.patch-page"],
|
|
14
|
+
"documents restore": ["api.patch-page"],
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* The raw operations whose body can delete, so `documents.delete: deny` holds over `api` too. Found by scanning
|
|
18
|
+
* Notion's OpenAPI document for body fields that trash, erase, archive or remove: `in_trash` (pages, blocks, databases,
|
|
19
|
+
* data sources), `erase_content` and `is_archived` (pages; what `is_archived` does is undocumented, so it counts as a
|
|
20
|
+
* delete), `allow_deleting_content` (Markdown updates), and a data source property set to `null`, which removes it
|
|
21
|
+
* with its values ([update a data source](https://developers.notion.com/reference/update-a-data-source)).
|
|
22
|
+
*/
|
|
23
|
+
export const TRASHING_OPERATIONS = [
|
|
24
|
+
"patch-page",
|
|
25
|
+
"update-page-markdown",
|
|
26
|
+
"update-a-block",
|
|
27
|
+
"update-database",
|
|
28
|
+
"update-a-data-source",
|
|
29
|
+
];
|
|
30
|
+
const TRASHES = "the body trashes, erases, archives or removes content";
|
|
31
|
+
/** Every operation that deletes by its method (a block, which may be a page, a comment, a view): always a delete. */
|
|
32
|
+
export const DELETING_OPERATIONS = operations
|
|
33
|
+
.filter((operation) => operation.effect === "destructive")
|
|
34
|
+
.map((operation) => operation.command);
|
|
35
|
+
/** One call that runs up to 100 agent operations, a delete among them. */
|
|
36
|
+
const AGENT_BATCH = "agent-batch";
|
|
37
|
+
const DELETING_FIELDS = ["in_trash", "erase_content", "is_archived", "archived"];
|
|
38
|
+
const isObject = (value) => !!value && typeof value === "object" && !Array.isArray(value);
|
|
39
|
+
/** A raw call that deletes: by its operation, or by a body that trashes, erases, archives or removes content. */
|
|
40
|
+
export const deletesByBody = (operation, body) => {
|
|
41
|
+
if (DELETING_OPERATIONS.includes(operation))
|
|
42
|
+
return true;
|
|
43
|
+
if (operation === AGENT_BATCH)
|
|
44
|
+
return (isObject(body) &&
|
|
45
|
+
Array.isArray(body.operations) &&
|
|
46
|
+
body.operations.some((one) => isObject(one) && one.action === "delete"));
|
|
47
|
+
if (!TRASHING_OPERATIONS.includes(operation) || !isObject(body))
|
|
48
|
+
return false;
|
|
49
|
+
const update = typeof body.type === "string" ? body[body.type] : undefined;
|
|
50
|
+
return (DELETING_FIELDS.some((field) => body[field] === true) ||
|
|
51
|
+
(isObject(update) && update.allow_deleting_content === true) ||
|
|
52
|
+
(operation === "update-a-data-source" &&
|
|
53
|
+
isObject(body.properties) &&
|
|
54
|
+
Object.values(body.properties).some((property) => property === null)));
|
|
55
|
+
};
|
|
4
56
|
/** Each command is checked against its own path (`notes.list`); add the keys a command checks inside itself. */
|
|
5
57
|
export const permissions = commandPermissions({
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
58
|
+
alsoChecks: (path) => {
|
|
59
|
+
const keys = PAGE_WRITE_KEYS[path.join(" ")] ?? [];
|
|
60
|
+
if (path.join(" ") === "documents update")
|
|
61
|
+
return [...keys, { key: DELETE_KEY, when: "with --allow-deleting-content" }];
|
|
62
|
+
if (path[0] === "api" && DELETING_OPERATIONS.includes(path[1] ?? ""))
|
|
63
|
+
return [DELETE_KEY];
|
|
64
|
+
if (path[0] === "api" && path[1] === AGENT_BATCH)
|
|
65
|
+
return [{ key: DELETE_KEY, when: "an operation's action is delete" }];
|
|
66
|
+
if (path[0] === "api" && TRASHING_OPERATIONS.includes(path[1] ?? ""))
|
|
67
|
+
return [{ key: DELETE_KEY, when: TRASHES }];
|
|
68
|
+
return keys;
|
|
69
|
+
},
|
|
70
|
+
defaults: {
|
|
71
|
+
// As gcal-cli and drive-cli: a page is created and changed freely, a page to the trash asks first. Over MCP `ask`
|
|
72
|
+
// goes ahead (cli-core's rule), so `deny` is what stops an agent.
|
|
73
|
+
[DELETE_KEY]: "ask",
|
|
74
|
+
// A generated API operation that deletes asks first at a terminal, as above.
|
|
75
|
+
...Object.fromEntries(operations
|
|
76
|
+
.filter((operation) => operation.effect === "destructive")
|
|
77
|
+
.map((operation) => [`api.${operation.command}`, "ask"])),
|
|
78
|
+
},
|
|
11
79
|
});
|
|
12
80
|
export const configuration = settingsFor(IDENTITY, { permissions });
|
|
13
81
|
//# sourceMappingURL=config.js.map
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,kBAAkB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAC3F,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAExC,gHAAgH;AAChH,MAAM,CAAC,MAAM,WAAW,GAAG,kBAAkB,CAAC;IAC5C,
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,kBAAkB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAC3F,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAExC,iGAAiG;AACjG,MAAM,CAAC,MAAM,UAAU,GAAG,kBAAkB,CAAA;AAE5C;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAsC;IAChE,kBAAkB,EAAE,CAAC,eAAe,CAAC;IACrC,kBAAkB,EAAE,CAAC,0BAA0B,CAAC;IAChD,kBAAkB,EAAE,CAAC,gBAAgB,CAAC;IACtC,mBAAmB,EAAE,CAAC,gBAAgB,CAAC;CACxC,CAAA;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,YAAY;IACZ,sBAAsB;IACtB,gBAAgB;IAChB,iBAAiB;IACjB,sBAAsB;CACd,CAAA;AACV,MAAM,OAAO,GAAG,uDAAuD,CAAA;AAEvE,qHAAqH;AACrH,MAAM,CAAC,MAAM,mBAAmB,GAAsB,UAAU;KAC7D,MAAM,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,MA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C7C,OAAO,IAAI,CAAA;IACb,CAAC;IACD,QAAQ,EAAE;QACR,kHAAkH;QAClH,kEAAkE;QAClE,CAAC,UAAU,CAAC,EAAE,KAAK;QACnB,6EAA6E;QAC7E,GAAG,MAAM,CAAC,WAAW,CACnB,UAAU;aACP,MAAM,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,MAAM,KAAK,aAAa,CAAC;aACzD,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,OAAO,SAAS,CAAC,OAAO,EAAE,EAAE,KAAK,CAAC,CAAC,CAC3D;KACF;CACF,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,aAAa,GAAkB,WAAW,CAAC,QAAQ,EAAE,EAAE,WAAW,EAAE,CAAC,CAAA"}
|
package/dist/context.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { type BaseEnvironment, type EventSink, type GlobalFlags, ProfileTokenSto
|
|
|
3
3
|
import type { Command } from "commander";
|
|
4
4
|
import { type LiveReads } from "./notion/notion.js";
|
|
5
5
|
import type { NotionReads } from "./notion/reads.js";
|
|
6
|
+
import { type LiveWrites } from "./notion/writes.js";
|
|
6
7
|
/** What a test hands `run()` beside cli-core's own: the fake Notion in place of the network (WC-ARCH-10). */
|
|
7
8
|
export interface ServiceEnvironment extends BaseEnvironment {
|
|
8
9
|
fetch?: typeof fetch;
|
|
@@ -48,4 +49,6 @@ export declare const notionFetchFor: (command: Command) => import("@wirecat/cli-
|
|
|
48
49
|
* a run named after the command, and the client's requests land in that run (WC-LIFE-5, WC-LIFE-15).
|
|
49
50
|
*/
|
|
50
51
|
export declare const withNotion: <T>(command: Command, body: (notion: LiveReads) => Promise<T>) => Promise<T>;
|
|
52
|
+
/** The writes' client for one run, the same transport as the reads'; the token is read before the write is guarded. */
|
|
53
|
+
export declare const notionWritesFor: (command: Command, token: string, events: EventSink) => LiveWrites;
|
|
51
54
|
//# sourceMappingURL=context.d.ts.map
|
package/dist/context.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAClD,OAAO,EACL,KAAK,eAAe,EAEpB,KAAK,SAAS,EAEd,KAAK,WAAW,EAChB,iBAAiB,EAElB,MAAM,uBAAuB,CAAA;AAE9B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAKxC,OAAO,EAAE,KAAK,SAAS,EAAa,MAAM,oBAAoB,CAAA;AAE9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAClD,OAAO,EACL,KAAK,eAAe,EAEpB,KAAK,SAAS,EAEd,KAAK,WAAW,EAChB,iBAAiB,EAElB,MAAM,uBAAuB,CAAA;AAE9B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAKxC,OAAO,EAAE,KAAK,SAAS,EAAa,MAAM,oBAAoB,CAAA;AAE9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,EAAE,KAAK,UAAU,EAAc,MAAM,oBAAoB,CAAA;AAEhE,6GAA6G;AAC7G,MAAM,WAAW,kBAAmB,SAAQ,eAAe;IACzD,KAAK,CAAC,EAAE,OAAO,KAAK,CAAA;IACpB,0FAA0F;IAC1F,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,2GAA2G;IAC3G,GAAG,CAAC,EAAE,MAAM,MAAM,CAAA;CACnB;AAED;;;GAGG;AACH,eAAO,MAAM,SAAS,YAAa,OAAO;;;;;;;;;;;;;;;;;;;CAczC,CAAA;AAED,+GAA+G;AAC/G,eAAO,MAAM,OAAO,YAAa,OAAO,KAAG,MAI1C,CAAA;AAmBD,4DAA4D;AAC5D,eAAO,MAAM,SAAS,YAAa,OAAO,SAAS,MAAM,UAAU,SAAS,KAAG,SACV,CAAA;AAErE,mHAAmH;AACnH,eAAO,MAAM,cAAc,YAAa,OAAO,SAAS,MAAM,UAAU,SAAS,KAAG,WAGnF,CAAA;AAED,+GAA+G;AAC/G,eAAO,MAAM,cAAc,YAAa,OAAO,+CAAiD,CAAA;AAEhG;;;GAGG;AACH,eAAO,MAAM,UAAU,GAAI,CAAC,WAAW,OAAO,QAAQ,CAAC,MAAM,EAAE,SAAS,KAAK,OAAO,CAAC,CAAC,CAAC,KAAG,OAAO,CAAC,CAAC,CAGlG,CAAA;AAED,uHAAuH;AACvH,eAAO,MAAM,eAAe,YAAa,OAAO,SAAS,MAAM,UAAU,SAAS,KAAG,UACf,CAAA"}
|
package/dist/context.js
CHANGED
|
@@ -6,6 +6,7 @@ import { notionClient, notionFetch, PACE, QUERY_PACE } from "./notion/client.js"
|
|
|
6
6
|
import { NOTION } from "./notion/errors.js";
|
|
7
7
|
import { liveReads } from "./notion/notion.js";
|
|
8
8
|
import { notionClock, notionPort } from "./notion/port.js";
|
|
9
|
+
import { liveWrites } from "./notion/writes.js";
|
|
9
10
|
/**
|
|
10
11
|
* Settings, keyring and the run come from cli-core's `baseContext` and nowhere else: a command that resolves settings
|
|
11
12
|
* on its own skips `--timeout`, the run record and the profile's permissions (WC-LIFE-5, WC-LIFE-15).
|
|
@@ -64,4 +65,6 @@ export const withNotion = (command, body) => {
|
|
|
64
65
|
const token = tokenOf(command);
|
|
65
66
|
return contextOf(command).run((events) => body(notionFor(command, token, events)));
|
|
66
67
|
};
|
|
68
|
+
/** The writes' client for one run, the same transport as the reads'; the token is read before the write is guarded. */
|
|
69
|
+
export const notionWritesFor = (command, token, events) => liveWrites(notionClient({ token, ...transportOf(command, events) }));
|
|
67
70
|
//# sourceMappingURL=context.js.map
|
package/dist/context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,WAAW,EAEX,aAAa,EAEb,iBAAiB,EACjB,aAAa,GACd,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAE5D,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAChF,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAC3C,OAAO,EAAkB,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAC9D,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,WAAW,EAEX,aAAa,EAEb,iBAAiB,EACjB,aAAa,GACd,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAE5D,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAChF,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAC3C,OAAO,EAAkB,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAC9D,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE1D,OAAO,EAAmB,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAWhE;;;GAGG;AACH,MAA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