@texonom/cli 1.2.0-alpha.0 → 1.2.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Seonglae Cho
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1 +1 @@
1
- {"program":{"fileNames":["../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2022.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2023.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.esnext.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2022.array.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2022.error.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2022.object.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2022.string.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2023.array.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../node_modules/.pnpm/typanion@3.13.0/node_modules/typanion/lib/types.d.ts","../../../node_modules/.pnpm/typanion@3.13.0/node_modules/typanion/lib/predicates/cascadingpredicates.d.ts","../../../node_modules/.pnpm/typanion@3.13.0/node_modules/typanion/lib/predicates/typepredicates.d.ts","../../../node_modules/.pnpm/typanion@3.13.0/node_modules/typanion/lib/predicates/helperpredicates.d.ts","../../../node_modules/.pnpm/typanion@3.13.0/node_modules/typanion/lib/tools.d.ts","../../../node_modules/.pnpm/typanion@3.13.0/node_modules/typanion/lib/index.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/assert.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/assert/strict.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/globals.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/async_hooks.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/buffer.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/child_process.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/cluster.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/console.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/constants.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/crypto.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/dgram.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/dns.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/dns/promises.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/domain.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/dom-events.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/events.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/fs.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/fs/promises.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/http.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/http2.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/https.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/inspector.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/module.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/net.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/os.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/path.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/process.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/punycode.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/querystring.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/readline.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/readline/promises.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/repl.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/stream.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/stream/promises.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/stream/web.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/string_decoder.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/test.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/timers.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/timers/promises.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/tls.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/trace_events.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/tty.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/url.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/util.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/v8.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/vm.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/wasi.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/worker_threads.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/zlib.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/globals.global.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/index.d.ts","../../../node_modules/.pnpm/clipanion@3.2.1_typanion@3.13.0/node_modules/clipanion/lib/core.d.ts","../../../node_modules/.pnpm/clipanion@3.2.1_typanion@3.13.0/node_modules/clipanion/lib/format.d.ts","../../../node_modules/.pnpm/clipanion@3.2.1_typanion@3.13.0/node_modules/clipanion/lib/errors.d.ts","../../../node_modules/.pnpm/clipanion@3.2.1_typanion@3.13.0/node_modules/clipanion/lib/advanced/options/utils.d.ts","../../../node_modules/.pnpm/clipanion@3.2.1_typanion@3.13.0/node_modules/clipanion/lib/advanced/cli.d.ts","../../../node_modules/.pnpm/clipanion@3.2.1_typanion@3.13.0/node_modules/clipanion/lib/advanced/command.d.ts","../../../node_modules/.pnpm/clipanion@3.2.1_typanion@3.13.0/node_modules/clipanion/lib/advanced/builtins/definitions.d.ts","../../../node_modules/.pnpm/clipanion@3.2.1_typanion@3.13.0/node_modules/clipanion/lib/advanced/builtins/help.d.ts","../../../node_modules/.pnpm/clipanion@3.2.1_typanion@3.13.0/node_modules/clipanion/lib/advanced/builtins/version.d.ts","../../../node_modules/.pnpm/clipanion@3.2.1_typanion@3.13.0/node_modules/clipanion/lib/advanced/builtins/index.d.ts","../../../node_modules/.pnpm/clipanion@3.2.1_typanion@3.13.0/node_modules/clipanion/lib/advanced/options/array.d.ts","../../../node_modules/.pnpm/clipanion@3.2.1_typanion@3.13.0/node_modules/clipanion/lib/advanced/options/boolean.d.ts","../../../node_modules/.pnpm/clipanion@3.2.1_typanion@3.13.0/node_modules/clipanion/lib/advanced/options/counter.d.ts","../../../node_modules/.pnpm/clipanion@3.2.1_typanion@3.13.0/node_modules/clipanion/lib/advanced/options/proxy.d.ts","../../../node_modules/.pnpm/clipanion@3.2.1_typanion@3.13.0/node_modules/clipanion/lib/advanced/options/rest.d.ts","../../../node_modules/.pnpm/clipanion@3.2.1_typanion@3.13.0/node_modules/clipanion/lib/advanced/options/string.d.ts","../../../node_modules/.pnpm/clipanion@3.2.1_typanion@3.13.0/node_modules/clipanion/lib/advanced/options/index.d.ts","../../../node_modules/.pnpm/clipanion@3.2.1_typanion@3.13.0/node_modules/clipanion/lib/advanced/index.d.ts","../package.json","../../../node_modules/.pnpm/prettier@3.0.1/node_modules/prettier/doc.d.ts","../../../node_modules/.pnpm/prettier@3.0.1/node_modules/prettier/index.d.ts","../../ntypes/build/core.d.ts","../../ntypes/build/block.d.ts","../../ntypes/build/formula.d.ts","../../ntypes/build/user.d.ts","../../ntypes/build/collection.d.ts","../../ntypes/build/collection-view.d.ts","../../ntypes/build/maps.d.ts","../../ntypes/build/api.d.ts","../../ntypes/build/index.d.ts","../../nclient/build/index.d.ts","../../../node_modules/.pnpm/is-url-superb@6.1.0/node_modules/is-url-superb/index.d.ts","../../nutils/build/index.d.ts","../src/notion.ts","../src/main.ts","../src/types.ts"],"fileInfos":[{"version":"f59215c5f1d886b05395ee7aca73e0ac69ddfad2843aa88530e797879d511bad","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","dc48272d7c333ccf58034c0026162576b7d50ea0e69c3b9292f803fc20720fd5","27147504487dc1159369da4f4da8a26406364624fa9bc3db632f7d94a5bae2c3","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc","f4e736d6c8d69ae5b3ab0ddfcaa3dc365c3e76909d6660af5b4e979b3934ac20","eeeb3aca31fbadef8b82502484499dfd1757204799a6f5b33116201c810676ec",{"version":"3dda5344576193a4ae48b8d03f105c86f20b2f2aff0a1d1fd7935f5d68649654","affectsGlobalScope":true},{"version":"9d9885c728913c1d16e0d2831b40341d6ad9a0ceecaabc55209b306ad9c736a5","affectsGlobalScope":true},{"version":"17bea081b9c0541f39dd1ae9bc8c78bdd561879a682e60e2f25f688c0ecab248","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"ab22100fdd0d24cfc2cc59d0a00fc8cf449830d9c4030dc54390a46bd562e929","affectsGlobalScope":true},{"version":"f7bd636ae3a4623c503359ada74510c4005df5b36de7f23e1db8a5c543fd176b","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"0c20f4d2358eb679e4ae8a4432bdd96c857a2960fd6800b21ec4008ec59d60ea","affectsGlobalScope":true},{"version":"36ae84ccc0633f7c0787bc6108386c8b773e95d3b052d9464a99cd9b8795fbec","affectsGlobalScope":true},{"version":"82d0d8e269b9eeac02c3bd1c9e884e85d483fcb2cd168bccd6bc54df663da031","affectsGlobalScope":true},{"version":"b8deab98702588840be73d67f02412a2d45a417a3c097b2e96f7f3a42ac483d1","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"376d554d042fb409cb55b5cbaf0b2b4b7e669619493c5d18d5fa8bd67273f82a","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"c4138a3dd7cd6cf1f363ca0f905554e8d81b45844feea17786cdf1626cb8ea06","affectsGlobalScope":true},{"version":"6ff3e2452b055d8f0ec026511c6582b55d935675af67cdb67dd1dc671e8065df","affectsGlobalScope":true},{"version":"03de17b810f426a2f47396b0b99b53a82c1b60e9cba7a7edda47f9bb077882f4","affectsGlobalScope":true},{"version":"8184c6ddf48f0c98429326b428478ecc6143c27f79b79e85740f17e6feb090f1","affectsGlobalScope":true},{"version":"261c4d2cf86ac5a89ad3fb3fafed74cbb6f2f7c1d139b0540933df567d64a6ca","affectsGlobalScope":true},{"version":"6af1425e9973f4924fca986636ac19a0cf9909a7e0d9d3009c349e6244e957b6","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"15a630d6817718a2ddd7088c4f83e4673fde19fa992d2eae2cf51132a302a5d3","affectsGlobalScope":true},{"version":"f06948deb2a51aae25184561c9640fb66afeddb34531a9212d011792b1d19e0a","affectsGlobalScope":true},{"version":"01e0ee7e1f661acedb08b51f8a9b7d7f959e9cdb6441360f06522cc3aea1bf2e","affectsGlobalScope":true},{"version":"ac17a97f816d53d9dd79b0d235e1c0ed54a8cc6a0677e9a3d61efb480b2a3e4e","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"9cc66b0513ad41cb5f5372cca86ef83a0d37d1c1017580b7dace3ea5661836df","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"709efdae0cb5df5f49376cde61daacc95cdd44ae4671da13a540da5088bf3f30","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"61ed9b6d07af959e745fb11f9593ecd743b279418cc8a99448ea3cd5f3b3eb22","affectsGlobalScope":true},{"version":"038a2f66a34ee7a9c2fbc3584c8ab43dff2995f8c68e3f566f4c300d2175e31e","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"f5c92f2c27b06c1a41b88f6db8299205aee52c2a2943f7ed29bd585977f254e8","affectsGlobalScope":true},{"version":"930b0e15811f84e203d3c23508674d5ded88266df4b10abee7b31b2ac77632d2","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"b9ea5778ff8b50d7c04c9890170db34c26a5358cccba36844fe319f50a43a61a","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"50d53ccd31f6667aff66e3d62adf948879a3a16f05d89882d1188084ee415bbc","affectsGlobalScope":true},{"version":"25de46552b782d43cb7284df22fe2a265de387cf0248b747a7a1b647d81861f6","affectsGlobalScope":true},{"version":"307c8b7ebbd7f23a92b73a4c6c0a697beca05b06b036c23a34553e5fe65e4fdc","affectsGlobalScope":true},{"version":"189c0703923150aa30673fa3de411346d727cc44a11c75d05d7cf9ef095daa22","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},"7fe869c60b17b972a0eb9423e8a50bd9796508be7cc7181758ecd649be30f56c","bad1f77bb946699281dc049ae841bc65231029b17ca2bf54fcb3c6afcbf06ec5","d06898a1601eb860aae768ffd0c288ff715bd4e1ed098bd29745308f4338b6d4","2854948cbc0bbf90a24216de4abaa6bcc9c5149049c648e9f3750e59f1e6853b","9b4b572caf9a82cd34b62baacdf31ff030c6fa307f174810240216d9cfcf8580","647ddde02a14904825d0f92904254c98f3cfa6946a61f1f519b1f9aa3595ce33","ba8691cf6bea9d53e6bf6cbc22af964a9633a21793981a1be3dce65e7a714d8b","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"bce910d9164785c9f0d4dcea4be359f5f92130c7c7833dea6138ab1db310a1f9","affectsGlobalScope":true},"7d2e3fea24c712c99c03ad8f556abedbfe105f87f1be10b95dbd409d24bc05a3",{"version":"7c387a02bf156d8d45667134d32518ac3ca1b99ca50ca9deff2c1a03eb6d1a81","affectsGlobalScope":true},"3719525a8f6ab731e3dfd585d9f87df55ec7d50d461df84f74eb4d68bb165244","f993522fd7d01ae1ead930091fe35130b8415720d6c2123dc2a7e8eb11bb3cba",{"version":"d5135ad93b33adcce80b18f8065087934cdc1730d63db58562edcf017e1aad9b","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","b787b5b54349a24f07d089b612a9fb8ff024dbbe991ff52ea2b188a6b1230644","bb9c4ffa5e6290c6980b63c815cdd1625876dadb2efaf77edbe82984be93e55e","1cdcfc1f624d6c08aa12c73935f6e13f095919cd99edf95752951796eb225729","df6d4b6ba1e64f682091862faa30104e93891f9e7202d006bf5e7a88ab4a0dbe","14b5aa23c5d0ae1907bc696ac7b6915d88f7d85799cc0dc2dcf98fbce2c5a67c","5c439dafdc09abe4d6c260a96b822fa0ba5be7203c71a63ab1f1423cd9e838ea",{"version":"6b526a5ec4a401ca7c26cfe6a48e641d8f30af76673bad3b06a1b4504594a960","affectsGlobalScope":true},{"version":"c2fcbd6fad600e96fee8c5df1a62e908d477f5b47a9374b2bab7e74f52cfcc92","affectsGlobalScope":true},"5e3f2470ce8038c4005ff1baff18a69848383f431d6817d453e70d66e037f4a2","cc68e79b99f80e4dfd01967ec96be69efb0ff5bd7f779d9a2cc09dfe590ffd28","91d3d8f536f22dcaeeace0fc6f3544d3562e266a27cf3a2fe280b8051af5d006","9503113febdd737095465792cc074d541902c82c0aea3922f940de18784812ad","8d3c583a07e0c37e876908c2d5da575019f689df8d9fa4c081d99119d53dba22","2c828a5405191d006115ab34e191b8474bc6c86ffdc401d1a9864b1b6e088a58",{"version":"e630e5528e899219ae319e83bef54bf3bcb91b01d76861ecf881e8e614b167f0","affectsGlobalScope":true},"bcebb922784739bdb34c18ee51095d25a92b560c78ccd2eaacd6bd00f7443d83","7ee6ed878c4528215c82b664fe0cfe80e8b4da6c0d4cc80869367868774db8b1","b0973c3cbcdc59b37bf477731d468696ecaf442593ec51bab497a613a580fe30",{"version":"4989e92ba5b69b182d2caaea6295af52b7dc73a4f7a2e336a676722884e7139d","affectsGlobalScope":true},{"version":"0715e4cd28ad471b2a93f3e552ff51a3ae423417a01a10aa1d3bc7c6b95059d6","affectsGlobalScope":true},"5153a2fd150e46ce57bb3f8db1318d33f6ad3261ed70ceeff92281c0608c74a3","210d54cd652ec0fec8c8916e4af59bb341065576ecda039842f9ffb2e908507c","36b03690b628eab08703d63f04eaa89c5df202e5f1edf3989f13ad389cd2c091","0effadd232a20498b11308058e334d3339cc5bf8c4c858393e38d9d4c0013dcf","25846d43937c672bab7e8195f3d881f93495df712ee901860effc109918938cc","ff1bad1849903b15fba47f3c29bdec5f97324874c93933a89b2bca28a23977fb","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff","69ee23dd0d215b09907ad30d23f88b7790c93329d1faf31d7835552a10cf7cbf","44b8b584a338b190a59f4f6929d072431950c7bd92ec2694821c11bce180c8a5","23b89798789dffbd437c0c423f5d02d11f9736aea73d6abf16db4f812ff36eda",{"version":"d9b4afd96c3c0ff70e90d05ef022e582b102e665e9029d34940472dc3058360e","affectsGlobalScope":true},{"version":"3c4ba1dd9b12ffa284b565063108f2f031d150ea15b8fafbdc17f5d2a07251f3","affectsGlobalScope":true},"e10177274a35a9d07c825615340b2fcde2f610f53f3fb40269fd196b4288dda6","1422cd9e705adcc09088fda85a900c2b70e3ad36ea85846f68bd1a884cdf4e2b","3c13ef48634e7b5012fcf7e8fce7496352c2d779a7201389ca96a2a81ee4314d","5d0a25ec910fa36595f85a67ac992d7a53dd4064a1ba6aea1c9f14ab73a023f2",{"version":"22d7b95cb63dead43834ae20ee492c9c8b6d90db3957d21665199f0efb1d3e26","affectsGlobalScope":true},{"version":"a9fc1469744055a3435f203123246b96c094e7ff8c4e1c3863829d9b705b7a34","affectsGlobalScope":true},"868831cab82b65dfe1d68180e898af1f2101e89ba9b754d1db6fb8cc2fac1921","0fe8985a28f82c450a04a6edf1279d7181c0893f37da7d2a27f8efd4fd5edb03","e59a892d87e72733e2a9ca21611b9beb52977be2696c7ba4b216cbbb9a48f5aa",{"version":"52120bb7e4583612225bdf08e7c12559548170f11e660d33a33623bae9bbdbba","affectsGlobalScope":true},"8a300fa9b698845a1f9c41ecbe2c5966634582a8e2020d51abcace9b55aa959e",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"d5be4343a9ace4611f04a6fffd91ceba91265fa15bfb0149306e0a6963e1a015","056e650abd76f4f163b63d28caa4a21ce6b8ac69d8717987a7861724499fa66a","8eb83d1ad044634c54c3de70ac76e596ae48ec0ed0800797211fbfe7d9bc94de","df0e93ded7e580b27eb3bfea87dffc49a823ea74ef6c625938cb8f5298e1bd57","c44308d3424b3d85a342c7f59eee52a7d2807859692c0e89e4373e88d5895743","7fdfb1d630e3baa80e994518127a8a60f298a0dd783824f50797e3d88213af94","bf78879e6f7417cc8b3ba859dbe762d9f1f64fead4183a85c8a998e156377bcb","079bf77582cfa769546f060b373cbe4bac74627c240bcf07f0b571c29c1c7269","dcd687115f7836cab01c44b1a3678422533adb6e8e255d046850a9b998ca953d","95046f08a9e3860e531bae878947f04cf91aade9ca8dae60f962aff85b892eeb","7ea8ac0a5b4461e346fe937ff19841c66bcf3121205de8d1b2a5d0a31f3b28eb","d9b36f58f094c4095818a4b5cf8dc8b6f3ac7d38fc3bafc871494e3c4d586551","5af4f0c77e82183dc512690283cc80a2b59370083a60ed75174a516b921452fc","5581450c9bfffa56208fa69ce62ea33c8671fa34cfdc1eeb262ec7ebf0b5cbf7","977997bf4efd7fc8d5b4a78f9474395315189d8d9d92a8280cb35babe0885534","dc9f4778bd2d16df16c101704eee59112818857cf58ecb59417633abca828ff0","fca70e3e8f1b91b6462c3d22546de7f79acd9fd7eee9b638f7f4bd348c851bd2","fb4113fc41b555bb1aa01fb17c66da9be37b734c5b4c4e244f70d7ecb0b7e5c0","cec053867ca5fba9e8e966de9bb9e7ad077a9f018175e20de473bf81cdc0b8ff",{"version":"ca775d29ac90277cffd8b0a1698eea580cd583ac577505dc510a3d84360a9b4c","signature":"177aed588384455949e5cbd37c161a9eb3766ed50ff898777ea4405ec6b57186"},"f0c4df2546dafc3b77d9c428453495f694171c36b48fb098e0e333f47ab1339f","5d7b6cc4df7683915a6fb125cb2fd4364245e2dad4bdd93298e250b2bf9c9b7d","d5a33c52d381fc00f5842490ffcf406e0f5b9dd801b016fadcb232bb4d347fdf","4673a6e2546f15b6c9664f9c360d74e79650dc9cb072a03a21b4690a1c236fb9","57aa4c028ae9d74d0908fd24563ccf6ce4ad3ec4b836fcbd69974adce60eb895","6b7f1146fc9396911257b68198cc560795f80945865d67657f30287affb516b7","b7061fe1870bdbe7145d836fedf1d04925de95c56128dbbf6e8fd2f7012618b5","b4e975657af1b37e99cac0753713e6425a16a7725790542838e9d48b0dd836b4","af7948154230b42e85802e14fbcf6b58e9fe15409178639f96be3c6990335f08","b798a298a669d510455b1c9fb6ae952333edaba0dae2672be9edd84aea4d600d","6679e3cd2e955ed99d12909354ed55974c4f8ec3844797bd933f1fcca74a3f7e","c4d1a62161ff087b163b16390ccdc8fb7462cda11d108bd62b4ac219bc73319e","a87e5902fd92d16a80e0020ac03d6477bc2e7a6f5b0407a73aff6b7aa9e01d55","c9d38c0a592e7132715ef2abc7b2a90dcbf32fd7e46325a916f7a4f8f1b275b8",{"version":"ad6f8cca6dfdbce5647dcec5280b4ab8f82813452f5aeb40aab8896709f1fd07","signature":"32efdc569c191830d30c907f9a75f294ffd4e31019d715781a4b583d665172a9"},{"version":"2287f190ac4b30e260de5c7663e8e6eaf246655a0b71986a28675142f7623c63","signature":"da032106e86bb4529cc130ccdb75b1390f8e407d67042bdb0d16b8da77864ff0"},{"version":"54ff28ab10d1009897fa679ac9d187b36a4f91a66884e2e8ff934fa10ad1af82","signature":"6b778ed1cb4e6fa6819fb87a868712a53d64385160925ee48431cf3b29854d3b"}],"root":[[154,156]],"options":{"declaration":true,"declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":true,"module":99,"noEmitOnError":true,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"..","sourceMap":true,"strict":false,"target":2,"tsBuildInfoFile":"./.tsbuildinfo"},"fileIdsList":[[67,113],[70,113],[71,76,104,113],[72,83,84,91,101,112,113],[72,73,83,91,113],[74,113],[75,76,84,92,113],[76,101,109,113],[77,79,83,91,113],[78,113],[79,80,113],[83,113],[81,83,113],[83,84,85,101,112,113],[83,84,85,98,101,104,113],[113,117],[113],[79,83,86,91,101,112,113],[83,84,86,87,91,101,109,112,113],[86,88,101,109,112,113],[67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119],[83,89,113],[90,112,113],[79,83,91,101,113],[92,113],[93,113],[70,94,113],[95,111,113,117],[96,113],[97,113],[83,98,99,113],[98,100,113,115],[71,83,101,102,103,104,113],[71,101,103,113],[101,102,113],[104,113],[105,113],[101,113],[83,107,108,113],[107,108,113],[76,91,101,109,113],[110,113],[91,111,113],[71,86,97,112,113],[76,113],[101,113,114],[113,115],[113,116],[71,76,83,85,94,101,112,113,115,117],[101,113,118],[113,126],[113,127,128,129],[101,113,120,121,122,124,126],[66,113,124,125],[113,122,123,125,126,130,137],[66,113,124],[113,124],[113,124,131,132,133,134,135,136],[66,113,121,123,125],[113,140],[61,62,63,64,65,113],[61,113],[113,138,139,154],[85,93,113,138,141,150,151,153],[113,150],[113,148],[113,142],[113,142,144],[113,142,143,144,145,146,147,148,149],[113,142,143,145,146,147],[113,150,152],[154],[138,150,151]],"referencedMap":[[67,1],[68,1],[70,2],[71,3],[72,4],[73,5],[74,6],[75,7],[76,8],[77,9],[78,10],[79,11],[80,11],[82,12],[81,13],[83,12],[84,14],[85,15],[69,16],[119,17],[86,18],[87,19],[88,20],[120,21],[89,22],[90,23],[91,24],[92,25],[93,26],[94,27],[95,28],[96,29],[97,30],[98,31],[99,31],[100,32],[101,33],[103,34],[102,35],[104,36],[105,37],[106,38],[107,39],[108,40],[109,41],[110,42],[111,43],[112,44],[113,45],[114,46],[115,47],[116,48],[117,49],[118,50],[127,51],[128,51],[130,52],[129,51],[125,53],[126,54],[138,55],[131,56],[132,57],[133,57],[137,58],[134,17],[135,17],[136,56],[124,59],[121,17],[123,17],[122,17],[152,17],[140,17],[141,60],[66,61],[62,62],[64,62],[63,62],[65,62],[61,17],[59,17],[60,17],[12,17],[14,17],[13,17],[2,17],[15,17],[16,17],[17,17],[18,17],[19,17],[20,17],[21,17],[22,17],[3,17],[4,17],[26,17],[23,17],[24,17],[25,17],[27,17],[28,17],[29,17],[5,17],[30,17],[31,17],[32,17],[33,17],[6,17],[37,17],[34,17],[35,17],[36,17],[38,17],[7,17],[39,17],[44,17],[45,17],[40,17],[41,17],[42,17],[43,17],[8,17],[49,17],[46,17],[47,17],[48,17],[50,17],[9,17],[51,17],[52,17],[53,17],[56,17],[54,17],[55,17],[57,17],[10,17],[1,17],[11,17],[58,17],[139,17],[155,63],[154,64],[156,17],[151,65],[149,66],[143,67],[147,67],[146,68],[142,17],[144,67],[150,69],[148,70],[145,67],[153,71]],"exportedModulesMap":[[67,1],[68,1],[70,2],[71,3],[72,4],[73,5],[74,6],[75,7],[76,8],[77,9],[78,10],[79,11],[80,11],[82,12],[81,13],[83,12],[84,14],[85,15],[69,16],[119,17],[86,18],[87,19],[88,20],[120,21],[89,22],[90,23],[91,24],[92,25],[93,26],[94,27],[95,28],[96,29],[97,30],[98,31],[99,31],[100,32],[101,33],[103,34],[102,35],[104,36],[105,37],[106,38],[107,39],[108,40],[109,41],[110,42],[111,43],[112,44],[113,45],[114,46],[115,47],[116,48],[117,49],[118,50],[127,51],[128,51],[130,52],[129,51],[125,53],[126,54],[138,55],[131,56],[132,57],[133,57],[137,58],[134,17],[135,17],[136,56],[124,59],[121,17],[123,17],[122,17],[152,17],[140,17],[141,60],[66,61],[62,62],[64,62],[63,62],[65,62],[61,17],[59,17],[60,17],[12,17],[14,17],[13,17],[2,17],[15,17],[16,17],[17,17],[18,17],[19,17],[20,17],[21,17],[22,17],[3,17],[4,17],[26,17],[23,17],[24,17],[25,17],[27,17],[28,17],[29,17],[5,17],[30,17],[31,17],[32,17],[33,17],[6,17],[37,17],[34,17],[35,17],[36,17],[38,17],[7,17],[39,17],[44,17],[45,17],[40,17],[41,17],[42,17],[43,17],[8,17],[49,17],[46,17],[47,17],[48,17],[50,17],[9,17],[51,17],[52,17],[53,17],[56,17],[54,17],[55,17],[57,17],[10,17],[1,17],[11,17],[58,17],[155,72],[154,73],[151,65],[149,66],[143,67],[147,67],[146,68],[142,17],[144,67],[150,69],[148,70],[145,67],[153,71]],"semanticDiagnosticsPerFile":[67,68,70,71,72,73,74,75,76,77,78,79,80,82,81,83,84,85,69,119,86,87,88,120,89,90,91,92,93,94,95,96,97,98,99,100,101,103,102,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,127,128,130,129,125,126,138,131,132,133,137,134,135,136,124,121,123,122,152,140,141,66,62,64,63,65,61,59,60,12,14,13,2,15,16,17,18,19,20,21,22,3,4,26,23,24,25,27,28,29,5,30,31,32,33,6,37,34,35,36,38,7,39,44,45,40,41,42,43,8,49,46,47,48,50,9,51,52,53,56,54,55,57,10,1,11,58,139,155,154,156,151,149,143,147,146,142,144,150,148,145,153]},"version":"5.1.6"}
1
+ {"program":{"fileNames":["../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2022.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2023.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.esnext.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2022.array.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2022.error.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2022.object.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2022.string.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es2023.array.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../node_modules/.pnpm/typanion@3.13.0/node_modules/typanion/lib/types.d.ts","../../../node_modules/.pnpm/typanion@3.13.0/node_modules/typanion/lib/predicates/cascadingpredicates.d.ts","../../../node_modules/.pnpm/typanion@3.13.0/node_modules/typanion/lib/predicates/typepredicates.d.ts","../../../node_modules/.pnpm/typanion@3.13.0/node_modules/typanion/lib/predicates/helperpredicates.d.ts","../../../node_modules/.pnpm/typanion@3.13.0/node_modules/typanion/lib/tools.d.ts","../../../node_modules/.pnpm/typanion@3.13.0/node_modules/typanion/lib/index.d.ts","../../../node_modules/.pnpm/@types+node@18.17.4/node_modules/@types/node/assert.d.ts","../../../node_modules/.pnpm/@types+node@18.17.4/node_modules/@types/node/assert/strict.d.ts","../../../node_modules/.pnpm/@types+node@18.17.4/node_modules/@types/node/globals.d.ts","../../../node_modules/.pnpm/@types+node@18.17.4/node_modules/@types/node/async_hooks.d.ts","../../../node_modules/.pnpm/@types+node@18.17.4/node_modules/@types/node/buffer.d.ts","../../../node_modules/.pnpm/@types+node@18.17.4/node_modules/@types/node/child_process.d.ts","../../../node_modules/.pnpm/@types+node@18.17.4/node_modules/@types/node/cluster.d.ts","../../../node_modules/.pnpm/@types+node@18.17.4/node_modules/@types/node/console.d.ts","../../../node_modules/.pnpm/@types+node@18.17.4/node_modules/@types/node/constants.d.ts","../../../node_modules/.pnpm/@types+node@18.17.4/node_modules/@types/node/crypto.d.ts","../../../node_modules/.pnpm/@types+node@18.17.4/node_modules/@types/node/dgram.d.ts","../../../node_modules/.pnpm/@types+node@18.17.4/node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/.pnpm/@types+node@18.17.4/node_modules/@types/node/dns.d.ts","../../../node_modules/.pnpm/@types+node@18.17.4/node_modules/@types/node/dns/promises.d.ts","../../../node_modules/.pnpm/@types+node@18.17.4/node_modules/@types/node/domain.d.ts","../../../node_modules/.pnpm/@types+node@18.17.4/node_modules/@types/node/dom-events.d.ts","../../../node_modules/.pnpm/@types+node@18.17.4/node_modules/@types/node/events.d.ts","../../../node_modules/.pnpm/@types+node@18.17.4/node_modules/@types/node/fs.d.ts","../../../node_modules/.pnpm/@types+node@18.17.4/node_modules/@types/node/fs/promises.d.ts","../../../node_modules/.pnpm/@types+node@18.17.4/node_modules/@types/node/http.d.ts","../../../node_modules/.pnpm/@types+node@18.17.4/node_modules/@types/node/http2.d.ts","../../../node_modules/.pnpm/@types+node@18.17.4/node_modules/@types/node/https.d.ts","../../../node_modules/.pnpm/@types+node@18.17.4/node_modules/@types/node/inspector.d.ts","../../../node_modules/.pnpm/@types+node@18.17.4/node_modules/@types/node/module.d.ts","../../../node_modules/.pnpm/@types+node@18.17.4/node_modules/@types/node/net.d.ts","../../../node_modules/.pnpm/@types+node@18.17.4/node_modules/@types/node/os.d.ts","../../../node_modules/.pnpm/@types+node@18.17.4/node_modules/@types/node/path.d.ts","../../../node_modules/.pnpm/@types+node@18.17.4/node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/.pnpm/@types+node@18.17.4/node_modules/@types/node/process.d.ts","../../../node_modules/.pnpm/@types+node@18.17.4/node_modules/@types/node/punycode.d.ts","../../../node_modules/.pnpm/@types+node@18.17.4/node_modules/@types/node/querystring.d.ts","../../../node_modules/.pnpm/@types+node@18.17.4/node_modules/@types/node/readline.d.ts","../../../node_modules/.pnpm/@types+node@18.17.4/node_modules/@types/node/readline/promises.d.ts","../../../node_modules/.pnpm/@types+node@18.17.4/node_modules/@types/node/repl.d.ts","../../../node_modules/.pnpm/@types+node@18.17.4/node_modules/@types/node/stream.d.ts","../../../node_modules/.pnpm/@types+node@18.17.4/node_modules/@types/node/stream/promises.d.ts","../../../node_modules/.pnpm/@types+node@18.17.4/node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/.pnpm/@types+node@18.17.4/node_modules/@types/node/stream/web.d.ts","../../../node_modules/.pnpm/@types+node@18.17.4/node_modules/@types/node/string_decoder.d.ts","../../../node_modules/.pnpm/@types+node@18.17.4/node_modules/@types/node/test.d.ts","../../../node_modules/.pnpm/@types+node@18.17.4/node_modules/@types/node/timers.d.ts","../../../node_modules/.pnpm/@types+node@18.17.4/node_modules/@types/node/timers/promises.d.ts","../../../node_modules/.pnpm/@types+node@18.17.4/node_modules/@types/node/tls.d.ts","../../../node_modules/.pnpm/@types+node@18.17.4/node_modules/@types/node/trace_events.d.ts","../../../node_modules/.pnpm/@types+node@18.17.4/node_modules/@types/node/tty.d.ts","../../../node_modules/.pnpm/@types+node@18.17.4/node_modules/@types/node/url.d.ts","../../../node_modules/.pnpm/@types+node@18.17.4/node_modules/@types/node/util.d.ts","../../../node_modules/.pnpm/@types+node@18.17.4/node_modules/@types/node/v8.d.ts","../../../node_modules/.pnpm/@types+node@18.17.4/node_modules/@types/node/vm.d.ts","../../../node_modules/.pnpm/@types+node@18.17.4/node_modules/@types/node/wasi.d.ts","../../../node_modules/.pnpm/@types+node@18.17.4/node_modules/@types/node/worker_threads.d.ts","../../../node_modules/.pnpm/@types+node@18.17.4/node_modules/@types/node/zlib.d.ts","../../../node_modules/.pnpm/@types+node@18.17.4/node_modules/@types/node/globals.global.d.ts","../../../node_modules/.pnpm/@types+node@18.17.4/node_modules/@types/node/index.d.ts","../../../node_modules/.pnpm/clipanion@3.2.1_typanion@3.13.0/node_modules/clipanion/lib/core.d.ts","../../../node_modules/.pnpm/clipanion@3.2.1_typanion@3.13.0/node_modules/clipanion/lib/format.d.ts","../../../node_modules/.pnpm/clipanion@3.2.1_typanion@3.13.0/node_modules/clipanion/lib/errors.d.ts","../../../node_modules/.pnpm/clipanion@3.2.1_typanion@3.13.0/node_modules/clipanion/lib/advanced/options/utils.d.ts","../../../node_modules/.pnpm/clipanion@3.2.1_typanion@3.13.0/node_modules/clipanion/lib/advanced/cli.d.ts","../../../node_modules/.pnpm/clipanion@3.2.1_typanion@3.13.0/node_modules/clipanion/lib/advanced/command.d.ts","../../../node_modules/.pnpm/clipanion@3.2.1_typanion@3.13.0/node_modules/clipanion/lib/advanced/builtins/definitions.d.ts","../../../node_modules/.pnpm/clipanion@3.2.1_typanion@3.13.0/node_modules/clipanion/lib/advanced/builtins/help.d.ts","../../../node_modules/.pnpm/clipanion@3.2.1_typanion@3.13.0/node_modules/clipanion/lib/advanced/builtins/version.d.ts","../../../node_modules/.pnpm/clipanion@3.2.1_typanion@3.13.0/node_modules/clipanion/lib/advanced/builtins/index.d.ts","../../../node_modules/.pnpm/clipanion@3.2.1_typanion@3.13.0/node_modules/clipanion/lib/advanced/options/array.d.ts","../../../node_modules/.pnpm/clipanion@3.2.1_typanion@3.13.0/node_modules/clipanion/lib/advanced/options/boolean.d.ts","../../../node_modules/.pnpm/clipanion@3.2.1_typanion@3.13.0/node_modules/clipanion/lib/advanced/options/counter.d.ts","../../../node_modules/.pnpm/clipanion@3.2.1_typanion@3.13.0/node_modules/clipanion/lib/advanced/options/proxy.d.ts","../../../node_modules/.pnpm/clipanion@3.2.1_typanion@3.13.0/node_modules/clipanion/lib/advanced/options/rest.d.ts","../../../node_modules/.pnpm/clipanion@3.2.1_typanion@3.13.0/node_modules/clipanion/lib/advanced/options/string.d.ts","../../../node_modules/.pnpm/clipanion@3.2.1_typanion@3.13.0/node_modules/clipanion/lib/advanced/options/index.d.ts","../../../node_modules/.pnpm/clipanion@3.2.1_typanion@3.13.0/node_modules/clipanion/lib/advanced/index.d.ts","../package.json","../../../node_modules/.pnpm/@types+jsonstream@0.8.31/node_modules/@types/jsonstream/index.d.ts","../../../node_modules/.pnpm/@types+graceful-fs@4.1.6/node_modules/@types/graceful-fs/index.d.ts","../../../node_modules/.pnpm/prettier@3.0.1/node_modules/prettier/doc.d.ts","../../../node_modules/.pnpm/prettier@3.0.1/node_modules/prettier/index.d.ts","../../ntypes/build/core.d.ts","../../ntypes/build/block.d.ts","../../ntypes/build/formula.d.ts","../../ntypes/build/user.d.ts","../../ntypes/build/collection.d.ts","../../ntypes/build/collection-view.d.ts","../../ntypes/build/space.d.ts","../../ntypes/build/maps.d.ts","../../ntypes/build/api.d.ts","../../ntypes/build/index.d.ts","../../nclient/build/index.d.ts","../../../node_modules/.pnpm/is-url-superb@6.1.0/node_modules/is-url-superb/index.d.ts","../../nutils/build/index.d.ts","../src/notion/index.ts","../src/notion/export.ts","../src/main.ts","../src/types.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/fs.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/util.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/index.d.ts","../../../node_modules/.pnpm/@types+node@18.17.1/node_modules/@types/node/stream.d.ts"],"fileInfos":[{"version":"f59215c5f1d886b05395ee7aca73e0ac69ddfad2843aa88530e797879d511bad","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","dc48272d7c333ccf58034c0026162576b7d50ea0e69c3b9292f803fc20720fd5","27147504487dc1159369da4f4da8a26406364624fa9bc3db632f7d94a5bae2c3","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc","f4e736d6c8d69ae5b3ab0ddfcaa3dc365c3e76909d6660af5b4e979b3934ac20","eeeb3aca31fbadef8b82502484499dfd1757204799a6f5b33116201c810676ec",{"version":"3dda5344576193a4ae48b8d03f105c86f20b2f2aff0a1d1fd7935f5d68649654","affectsGlobalScope":true},{"version":"9d9885c728913c1d16e0d2831b40341d6ad9a0ceecaabc55209b306ad9c736a5","affectsGlobalScope":true},{"version":"17bea081b9c0541f39dd1ae9bc8c78bdd561879a682e60e2f25f688c0ecab248","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"ab22100fdd0d24cfc2cc59d0a00fc8cf449830d9c4030dc54390a46bd562e929","affectsGlobalScope":true},{"version":"f7bd636ae3a4623c503359ada74510c4005df5b36de7f23e1db8a5c543fd176b","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"0c20f4d2358eb679e4ae8a4432bdd96c857a2960fd6800b21ec4008ec59d60ea","affectsGlobalScope":true},{"version":"36ae84ccc0633f7c0787bc6108386c8b773e95d3b052d9464a99cd9b8795fbec","affectsGlobalScope":true},{"version":"82d0d8e269b9eeac02c3bd1c9e884e85d483fcb2cd168bccd6bc54df663da031","affectsGlobalScope":true},{"version":"b8deab98702588840be73d67f02412a2d45a417a3c097b2e96f7f3a42ac483d1","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"376d554d042fb409cb55b5cbaf0b2b4b7e669619493c5d18d5fa8bd67273f82a","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"c4138a3dd7cd6cf1f363ca0f905554e8d81b45844feea17786cdf1626cb8ea06","affectsGlobalScope":true},{"version":"6ff3e2452b055d8f0ec026511c6582b55d935675af67cdb67dd1dc671e8065df","affectsGlobalScope":true},{"version":"03de17b810f426a2f47396b0b99b53a82c1b60e9cba7a7edda47f9bb077882f4","affectsGlobalScope":true},{"version":"8184c6ddf48f0c98429326b428478ecc6143c27f79b79e85740f17e6feb090f1","affectsGlobalScope":true},{"version":"261c4d2cf86ac5a89ad3fb3fafed74cbb6f2f7c1d139b0540933df567d64a6ca","affectsGlobalScope":true},{"version":"6af1425e9973f4924fca986636ac19a0cf9909a7e0d9d3009c349e6244e957b6","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"15a630d6817718a2ddd7088c4f83e4673fde19fa992d2eae2cf51132a302a5d3","affectsGlobalScope":true},{"version":"f06948deb2a51aae25184561c9640fb66afeddb34531a9212d011792b1d19e0a","affectsGlobalScope":true},{"version":"01e0ee7e1f661acedb08b51f8a9b7d7f959e9cdb6441360f06522cc3aea1bf2e","affectsGlobalScope":true},{"version":"ac17a97f816d53d9dd79b0d235e1c0ed54a8cc6a0677e9a3d61efb480b2a3e4e","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"9cc66b0513ad41cb5f5372cca86ef83a0d37d1c1017580b7dace3ea5661836df","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"709efdae0cb5df5f49376cde61daacc95cdd44ae4671da13a540da5088bf3f30","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"61ed9b6d07af959e745fb11f9593ecd743b279418cc8a99448ea3cd5f3b3eb22","affectsGlobalScope":true},{"version":"038a2f66a34ee7a9c2fbc3584c8ab43dff2995f8c68e3f566f4c300d2175e31e","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"f5c92f2c27b06c1a41b88f6db8299205aee52c2a2943f7ed29bd585977f254e8","affectsGlobalScope":true},{"version":"930b0e15811f84e203d3c23508674d5ded88266df4b10abee7b31b2ac77632d2","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"b9ea5778ff8b50d7c04c9890170db34c26a5358cccba36844fe319f50a43a61a","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"50d53ccd31f6667aff66e3d62adf948879a3a16f05d89882d1188084ee415bbc","affectsGlobalScope":true},{"version":"25de46552b782d43cb7284df22fe2a265de387cf0248b747a7a1b647d81861f6","affectsGlobalScope":true},{"version":"307c8b7ebbd7f23a92b73a4c6c0a697beca05b06b036c23a34553e5fe65e4fdc","affectsGlobalScope":true},{"version":"189c0703923150aa30673fa3de411346d727cc44a11c75d05d7cf9ef095daa22","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},"7fe869c60b17b972a0eb9423e8a50bd9796508be7cc7181758ecd649be30f56c","bad1f77bb946699281dc049ae841bc65231029b17ca2bf54fcb3c6afcbf06ec5","d06898a1601eb860aae768ffd0c288ff715bd4e1ed098bd29745308f4338b6d4","2854948cbc0bbf90a24216de4abaa6bcc9c5149049c648e9f3750e59f1e6853b","9b4b572caf9a82cd34b62baacdf31ff030c6fa307f174810240216d9cfcf8580","647ddde02a14904825d0f92904254c98f3cfa6946a61f1f519b1f9aa3595ce33","ba8691cf6bea9d53e6bf6cbc22af964a9633a21793981a1be3dce65e7a714d8b","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"bce910d9164785c9f0d4dcea4be359f5f92130c7c7833dea6138ab1db310a1f9","affectsGlobalScope":true},"7d2e3fea24c712c99c03ad8f556abedbfe105f87f1be10b95dbd409d24bc05a3",{"version":"7c387a02bf156d8d45667134d32518ac3ca1b99ca50ca9deff2c1a03eb6d1a81","affectsGlobalScope":true},"3719525a8f6ab731e3dfd585d9f87df55ec7d50d461df84f74eb4d68bb165244","f993522fd7d01ae1ead930091fe35130b8415720d6c2123dc2a7e8eb11bb3cba",{"version":"d5135ad93b33adcce80b18f8065087934cdc1730d63db58562edcf017e1aad9b","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","b787b5b54349a24f07d089b612a9fb8ff024dbbe991ff52ea2b188a6b1230644","bb9c4ffa5e6290c6980b63c815cdd1625876dadb2efaf77edbe82984be93e55e","1cdcfc1f624d6c08aa12c73935f6e13f095919cd99edf95752951796eb225729","df6d4b6ba1e64f682091862faa30104e93891f9e7202d006bf5e7a88ab4a0dbe","14b5aa23c5d0ae1907bc696ac7b6915d88f7d85799cc0dc2dcf98fbce2c5a67c","5c439dafdc09abe4d6c260a96b822fa0ba5be7203c71a63ab1f1423cd9e838ea",{"version":"6b526a5ec4a401ca7c26cfe6a48e641d8f30af76673bad3b06a1b4504594a960","affectsGlobalScope":true},{"version":"c2fcbd6fad600e96fee8c5df1a62e908d477f5b47a9374b2bab7e74f52cfcc92","affectsGlobalScope":true},"5e3f2470ce8038c4005ff1baff18a69848383f431d6817d453e70d66e037f4a2","cc68e79b99f80e4dfd01967ec96be69efb0ff5bd7f779d9a2cc09dfe590ffd28","91d3d8f536f22dcaeeace0fc6f3544d3562e266a27cf3a2fe280b8051af5d006","9503113febdd737095465792cc074d541902c82c0aea3922f940de18784812ad","8d3c583a07e0c37e876908c2d5da575019f689df8d9fa4c081d99119d53dba22","2c828a5405191d006115ab34e191b8474bc6c86ffdc401d1a9864b1b6e088a58",{"version":"e630e5528e899219ae319e83bef54bf3bcb91b01d76861ecf881e8e614b167f0","affectsGlobalScope":true},"bcebb922784739bdb34c18ee51095d25a92b560c78ccd2eaacd6bd00f7443d83","7ee6ed878c4528215c82b664fe0cfe80e8b4da6c0d4cc80869367868774db8b1","b0973c3cbcdc59b37bf477731d468696ecaf442593ec51bab497a613a580fe30",{"version":"69e93290f59948789d5fce61cb0b89dde93747a4576744d0d6fae41ee3991646","affectsGlobalScope":true},{"version":"0715e4cd28ad471b2a93f3e552ff51a3ae423417a01a10aa1d3bc7c6b95059d6","affectsGlobalScope":true},"5153a2fd150e46ce57bb3f8db1318d33f6ad3261ed70ceeff92281c0608c74a3","210d54cd652ec0fec8c8916e4af59bb341065576ecda039842f9ffb2e908507c","36b03690b628eab08703d63f04eaa89c5df202e5f1edf3989f13ad389cd2c091","0effadd232a20498b11308058e334d3339cc5bf8c4c858393e38d9d4c0013dcf","25846d43937c672bab7e8195f3d881f93495df712ee901860effc109918938cc","ff1bad1849903b15fba47f3c29bdec5f97324874c93933a89b2bca28a23977fb","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff","69ee23dd0d215b09907ad30d23f88b7790c93329d1faf31d7835552a10cf7cbf","44b8b584a338b190a59f4f6929d072431950c7bd92ec2694821c11bce180c8a5","23b89798789dffbd437c0c423f5d02d11f9736aea73d6abf16db4f812ff36eda",{"version":"ce29decface8937cc37bd5975b2fc40412bf2c075fcb069e5482e7ffdfff504f","affectsGlobalScope":true},{"version":"3c4ba1dd9b12ffa284b565063108f2f031d150ea15b8fafbdc17f5d2a07251f3","affectsGlobalScope":true},"e10177274a35a9d07c825615340b2fcde2f610f53f3fb40269fd196b4288dda6","1422cd9e705adcc09088fda85a900c2b70e3ad36ea85846f68bd1a884cdf4e2b","3c13ef48634e7b5012fcf7e8fce7496352c2d779a7201389ca96a2a81ee4314d","5d0a25ec910fa36595f85a67ac992d7a53dd4064a1ba6aea1c9f14ab73a023f2",{"version":"22d7b95cb63dead43834ae20ee492c9c8b6d90db3957d21665199f0efb1d3e26","affectsGlobalScope":true},{"version":"a9fc1469744055a3435f203123246b96c094e7ff8c4e1c3863829d9b705b7a34","affectsGlobalScope":true},"868831cab82b65dfe1d68180e898af1f2101e89ba9b754d1db6fb8cc2fac1921","0fe8985a28f82c450a04a6edf1279d7181c0893f37da7d2a27f8efd4fd5edb03","e59a892d87e72733e2a9ca21611b9beb52977be2696c7ba4b216cbbb9a48f5aa",{"version":"52120bb7e4583612225bdf08e7c12559548170f11e660d33a33623bae9bbdbba","affectsGlobalScope":true},"8a300fa9b698845a1f9c41ecbe2c5966634582a8e2020d51abcace9b55aa959e",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"d5be4343a9ace4611f04a6fffd91ceba91265fa15bfb0149306e0a6963e1a015","056e650abd76f4f163b63d28caa4a21ce6b8ac69d8717987a7861724499fa66a","8eb83d1ad044634c54c3de70ac76e596ae48ec0ed0800797211fbfe7d9bc94de","df0e93ded7e580b27eb3bfea87dffc49a823ea74ef6c625938cb8f5298e1bd57","c44308d3424b3d85a342c7f59eee52a7d2807859692c0e89e4373e88d5895743","7fdfb1d630e3baa80e994518127a8a60f298a0dd783824f50797e3d88213af94","bf78879e6f7417cc8b3ba859dbe762d9f1f64fead4183a85c8a998e156377bcb","079bf77582cfa769546f060b373cbe4bac74627c240bcf07f0b571c29c1c7269","dcd687115f7836cab01c44b1a3678422533adb6e8e255d046850a9b998ca953d","95046f08a9e3860e531bae878947f04cf91aade9ca8dae60f962aff85b892eeb","7ea8ac0a5b4461e346fe937ff19841c66bcf3121205de8d1b2a5d0a31f3b28eb","d9b36f58f094c4095818a4b5cf8dc8b6f3ac7d38fc3bafc871494e3c4d586551","5af4f0c77e82183dc512690283cc80a2b59370083a60ed75174a516b921452fc","5581450c9bfffa56208fa69ce62ea33c8671fa34cfdc1eeb262ec7ebf0b5cbf7","977997bf4efd7fc8d5b4a78f9474395315189d8d9d92a8280cb35babe0885534","dc9f4778bd2d16df16c101704eee59112818857cf58ecb59417633abca828ff0","fca70e3e8f1b91b6462c3d22546de7f79acd9fd7eee9b638f7f4bd348c851bd2","fb4113fc41b555bb1aa01fb17c66da9be37b734c5b4c4e244f70d7ecb0b7e5c0","cec053867ca5fba9e8e966de9bb9e7ad077a9f018175e20de473bf81cdc0b8ff",{"version":"a7400fa1f234ab5dee8c4fdc6e1afbef9078b8ceb8c9e29b8694181b46df46c4","signature":"80929751b3512388f49be15d8d4e2c64e6cbb2c0377112ea354a6f328bab4c4c"},"c63a0ce74ba51ad0e9cd442df25b8fc205e63d13898bc8c7ccd9ad098370f897","bf88ef4208a770ca39a844b182b3695df536326ea566893fdc5b8418702a331e","f0c4df2546dafc3b77d9c428453495f694171c36b48fb098e0e333f47ab1339f","5d7b6cc4df7683915a6fb125cb2fd4364245e2dad4bdd93298e250b2bf9c9b7d","d5a33c52d381fc00f5842490ffcf406e0f5b9dd801b016fadcb232bb4d347fdf","8ae7855cf16c0a899ad0bdbf0675480766197e05467a249b5ddf7dcf9ace7a56","57aa4c028ae9d74d0908fd24563ccf6ce4ad3ec4b836fcbd69974adce60eb895","d979abc48001c25784feecb34dba191ed2c33f8944f7bd7b077b464285586c12","b5a33c11d9bca76dad214b1f8cf8571ef5a0fc60eecbbfa8f6cf0b73c1183d20","b4e975657af1b37e99cac0753713e6425a16a7725790542838e9d48b0dd836b4","85334ca199cff2ab0bcec4f106a3e8350f71cf04b485f87e794dc7872ccd6db8","0f321314fe3ba624e0e2957041ab096afc446d2ca0c0daf4719eafebae63e9dd","b798a298a669d510455b1c9fb6ae952333edaba0dae2672be9edd84aea4d600d","da90b2dfbb04735ed503d67065160c0f48cfe3ea26090093281b334f61b2cc88","73be1db7a55a0edb3055b83ad858205c04b8db4acc1a81d16f9dd1d0c30460b7","a87e5902fd92d16a80e0020ac03d6477bc2e7a6f5b0407a73aff6b7aa9e01d55","3b653bb22bc87cb0df3a53cd4dc300642233a627152b2e2c2a45237995f342b1",{"version":"e97b049516897082aa5afc2a169ddedc8926546f1522f133272ab8eafd7bb705","signature":"8554ab2500a235502c77a76adbd47ad77483d372e325f2bdf32ecfe9467b57b1"},{"version":"666856a3b3ac561a0a1b85db6c5bc192ba756939ec3fd11aba24c5a80f059928","signature":"b9ca17a1bf7a856b8ec77c7d51ff089af47a73a7c77e702e65f8a450843596d2"},{"version":"85d8c15e12f05164606168b9d9bb56f664ca6c0a207beaebcc00b3e56b4d6342","signature":"16dec6f85a3dc618c0e71238018cea74558f197ef532887b8af0a66cdf642714"},{"version":"54ff28ab10d1009897fa679ac9d187b36a4f91a66884e2e8ff934fa10ad1af82","signature":"6b778ed1cb4e6fa6819fb87a868712a53d64385160925ee48431cf3b29854d3b"}],"root":[[157,160]],"options":{"declaration":true,"declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":true,"module":99,"noEmitOnError":true,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"..","sourceMap":true,"strict":false,"target":2,"tsBuildInfoFile":"./.tsbuildinfo"},"fileIdsList":[[84,113,120],[113,120],[67,113],[70,113],[71,76,104,113],[72,83,84,91,101,112,113],[72,73,83,91,113],[74,113],[75,76,84,92,113],[76,101,109,113],[77,79,83,91,113],[78,113],[79,80,113],[83,113],[81,83,113],[83,84,85,101,112,113],[83,84,85,98,101,104,113],[113,117],[113],[79,83,86,91,101,112,113],[83,84,86,87,91,101,109,112,113],[86,88,101,109,112,113],[67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119],[83,89,113],[90,112,113],[79,83,91,101,113],[92,113],[93,113],[70,94,113],[95,111,113,117],[96,113],[97,113],[83,98,99,113],[98,100,113,115],[71,83,101,102,103,104,113],[71,101,103,113],[101,102,113],[104,113],[105,113],[70,101,113],[83,107,108,113],[107,108,113],[76,91,101,109,113],[110,113],[91,111,113],[71,86,97,112,113],[76,113],[101,113,114],[113,115],[113,116],[71,76,83,85,94,101,112,113,115,117],[101,113,118],[113,126],[113,127,128,129],[101,113,120,121,122,124,126],[66,113,124,125],[113,122,123,125,126,130,137],[66,113,124],[113,124],[113,124,131,132,133,134,135,136],[66,113,121,123,125],[113,142],[61,62,63,64,65,113],[61,113],[113,138,139,158],[85,93,101,113,138,140,141,143,153,154,156,157],[113,138],[113,153],[113,151],[113,144],[113,144,146],[113,144,145,146,147,148,149,150,151,152],[113,144,145,147,148,149,150],[113,153,155],[161,162,163],[162,163],[126,162],[127,128,129,162],[121,122,124,126,162,163,164],[66,124,125,162],[122,123,125,126,130,137,162],[66,124,162],[124,162],[124,131,132,133,134,135,136,162],[162],[66,121,123,125,162],[142,162],[61,62,63,64,65,162],[61,162],[158],[153,154,156,157],[138],[153,162],[151,162],[144,162],[144,146,162],[144,145,146,147,148,149,150,151,152,162],[144,145,147,148,149,150,162]],"referencedMap":[[141,1],[140,2],[67,3],[68,3],[70,4],[71,5],[72,6],[73,7],[74,8],[75,9],[76,10],[77,11],[78,12],[79,13],[80,13],[82,14],[81,15],[83,14],[84,16],[85,17],[69,18],[119,19],[86,20],[87,21],[88,22],[120,23],[89,24],[90,25],[91,26],[92,27],[93,28],[94,29],[95,30],[96,31],[97,32],[98,33],[99,33],[100,34],[101,35],[103,36],[102,37],[104,38],[105,39],[106,40],[107,41],[108,42],[109,43],[110,44],[111,45],[112,46],[113,47],[114,48],[115,49],[116,50],[117,51],[118,52],[127,53],[128,53],[130,54],[129,53],[125,55],[126,56],[138,57],[131,58],[132,59],[133,59],[137,60],[134,19],[135,19],[136,58],[124,61],[121,19],[123,19],[122,19],[155,19],[142,19],[143,62],[66,63],[62,64],[64,64],[63,64],[65,64],[61,19],[59,19],[60,19],[12,19],[14,19],[13,19],[2,19],[15,19],[16,19],[17,19],[18,19],[19,19],[20,19],[21,19],[22,19],[3,19],[4,19],[26,19],[23,19],[24,19],[25,19],[27,19],[28,19],[29,19],[5,19],[30,19],[31,19],[32,19],[33,19],[6,19],[37,19],[34,19],[35,19],[36,19],[38,19],[7,19],[39,19],[44,19],[45,19],[40,19],[41,19],[42,19],[43,19],[8,19],[49,19],[46,19],[47,19],[48,19],[50,19],[9,19],[51,19],[52,19],[53,19],[56,19],[54,19],[55,19],[57,19],[10,19],[1,19],[11,19],[58,19],[139,19],[159,65],[158,66],[157,67],[160,19],[154,68],[152,69],[145,70],[149,70],[148,71],[144,19],[146,70],[153,72],[151,73],[150,70],[147,70],[156,74]],"exportedModulesMap":[[141,75],[140,76],[67,3],[68,3],[70,4],[71,5],[72,6],[73,7],[74,8],[75,9],[76,10],[77,11],[78,12],[79,13],[80,13],[82,14],[81,15],[83,14],[84,16],[85,17],[69,18],[119,19],[86,20],[87,21],[88,22],[120,23],[89,24],[90,25],[91,26],[92,27],[93,28],[94,29],[95,30],[96,31],[97,32],[98,33],[99,33],[100,34],[101,35],[103,36],[102,37],[104,38],[105,39],[106,40],[107,41],[108,42],[109,43],[110,44],[111,45],[112,46],[113,47],[114,48],[115,49],[116,50],[117,51],[118,52],[127,77],[128,77],[130,78],[129,77],[125,79],[126,80],[138,81],[131,82],[132,83],[133,83],[137,84],[134,85],[135,85],[136,82],[124,86],[121,85],[123,85],[122,85],[155,85],[142,85],[143,87],[66,88],[62,89],[64,89],[63,89],[65,89],[61,85],[59,85],[60,85],[12,85],[14,85],[13,85],[2,85],[15,85],[16,85],[17,85],[18,85],[19,85],[20,85],[21,85],[22,85],[3,85],[4,85],[26,85],[23,85],[24,85],[25,85],[27,85],[28,85],[29,85],[5,85],[30,85],[31,85],[32,85],[33,85],[6,85],[37,85],[34,85],[35,85],[36,85],[38,85],[7,85],[39,85],[44,85],[45,85],[40,85],[41,85],[42,85],[43,85],[8,85],[49,85],[46,85],[47,85],[48,85],[50,85],[9,85],[51,85],[52,85],[53,85],[56,85],[54,85],[55,85],[57,85],[10,85],[1,85],[11,85],[58,85],[159,90],[158,91],[157,92],[154,93],[152,94],[145,95],[149,95],[148,96],[144,85],[146,95],[153,97],[151,98],[150,95],[147,95],[156,74]],"semanticDiagnosticsPerFile":[141,140,67,68,70,71,72,73,74,75,76,77,78,79,80,82,81,83,84,85,69,119,86,87,88,120,89,90,91,92,93,94,95,96,97,98,99,100,101,103,102,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,127,128,130,129,125,126,138,131,132,133,137,134,135,136,124,121,123,122,155,142,143,66,62,64,63,65,61,59,60,12,14,13,2,15,16,17,18,19,20,21,22,3,4,26,23,24,25,27,28,29,5,30,31,32,33,6,37,34,35,36,38,7,39,44,45,40,41,42,43,8,49,46,47,48,50,9,51,52,53,56,54,55,57,10,1,11,58,139,159,158,157,160,154,152,145,149,148,144,146,153,151,150,147,156]},"version":"5.1.6"}
@@ -1,24 +1,50 @@
1
- import { Command } from 'clipanion';
1
+ import * as _texonom_ntypes from '@texonom/ntypes';
2
+ import { ExtendedRecordMap, PageMap, Block, CollectionViewBlock, Decoration } from '@texonom/ntypes';
2
3
  import { NotionAPI } from '@texonom/nclient';
3
- import { ExtendedRecordMap, Decoration } from '@texonom/ntypes';
4
+ import { Command } from 'clipanion';
5
+ import { PageTree } from '@texonom/nutils';
4
6
 
5
7
  declare abstract class NotionCommand extends Command {
6
8
  token: string;
7
9
  execute(): Promise<void>;
8
10
  }
11
+
9
12
  declare class NotionExportCommand extends NotionCommand {
10
13
  static paths: string[][];
11
14
  notion: NotionAPI;
15
+ recordMap: ExtendedRecordMap;
16
+ pageTree: PageTree;
17
+ pageMap: PageMap;
18
+ promises: Promise<unknown>[];
12
19
  folder: string;
20
+ validation: boolean;
21
+ update: boolean;
13
22
  page: string;
14
23
  recursive: boolean;
24
+ prefetch: boolean;
25
+ load: boolean;
15
26
  raw: boolean;
27
+ dataset: boolean;
16
28
  list: string[];
17
29
  constructor();
18
30
  execute(): Promise<void>;
31
+ loadRaw(): Promise<void>;
32
+ fetchRawSpace(startPage: string): Promise<void>;
33
+ saveRawSpace(): Promise<void>;
34
+ saveRawPage(id: string): Promise<void>;
19
35
  exportMd(id: string, folder: string): Promise<void>;
20
- pageToMarkdown(id: string, recordMap: ExtendedRecordMap, folder: any): Promise<string>;
36
+ pageToMarkdown(id: string, recordMap: ExtendedRecordMap, folder: string): Promise<string>;
37
+ getBlock(id: string, recordMap: ExtendedRecordMap, message?: string): Promise<Block>;
38
+ getUser(id: string, recordMap: ExtendedRecordMap): Promise<_texonom_ntypes.User>;
39
+ getSpace(id: string, recordMap: ExtendedRecordMap): Promise<_texonom_ntypes.Space>;
40
+ getCollection(collectionViewBlock: CollectionViewBlock, recordMap: ExtendedRecordMap, message?: string): Promise<_texonom_ntypes.Collection>;
41
+ getCollectionView(collectionId: string, viewId: string, recordMap: ExtendedRecordMap, message?: string): Promise<{
42
+ type: string;
43
+ blockIds: string[];
44
+ hasMore: boolean;
45
+ }>;
46
+ childrenToMd(parentBlock: Block, recordMap: ExtendedRecordMap, prefix: string, folder: string, page: Block): Promise<string>;
47
+ decorationsToMarkdown(decos: Decoration[], recordMap: ExtendedRecordMap, prefix?: string): Promise<string>;
21
48
  }
22
- declare function decorationsToMarkdown(decos: Decoration[], recordMap: ExtendedRecordMap): string;
23
49
 
24
- export { NotionCommand, NotionExportCommand, decorationsToMarkdown };
50
+ export { NotionExportCommand };
@@ -1 +1 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":"AAgBA,cAAc,UAAU,CAAA"}
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":"AAgBA,cAAc,iBAAiB,CAAA"}
package/build/src/main.js CHANGED
@@ -1,28 +1,22 @@
1
- import{Cli as B,Builtins as E}from"clipanion";var P="Notion CLI",S="1.2.0-alpha.0";import{join as v}from"path";import{writeFile as T,mkdir as j}from"fs/promises";import D from"prettier";import{Command as F,Option as k}from"clipanion";import{NotionAPI as J}from"@texonom/nclient";import{getBlockTitle as N,getCanonicalPageId as h,parsePageId as L,formatDate as I,getTextContent as w}from"@texonom/nutils";var x=class extends F{constructor(){super(...arguments);this.token=k.String("-t,--token",{description:"Notion Access Token"})}async execute(){}},g=class extends x{constructor(){super();this.folder=k.String("-o,--output","data",{description:"Export folder"});this.page=k.String("-p,--page",{required:!0,description:"Target page"});this.recursive=k.Boolean("-r,--recursive",{description:"Recursively export children"});this.raw=k.Boolean("--raw",{description:`Export raw recordMap JSON data
2
- Markdown format do not preserve all information`})}async execute(){await super.execute();let o=L(this.page);if(this.notion=new J({authToken:this.token}),await j(this.folder,{recursive:!0}),this.raw){let t=await this.notion.getPage(o),a=t.block[o].value,n=`${h(o,t)}`,e=JSON.stringify(this.recursive?a:t),i="json";this.raw&&(e=await D.format(e,{parser:"json"})),await T(`${v(this.folder,n)}.${i}`,e)}else this.exportMd(o,this.folder)}async exportMd(o,t){let a=await this.notion.getPage(o),n=await this.pageToMarkdown(o,a,t),e=v(t,`${h(o,a)}`);return T(`${e}.md`,n)}async pageToMarkdown(o,t,a){var u;let n=t.block[o].value,e=`---
3
- `,i=t.collection[n.parent_id].value??t.block[n.parent_id].value??t.space[n.parent_id].value,f=Object.keys(i.schema);for(let c of f){let s=i.schema[c].name,l=i.schema[c].type,r="";switch(l){case"text":r=d(n.properties[c],t);break;case"title":r=d(n.properties[c],t);break;case"created_by":r=t[n.created_by_id]?t[n.created_by_id].value.name:"Unknown";break;case"last_edited_by":r=t[n.last_edited_by_id]?t[n.last_edited_by_id].value.name:"Unknown";break;case"created_time":r=I(n.created_time);break;case"last_edited_time":r=I(n.last_edited_time);break;default:r=""}e+=`${s}: ${r}
4
- `}e+=`Parent: ${n.parent_table==="collection"?w(i.name):N(i,t)}
5
- `,e+=`---
6
- `;for(let c of n.content){let s=t.block[c].value,l=(u=s==null?void 0:s.properties)==null?void 0:u.title;switch(s.type){case"header":e+=`
7
- # ${d(l,t)}`;break;case"sub_header":e+=`
8
- ## ${d(l,t)}`;break;case"sub_sub_header":e+=`
9
- ### ${d(l,t)}`;break;case"text":e+=`
10
- ${d(l,t)}`;break;case"bulleted_list":e+=`
11
- - `;break;case"numbered_list":e+=`
12
- 1. `;break;case"to_do":e+=`
13
- - [ ] `;break;case"toggle":e+=`
14
- <details><summary>`;break;case"quote":e+=`
15
- > `;break;case"code":e+=`
16
- \`\`\`type${d(l,t)}\`\`\``;break;case"equation":e+=`
17
- $$`;break;case"callout":e+=`
18
- :::note`;break;case"external_object_instance":e+=`
19
- `;break;case"collection_view":{let r=t.collection[s.collection_id].value;if(e+=`
20
- ${d(r.name,t)}`,this.recursive){let C=s.view_ids.map(b=>t.collection_view[b].value),R=Object.keys(C.reduce((b,A)=>{let O=t.collection_query[r.id][A.id].collection_group_results.blockIds;for(let q of O)b[q]=!0;return b},{})),y=v(a,`${h(s.id,t)}`);await j(y,{recursive:!0});for(let b of R)this.exportMd(b,y)}break}case"image":e+=`
21
- ![](`;break;case"video":e+=`
22
- <video src="`;break;case"bookmark":e+=`
23
- [${w(s.properties.title)}](${w(s.properties.link)})`;break;case"file":e+=`
24
- [File](`;break;case"pdf":e+=`
25
- [PDF](`;break;case"divider":e+=`
26
- ---`;break;default:e+=`
27
- `}}return e}};g.paths=[["export"]];function d(m,p){return m?m.reduce((o,t)=>{let[a,n]=t;return n?o+n.reduce((e,i)=>{var f;switch(i[0]){case"p":{let u=i[1],c=(f=p.block[u])==null?void 0:f.value;if(!c)return console.debug('"p" missing block',u),e;let s=N(c,p),l=U(u,p);return e+`[${s}](${l})`}case"a":{let u=i[1];return e+`[${a}](${u})`}default:return e}},""):o+a},""):""}var U=(m,p,o="https://texonom.com")=>`${o}/${h(m,p)}`;var _=new B({binaryName:"notion",binaryLabel:P,binaryVersion:S});_.register(g);_.register(E.HelpCommand);_.register(E.VersionCommand);_.runExit(process.argv.slice(2),B.defaultContext);export{x as NotionCommand,g as NotionExportCommand,d as decorationsToMarkdown};
1
+ import{Cli as Y,Builtins as Z}from"clipanion";var z="Notion CLI",G="1.2.0";import{join as w}from"path";import{mkdir as E,readFile as P}from"fs/promises";import K from"JSONStream";import W from"graceful-fs";import{promisify as oe}from"util";import ie from"stream";import se from"prettier";import{Option as S}from"clipanion";import{NotionAPI as N}from"@texonom/nclient";import{getBlockTitle as R,getCanonicalPageId as x,parsePageId as ae,formatDate as Q,getTextContent as q,getBlockParent as ne,defaultMapImageUrl as re,getAllInSpace as ce,getPageTitle as D}from"@texonom/nutils";import{isCollection as X,isSpace as le}from"@texonom/ntypes";import{Command as ee,Option as te}from"clipanion";var J=class extends ee{constructor(){super(...arguments);this.token=te.String("-t,--token",{description:"Notion Access Token"})}async execute(){}};var O=oe(W.writeFile),C=class extends J{constructor(){super();this.promises=[];this.folder=S.String("-o,--output","data",{description:"Export folder"});this.validation=S.Boolean("-v,--validation",{description:"Validation exported data only"});this.update=S.Boolean("-u,--update",{description:"Update exported data and resave to --folder"});this.page=S.String("-p,--page",{required:!0,description:"Target page to export"});this.recursive=S.Boolean("-r,--recursive",{description:"Recursively export children"});this.prefetch=S.Boolean("-f, --prefetch",{description:"Prefetch all space for faster export (recommended for exporting all pages in a space)"});this.load=S.Boolean("-l, --load",{description:"Load datas from exported cache folder --folder"});this.raw=S.Boolean("--raw",{description:`Export raw recordMap JSON data
2
+ Markdown format do not preserve all information`});this.dataset=S.Boolean("-d, --dataset",{description:"Export as dataset for LLM learning"})}async execute(){await super.execute();let o=ae(this.page);this.notion=new N,this.validation&&(O=async()=>{}),this.load&&await this.loadRaw(),this.prefetch&&await this.fetchRawSpace(o),console.time("time spent"),this.raw?this.recursive?await this.saveRawSpace():await this.saveRawPage(o):await this.exportMd(o,this.folder),await Promise.all(this.promises),console.timeEnd("time spent"),this.update&&(this.recursive?await this.saveRawSpace():await this.saveRawPage(o))}async loadRaw(){console.time("load prefetch file");let o=[];o.push(P(w(this.folder,"recordMap","block.json"),"utf8").then(JSON.parse)),o.push(P(w(this.folder,"recordMap","collection.json"),"utf8").then(JSON.parse)),o.push(P(w(this.folder,"recordMap","notion_user.json"),"utf8").then(JSON.parse)),o.push(P(w(this.folder,"recordMap","space.json"),"utf8").then(JSON.parse)),o.push(P(w(this.folder,"recordMap","collection_view.json"),"utf8").then(JSON.parse)),o.push(P(w(this.folder,"recordMap","collection_query.json"),"utf8").then(JSON.parse)),o.push(P(w(this.folder,"recordMap","signed_urls.json"),"utf8").then(JSON.parse)),o.push(P(w(this.folder,"pageTree.json"),"utf8").then(JSON.parse));let[e,t,s,a,i,l,c,m]=await Promise.all(o),d={},u=W.createReadStream(w(this.folder,"pageMap.json")),h=K.parse("*");u.pipe(h),h.on("data",g=>{let f=Object.keys(g.block)[0];d[f]=g}),await new Promise(g=>ie.finished(h,f=>g(f))),this.pageMap=d,this.pageTree=m,this.recordMap={block:e,collection:t,notion_user:s,space:a,collection_query:l,collection_view:i,signed_urls:c},console.timeEnd("load prefetch file")}async fetchRawSpace(o){let{recordMap:e,pageTree:t,pageMap:s}=await ce(o,this.notion.getPage.bind(this.notion),this.notion.getBlocks.bind(this.notion),this.notion.fetchCollections.bind(this.notion),this.recordMap);this.pageMap=s,this.recordMap=e,this.pageTree=t}async saveRawSpace(){if(this.validation)return;await E(this.folder,{recursive:!0});let o="json";console.time("write file");let e=[];await E(w(this.folder,"recordMap"),{recursive:!0});for(let a in this.recordMap)e.push(O(`${w(this.folder,"recordMap",a)}.${o}`,JSON.stringify(this.recordMap[a])));let t=W.createWriteStream(`${w(this.folder,"pageMap")}.${o}`),s=K.stringifyObject();s.pipe(t);for(let a in this.pageMap)s.write([a,this.pageMap[a]]);s.end(),e.push(O(`${w(this.folder,"pageTree")}.${o}`,JSON.stringify(this.pageTree))),await Promise.all(e),console.timeEnd("write file")}async saveRawPage(o){if(this.validation)return;await E(this.folder,{recursive:!0});let e=await this.notion.getPage(o),t=`${x(o,e)}`,s=JSON.stringify(e),a="json";s=await se.format(s,{parser:"json"}),await O(`${w(this.folder,t)}.${a}`,s)}async exportMd(o,e){try{let t=this.pageMap?this.pageMap[o]:await this.notion.getPage(o);this.recursive||(this.recordMap=t);try{t||(t=await this.notion.getPage(o))}catch{return}if(!["page","collection_view_page"].includes(t.block[o].value.type))throw new Error("Not a page");let s=await this.pageToMarkdown(o,t,e),a=w(e,`${x(o,t)}`);this.promises.push(O(`${a}.md`,s))}catch(t){console.error(o,t)}}async pageToMarkdown(o,e,t){var l,c;let s=e.block[o].value,a=`---
3
+ `;a+=`Title: ${await this.decorationsToMarkdown((l=s.properties)!=null&&l.title?s.properties.title:[["Untitled"]],e)}
4
+ `;let i=ne(s,e);if(le(i)?a+=`Parent: ${i.name}
5
+ `:X(i)?a+=`Parent: ${q(i.name)}
6
+ `:i&&(a+=`Parent: ${R(i,e)}
7
+ `),X(i)){let m=i!=null&&i.schema?Object.keys(i.schema):[];m.splice(m.indexOf("title"),1);for(let d of m){let u=i.schema[d].name,h=i.schema[d].type,g="";switch(h){case"text":g=(c=s==null?void 0:s.properties)!=null&&c[d]?await this.decorationsToMarkdown(s.properties[d],e):"";break;case"created_by":{let f=await this.getUser(s.created_by_id,e);g=f?f.name:"Unknown";break}case"last_edited_by":{let f=await this.getUser(s.last_edited_by_id,e);g=f?f.name:"Unknown";break}case"created_time":g=Q(s.created_time);break;case"last_edited_time":g=Q(s.last_edited_time);break;default:g=""}a+=`${u}: ${g}
8
+ `}}return a+=`---
9
+ `,a+await this.childrenToMd(s,e,`
10
+ `,t,s)}async getBlock(o,e,t=""){var a,i,l,c,m;let s=(a=e.block[o])==null?void 0:a.value;!s&&this.recordMap&&(s=(i=this.recordMap.block[o])==null?void 0:i.value);try{!s&&this.token&&(s=(m=(c=(l=(await new N({authToken:this.token}).getBlocks([o])).recordMap)==null?void 0:l.block)==null?void 0:c[o])==null?void 0:m.value)}catch{s||console.debug(`${t} Missing block ${o}`)}return s&&(e.block[o]={value:s,role:"reader"},this.recordMap&&(this.recordMap.block[o]={value:s,role:"reader"})),s}async getUser(o,e){var s,a,i,l,c;let t=(s=e.notion_user[o])==null?void 0:s.value;!t&&this.recordMap&&(t=(a=this.recordMap.notion_user[o])==null?void 0:a.value);try{!t&&this.token&&(t=(c=(l=(i=(await new N({authToken:this.token}).getUsers([o])).recordMapWithRoles)==null?void 0:i.notion_user)==null?void 0:l[o])==null?void 0:c.value)}catch{t||console.debug(`Missing user ${o}`)}return t&&(e.notion_user[o]={value:t,role:"reader"},this.recordMap&&(this.recordMap.notion_user[o]={value:t,role:"reader"})),t}async getSpace(o,e){var s,a,i,l,c;let t=(s=e.space[o])==null?void 0:s.value;!t&&this.recordMap&&(t=(a=this.recordMap.space[o])==null?void 0:a.value);try{!t&&this.token&&(t=(c=(l=(i=(await new N({authToken:this.token}).getSpaces([o])).recordMapWithRoles)==null?void 0:i.space)==null?void 0:l[o])==null?void 0:c.value,t&&(e.space[o]={value:t,role:"reader"},this.recordMap&&(this.recordMap.space[o]={value:t,role:"reader"})))}catch{t||console.debug(`Missing space ${o}`)}return t}async getCollection(o,e,t=""){var i,l,c,m,d;let s=o.collection_id,a=(i=e.collection[o.collection_id])==null?void 0:i.value;if(!a&&this.recordMap&&(a=(l=this.recordMap.collection[s])==null?void 0:l.value,a)){e.collection[s]=(c=this.recordMap.collection)==null?void 0:c[s];for(let u of o.view_ids)e.collection_view[u]=(m=this.recordMap.collection_view)==null?void 0:m[u]}try{if(!a&&this.token){let h=await new N({authToken:this.token}).getPageRaw(o.id);a=(d=h.recordMap.collection[s])==null?void 0:d.value,a&&(e.collection_view={...e.collection_view,...h.recordMap.collection_view},e.collection={...e.collection,...h.recordMap.collection},e.block={...e.block,...h.recordMap.block},this.recordMap.collection_view={...this.recordMap.collection_view,...h.recordMap.collection_view},this.recordMap.collection={...this.recordMap.collection,...h.recordMap.collection},this.recordMap.block={...this.recordMap.block,...h.recordMap.block})}}catch{a||console.debug(`${t} Missing collection block ${o.id}`)}return await this.getCollectionView(s,o.view_ids[0],e,t),a}async getCollectionView(o,e,t,s=""){var i,l,c,m,d,u,h,g,f,y,b,k,$,_,T;let a=(c=(l=(i=t.collection_query)==null?void 0:i[o])==null?void 0:l[e])==null?void 0:c.collection_group_results;!a&&this.recordMap&&(a=(u=(d=(m=this.recordMap.collection_query)==null?void 0:m[o])==null?void 0:d[e])==null?void 0:u.collection_group_results,a&&(t.collection_query[o]={...t.collection_query[o],[e]:(g=(h=this.recordMap.collection_query)==null?void 0:h[o])==null?void 0:g[e]},t.collection[o]={...t.collection[o],[e]:(y=(f=this.recordMap.collection)==null?void 0:f[o])==null?void 0:y[e]}));try{if(!a&&this.token){let n=await new N({authToken:this.token}).getCollectionData(o,e,(b=t.collection_view[e])==null?void 0:b.value);if(a=($=(k=n.result)==null?void 0:k.reducerResults)==null?void 0:$.collection_group_results,a){t.collection_query[o]={...t.collection_query[o],[e]:(_=n.result)==null?void 0:_.reducerResults},this.recordMap&&(this.recordMap.collection_query[o]={...this.recordMap.collection_query[o],[e]:(T=n.result)==null?void 0:T.reducerResults});for(let p in n.recordMap.block){let r=n.recordMap.block[p].value;r&&(t.block[p]={value:r,role:"reader"},this.recordMap&&(this.recordMap.block[p]={value:r,role:"reader"}))}for(let p in n.recordMap.collection){let r=n.recordMap.collection[p].value;r&&(t.collection[p]={value:r,role:"reader"},this.recordMap&&(this.recordMap.collection[p]={value:r,role:"reader"}))}for(let p in n.recordMap.collection_view){let r=n.recordMap.collection_view[p].value;r&&(t.collection_view[p]={value:r,role:"reader"},this.recordMap&&(this.recordMap.collection_view[p]={value:r,role:"reader"}))}}}}catch{a||console.debug(`${s} Missing collection view ${e}`)}return a}async childrenToMd(o,e,t,s,a){var c,m,d,u,h,g,f,y,b,k,$,_,T;let i="",l=1;for(let B of o.content?o.content:[]){let n=await this.getBlock(B,e,`${B} from ${R(a,e)}`);if(!n)continue;let p=(c=n==null?void 0:n.properties)==null?void 0:c.title;switch(n.type){case"header":i+=`${t}# ${await this.decorationsToMarkdown(p,e)}`;break;case"sub_header":i+=`${t}## ${await this.decorationsToMarkdown(p,e)}`;break;case"sub_sub_header":i+=`${t}### ${await this.decorationsToMarkdown(p,e)}`;break;case"text":i+=`${t}${await this.decorationsToMarkdown(p,e)}`;break;case"bulleted_list":i+=`${t}- ${await this.decorationsToMarkdown(p,e)}`;break;case"numbered_list":i+=`${t}${l++}. ${await this.decorationsToMarkdown(p,e)}`;break;case"to_do":i+=`${t}- [ ] ${await this.decorationsToMarkdown(p,e)}`;break;case"toggle":i+=`${t}<details><summary>${t}${t}${await this.decorationsToMarkdown(p,e)}</summary>
11
+ `;break;case"quote":i+=await this.decorationsToMarkdown(p,e,`
12
+ ${t.trim()}> `)+`
13
+ `;break;case"code":i+=`${t}\`\`\`type${await this.decorationsToMarkdown(p,e)}\`\`\``;break;case"equation":i+=`${t}$$${await this.decorationsToMarkdown(p,e)}$$`;break;case"callout":{i+=await this.decorationsToMarkdown(p,e,`
14
+ ${t.trim()}> `)+`
15
+ `;break}case"bookmark":{let r=`
16
+ ${t.trim()}> `;i+=`${r}[${q((m=n.properties)!=null&&m.title?n.properties.title:[["Untitled"]])}](${q(n.properties.link)})
17
+ `;break}case"external_object_instance":try{let r=n.format.original_url,A=n.format.attributes?(u=(d=n.format.attributes.filter(j=>j.id==="title")[0])==null?void 0:d.values)==null?void 0:u[0]:r;if(!r)break;i+=`${t}${t}[${A}](${r})${t}`;break}catch(r){console.error(r,n.id);break}case"collection_view_page":case"collection_view":{let r=await this.getCollection(n,e,`${n.id} from ${D(e)}`);if(!r)continue;i+=`${t}### ${await this.decorationsToMarkdown(r.name,e)}`,i+=`${t}|Title|
18
+ |:-:|`;let A=n.view_ids.map(v=>{var M;return e.collection_view[v]||console.debug(`Missing view ${v} from ${r.name}`),(M=e.collection_view[v])==null?void 0:M.value}).filter(Boolean),j=[];for(let v of A){let M=await this.getCollectionView(r.id,v.id,e,`${r.name} ${v.name}`);if(M)for(let I of M.blockIds)j.push(I);else break}for(let v of j){let M=(h=e.block[v])==null?void 0:h.value;M||console.debug(`no ${v} in ${r.name[0]}`),i+=`${t}|[${R(M,e)}](${U(v,e)})|`}if(this.recursive&&j.length){let v=w(s,`${x(a.id,e)}`,`${x(r.id,e)}`);await E(v,{recursive:!0});for(let M of j)this.promises.push(this.exportMd(M,v))}break}case"page":{if(i+=`${t}${t}[${R(n,e)}](${U(n.id,e)})${t}`,this.recursive){let r=w(s,`${x(a.id,e)}`);await E(r,{recursive:!0}),this.promises.push(this.exportMd(n.id,r))}break}case"alias":{let r=(y=e.block[(f=(g=n.format)==null?void 0:g.alias_pointer)==null?void 0:f.id])==null?void 0:y.value;if(!r){console.debug(`Missing alias ${(k=(b=n.format)==null?void 0:b.alias_pointer)==null?void 0:k.id} from ${R(a,e)} ${a.id}`);continue}i+=`${t}${t}[${R(r,e)}](${U(r.id,e)})${t}`;break}case"image":{let r=n.properties.caption?q(n.properties.caption):"";i+=`${t}![${r}](${re(($=n.format)==null?void 0:$.display_source,n)})`;break}case"video":i+=`${t}<video src="${n.format.display_source} />`;break;case"file":i+=`${t}[File](${(_=n.format)==null?void 0:_.display_source})`;break;case"pdf":i+=`${t}<iframe src="${(T=n.format)==null?void 0:T.display_source}"/>`;break;case"divider":i+=`${t}---`;break;case"column_list":break;case"column":break;default:i+=`${t}`}if(n.content&&n.type!=="page"&&n.type!=="collection_view_page"){let r=["toggle","transclusion_container","transclusion_reference","column_list"].includes(n.type)?t:`
19
+ ${t.trim()}> `;i+=await this.childrenToMd(n,e,r,s,a),n.type==="column"&&(i+=`
20
+ `)}n.type==="toggle"&&(i+=`${t}</details>${t}`)}return i}async decorationsToMarkdown(o,e,t=""){var l,c,m;if(!o)return"";let s="";for(let d of o){let u="",[h,g]=d;if(!g)s+=h;else{let f=h;for(let b of g)switch(b[0]){case"p":{let k=b[1],$=await this.getBlock(k,e,`"p" ${D(e)}`);if(!$)break;let _=R($,e),T=U(k,e);f=`[${_}](${T})`;break}case"a":{let k=b[1];f=`[${h}](${k})`;break}case"i":u+="*";break;case"b":u+="**";break;case"h":u+="";break;case"c":u+="`";break;case"s":u+="~~";break;case"e":u+="$",f=b[1];break;case"eoi":try{let k=b[1],$=await this.getBlock(k,e,`"eoi" ${D(e)}`);if(!$)break;let _=$.format.uri,T=$.format.attributes?(m=(c=(l=$.format.attributes)==null?void 0:l.filter(B=>B.id==="title")[0])==null?void 0:c.values)==null?void 0:m[0]:_;if(!_)break;f=`[${T}](${_})`;break}catch(k){console.error(k,d);break}case"u":{let k=await this.getUser(b[1],e);if(!k)break;f=`[@${k.name}](mailto:${k.email})`;break}}let y=f;g.find(b=>b[0]==="_")&&(y=`<u>${f}</u>`),y=u+y+u.split("").reverse().join(""),s+=y}}return s.split(`
21
+ `).map(d=>t+d).join("")}};C.paths=[["export"]];var U=(L,F,o="https://texonom.com")=>`${o}/${x(L,F)}`;var V=new Y({binaryName:"notion",binaryLabel:z,binaryVersion:G});V.register(C);V.register(Z.HelpCommand);V.register(Z.VersionCommand);V.runExit(process.argv.slice(2),Y.defaultContext);export{C as NotionExportCommand};
28
22
  //# sourceMappingURL=main.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/main.ts","../../package.json","../../src/notion.ts"],"sourcesContent":["import { Cli, Builtins } from 'clipanion'\n\nimport { version, displayName } from '../package.json'\nimport { NotionExportCommand } from './notion'\n\nconst cli = new Cli({\n binaryName: 'notion',\n binaryLabel: displayName,\n binaryVersion: version\n})\n\ncli.register(NotionExportCommand)\ncli.register(Builtins.HelpCommand)\ncli.register(Builtins.VersionCommand)\ncli.runExit(process.argv.slice(2), Cli.defaultContext)\n\nexport * from './notion'\n","{\n \"name\": \"@texonom/cli\",\n \"displayName\": \"Notion CLI\",\n \"version\": \"1.2.0-alpha.0\",\n \"type\": \"module\",\n \"description\": \"Robust TypeScript client for the unofficial Notion API.\",\n \"repository\": \"texonom/notion-node\",\n \"author\": \"Alan Jo <sungle3737@gmail.com>\",\n \"license\": \"MIT\",\n \"main\": \"./build/src/main.js\",\n \"module\": \"./build/src/main.js\",\n \"types\": \"./build/src/main.d.ts\",\n \"sideEffects\": false,\n \"files\": [\n \"build\"\n ],\n \"engines\": {\n \"node\": \">=v12.22.12\"\n },\n \"bin\": {\n \"notion\": \"./build/src/main.js\"\n },\n \"scripts\": {\n \"build\": \"tsc && tsup\",\n \"watch\": \"tsup --watch --silent --onSuccess 'echo build successful'\",\n \"test\": \"vitest --run\",\n \"prerelease\": \"standard-version --skip.changelog --prerelease\",\n \"release\": \"standard-version --release-as\",\n \"pu\": \"pnpm publish\"\n },\n \"dependencies\": {\n \"@texonom/nclient\": \"workspace:^\",\n \"@texonom/ntypes\": \"workspace:^\",\n \"@texonom/nutils\": \"workspace:^\",\n \"clipanion\": \"^3.2.1\",\n \"prettier\": \"^3.0.1\"\n },\n \"standard-version\": {\n \"skip\": {\n \"commit\": true,\n \"tag\": true\n }\n }\n}\n","import { join } from 'path'\nimport { writeFile, mkdir } from 'fs/promises'\n\nimport prettier from 'prettier'\n\nimport { Command, Option } from 'clipanion'\nimport { NotionAPI } from '@texonom/nclient'\nimport { getBlockTitle, getCanonicalPageId, parsePageId, formatDate, getTextContent } from '@texonom/nutils'\n\nimport type { ExtendedRecordMap, Decoration, PageBlock } from '@texonom/ntypes'\n\nexport abstract class NotionCommand extends Command {\n // for private page or eoi like github inline block\n token = Option.String('-t,--token', {\n description: 'Notion Access Token'\n })\n async execute() {}\n}\n\nexport class NotionExportCommand extends NotionCommand {\n static paths = [['export']]\n notion: NotionAPI\n\n // Options\n folder = Option.String('-o,--output', 'data', {\n description: 'Export folder'\n })\n page = Option.String('-p,--page', {\n required: true,\n description: 'Target page'\n })\n recursive = Option.Boolean('-r,--recursive', {\n description: 'Recursively export children'\n })\n raw = Option.Boolean('--raw', {\n description: 'Export raw recordMap JSON data \\n Markdown format do not preserve all information'\n })\n list: string[]\n constructor() {\n super()\n }\n\n // Execute\n async execute() {\n await super.execute()\n const id = parsePageId(this.page)\n this.notion = new NotionAPI({ authToken: this.token })\n\n // Save\n await mkdir(this.folder, { recursive: true })\n if (this.raw) {\n const recordMap = await this.notion.getPage(id)\n const root = recordMap.block[id].value\n const filename = `${getCanonicalPageId(id, recordMap)}`\n let target = JSON.stringify(this.recursive ? root : recordMap)\n const ext = 'json'\n if (this.raw) target = await prettier.format(target, { parser: 'json' })\n await writeFile(`${join(this.folder, filename)}.${ext}`, target)\n } else {\n this.exportMd(id, this.folder)\n }\n }\n\n async exportMd(id: string, folder: string) {\n const recordMap = await this.notion.getPage(id)\n const target = await this.pageToMarkdown(id, recordMap, folder)\n const path = join(folder, `${getCanonicalPageId(id, recordMap)}`)\n return writeFile(`${path}.md`, target)\n }\n\n async pageToMarkdown(id: string, recordMap: ExtendedRecordMap, folder) {\n const page = recordMap.block[id].value as PageBlock\n\n // Title\n let md = `---\\n`\n\n // Property\n const parent =\n recordMap.collection[page.parent_id].value ??\n recordMap.block[page.parent_id].value ??\n recordMap.space[page.parent_id].value\n const properties = Object.keys(parent.schema)\n\n for (const property of properties) {\n const propName = parent.schema[property].name\n const propType = parent.schema[property].type\n let value = String()\n switch (propType) {\n case 'text':\n value = decorationsToMarkdown(page.properties[property], recordMap)\n break\n case 'title':\n value = decorationsToMarkdown(page.properties[property], recordMap)\n break\n case 'created_by':\n value = recordMap[page.created_by_id] ? recordMap[page.created_by_id].value.name : 'Unknown'\n break\n case 'last_edited_by':\n value = recordMap[page.last_edited_by_id] ? recordMap[page.last_edited_by_id].value.name : 'Unknown'\n break\n case 'created_time':\n value = formatDate(page.created_time)\n break\n case 'last_edited_time':\n value = formatDate(page.last_edited_time)\n break\n default:\n value = ''\n }\n md += `${propName}: ${value}\\n`\n }\n md += `Parent: ${page.parent_table === 'collection' ? getTextContent(parent.name) : getBlockTitle(parent, recordMap)}\\n`\n md += '---\\n'\n\n // Content\n for (const child of page.content) {\n const childBlock = recordMap.block[child].value\n const title = childBlock?.properties?.title\n switch (childBlock.type) {\n case 'header':\n md += `\\n# ${decorationsToMarkdown(title, recordMap)}`\n break\n case 'sub_header':\n md += `\\n## ${decorationsToMarkdown(title, recordMap)}`\n break\n case 'sub_sub_header':\n md += `\\n### ${decorationsToMarkdown(title, recordMap)}`\n break\n case 'text':\n md += `\\n${decorationsToMarkdown(title, recordMap)}`\n break\n case 'bulleted_list':\n md += '\\n- '\n break\n case 'numbered_list':\n md += '\\n1. '\n break\n case 'to_do':\n md += '\\n- [ ] '\n break\n case 'toggle':\n md += '\\n<details><summary>'\n break\n case 'quote':\n md += '\\n> '\n break\n case 'code':\n md += `\\n\\`\\`\\`type${decorationsToMarkdown(title, recordMap)}\\`\\`\\``\n break\n case 'equation':\n md += '\\n$$'\n break\n case 'callout':\n md += '\\n:::note'\n break\n case 'external_object_instance':\n md += `\\n`\n break\n\n // Collection\n case 'collection_view': {\n const collection = recordMap.collection[childBlock.collection_id].value\n md += `\\n${decorationsToMarkdown(collection.name, recordMap)}`\n\n if (this.recursive) {\n const views = childBlock.view_ids.map(id => recordMap.collection_view[id].value)\n const children = Object.keys(\n views.reduce((page, view) => {\n const results = recordMap.collection_query[collection.id][view.id].collection_group_results.blockIds\n for (const result of results) page[result] = true\n return page\n }, {})\n )\n const parentFolder = join(folder, `${getCanonicalPageId(childBlock.id, recordMap)}`)\n await mkdir(parentFolder, { recursive: true })\n for (const childPage of children) this.exportMd(childPage, parentFolder)\n }\n break\n }\n // Media\n case 'image':\n md += '\\n![]('\n break\n case 'video':\n md += '\\n<video src=\"'\n break\n case 'bookmark':\n md += `\\n[${getTextContent(childBlock.properties.title)}](${getTextContent(childBlock.properties.link)})`\n break\n\n // Embed\n case 'file':\n md += '\\n[File]('\n break\n case 'pdf':\n md += '\\n[PDF]('\n break\n\n // Else\n case 'divider':\n md += '\\n---'\n break\n default:\n md += '\\n'\n }\n }\n return md\n }\n}\n\nexport function decorationsToMarkdown(decos: Decoration[], recordMap: ExtendedRecordMap) {\n if (!decos) return String()\n return decos.reduce((md, deco) => {\n const [text, subdecos] = deco\n if (!subdecos) return md + text\n else\n return (\n md +\n subdecos.reduce((md, subdeco) => {\n switch (subdeco[0]) {\n case 'p': {\n const blockId = subdeco[1]\n const linkedBlock = recordMap.block[blockId]?.value\n if (!linkedBlock) {\n console.debug('\"p\" missing block', blockId)\n return md\n }\n const title = getBlockTitle(linkedBlock, recordMap)\n const url = getBlockLink(blockId, recordMap)\n return md + `[${title}](${url})`\n }\n case 'a': {\n const url = subdeco[1]\n return md + `[${text}](${url})`\n }\n default:\n return md\n }\n }, String())\n )\n }, String())\n}\n\nconst getBlockLink = (blockId: string, recordMap: ExtendedRecordMap, domain = 'https://texonom.com') =>\n `${domain}/${getCanonicalPageId(blockId, recordMap)}`\n"],"mappings":"AAAA,OAAS,OAAAA,EAAK,YAAAC,MAAgB,YCE5B,IAAAC,EAAe,aACfC,EAAW,gBCHb,OAAS,QAAAC,MAAY,OACrB,OAAS,aAAAC,EAAW,SAAAC,MAAa,cAEjC,OAAOC,MAAc,WAErB,OAAS,WAAAC,EAAS,UAAAC,MAAc,YAChC,OAAS,aAAAC,MAAiB,mBAC1B,OAAS,iBAAAC,EAAe,sBAAAC,EAAoB,eAAAC,EAAa,cAAAC,EAAY,kBAAAC,MAAsB,kBAIpF,IAAeC,EAAf,cAAqCR,CAAQ,CAA7C,kCAEL,WAAQC,EAAO,OAAO,aAAc,CAClC,YAAa,qBACf,CAAC,EACD,MAAM,SAAU,CAAC,CACnB,EAEaQ,EAAN,cAAkCD,CAAc,CAmBrD,aAAc,CACZ,MAAM,EAfR,YAASP,EAAO,OAAO,cAAe,OAAQ,CAC5C,YAAa,eACf,CAAC,EACD,UAAOA,EAAO,OAAO,YAAa,CAChC,SAAU,GACV,YAAa,aACf,CAAC,EACD,eAAYA,E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,cAAc","names":["Cli","Builtins","displayName","version","join","writeFile","mkdir","prettier","Command","Option","NotionAPI","getBlockTitle","getCanonicalPageId","parsePageId","formatDate","getTextContent","NotionCommand","NotionExportCommand","id","recordMap","root","filename","target","ext","folder","path","_a","page","md","parent","properties","property","propName","propType","value","decorationsToMarkdown","child","childBlock","title","collection","views","children","view","results","result","parentFolder","childPage","decos","deco","text","subdecos","subdeco","blockId","linkedBlock","url","getBlockLink","domain","cli","Cli","displayName","version","NotionExportCommand","Builtins"]}
1
+ {"version":3,"sources":["../../src/main.ts","../../package.json","../../src/notion/export.ts","../../src/notion/index.ts"],"sourcesContent":["import { Cli, Builtins } from 'clipanion'\n\nimport { version, displayName } from '../package.json'\nimport { NotionExportCommand } from './notion/export'\n\nconst cli = new Cli({\n binaryName: 'notion',\n binaryLabel: displayName,\n binaryVersion: version\n})\n\ncli.register(NotionExportCommand)\ncli.register(Builtins.HelpCommand)\ncli.register(Builtins.VersionCommand)\ncli.runExit(process.argv.slice(2), Cli.defaultContext)\n\nexport * from './notion/export'\n","{\n \"name\": \"@texonom/cli\",\n \"displayName\": \"Notion CLI\",\n \"version\": \"1.2.0\",\n \"type\": \"module\",\n \"description\": \"Texonom CLI which has ability to export data from Notion.so\",\n \"repository\": \"texonom/notion-node\",\n \"author\": \"Alan Jo <sungle3737@gmail.com>\",\n \"license\": \"MIT\",\n \"main\": \"./build/src/main.js\",\n \"module\": \"./build/src/main.js\",\n \"types\": \"./build/src/main.d.ts\",\n \"sideEffects\": false,\n \"files\": [\n \"build\"\n ],\n \"engines\": {\n \"node\": \">=v12.22.12\"\n },\n \"bin\": {\n \"notion\": \"./build/src/main.js\"\n },\n \"scripts\": {\n \"build\": \"tsc && tsup\",\n \"watch\": \"tsup --watch --silent --onSuccess 'echo build successful'\",\n \"test\": \"vitest --run\",\n \"prerelease\": \"standard-version --skip.changelog --prerelease\",\n \"release\": \"standard-version --release-as\",\n \"pu\": \"pnpm publish\"\n },\n \"dependencies\": {\n \"@texonom/nclient\": \"workspace:^\",\n \"@texonom/ntypes\": \"workspace:^\",\n \"@texonom/nutils\": \"workspace:^\",\n \"JSONStream\": \"^1.3.5\",\n \"clipanion\": \"^3.2.1\",\n \"graceful-fs\": \"^4.2.11\",\n \"prettier\": \"^3.0.1\"\n },\n \"standard-version\": {\n \"skip\": {\n \"commit\": true,\n \"tag\": true\n }\n },\n \"devDependencies\": {\n \"@types/graceful-fs\": \"^4.1.6\",\n \"@types/jsonstream\": \"^0.8.31\"\n }\n}\n","import { join } from 'path'\nimport { mkdir, readFile } from 'fs/promises'\nimport JSONStream from 'JSONStream'\nimport fs from 'graceful-fs'\nimport { promisify } from 'util'\nimport stream from 'stream'\n\nimport prettier from 'prettier'\n\nimport { Option } from 'clipanion'\nimport { NotionAPI } from '@texonom/nclient'\nimport {\n getBlockTitle,\n getCanonicalPageId,\n parsePageId,\n formatDate,\n getTextContent,\n getBlockParent,\n defaultMapImageUrl,\n getAllInSpace,\n getPageTitle\n} from '@texonom/nutils'\nimport { isCollection, isSpace } from '@texonom/ntypes'\n\nimport { NotionCommand } from '.'\n\nimport type { PageTree } from '@texonom/nutils'\nimport type { ExtendedRecordMap, Decoration, PageBlock, Block, PageMap, CollectionViewBlock } from '@texonom/ntypes'\n\nlet writeFile = promisify(fs.writeFile)\n\nexport class NotionExportCommand extends NotionCommand {\n static paths = [['export']]\n notion: NotionAPI\n recordMap: ExtendedRecordMap\n pageTree: PageTree\n pageMap: PageMap\n promises: Promise<unknown>[] = []\n\n folder = Option.String('-o,--output', 'data', {\n description: 'Export folder'\n })\n validation = Option.Boolean('-v,--validation', {\n description: 'Validation exported data only'\n })\n update = Option.Boolean('-u,--update', {\n description: 'Update exported data and resave to --folder'\n })\n page = Option.String('-p,--page', {\n required: true,\n description: 'Target page to export'\n })\n recursive = Option.Boolean('-r,--recursive', {\n description: 'Recursively export children'\n })\n prefetch = Option.Boolean('-f, --prefetch', {\n description: 'Prefetch all space for faster export (recommended for exporting all pages in a space)'\n })\n load = Option.Boolean('-l, --load', {\n description: 'Load datas from exported cache folder --folder'\n })\n raw = Option.Boolean('--raw', {\n description: 'Export raw recordMap JSON data \\n Markdown format do not preserve all information'\n })\n dataset = Option.Boolean('-d, --dataset', {\n description: 'Export as dataset for LLM learning'\n })\n list: string[]\n constructor() {\n super()\n }\n\n // Main execution function\n async execute() {\n await super.execute()\n const id = parsePageId(this.page)\n this.notion = new NotionAPI()\n if (this.validation) writeFile = async () => {}\n\n // Load\n if (this.load) await this.loadRaw()\n if (this.prefetch) await this.fetchRawSpace(id)\n\n console.time('time spent')\n // Save\n if (this.raw)\n if (this.recursive) await this.saveRawSpace()\n else await this.saveRawPage(id)\n // Export\n else await this.exportMd(id, this.folder)\n await Promise.all(this.promises)\n console.timeEnd('time spent')\n // Update\n if (this.update)\n if (this.recursive) await this.saveRawSpace()\n else await this.saveRawPage(id)\n }\n\n async loadRaw() {\n console.time('load prefetch file')\n const promises = []\n promises.push(readFile(join(this.folder, 'recordMap', 'block.json'), 'utf8').then(JSON.parse))\n promises.push(readFile(join(this.folder, 'recordMap', 'collection.json'), 'utf8').then(JSON.parse))\n promises.push(readFile(join(this.folder, 'recordMap', 'notion_user.json'), 'utf8').then(JSON.parse))\n promises.push(readFile(join(this.folder, 'recordMap', 'space.json'), 'utf8').then(JSON.parse))\n promises.push(readFile(join(this.folder, 'recordMap', 'collection_view.json'), 'utf8').then(JSON.parse))\n promises.push(readFile(join(this.folder, 'recordMap', 'collection_query.json'), 'utf8').then(JSON.parse))\n promises.push(readFile(join(this.folder, 'recordMap', 'signed_urls.json'), 'utf8').then(JSON.parse))\n promises.push(readFile(join(this.folder, 'pageTree.json'), 'utf8').then(JSON.parse))\n\n const [block, collection, notion_user, space, collection_view, collection_query, signed_urls, pageTree] =\n await Promise.all(promises)\n\n const pageMap = {}\n const inputStream = fs.createReadStream(join(this.folder, 'pageMap.json'))\n const parseStream = JSONStream.parse('*')\n inputStream.pipe(parseStream)\n parseStream.on('data', (recordMap: ExtendedRecordMap) => {\n const key = Object.keys(recordMap.block)[0]\n pageMap[key] = recordMap\n })\n await new Promise(res => stream.finished(parseStream, err => res(err)))\n this.pageMap = pageMap\n this.pageTree = pageTree\n this.recordMap = { block, collection, notion_user, space, collection_query, collection_view, signed_urls }\n console.timeEnd('load prefetch file')\n }\n\n async fetchRawSpace(startPage: string) {\n const { recordMap, pageTree, pageMap } = await getAllInSpace(\n startPage,\n this.notion.getPage.bind(this.notion),\n this.notion.getBlocks.bind(this.notion),\n this.notion.fetchCollections.bind(this.notion),\n this.recordMap\n )\n this.pageMap = pageMap\n this.recordMap = recordMap\n this.pageTree = pageTree\n }\n\n async saveRawSpace() {\n if (this.validation) return\n await mkdir(this.folder, { recursive: true })\n const ext = 'json'\n console.time('write file')\n const promises = []\n await mkdir(join(this.folder, 'recordMap'), { recursive: true })\n for (const table in this.recordMap)\n promises.push(writeFile(`${join(this.folder, 'recordMap', table)}.${ext}`, JSON.stringify(this.recordMap[table])))\n\n const outputStream = fs.createWriteStream(`${join(this.folder, 'pageMap')}.${ext}`)\n const transformStream = JSONStream.stringifyObject()\n transformStream.pipe(outputStream)\n // @ts-ignore\n for (const key in this.pageMap) transformStream.write([key, this.pageMap[key]])\n transformStream.end()\n\n promises.push(writeFile(`${join(this.folder, 'pageTree')}.${ext}`, JSON.stringify(this.pageTree)))\n\n await Promise.all(promises)\n console.timeEnd('write file')\n }\n\n async saveRawPage(id: string) {\n if (this.validation) return\n await mkdir(this.folder, { recursive: true })\n const recordMap = await this.notion.getPage(id)\n const filename = `${getCanonicalPageId(id, recordMap)}`\n let target = JSON.stringify(recordMap)\n const ext = 'json'\n target = await prettier.format(target, { parser: 'json' })\n await writeFile(`${join(this.folder, filename)}.${ext}`, target)\n }\n\n async exportMd(id: string, folder: string) {\n try {\n let recordMap = this.pageMap ? this.pageMap[id] : await this.notion.getPage(id)\n if (!this.recursive) this.recordMap = recordMap\n try {\n if (!recordMap) recordMap = await this.notion.getPage(id)\n } catch {\n return\n }\n if (!['page', 'collection_view_page'].includes(recordMap.block[id].value.type)) throw new Error('Not a page')\n const target = await this.pageToMarkdown(id, recordMap, folder)\n const path = join(folder, `${getCanonicalPageId(id, recordMap)}`)\n this.promises.push(writeFile(`${path}.md`, target))\n } catch (e) {\n console.error(id, e)\n }\n }\n\n async pageToMarkdown(id: string, recordMap: ExtendedRecordMap, folder: string) {\n const page = recordMap.block[id].value as PageBlock\n\n // Metadata\n let md = `---\\n`\n md += `Title: ${await this.decorationsToMarkdown(\n page.properties?.title ? page.properties.title : [['Untitled']],\n recordMap\n )}\\n`\n const parent = getBlockParent(page, recordMap)\n if (isSpace(parent)) md += `Parent: ${parent.name}\\n`\n else if (isCollection(parent)) md += `Parent: ${getTextContent(parent.name)}\\n`\n else if (parent) md += `Parent: ${getBlockTitle(parent, recordMap)}\\n`\n\n // Collection Attributes\n if (isCollection(parent)) {\n const properties = parent?.schema ? Object.keys(parent.schema) : []\n properties.splice(properties.indexOf('title'), 1)\n for (const property of properties) {\n const propName = parent.schema[property].name\n const propType = parent.schema[property].type\n let value = String()\n switch (propType) {\n case 'text':\n value = page?.properties?.[property]\n ? await this.decorationsToMarkdown(page.properties[property], recordMap)\n : ''\n break\n case 'created_by': {\n const user = await this.getUser(page.created_by_id, recordMap)\n value = user ? user.name : 'Unknown'\n break\n }\n case 'last_edited_by': {\n const user = await this.getUser(page.last_edited_by_id, recordMap)\n value = user ? user.name : 'Unknown'\n break\n }\n case 'created_time':\n value = formatDate(page.created_time)\n break\n case 'last_edited_time':\n value = formatDate(page.last_edited_time)\n break\n default:\n value = ''\n }\n md += `${propName}: ${value}\\n`\n }\n }\n md += '---\\n'\n\n return md + (await this.childrenToMd(page, recordMap, '\\n', folder, page))\n }\n\n async getBlock(id: string, recordMap: ExtendedRecordMap, message = '') {\n let block = recordMap.block[id]?.value\n if (!block && this.recordMap) block = this.recordMap.block[id]?.value\n try {\n if (!block && this.token) {\n const notion = new NotionAPI({ authToken: this.token })\n const response = await notion.getBlocks([id])\n block = response.recordMap?.block?.[id]?.value\n }\n } catch {\n if (!block) console.debug(`${message} Missing block ${id}`)\n }\n if (block) {\n recordMap.block[id] = { value: block, role: 'reader' }\n if (this.recordMap) this.recordMap.block[id] = { value: block, role: 'reader' }\n }\n return block\n }\n\n async getUser(id: string, recordMap: ExtendedRecordMap) {\n let user = recordMap.notion_user[id]?.value\n if (!user && this.recordMap) user = this.recordMap.notion_user[id]?.value\n try {\n if (!user && this.token) {\n const notion = new NotionAPI({ authToken: this.token })\n const response = await notion.getUsers([id])\n user = response.recordMapWithRoles?.notion_user?.[id]?.value\n }\n } catch {\n if (!user) console.debug(`Missing user ${id}`)\n }\n if (user) {\n recordMap.notion_user[id] = { value: user, role: 'reader' }\n if (this.recordMap) this.recordMap.notion_user[id] = { value: user, role: 'reader' }\n }\n return user\n }\n\n async getSpace(id: string, recordMap: ExtendedRecordMap) {\n let space = recordMap.space[id]?.value\n if (!space && this.recordMap) space = this.recordMap.space[id]?.value\n try {\n if (!space && this.token) {\n const notion = new NotionAPI({ authToken: this.token })\n const response = await notion.getSpaces([id])\n space = response.recordMapWithRoles?.space?.[id]?.value\n if (space) {\n recordMap.space[id] = { value: space, role: 'reader' }\n if (this.recordMap) this.recordMap.space[id] = { value: space, role: 'reader' }\n }\n }\n } catch {\n if (!space) console.debug(`Missing space ${id}`)\n }\n return space\n }\n\n async getCollection(collectionViewBlock: CollectionViewBlock, recordMap: ExtendedRecordMap, message = '') {\n const collectionId = collectionViewBlock.collection_id\n let collection = recordMap.collection[collectionViewBlock.collection_id]?.value\n if (!collection && this.recordMap) {\n collection = this.recordMap.collection[collectionId]?.value\n if (collection) {\n recordMap.collection[collectionId] = this.recordMap.collection?.[collectionId]\n for (const viewId of collectionViewBlock.view_ids)\n recordMap.collection_view[viewId] = this.recordMap.collection_view?.[viewId]\n }\n }\n try {\n if (!collection && this.token) {\n const notion = new NotionAPI({ authToken: this.token })\n const response = await notion.getPageRaw(collectionViewBlock.id)\n collection = response.recordMap.collection[collectionId]?.value\n if (collection) {\n recordMap.collection_view = { ...recordMap.collection_view, ...response.recordMap.collection_view }\n recordMap.collection = { ...recordMap.collection, ...response.recordMap.collection }\n recordMap.block = { ...recordMap.block, ...response.recordMap.block }\n this.recordMap.collection_view = { ...this.recordMap.collection_view, ...response.recordMap.collection_view }\n this.recordMap.collection = { ...this.recordMap.collection, ...response.recordMap.collection }\n this.recordMap.block = { ...this.recordMap.block, ...response.recordMap.block }\n }\n }\n } catch {\n if (!collection) console.debug(`${message} Missing collection block ${collectionViewBlock.id}`)\n }\n await this.getCollectionView(collectionId, collectionViewBlock.view_ids[0], recordMap, message)\n return collection\n }\n\n async getCollectionView(collectionId: string, viewId: string, recordMap: ExtendedRecordMap, message = '') {\n let results = recordMap.collection_query?.[collectionId]?.[viewId]?.collection_group_results\n if (!results && this.recordMap) {\n results = this.recordMap.collection_query?.[collectionId]?.[viewId]?.collection_group_results\n if (results) {\n recordMap.collection_query![collectionId] = {\n ...recordMap.collection_query![collectionId],\n [viewId]: this.recordMap.collection_query?.[collectionId]?.[viewId]\n }\n recordMap.collection![collectionId] = {\n ...recordMap.collection![collectionId],\n [viewId]: this.recordMap.collection?.[collectionId]?.[viewId]\n }\n }\n }\n try {\n if (!results && this.token) {\n const notion = new NotionAPI({ authToken: this.token })\n const response = await notion.getCollectionData(collectionId, viewId, recordMap.collection_view[viewId]?.value)\n results = response.result?.reducerResults?.collection_group_results\n if (results) {\n recordMap.collection_query![collectionId] = {\n ...recordMap.collection_query![collectionId],\n [viewId]: response.result?.reducerResults\n }\n if (this.recordMap)\n this.recordMap.collection_query![collectionId] = {\n ...this.recordMap.collection_query![collectionId],\n [viewId]: response.result?.reducerResults\n }\n for (const blockId in response.recordMap.block) {\n const block = response.recordMap.block[blockId].value\n if (block) {\n recordMap.block[blockId] = { value: block, role: 'reader' }\n if (this.recordMap) this.recordMap.block[blockId] = { value: block, role: 'reader' }\n }\n }\n for (const collection in response.recordMap.collection) {\n const collectionValue = response.recordMap.collection[collection].value\n if (collectionValue) {\n recordMap.collection[collection] = { value: collectionValue, role: 'reader' }\n if (this.recordMap) this.recordMap.collection[collection] = { value: collectionValue, role: 'reader' }\n }\n }\n for (const collectionView in response.recordMap.collection_view) {\n const collectionViewValue = response.recordMap.collection_view[collectionView].value\n if (collectionViewValue) {\n recordMap.collection_view[collectionView] = { value: collectionViewValue, role: 'reader' }\n if (this.recordMap)\n this.recordMap.collection_view[collectionView] = { value: collectionViewValue, role: 'reader' }\n }\n }\n }\n }\n } catch {\n if (!results) console.debug(`${message} Missing collection view ${viewId}`)\n }\n return results\n }\n\n async childrenToMd(parentBlock: Block, recordMap: ExtendedRecordMap, prefix: string, folder: string, page: Block) {\n let md = String()\n let numbering = 1\n for (const child of parentBlock.content ? parentBlock.content : []) {\n const childBlock = await this.getBlock(child, recordMap, `${child} from ${getBlockTitle(page, recordMap)}`)\n if (!childBlock) continue\n\n const title = childBlock?.properties?.title\n switch (childBlock.type) {\n case 'header':\n md += `${prefix}# ${await this.decorationsToMarkdown(title, recordMap)}`\n break\n case 'sub_header':\n md += `${prefix}## ${await this.decorationsToMarkdown(title, recordMap)}`\n break\n case 'sub_sub_header':\n md += `${prefix}### ${await this.decorationsToMarkdown(title, recordMap)}`\n break\n case 'text':\n md += `${prefix}${await this.decorationsToMarkdown(title, recordMap)}`\n break\n case 'bulleted_list':\n md += `${prefix}- ${await this.decorationsToMarkdown(title, recordMap)}`\n break\n case 'numbered_list':\n md += `${prefix}${numbering++}. ${await this.decorationsToMarkdown(title, recordMap)}`\n break\n case 'to_do':\n md += `${prefix}- [ ] ${await this.decorationsToMarkdown(title, recordMap)}`\n break\n case 'toggle':\n md += `${prefix}<details><summary>${prefix}${prefix}${await this.decorationsToMarkdown(\n title,\n recordMap\n )}</summary>\\n`\n break\n case 'quote':\n md += (await this.decorationsToMarkdown(title, recordMap, `\\n${prefix.trim()}> `)) + '\\n'\n break\n case 'code':\n md += `${prefix}\\`\\`\\`type${await this.decorationsToMarkdown(title, recordMap)}\\`\\`\\``\n break\n case 'equation':\n md += `${prefix}$$${await this.decorationsToMarkdown(title, recordMap)}$$`\n break\n case 'callout': {\n md += (await this.decorationsToMarkdown(title, recordMap, `\\n${prefix.trim()}> `)) + '\\n'\n break\n }\n case 'bookmark': {\n const nesting = `\\n${prefix.trim()}> `\n md += `${nesting}[${getTextContent(\n childBlock.properties?.title ? childBlock.properties.title : [['Untitled']]\n )}](${getTextContent(childBlock.properties.link)})\\n`\n break\n }\n case 'external_object_instance': {\n try {\n const url = childBlock.format.original_url\n const title = childBlock.format.attributes\n ? childBlock.format.attributes.filter(attr => attr.id === 'title')[0]?.values?.[0]\n : url\n if (!url) break\n md += `${prefix}${prefix}[${title}](${url})${prefix}`\n break\n } catch (e) {\n console.error(e, childBlock.id)\n break\n }\n }\n\n // Collection\n case 'collection_view_page':\n case 'collection_view': {\n const collection = await this.getCollection(\n childBlock as CollectionViewBlock,\n recordMap,\n `${childBlock.id} from ${getPageTitle(recordMap)}`\n )\n if (!collection) continue\n\n // Generate Table\n md += `${prefix}### ${await this.decorationsToMarkdown(collection.name, recordMap)}`\n md += `${prefix}|Title|\\n|:-:|`\n const views = childBlock.view_ids\n .map(id => {\n if (!recordMap.collection_view[id]) console.debug(`Missing view ${id} from ${collection.name}`)\n return recordMap.collection_view[id]?.value\n })\n .filter(Boolean)\n const children = []\n for (const view of views) {\n const results = await this.getCollectionView(\n collection.id,\n view.id,\n recordMap,\n `${collection.name} ${view.name}`\n )\n if (results) for (const result of results.blockIds) children.push(result)\n else break\n }\n for (const childPage of children) {\n const childBlock = recordMap.block[childPage]?.value\n if (!childBlock) console.debug(`no ${childPage} in ${collection.name[0]}`)\n md += `${prefix}|[${getBlockTitle(childBlock, recordMap)}](${getBlockLink(childPage, recordMap)})|`\n }\n\n // Make children page\n if (this.recursive && children.length) {\n const parentFolder = join(\n folder,\n `${getCanonicalPageId(page.id, recordMap)}`,\n `${getCanonicalPageId(collection.id, recordMap)}`\n )\n await mkdir(parentFolder, { recursive: true })\n for (const childPage of children) this.promises.push(this.exportMd(childPage, parentFolder))\n }\n break\n }\n case 'page': {\n md += `${prefix}${prefix}[${getBlockTitle(childBlock, recordMap)}](${getBlockLink(\n childBlock.id,\n recordMap\n )})${prefix}`\n if (this.recursive) {\n const parentFolder = join(folder, `${getCanonicalPageId(page.id, recordMap)}`)\n await mkdir(parentFolder, { recursive: true })\n this.promises.push(this.exportMd(childBlock.id, parentFolder))\n }\n break\n }\n case 'alias': {\n const aliasBlock = recordMap.block[childBlock.format?.alias_pointer?.id]?.value\n if (!aliasBlock) {\n console.debug(\n `Missing alias ${childBlock.format?.alias_pointer?.id} from ${getBlockTitle(page, recordMap)} ${page.id}`\n )\n continue\n }\n md += `${prefix}${prefix}[${getBlockTitle(aliasBlock, recordMap)}](${getBlockLink(\n aliasBlock.id,\n recordMap\n )})${prefix}`\n break\n }\n\n // Media\n case 'image': {\n const caption = childBlock.properties.caption ? getTextContent(childBlock.properties.caption) : ''\n md += `${prefix}![${caption}](${defaultMapImageUrl(childBlock.format?.display_source, childBlock)})`\n break\n }\n\n case 'video':\n md += `${prefix}<video src=\"${childBlock.format.display_source} />`\n break\n\n // Embed\n case 'file':\n md += `${prefix}[File](${childBlock.format?.display_source})`\n break\n case 'pdf':\n md += `${prefix}<iframe src=\"${childBlock.format?.display_source}\"/>`\n break\n\n // Else\n case 'divider':\n md += `${prefix}---`\n break\n case 'column_list':\n break\n case 'column':\n break\n default:\n md += `${prefix}`\n }\n\n // Finalize\n if (childBlock.content && childBlock.type !== 'page' && childBlock.type !== 'collection_view_page') {\n const nestedPrefix = ['toggle', `transclusion_container`, `transclusion_reference`, 'column_list'].includes(\n childBlock.type\n )\n ? prefix\n : `\\n${prefix.trim()}> `\n md += await this.childrenToMd(childBlock, recordMap, nestedPrefix, folder, page)\n if (childBlock.type === 'column') md += '\\n'\n }\n if (childBlock.type === 'toggle') md += `${prefix}</details>${prefix}`\n }\n return md\n }\n\n async decorationsToMarkdown(decos: Decoration[], recordMap: ExtendedRecordMap, prefix = '') {\n if (!decos) return String()\n let md = String()\n for (const deco of decos) {\n let wrapper = String()\n const [text, subdecos] = deco\n if (!subdecos) {\n md += text\n } else {\n let textonly: string = text\n for (const subdeco of subdecos)\n switch (subdeco[0]) {\n case 'p': {\n const blockId = subdeco[1]\n const linkedBlock = await this.getBlock(blockId, recordMap, `\"p\" ${getPageTitle(recordMap)}`)\n if (!linkedBlock) break\n\n const title = getBlockTitle(linkedBlock, recordMap)\n const url = getBlockLink(blockId, recordMap)\n textonly = `[${title}](${url})`\n break\n }\n case 'a': {\n const url = subdeco[1]\n textonly = `[${text}](${url})`\n break\n }\n case 'i':\n wrapper += '*'\n break\n case 'b':\n wrapper += '**'\n break\n case 'h':\n // Disable for now == syntax does not supported well\n wrapper += ''\n break\n case 'c':\n wrapper += '`'\n break\n case 's':\n wrapper += '~~'\n break\n case 'e':\n wrapper += '$'\n textonly = subdeco[1]\n break\n case 'eoi': {\n try {\n const objectid = subdeco[1]\n const object = await this.getBlock(objectid, recordMap, `\"eoi\" ${getPageTitle(recordMap)}`)\n if (!object) break\n const url = object.format.uri\n const title = object.format.attributes\n ? object.format.attributes?.filter(attr => attr.id === 'title')[0]?.values?.[0]\n : url\n if (!url) break\n textonly = `[${title}](${url})`\n break\n } catch (e) {\n console.error(e, deco)\n break\n }\n }\n case 'u': {\n const user = await this.getUser(subdeco[1], recordMap)\n if (!user) break\n textonly = `[@${user.name}](mailto:${user.email})`\n break\n }\n }\n let decorated: string = textonly\n if (subdecos.find(subdeco => subdeco[0] === '_')) decorated = `<u>${textonly}</u>`\n decorated = wrapper + decorated + wrapper.split('').reverse().join('')\n md += decorated\n }\n }\n const lines = md.split('\\n')\n const prefixed = lines.map(line => prefix + line)\n return prefixed.join('')\n }\n}\n\nconst getBlockLink = (blockId: string, recordMap: ExtendedRecordMap, domain = 'https://texonom.com') =>\n `${domain}/${getCanonicalPageId(blockId, recordMap)}`\n","import { Command, Option } from 'clipanion'\n\nexport abstract class NotionCommand extends Command {\n // for private page or eoi like github inline block\n token = Option.String('-t,--token', {\n description: 'Notion Access Token'\n })\n async execute() {}\n}\n"],"mappings":"AAAA,OAAS,OAAAA,EAAK,YAAAC,MAAgB,YCE5B,IAAAC,EAAe,aACfC,EAAW,QCHb,OAAS,QAAAC,MAAY,OACrB,OAAS,SAAAC,EAAO,YAAAC,MAAgB,cAChC,OAAOC,MAAgB,aACvB,OAAOC,MAAQ,cACf,OAAS,aAAAC,OAAiB,OAC1B,OAAOC,OAAY,SAEnB,OAAOC,OAAc,WAErB,OAAS,UAAAC,MAAc,YACvB,OAAS,aAAAC,MAAiB,mBAC1B,OACE,iBAAAC,EACA,sBAAAC,EACA,eAAAC,GACA,cAAAC,EACA,kBAAAC,EACA,kBAAAC,GACA,sBAAAC,GACA,iBAAAC,GACA,gBAAAC,MACK,kBACP,OAAS,gBAAAC,EAAc,WAAAC,OAAe,kBCtBtC,OAAS,WAAAC,GAAS,UAAAC,OAAc,YAEzB,IAAeC,EAAf,cAAqCF,EAAQ,CAA7C,kCAEL,WAAQC,GAAO,OAAO,aAAc,CAClC,YAAa,qBACf,CAAC,EACD,MAAM,SAAU,CAAC,CACnB,EDqBA,IAAIE,EAAYC,GAAUC,EAAG,SAAS,EAEzBC,EAAN,cAAkCC,CAAc,CAqCrD,aAAc,CACZ,MAAM,EAhCR,cAA+B,CAAC,EAEhC,YAASC,EAAO,OAAO,cAAe,OAAQ,CAC5C,YAAa,eACf,CAAC,EACD,gBAAaA,EAAO,QAAQ,kBAAmB,CAC7C,YAAa,+BACf,CAAC,EACD,YAASA,EAAO,QAAQ,cAAe,CACrC,YAAa,6CACf,CAAC,EACD,UAAOA,EAAO,OAAO,YAAa,CAChC,SAAU,GACV,YAAa,uBACf,CAAC,EACD,eAAYA,EAAO,QAAQ,iBAAkB,CAC3C,YAAa,6BACf,CAAC,EACD,cAAWA,EAAO,QAAQ,iBAAkB,CAC1C,YAAa,uFACf,CAAC,EACD,UAAOA,EAAO,QAAQ,aAAc,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ACpEK,EAAYR,EAAUQ,EAAYR,EAAQ,MAAM,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,EACrE5D,GAAMoE,GAKV,OAFcpE,EAAG,MAAM;AAAA,CAAI,EACJ,IAAIqE,GAAQ/B,EAAS+B,CAAI,EAChC,KAAK,EAAE,CACzB,CACF,EA/nBahH,EACJ,MAAQ,CAAC,CAAC,QAAQ,CAAC,EAgoB5B,IAAM+F,EAAe,CAACnB,EAAiBvD,EAA8B4F,EAAS,wBAC5E,GAAGA,KAAU/E,EAAmB0C,EAASvD,CAAS,IF5pBpD,IAAM6F,EAAM,IAAIC,EAAI,CAClB,WAAY,SACZ,YAAaC,EACb,cAAeC,CACjB,CAAC,EAEDH,EAAI,SAASI,CAAmB,EAChCJ,EAAI,SAASK,EAAS,WAAW,EACjCL,EAAI,SAASK,EAAS,cAAc,EACpCL,EAAI,QAAQ,QAAQ,KAAK,MAAM,CAAC,EAAGC,EAAI,cAAc","names":["Cli","Builtins","displayName","version","join","mkdir","readFile","JSONStream","fs","promisify","stream","prettier","Option","NotionAPI","getBlockTitle","getCanonicalPageId","parsePageId","formatDate","getTextContent","getBlockParent","defaultMapImageUrl","getAllInSpace","getPageTitle","isCollection","isSpace","Command","Option","NotionCommand","writeFile","promisify","fs","NotionExportCommand","NotionCommand","Option","id","parsePageId","NotionAPI","promises","readFile","join","block","collection","notion_user","space","collection_view","collection_query","signed_urls","pageTree","pageMap","inputStream","parseStream","JSONStream","recordMap","key","res","stream","err","startPage","getAllInSpace","mkdir","ext","table","outputStream","transformStream","filename","getCanonicalPageId","target","prettier","folder","path","e","_a","_b","page","md","parent","getBlockParent","isSpace","isCollection","getTextContent","getBlockTitle","properties","property","propName","propType","value","user","formatDate","message","_c","_d","_e","collectionViewBlock","collectionId","viewId","response","_f","_g","_h","_i","_j","_k","_l","_m","_n","_o","results","blockId","collectionValue","collectionView","collectionViewValue","parentBlock","prefix","numbering","child","childBlock","title","nesting","url","attr","getPageTitle","views","children","view","result","childPage","getBlockLink","parentFolder","aliasBlock","caption","defaultMapImageUrl","nestedPrefix","decos","deco","wrapper","text","subdecos","textonly","subdeco","linkedBlock","objectid","object","decorated","line","domain","cli","Cli","displayName","version","NotionExportCommand","Builtins"]}
@@ -0,0 +1,42 @@
1
+ import { NotionAPI } from '@texonom/nclient';
2
+ import { NotionCommand } from '.';
3
+ import type { PageTree } from '@texonom/nutils';
4
+ import type { ExtendedRecordMap, Decoration, Block, PageMap, CollectionViewBlock } from '@texonom/ntypes';
5
+ export declare class NotionExportCommand extends NotionCommand {
6
+ static paths: string[][];
7
+ notion: NotionAPI;
8
+ recordMap: ExtendedRecordMap;
9
+ pageTree: PageTree;
10
+ pageMap: PageMap;
11
+ promises: Promise<unknown>[];
12
+ folder: string;
13
+ validation: boolean;
14
+ update: boolean;
15
+ page: string;
16
+ recursive: boolean;
17
+ prefetch: boolean;
18
+ load: boolean;
19
+ raw: boolean;
20
+ dataset: boolean;
21
+ list: string[];
22
+ constructor();
23
+ execute(): Promise<void>;
24
+ loadRaw(): Promise<void>;
25
+ fetchRawSpace(startPage: string): Promise<void>;
26
+ saveRawSpace(): Promise<void>;
27
+ saveRawPage(id: string): Promise<void>;
28
+ exportMd(id: string, folder: string): Promise<void>;
29
+ pageToMarkdown(id: string, recordMap: ExtendedRecordMap, folder: string): Promise<string>;
30
+ getBlock(id: string, recordMap: ExtendedRecordMap, message?: string): Promise<Block>;
31
+ getUser(id: string, recordMap: ExtendedRecordMap): Promise<import("@texonom/ntypes").User>;
32
+ getSpace(id: string, recordMap: ExtendedRecordMap): Promise<import("@texonom/ntypes").Space>;
33
+ getCollection(collectionViewBlock: CollectionViewBlock, recordMap: ExtendedRecordMap, message?: string): Promise<import("@texonom/ntypes").Collection>;
34
+ getCollectionView(collectionId: string, viewId: string, recordMap: ExtendedRecordMap, message?: string): Promise<{
35
+ type: string;
36
+ blockIds: string[];
37
+ hasMore: boolean;
38
+ }>;
39
+ childrenToMd(parentBlock: Block, recordMap: ExtendedRecordMap, prefix: string, folder: string, page: Block): Promise<string>;
40
+ decorationsToMarkdown(decos: Decoration[], recordMap: ExtendedRecordMap, prefix?: string): Promise<string>;
41
+ }
42
+ //# sourceMappingURL=export.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"export.d.ts","sourceRoot":"","sources":["../../../src/notion/export.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAc5C,OAAO,EAAE,aAAa,EAAE,MAAM,GAAG,CAAA;AAEjC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,UAAU,EAAa,KAAK,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAIpH,qBAAa,mBAAoB,SAAQ,aAAa;IACpD,MAAM,CAAC,KAAK,aAAe;IAC3B,MAAM,EAAE,SAAS,CAAA;IACjB,SAAS,EAAE,iBAAiB,CAAA;IAC5B,QAAQ,EAAE,QAAQ,CAAA;IAClB,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,CAAK;IAEjC,MAAM,SAEJ;IACF,UAAU,UAER;IACF,MAAM,UAEJ;IACF,IAAI,SAGF;IACF,SAAS,UAEP;IACF,QAAQ,UAEN;IACF,IAAI,UAEF;IACF,GAAG,UAED;IACF,OAAO,UAEL;IACF,IAAI,EAAE,MAAM,EAAE,CAAA;;IAMR,OAAO;IAyBP,OAAO;IA8BP,aAAa,CAAC,SAAS,EAAE,MAAM;IAa/B,YAAY;IAuBZ,WAAW,CAAC,EAAE,EAAE,MAAM;IAWtB,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAkBnC,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM;IAuDvE,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,iBAAiB,EAAE,OAAO,SAAK;IAmB/D,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,iBAAiB;IAmBhD,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,iBAAiB;IAmBjD,aAAa,CAAC,mBAAmB,EAAE,mBAAmB,EAAE,SAAS,EAAE,iBAAiB,EAAE,OAAO,SAAK;IAgClG,iBAAiB,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,iBAAiB,EAAE,OAAO,SAAK;;;;;IA4DlG,YAAY,CAAC,WAAW,EAAE,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK;IAgM1G,qBAAqB,CAAC,KAAK,EAAE,UAAU,EAAE,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,SAAK;CAiF3F"}
@@ -0,0 +1,6 @@
1
+ import { Command } from 'clipanion';
2
+ export declare abstract class NotionCommand extends Command {
3
+ token: string;
4
+ execute(): Promise<void>;
5
+ }
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/notion/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAA;AAE3C,8BAAsB,aAAc,SAAQ,OAAO;IAEjD,KAAK,SAEH;IACI,OAAO;CACd"}
@@ -1,6 +1,6 @@
1
1
  import { Command } from 'clipanion';
2
2
  import { NotionAPI } from '@texonom/nclient';
3
- import type { ExtendedRecordMap, Decoration } from '@texonom/ntypes';
3
+ import type { ExtendedRecordMap, Decoration, Block } from '@texonom/ntypes';
4
4
  export declare abstract class NotionCommand extends Command {
5
5
  token: string;
6
6
  execute(): Promise<void>;
@@ -15,8 +15,11 @@ export declare class NotionExportCommand extends NotionCommand {
15
15
  list: string[];
16
16
  constructor();
17
17
  execute(): Promise<void>;
18
+ fetchRecordmap(id: string): Promise<ExtendedRecordMap>;
19
+ loadRecordmap(folder: string): Promise<ExtendedRecordMap>;
18
20
  exportMd(id: string, folder: string): Promise<void>;
19
- pageToMarkdown(id: string, recordMap: ExtendedRecordMap, folder: any): Promise<string>;
21
+ pageToMarkdown(id: string, recordMap: ExtendedRecordMap, folder: string): Promise<string>;
22
+ childrenToMd(parentBlock: Block, recordMap: ExtendedRecordMap, prefix: string, folder: string, page: Block): Promise<string>;
20
23
  }
21
- export declare function decorationsToMarkdown(decos: Decoration[], recordMap: ExtendedRecordMap): string;
24
+ export declare function decorationsToMarkdown(decos: Decoration[], recordMap: ExtendedRecordMap, prefix?: string): string;
22
25
  //# sourceMappingURL=notion.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"notion.d.ts","sourceRoot":"","sources":["../../src/notion.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAA;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAG5C,OAAO,KAAK,EAAE,iBAAiB,EAAE,UAAU,EAAa,MAAM,iBAAiB,CAAA;AAE/E,8BAAsB,aAAc,SAAQ,OAAO;IAEjD,KAAK,SAEH;IACI,OAAO;CACd;AAED,qBAAa,mBAAoB,SAAQ,aAAa;IACpD,MAAM,CAAC,KAAK,aAAe;IAC3B,MAAM,EAAE,SAAS,CAAA;IAGjB,MAAM,SAEJ;IACF,IAAI,SAGF;IACF,SAAS,UAEP;IACF,GAAG,UAED;IACF,IAAI,EAAE,MAAM,EAAE,CAAA;;IAMR,OAAO;IAoBP,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAOnC,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,KAAA;CA0ItE;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,UAAU,EAAE,EAAE,SAAS,EAAE,iBAAiB,UA+BtF"}
1
+ {"version":3,"file":"notion.d.ts","sourceRoot":"","sources":["../../src/notion.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAA;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAY5C,OAAO,KAAK,EAAE,iBAAiB,EAAE,UAAU,EAAa,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAEtF,8BAAsB,aAAc,SAAQ,OAAO;IAEjD,KAAK,SAEH;IACI,OAAO;CACd;AAED,qBAAa,mBAAoB,SAAQ,aAAa;IACpD,MAAM,CAAC,KAAK,aAAe;IAC3B,MAAM,EAAE,SAAS,CAAA;IAGjB,MAAM,SAEJ;IACF,IAAI,SAGF;IACF,SAAS,UAEP;IACF,GAAG,UAED;IACF,IAAI,EAAE,MAAM,EAAE,CAAA;;IAMR,OAAO;IAoBP,cAAc,CAAC,EAAE,EAAE,MAAM;IAKzB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAIzD,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAYnC,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM;IA8CvE,YAAY,CAAC,WAAW,EAAE,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK;CAyKjH;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,UAAU,EAAE,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,SAAK,UAiFnG"}
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@texonom/cli",
3
3
  "displayName": "Notion CLI",
4
- "version": "1.2.0-alpha.0",
4
+ "version": "1.2.0",
5
5
  "type": "module",
6
- "description": "Robust TypeScript client for the unofficial Notion API.",
6
+ "description": "Texonom CLI which has ability to export data from Notion.so",
7
7
  "repository": "texonom/notion-node",
8
8
  "author": "Alan Jo <sungle3737@gmail.com>",
9
9
  "license": "MIT",
@@ -21,11 +21,13 @@
21
21
  "notion": "./build/src/main.js"
22
22
  },
23
23
  "dependencies": {
24
+ "JSONStream": "^1.3.5",
24
25
  "clipanion": "^3.2.1",
26
+ "graceful-fs": "^4.2.11",
25
27
  "prettier": "^3.0.1",
26
- "@texonom/nclient": "^1.2.0-alpha.0",
27
- "@texonom/ntypes": "^1.2.0-alpha.0",
28
- "@texonom/nutils": "^1.2.0-alpha.0"
28
+ "@texonom/nclient": "^1.2.0",
29
+ "@texonom/nutils": "^1.2.0",
30
+ "@texonom/ntypes": "^1.2.0"
29
31
  },
30
32
  "standard-version": {
31
33
  "skip": {
@@ -33,6 +35,10 @@
33
35
  "tag": true
34
36
  }
35
37
  },
38
+ "devDependencies": {
39
+ "@types/graceful-fs": "^4.1.6",
40
+ "@types/jsonstream": "^0.8.31"
41
+ },
36
42
  "scripts": {
37
43
  "build": "tsc && tsup",
38
44
  "watch": "tsup --watch --silent --onSuccess 'echo build successful'",
package/readme.md CHANGED
@@ -10,11 +10,18 @@
10
10
  pnpm i @texonom/cli
11
11
  ```
12
12
 
13
- ## Usages
13
+ # Usages
14
14
 
15
- ### Export
15
+ ## Export
16
16
 
17
17
  ```zsh
18
18
  ## export block, collection, collection_view and notion_user for each folder
19
19
  notion export --raw
20
20
  ```
21
+
22
+ ### Example
23
+
24
+ ```
25
+ pnpm tsx src/main.ts export -p 04089c8ae3534bf79512fc495944b321 --raw -r -f
26
+ pnpm tsx src/main.ts export -p 04089c8ae3534bf79512fc495944b321 -r -l -t -u
27
+ ```