@aiquants/markdown 13.1.0 → 13.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/README.md +21 -3
- package/dist/index.server.cjs +1 -1
- package/dist/index.server.d.ts +1 -1
- package/dist/index.server.js +95 -86
- package/dist/{markdownServiceClient-C47z3Ynu.cjs → markdownServiceClient-Dle7LnFB.cjs} +1 -1
- package/dist/{markdownServiceClient-uDeklhtG.js → markdownServiceClient-OrOuExUG.js} +7 -6
- package/dist/markdownServiceClient.d.ts +1 -0
- package/dist/mermaidFrame/NOTICES.md +1 -1
- package/dist/remarkProcessor.server.d.ts +2 -0
- package/dist/serviceClient.cjs +1 -1
- package/dist/serviceClient.js +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -58,7 +58,7 @@ export MARKDOWN_API_BINARY=/path/to/markdown-api
|
|
|
58
58
|
|
|
59
59
|
| 変数 | 既定値 | 用途 |
|
|
60
60
|
| --- | --- | --- |
|
|
61
|
-
| `MARKDOWN_SOCKET_PATH` | (必須) | サービスと通信する UNIX ドメインソケットのパス (サービスも同じ変数を読む)。未設定か空なら `parseMarkdown` は変数を名指して失敗し、`createLinkCardHandler` の処理は 500 で答え、サービスは起動しない (パスを推し量らない)。プロセスの間は変えない (輸送は接続を開く時に読み、開いた接続を使い続ける)。ソケットのディレクトリは持ち主だけが書けること (ソケットの上では何も認証しないので、ほかの利用者が先に道を取ると、呼び出しのトークンと文書を受け取り、答えを返せる) |
|
|
61
|
+
| `MARKDOWN_SOCKET_PATH` | (必須) | サービスと通信する UNIX ドメインソケットのパス (サービスも同じ変数を読む)。未設定か空なら `parseMarkdown` と `nodeMarkdownServiceClient` は変数を名指して失敗し、`createLinkCardHandler` の処理は 500 で答え、サービスは起動しない (パスを推し量らない)。プロセスの間は変えない (輸送は接続を開く時に読み、開いた接続を使い続ける)。ソケットのディレクトリは持ち主だけが書けること (ソケットの上では何も認証しないので、ほかの利用者が先に道を取ると、呼び出しのトークンと文書を受け取り、答えを返せる) |
|
|
62
62
|
| `MARKDOWN_SOCKET_MODE` | `0600` | サービスのソケットの権限。`0600` (所有者のみ) か `0660` (所有者とグループ) だけで、ほかの値ではサービスが値を名指して起動しない (ソケットの上では何も認証しないため、ほかの利用者へは開かない) |
|
|
63
63
|
| `MARKDOWN_API_BINARY` | (なし) | 自前ビルドしたバイナリの明示指定 |
|
|
64
64
|
| `MARKDOWN_API_STARTUP_TIMEOUT_MS` | `10000` | 自動起動したサービスが待ち受け開始するまでの猶予 (ミリ秒。子が先に終われば待たない)。未設定か空なら既定値で、正の整数のほかの値は子を起こす時に `RangeError` で変数を名指す |
|
|
@@ -72,7 +72,7 @@ export MARKDOWN_API_BINARY=/path/to/markdown-api
|
|
|
72
72
|
|
|
73
73
|
後の 4 つはサービス (`markdown-api`) が読む。自動起動したサービスは呼び出し元のプロセスの環境を受け継ぐ。正の数 (時間は正の時間) 以外の値ではサービスが起動しない。
|
|
74
74
|
|
|
75
|
-
`parseMarkdown
|
|
75
|
+
`parseMarkdown`・`nodeMarkdownServiceClient`・リンクのカードは `@aiquants/local-service-transport` の輸送でサービスへ届く。呼び出しは HTTP/2 の接続 1 本を分け合い、止めた呼び出しの後は次の呼び出しから新しい接続へ移る。
|
|
76
76
|
|
|
77
77
|
自動起動したサービスは起こしたホストの子で、ホストと一緒に終わる。ソケットを複数のホストで分けると、先に終わるホストの子の上の呼び出しは失敗し、次の呼び出しが子を起こす (サービスは起動のときに道のソケットを生死を問わず消すため、後に起きた子が道を取る)。ソケットを分けるホストでは、サービスをプロセスマネージャで起こす。
|
|
78
78
|
|
|
@@ -261,11 +261,29 @@ const { htmlContent, headings } = await service.convert(
|
|
|
261
261
|
```
|
|
262
262
|
|
|
263
263
|
- **Options** are `ParseOptions`, checked before anything is sent.
|
|
264
|
-
- **Transport**: in Node,
|
|
264
|
+
- **Transport**: in Node, take [`nodeMarkdownServiceClient`](#node-client), or build the client over `createLocalServiceTransport` of `@aiquants/local-service-transport`, the transport `parseMarkdown` runs on. A fast run of stopped calls loses a plain shared HTTP/2 connection, and every later call fails or hangs until the process restarts; this transport moves the next calls to a new connection.
|
|
265
265
|
- **Storage**: every call names `X-Storage-Auth-Mode: oauth2`; a token that is no RFC 6750 bearer token is refused with a `TypeError` that does not repeat it; and `userOAuthToken` (`undefined` when the reader holds none) rides as the bearer token: the service reads the cloud only with the reader's own credentials.
|
|
266
266
|
- **Errors** are the browser converter's classes, with the transport's failure as `cause` when there is one: `MarkdownResourceExhaustedError` past a size limit, an answer longer than `maxHtmlBytes` included; `MarkdownConversionTimeoutError` past a deadline, whose `timeoutMs` is the limit the call set, or `null` when the call set none and the service stopped at its own; and `MarkdownConversionError` with `code`: `unavailable` when the service cannot be reached, goes away during the call or has no provider for the document's scheme, `invalid_argument` for a refused request, `internal`.
|
|
267
267
|
A call `signal` stopped rejects with a `ConnectError` of code `canceled`, whatever the signal's reason. Any other code (`unauthenticated`, `permission_denied`) stays the `ConnectError` it is.
|
|
268
268
|
|
|
269
|
+
#### Node client
|
|
270
|
+
|
|
271
|
+
`nodeMarkdownServiceClient` of `@aiquants/markdown/server` is this client over the process's socket (`MARKDOWN_SOCKET_PATH`), for a Node host that hands a client to code written against `./service-client`:
|
|
272
|
+
|
|
273
|
+
```ts
|
|
274
|
+
import { nodeMarkdownServiceClient } from "@aiquants/markdown/server"
|
|
275
|
+
|
|
276
|
+
// Code written against ./service-client takes it as a MarkdownServiceClient
|
|
277
|
+
const { htmlContent, headings } = await nodeMarkdownServiceClient.convert(
|
|
278
|
+
{ markdownText, filePath: "notes/my-file.md", workspaceRoot: "/workspace", userOAuthToken: undefined },
|
|
279
|
+
{ deniedPathSegments: hostDenyRules, maxHtmlBytes: 4 * 1024 * 1024, timeoutMs: 10_000, signal: controller.signal },
|
|
280
|
+
)
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
- **Conversion**: it converts as `parseMarkdown` does, over the transport `parseMarkdown` and the link cards share: it waits for the service within the call's signal and deadline, starts it when nothing listens, and sends the conversion with what is left of the deadline. The options, the storage headers and the token check are those of the client above.
|
|
284
|
+
- **Errors** are those of the client above. A deadline passed while it waited or converted carries the limit the call set, not what was left of it; a service out of reach, which on Windows is every call, is `unavailable` with its socket named. An unset `MARKDOWN_SOCKET_PATH` (an `Error` naming the variable, before anything), invalid options (a `RangeError` or `TypeError` naming `MarkdownServiceClient.convert` and the option) and an invalid `MARKDOWN_API_STARTUP_TIMEOUT_MS` (a `RangeError` naming the variable, when the service has to be started) are thrown as they are.
|
|
285
|
+
- **Importing** it opens nothing: the value is frozen, and the transport connects on the first call.
|
|
286
|
+
|
|
269
287
|
## Viewer, embeds and links
|
|
270
288
|
|
|
271
289
|
`MarkdownRenderer` keys every top-level block by its content, from the keys of the last committed render: a fingerprint of the block's HTML without `data-source-lines` (a ```` ```spreadsheets ```` block's fingerprint also leaves its table's text out), and the content itself. A block takes the earliest unclaimed key of the same fingerprint and content, then the earliest unclaimed key of its fingerprint (a table whose cells changed), else a new key.
|
package/dist/index.server.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./errors-BWZJx2MD.cjs"),D=require("node:child_process"),v=require("node:fs"),U=require("node:module"),x=require("node:net"),$=require("node:path"),F=require("node:url"),j=require("@aiquants/local-service-transport"),o=require("@connectrpc/connect"),c=require("./markdownServiceClient-Dle7LnFB.cjs"),p=require("./pageFetchPort-2H18xcdi.cjs");var m=typeof document<"u"?document.currentScript:null;function g(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const t=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,t.get?t:{enumerable:!0,get:()=>e[n]})}}return r.default=e,Object.freeze(r)}const C=g(x),h=g($),a=()=>{const e=process.env.MARKDOWN_SOCKET_PATH;if(e===void 0||e==="")throw new Error("MARKDOWN_SOCKET_PATH is required: set it to the path of the markdown-api service's UNIX domain socket, the same value the service reads");return e},O=j.createLocalServiceTransport({createConnection:()=>C.connect(a()),readMaxBytes:2*u.MAX_HTML_BYTES_LIMIT+u.RESPONSE_HEADROOM_BYTES}),G=o.createClient(c.MarkdownService,O),y=()=>{try{return h.dirname(F.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:m&&m.tagName.toUpperCase()==="SCRIPT"&&m.src||new URL("index.server.cjs",document.baseURI).href))}catch{return __dirname}},R=()=>`@aiquants/markdown-${process.platform}-${process.arch}`,M="markdown-api",H=()=>{const e=process.env.MARKDOWN_API_BINARY;if(e&&v.existsSync(e))return e;try{const n=U.createRequire(h.join(y(),"index.js")).resolve(`${R()}/bin/${M}`);if(v.existsSync(n))return n}catch{}const r=h.join(y(),"..","..","go","markdown-api","dist",M);return v.existsSync(r)?r:void 0},W=()=>[`markdown-api binary not found for ${process.platform}-${process.arch}.`,`Expected the optional dependency ${R()} to be installed.`,"If your platform is unsupported, build the service yourself","(https://github.com/fehde-k/aiquants/tree/main/packages/go/markdown-api)","and point MARKDOWN_API_BINARY at it."].join(" "),B="The markdown-api service is not started from Node.js on Windows; a Windows host runs the service inside its own executable instead.",K=new Set(["ENOENT","ECONNREFUSED"]),_=()=>new Promise(e=>{const r=C.connect(a());r.on("connect",()=>{r.destroy(),e("listening")}),r.on("error",n=>{n.code==="EAGAIN"?e("listening"):e(K.has(n.code)?"absent":"unknown")})}),k=async(e,r)=>{const n=Date.now();for(;Date.now()-n<e&&!r();){if(await _()==="listening")return!0;await new Promise(t=>setTimeout(t,100))}return await _()==="listening"};let i=null,S=null;const Y=2e3,z=1e4,X=()=>{const e=process.env.MARKDOWN_API_STARTUP_TIMEOUT_MS;if(e===void 0||e==="")return z;const r=Number(e);if(!Number.isSafeInteger(r)||r<=0)throw new RangeError(`MARKDOWN_API_STARTUP_TIMEOUT_MS must be a positive integer of milliseconds; got ${JSON.stringify(e)}`);return r};let d=null;const I=()=>{i=null,process.removeListener("exit",l),process.removeListener("SIGTERM",w),process.removeListener("SIGINT",w)},l=()=>{const e=i;e!==null&&(I(),e.kill("SIGTERM"))},w=e=>{l(),process.listenerCount(e)===0&&process.kill(process.pid,e)},J=e=>{i=e,e.unref(),process.once("exit",l),process.prependOnceListener("SIGTERM",w),process.prependOnceListener("SIGINT",w);const r=()=>{i===e&&I()};e.once("exit",r),e.once("error",n=>{console.error("Failed to spawn markdown-api Go server:",n),r()})},V=async()=>{const e=H();if(!e)return await k(Y,()=>!1)?!0:(d=W(),!1);d=null;const r=X();l();let n;try{n=D.spawn(e,[],{stdio:["ignore","ignore","inherit"]}),J(n)}catch(s){return console.error("Failed to spawn markdown-api Go server:",s),!1}if(await k(r,()=>i!==n))return!0;const t=n.exitCode??n.signalCode;return console.error(t===null?"markdown-api Go server did not become ready on socket:":`markdown-api Go server ended (${t}) before it listened on socket:`,a()),l(),!1},Q=async e=>process.platform==="win32"?(d=B,!1):await _()!=="absent"||e()?!0:(S??=V().finally(()=>{S=null}),S),Z=async e=>{if(await Q(e))return;const r=d?` ${d}`:"";throw new o.ConnectError(`markdown service is not reachable on ${a()}.${r}`,o.Code.Unavailable)},N=async({signal:e,timeoutMs:r})=>{const n=()=>new o.ConnectError("the call was stopped before the service listened",o.Code.Canceled);if(e?.aborted===!0)throw n();const t=Date.now();let s=!1,f=()=>{},T;const A=new Promise((ae,L)=>{const E=q=>{s=!0,L(q)};f=()=>E(n()),e?.addEventListener("abort",f,{once:!0}),r!==void 0&&(T=setTimeout(()=>E(new o.ConnectError("the deadline passed before the service listened",o.Code.DeadlineExceeded)),r))});try{await Promise.race([Z(()=>s),A])}finally{e?.removeEventListener("abort",f),clearTimeout(T)}return r===void 0?void 0:Math.max(1,r-(Date.now()-t))},b=async e=>(a(),await N({signal:e}),O),ee=(e,r)=>{if(!(e instanceof o.ConnectError)||e.code===o.Code.Unavailable||r?.aborted===!0||!c.lostTheService(e))return e;const n=e.cause,t=n?.syscall==="connect"?`markdown service is not reachable on ${a()}: ${n.code}`:`markdown service went away during the call: ${e.rawMessage}`;return new o.ConnectError(t,o.Code.Unavailable,void 0,void 0,e)},P=async(e,r,n)=>{a(),c.assertServiceOptions(r,n);const t=await N(r);try{return await c.sendConversion(G,e,{...r,timeoutMs:t})}catch(s){throw ee(s,r.signal)}},re=(e,r,n,t,s)=>P({markdownText:e,filePath:r,workspaceRoot:n,userOAuthToken:t},s,"parseMarkdown"),ne=Object.freeze({convert:async(e,r)=>{try{return await P(e,r,"MarkdownServiceClient.convert")}catch(n){throw c.serviceFailureOf(n,r)}}}),te=Object.freeze(["authorize"]),oe={open:async(e,r)=>p.createConnectPageFetch(await b(r)).open(e,r),classify:async(e,r)=>p.createConnectPageFetch(await b(r)).classify(e,r)},se=e=>(p.assertLinkCardHandlerOptions(e,"createLinkCardHandler",te),p.createLinkCardHandlerCore({authorize:e.authorize,pageFetch:oe}));exports.MAX_HTML_BYTES_LIMIT=u.MAX_HTML_BYTES_LIMIT;exports.MarkdownResourceExhaustedError=u.MarkdownResourceExhaustedError;exports.createLinkCardHandler=se;exports.nodeMarkdownServiceClient=ne;exports.parseMarkdown=re;
|
package/dist/index.server.d.ts
CHANGED
|
@@ -2,4 +2,4 @@ export { MAX_HTML_BYTES_LIMIT, type ParseOptions, type ParseResult } from "./con
|
|
|
2
2
|
export { MarkdownResourceExhaustedError } from "./errors.ts";
|
|
3
3
|
export type { LinkCardHandler, LinkCardHandlerOptions } from "./linkCardServer/linkCardCore.ts";
|
|
4
4
|
export { createLinkCardHandler } from "./linkCardServer/linkCardHandler.server.ts";
|
|
5
|
-
export { parseMarkdown } from "./remarkProcessor.server.ts";
|
|
5
|
+
export { nodeMarkdownServiceClient, parseMarkdown } from "./remarkProcessor.server.ts";
|
package/dist/index.server.js
CHANGED
|
@@ -1,146 +1,155 @@
|
|
|
1
|
-
import { M as
|
|
2
|
-
import { c as
|
|
3
|
-
import { spawn as
|
|
4
|
-
import { existsSync as
|
|
5
|
-
import { createRequire as
|
|
6
|
-
import * as
|
|
7
|
-
import * as
|
|
8
|
-
import { fileURLToPath as
|
|
9
|
-
import { createLocalServiceTransport as
|
|
10
|
-
import { createClient as
|
|
11
|
-
import { M as
|
|
12
|
-
import { b as
|
|
1
|
+
import { M as C, R as L } from "./errors-CapTNE7l.js";
|
|
2
|
+
import { c as Me } from "./errors-CapTNE7l.js";
|
|
3
|
+
import { spawn as D } from "node:child_process";
|
|
4
|
+
import { existsSync as m } from "node:fs";
|
|
5
|
+
import { createRequire as $ } from "node:module";
|
|
6
|
+
import * as _ from "node:net";
|
|
7
|
+
import * as f from "node:path";
|
|
8
|
+
import { fileURLToPath as x } from "node:url";
|
|
9
|
+
import { createLocalServiceTransport as U } from "@aiquants/local-service-transport";
|
|
10
|
+
import { createClient as G, ConnectError as a, Code as i } from "@connectrpc/connect";
|
|
11
|
+
import { M as W, s as F, a as B, b as H, l as K } from "./markdownServiceClient-OrOuExUG.js";
|
|
12
|
+
import { b as j, a as q, c as T } from "./pageFetchPort-DVpXsKCz.js";
|
|
13
13
|
const s = () => {
|
|
14
14
|
const e = process.env.MARKDOWN_SOCKET_PATH;
|
|
15
15
|
if (e === void 0 || e === "")
|
|
16
16
|
throw new Error("MARKDOWN_SOCKET_PATH is required: set it to the path of the markdown-api service's UNIX domain socket, the same value the service reads");
|
|
17
17
|
return e;
|
|
18
|
-
},
|
|
19
|
-
createConnection: () =>
|
|
20
|
-
readMaxBytes: 2 *
|
|
21
|
-
}),
|
|
18
|
+
}, b = U({
|
|
19
|
+
createConnection: () => _.connect(s()),
|
|
20
|
+
readMaxBytes: 2 * C + L
|
|
21
|
+
}), z = G(W, b), E = () => {
|
|
22
22
|
try {
|
|
23
|
-
return
|
|
23
|
+
return f.dirname(x(import.meta.url));
|
|
24
24
|
} catch {
|
|
25
25
|
return __dirname;
|
|
26
26
|
}
|
|
27
|
-
},
|
|
27
|
+
}, N = () => `@aiquants/markdown-${process.platform}-${process.arch}`, k = "markdown-api", Y = () => {
|
|
28
28
|
const e = process.env.MARKDOWN_API_BINARY;
|
|
29
|
-
if (e &&
|
|
29
|
+
if (e && m(e))
|
|
30
30
|
return e;
|
|
31
31
|
try {
|
|
32
|
-
const t =
|
|
33
|
-
if (
|
|
32
|
+
const t = $(f.join(E(), "index.js")).resolve(`${N()}/bin/${k}`);
|
|
33
|
+
if (m(t))
|
|
34
34
|
return t;
|
|
35
35
|
} catch {
|
|
36
36
|
}
|
|
37
|
-
const r =
|
|
38
|
-
return
|
|
39
|
-
},
|
|
37
|
+
const r = f.join(E(), "..", "..", "go", "markdown-api", "dist", k);
|
|
38
|
+
return m(r) ? r : void 0;
|
|
39
|
+
}, X = () => [
|
|
40
40
|
`markdown-api binary not found for ${process.platform}-${process.arch}.`,
|
|
41
|
-
`Expected the optional dependency ${
|
|
41
|
+
`Expected the optional dependency ${N()} to be installed.`,
|
|
42
42
|
"If your platform is unsupported, build the service yourself",
|
|
43
43
|
"(https://github.com/fehde-k/aiquants/tree/main/packages/go/markdown-api)",
|
|
44
44
|
"and point MARKDOWN_API_BINARY at it."
|
|
45
|
-
].join(" "),
|
|
46
|
-
const r =
|
|
45
|
+
].join(" "), J = "The markdown-api service is not started from Node.js on Windows; a Windows host runs the service inside its own executable instead.", V = /* @__PURE__ */ new Set(["ENOENT", "ECONNREFUSED"]), v = () => new Promise((e) => {
|
|
46
|
+
const r = _.connect(s());
|
|
47
47
|
r.on("connect", () => {
|
|
48
48
|
r.destroy(), e("listening");
|
|
49
49
|
}), r.on("error", (t) => {
|
|
50
|
-
t.code === "EAGAIN" ? e("listening") : e(
|
|
50
|
+
t.code === "EAGAIN" ? e("listening") : e(V.has(t.code) ? "absent" : "unknown");
|
|
51
51
|
});
|
|
52
|
-
}),
|
|
52
|
+
}), y = async (e, r) => {
|
|
53
53
|
const t = Date.now();
|
|
54
54
|
for (; Date.now() - t < e && !r(); ) {
|
|
55
|
-
if (await
|
|
55
|
+
if (await v() === "listening") return !0;
|
|
56
56
|
await new Promise((n) => setTimeout(n, 100));
|
|
57
57
|
}
|
|
58
|
-
return await
|
|
58
|
+
return await v() === "listening";
|
|
59
59
|
};
|
|
60
|
-
let
|
|
61
|
-
const
|
|
60
|
+
let c = null, w = null;
|
|
61
|
+
const Q = 2e3, Z = 1e4, ee = () => {
|
|
62
62
|
const e = process.env.MARKDOWN_API_STARTUP_TIMEOUT_MS;
|
|
63
|
-
if (e === void 0 || e === "") return
|
|
63
|
+
if (e === void 0 || e === "") return Z;
|
|
64
64
|
const r = Number(e);
|
|
65
65
|
if (!Number.isSafeInteger(r) || r <= 0)
|
|
66
66
|
throw new RangeError(`MARKDOWN_API_STARTUP_TIMEOUT_MS must be a positive integer of milliseconds; got ${JSON.stringify(e)}`);
|
|
67
67
|
return r;
|
|
68
68
|
};
|
|
69
|
-
let
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
},
|
|
73
|
-
const e =
|
|
74
|
-
e !== null && (
|
|
75
|
-
},
|
|
76
|
-
|
|
77
|
-
},
|
|
78
|
-
|
|
69
|
+
let d = null;
|
|
70
|
+
const O = () => {
|
|
71
|
+
c = null, process.removeListener("exit", l), process.removeListener("SIGTERM", p), process.removeListener("SIGINT", p);
|
|
72
|
+
}, l = () => {
|
|
73
|
+
const e = c;
|
|
74
|
+
e !== null && (O(), e.kill("SIGTERM"));
|
|
75
|
+
}, p = (e) => {
|
|
76
|
+
l(), process.listenerCount(e) === 0 && process.kill(process.pid, e);
|
|
77
|
+
}, re = (e) => {
|
|
78
|
+
c = e, e.unref(), process.once("exit", l), process.prependOnceListener("SIGTERM", p), process.prependOnceListener("SIGINT", p);
|
|
79
79
|
const r = () => {
|
|
80
|
-
|
|
80
|
+
c === e && O();
|
|
81
81
|
};
|
|
82
82
|
e.once("exit", r), e.once("error", (t) => {
|
|
83
83
|
console.error("Failed to spawn markdown-api Go server:", t), r();
|
|
84
84
|
});
|
|
85
|
-
},
|
|
86
|
-
const e =
|
|
85
|
+
}, te = async () => {
|
|
86
|
+
const e = Y();
|
|
87
87
|
if (!e)
|
|
88
|
-
return await
|
|
89
|
-
|
|
90
|
-
const r =
|
|
91
|
-
|
|
88
|
+
return await y(Q, () => !1) ? !0 : (d = X(), !1);
|
|
89
|
+
d = null;
|
|
90
|
+
const r = ee();
|
|
91
|
+
l();
|
|
92
92
|
let t;
|
|
93
93
|
try {
|
|
94
|
-
t =
|
|
94
|
+
t = D(e, [], { stdio: ["ignore", "ignore", "inherit"] }), re(t);
|
|
95
95
|
} catch (o) {
|
|
96
96
|
return console.error("Failed to spawn markdown-api Go server:", o), !1;
|
|
97
97
|
}
|
|
98
|
-
if (await
|
|
98
|
+
if (await y(r, () => c !== t)) return !0;
|
|
99
99
|
const n = t.exitCode ?? t.signalCode;
|
|
100
|
-
return console.error(n === null ? "markdown-api Go server did not become ready on socket:" : `markdown-api Go server ended (${n}) before it listened on socket:`, s()),
|
|
101
|
-
},
|
|
100
|
+
return console.error(n === null ? "markdown-api Go server did not become ready on socket:" : `markdown-api Go server ended (${n}) before it listened on socket:`, s()), l(), !1;
|
|
101
|
+
}, ne = async (e) => process.platform === "win32" ? (d = J, !1) : await v() !== "absent" || e() ? !0 : (w ??= te().finally(() => {
|
|
102
102
|
w = null;
|
|
103
|
-
}), w),
|
|
104
|
-
if (await
|
|
105
|
-
const r =
|
|
106
|
-
throw new
|
|
107
|
-
},
|
|
108
|
-
const t = () => new
|
|
103
|
+
}), w), oe = async (e) => {
|
|
104
|
+
if (await ne(e)) return;
|
|
105
|
+
const r = d ? ` ${d}` : "";
|
|
106
|
+
throw new a(`markdown service is not reachable on ${s()}.${r}`, i.Unavailable);
|
|
107
|
+
}, R = async ({ signal: e, timeoutMs: r }) => {
|
|
108
|
+
const t = () => new a("the call was stopped before the service listened", i.Canceled);
|
|
109
109
|
if (e?.aborted === !0) throw t();
|
|
110
110
|
const n = Date.now();
|
|
111
|
-
let o = !1,
|
|
112
|
-
},
|
|
113
|
-
const
|
|
114
|
-
const S = (
|
|
115
|
-
o = !0,
|
|
111
|
+
let o = !1, u = () => {
|
|
112
|
+
}, h;
|
|
113
|
+
const g = new Promise((ce, I) => {
|
|
114
|
+
const S = (P) => {
|
|
115
|
+
o = !0, I(P);
|
|
116
116
|
};
|
|
117
|
-
|
|
117
|
+
u = () => S(t()), e?.addEventListener("abort", u, { once: !0 }), r !== void 0 && (h = setTimeout(() => S(new a("the deadline passed before the service listened", i.DeadlineExceeded)), r));
|
|
118
118
|
});
|
|
119
119
|
try {
|
|
120
|
-
await Promise.race([
|
|
120
|
+
await Promise.race([oe(() => o), g]);
|
|
121
121
|
} finally {
|
|
122
|
-
e?.removeEventListener("abort",
|
|
122
|
+
e?.removeEventListener("abort", u), clearTimeout(h);
|
|
123
123
|
}
|
|
124
124
|
return r === void 0 ? void 0 : Math.max(1, r - (Date.now() - n));
|
|
125
|
-
},
|
|
126
|
-
if (!(e instanceof
|
|
125
|
+
}, M = async (e) => (s(), await R({ signal: e }), b), se = (e, r) => {
|
|
126
|
+
if (!(e instanceof a) || e.code === i.Unavailable || r?.aborted === !0 || !K(e)) return e;
|
|
127
127
|
const t = e.cause, n = t?.syscall === "connect" ? `markdown service is not reachable on ${s()}: ${t.code}` : `markdown service went away during the call: ${e.rawMessage}`;
|
|
128
|
-
return new
|
|
129
|
-
},
|
|
130
|
-
s(),
|
|
131
|
-
const
|
|
128
|
+
return new a(n, i.Unavailable, void 0, void 0, e);
|
|
129
|
+
}, A = async (e, r, t) => {
|
|
130
|
+
s(), B(r, t);
|
|
131
|
+
const n = await R(r);
|
|
132
132
|
try {
|
|
133
|
-
return await
|
|
134
|
-
} catch (
|
|
135
|
-
throw
|
|
133
|
+
return await H(z, e, { ...r, timeoutMs: n });
|
|
134
|
+
} catch (o) {
|
|
135
|
+
throw se(o, r.signal);
|
|
136
|
+
}
|
|
137
|
+
}, Se = (e, r, t, n, o) => A({ markdownText: e, filePath: r, workspaceRoot: t, userOAuthToken: n }, o, "parseMarkdown"), Te = Object.freeze({
|
|
138
|
+
convert: async (e, r) => {
|
|
139
|
+
try {
|
|
140
|
+
return await A(e, r, "MarkdownServiceClient.convert");
|
|
141
|
+
} catch (t) {
|
|
142
|
+
throw F(t, r);
|
|
143
|
+
}
|
|
136
144
|
}
|
|
137
|
-
},
|
|
138
|
-
open: async (e, r) => T(await
|
|
139
|
-
classify: async (e, r) => T(await
|
|
140
|
-
},
|
|
145
|
+
}), ae = Object.freeze(["authorize"]), ie = {
|
|
146
|
+
open: async (e, r) => T(await M(r)).open(e, r),
|
|
147
|
+
classify: async (e, r) => T(await M(r)).classify(e, r)
|
|
148
|
+
}, Ee = (e) => (j(e, "createLinkCardHandler", ae), q({ authorize: e.authorize, pageFetch: ie }));
|
|
141
149
|
export {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
150
|
+
C as MAX_HTML_BYTES_LIMIT,
|
|
151
|
+
Me as MarkdownResourceExhaustedError,
|
|
152
|
+
Ee as createLinkCardHandler,
|
|
153
|
+
Te as nodeMarkdownServiceClient,
|
|
154
|
+
Se as parseMarkdown
|
|
146
155
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const a=require("@connectrpc/connect"),i=require("./errors-BWZJx2MD.cjs"),r=require("@bufbuild/protobuf");class l extends r.Message{markdownText="";filePath="";workspaceRoot="";validateExistence=!1;enableSubscript;enableSuperscript;enableMark;enableTableMerge;enableEmbeds;enableZennDirectives;resolveImports=!1;maxHtmlBytes;deny;includeSourceLines=!1;cjkFriendlyEmphasis=!1;hardLineBreaks=!1;includeStreamingHints=!1;constructor(e){super(),r.proto3.util.initPartial(e,this)}static runtime=r.proto3;static typeName="markdown.v1.ConvertRequest";static fields=r.proto3.util.newFieldList(()=>[{no:1,name:"markdown_text",kind:"scalar",T:9},{no:2,name:"file_path",kind:"scalar",T:9},{no:3,name:"workspace_root",kind:"scalar",T:9},{no:4,name:"validate_existence",kind:"scalar",T:8},{no:5,name:"enable_subscript",kind:"scalar",T:8,opt:!0},{no:6,name:"enable_superscript",kind:"scalar",T:8,opt:!0},{no:7,name:"enable_mark",kind:"scalar",T:8,opt:!0},{no:8,name:"enable_table_merge",kind:"scalar",T:8,opt:!0},{no:9,name:"enable_embeds",kind:"scalar",T:8,opt:!0},{no:10,name:"enable_zenn_directives",kind:"scalar",T:8,opt:!0},{no:11,name:"resolve_imports",kind:"scalar",T:8},{no:12,name:"max_html_bytes",kind:"scalar",T:13,opt:!0},{no:13,name:"deny",kind:"message",T:c},{no:14,name:"include_source_lines",kind:"scalar",T:8},{no:15,name:"cjk_friendly_emphasis",kind:"scalar",T:8},{no:16,name:"hard_line_breaks",kind:"scalar",T:8},{no:17,name:"include_streaming_hints",kind:"scalar",T:8}]);static fromBinary(e,t){return new l().fromBinary(e,t)}static fromJson(e,t){return new l().fromJson(e,t)}static fromJsonString(e,t){return new l().fromJsonString(e,t)}static equals(e,t){return r.proto3.util.equals(l,e,t)}}class c extends r.Message{segmentPatterns=[];constructor(e){super(),r.proto3.util.initPartial(e,this)}static runtime=r.proto3;static typeName="markdown.v1.DenyRules";static fields=r.proto3.util.newFieldList(()=>[{no:1,name:"segment_patterns",kind:"scalar",T:9,repeated:!0}]);static fromBinary(e,t){return new c().fromBinary(e,t)}static fromJson(e,t){return new c().fromJson(e,t)}static fromJsonString(e,t){return new c().fromJsonString(e,t)}static equals(e,t){return r.proto3.util.equals(c,e,t)}}class d extends r.Message{htmlContent="";headings=[];blockOffsets=[];constructor(e){super(),r.proto3.util.initPartial(e,this)}static runtime=r.proto3;static typeName="markdown.v1.ConvertResponse";static fields=r.proto3.util.newFieldList(()=>[{no:1,name:"html_content",kind:"scalar",T:9},{no:2,name:"headings",kind:"message",T:u,repeated:!0},{no:3,name:"block_offsets",kind:"scalar",T:13,repeated:!0}]);static fromBinary(e,t){return new d().fromBinary(e,t)}static fromJson(e,t){return new d().fromJson(e,t)}static fromJsonString(e,t){return new d().fromJsonString(e,t)}static equals(e,t){return r.proto3.util.equals(d,e,t)}}class u extends r.Message{text="";depth=0;id="";constructor(e){super(),r.proto3.util.initPartial(e,this)}static runtime=r.proto3;static typeName="markdown.v1.Heading";static fields=r.proto3.util.newFieldList(()=>[{no:1,name:"text",kind:"scalar",T:9},{no:2,name:"depth",kind:"scalar",T:5},{no:3,name:"id",kind:"scalar",T:9}]);static fromBinary(e,t){return new u().fromBinary(e,t)}static fromJson(e,t){return new u().fromJson(e,t)}static fromJsonString(e,t){return new u().fromJsonString(e,t)}static equals(e,t){return r.proto3.util.equals(u,e,t)}}const w={typeName:"markdown.v1.MarkdownService",methods:{convert:{name:"Convert",I:l,O:d,kind:r.MethodKind.Unary}}},
|
|
1
|
+
"use strict";const a=require("@connectrpc/connect"),i=require("./errors-BWZJx2MD.cjs"),r=require("@bufbuild/protobuf");class l extends r.Message{markdownText="";filePath="";workspaceRoot="";validateExistence=!1;enableSubscript;enableSuperscript;enableMark;enableTableMerge;enableEmbeds;enableZennDirectives;resolveImports=!1;maxHtmlBytes;deny;includeSourceLines=!1;cjkFriendlyEmphasis=!1;hardLineBreaks=!1;includeStreamingHints=!1;constructor(e){super(),r.proto3.util.initPartial(e,this)}static runtime=r.proto3;static typeName="markdown.v1.ConvertRequest";static fields=r.proto3.util.newFieldList(()=>[{no:1,name:"markdown_text",kind:"scalar",T:9},{no:2,name:"file_path",kind:"scalar",T:9},{no:3,name:"workspace_root",kind:"scalar",T:9},{no:4,name:"validate_existence",kind:"scalar",T:8},{no:5,name:"enable_subscript",kind:"scalar",T:8,opt:!0},{no:6,name:"enable_superscript",kind:"scalar",T:8,opt:!0},{no:7,name:"enable_mark",kind:"scalar",T:8,opt:!0},{no:8,name:"enable_table_merge",kind:"scalar",T:8,opt:!0},{no:9,name:"enable_embeds",kind:"scalar",T:8,opt:!0},{no:10,name:"enable_zenn_directives",kind:"scalar",T:8,opt:!0},{no:11,name:"resolve_imports",kind:"scalar",T:8},{no:12,name:"max_html_bytes",kind:"scalar",T:13,opt:!0},{no:13,name:"deny",kind:"message",T:c},{no:14,name:"include_source_lines",kind:"scalar",T:8},{no:15,name:"cjk_friendly_emphasis",kind:"scalar",T:8},{no:16,name:"hard_line_breaks",kind:"scalar",T:8},{no:17,name:"include_streaming_hints",kind:"scalar",T:8}]);static fromBinary(e,t){return new l().fromBinary(e,t)}static fromJson(e,t){return new l().fromJson(e,t)}static fromJsonString(e,t){return new l().fromJsonString(e,t)}static equals(e,t){return r.proto3.util.equals(l,e,t)}}class c extends r.Message{segmentPatterns=[];constructor(e){super(),r.proto3.util.initPartial(e,this)}static runtime=r.proto3;static typeName="markdown.v1.DenyRules";static fields=r.proto3.util.newFieldList(()=>[{no:1,name:"segment_patterns",kind:"scalar",T:9,repeated:!0}]);static fromBinary(e,t){return new c().fromBinary(e,t)}static fromJson(e,t){return new c().fromJson(e,t)}static fromJsonString(e,t){return new c().fromJsonString(e,t)}static equals(e,t){return r.proto3.util.equals(c,e,t)}}class d extends r.Message{htmlContent="";headings=[];blockOffsets=[];constructor(e){super(),r.proto3.util.initPartial(e,this)}static runtime=r.proto3;static typeName="markdown.v1.ConvertResponse";static fields=r.proto3.util.newFieldList(()=>[{no:1,name:"html_content",kind:"scalar",T:9},{no:2,name:"headings",kind:"message",T:u,repeated:!0},{no:3,name:"block_offsets",kind:"scalar",T:13,repeated:!0}]);static fromBinary(e,t){return new d().fromBinary(e,t)}static fromJson(e,t){return new d().fromJson(e,t)}static fromJsonString(e,t){return new d().fromJsonString(e,t)}static equals(e,t){return r.proto3.util.equals(d,e,t)}}class u extends r.Message{text="";depth=0;id="";constructor(e){super(),r.proto3.util.initPartial(e,this)}static runtime=r.proto3;static typeName="markdown.v1.Heading";static fields=r.proto3.util.newFieldList(()=>[{no:1,name:"text",kind:"scalar",T:9},{no:2,name:"depth",kind:"scalar",T:5},{no:3,name:"id",kind:"scalar",T:9}]);static fromBinary(e,t){return new u().fromBinary(e,t)}static fromJson(e,t){return new u().fromJson(e,t)}static fromJsonString(e,t){return new u().fromJsonString(e,t)}static equals(e,t){return r.proto3.util.equals(u,e,t)}}const w={typeName:"markdown.v1.MarkdownService",methods:{convert:{name:"Convert",I:l,O:d,kind:r.MethodKind.Unary}}},g="X-Storage-Auth-Mode",p="oauth2",h=(n,e)=>{if(i.assertConversionOptions(n,e),n.timeoutMs!==void 0&&!i.isTimerDelay(n.timeoutMs))throw new RangeError(`${e}: timeoutMs must be a positive integer of at most ${i.MAX_TIMER_MS}, got ${n.timeoutMs}`)},M=(n,e)=>n.length>e?!0:n.length*3<=e?!1:new TextEncoder().encode(n).byteLength>e,S=/^[\w\-.~+/]+=*$/,C=(n,e)=>{const t={[g]:p};if(n.userOAuthToken){if(!S.test(n.userOAuthToken))throw new TypeError("userOAuthToken is not an RFC 6750 bearer token");t.Authorization=`Bearer ${n.userOAuthToken}`}return{headers:t,signal:e.signal,timeoutMs:e.timeoutMs}},b=async(n,e,t)=>{let o;try{o=await n.convert({markdownText:e.markdownText,filePath:e.filePath,workspaceRoot:e.workspaceRoot,validateExistence:t.validateExistence??!0,enableSubscript:t.enableSubscript,enableSuperscript:t.enableSuperscript,enableMark:t.enableMark,enableTableMerge:t.enableTableMerge,enableEmbeds:t.enableEmbeds,enableZennDirectives:t.enableZennDirectives,resolveImports:t.resolveImports??!1,includeSourceLines:t.includeSourceLines??!1,includeStreamingHints:t.includeStreamingHints??!1,cjkFriendlyEmphasis:t.cjkFriendlyEmphasis??!1,hardLineBreaks:t.hardLineBreaks??!1,maxHtmlBytes:t.maxHtmlBytes,deny:new c({segmentPatterns:[...t.deniedPathSegments]})},C(e,t))}catch(s){throw s instanceof a.ConnectError?t.signal?.aborted===!0?s.code===a.Code.Canceled?s:new a.ConnectError(s.rawMessage,a.Code.Canceled,void 0,void 0,s):s.code===a.Code.ResourceExhausted?new i.MarkdownResourceExhaustedError(s.rawMessage,{cause:s}):s:s}const m=t.includeStreamingHints===!0?o.blockOffsets:void 0,f=i.BLOCK_OFFSET_BYTES*(m?.length??0);if(M(o.htmlContent,t.maxHtmlBytes-f))throw new i.MarkdownResourceExhaustedError(`the conversion's HTML${f>0?" with its block offsets":""} is longer than maxHtmlBytes (${t.maxHtmlBytes})`);const k={htmlContent:o.htmlContent,headings:o.headings.map(s=>({text:s.text,depth:s.depth,id:s.id}))};return m===void 0?k:{...k,blockOffsets:m}},v=n=>{switch(n.code){case a.Code.Canceled:case a.Code.Unavailable:return!0;case a.Code.InvalidArgument:case a.Code.Internal:case a.Code.Unknown:case a.Code.Aborted:return n.cause!==void 0;default:return!1}},T=(n,{signal:e,timeoutMs:t})=>{if(!(n instanceof a.ConnectError)||e?.aborted===!0&&n.code===a.Code.Canceled)return n;if(v(n))return new i.MarkdownConversionError("unavailable",n.rawMessage,{cause:n});switch(n.code){case a.Code.DeadlineExceeded:return new i.MarkdownConversionTimeoutError(t??null,{cause:n});case a.Code.InvalidArgument:return new i.MarkdownConversionError("invalid_argument",n.rawMessage,{cause:n});case a.Code.Internal:case a.Code.Unknown:return new i.MarkdownConversionError("internal",n.rawMessage,{cause:n});default:return n}},E=({transport:n})=>{const e=a.createClient(w,n);return{convert:async(t,o)=>{h(o,"MarkdownServiceClient.convert");try{return await b(e,t,o)}catch(m){throw T(m,o)}}}};exports.MarkdownService=w;exports.assertServiceOptions=h;exports.createMarkdownServiceClient=E;exports.lostTheService=v;exports.sendConversion=b;exports.serviceFailureOf=T;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createClient as T, ConnectError as k, Code as s } from "@connectrpc/connect";
|
|
2
|
-
import {
|
|
2
|
+
import { a as f, b as g, e as v, i as M, d as y, c as b, B as S } from "./errors-CapTNE7l.js";
|
|
3
3
|
import { Message as u, proto3 as a, MethodKind as p } from "@bufbuild/protobuf";
|
|
4
4
|
class l extends u {
|
|
5
5
|
/**
|
|
@@ -386,8 +386,8 @@ const E = {
|
|
|
386
386
|
}
|
|
387
387
|
}
|
|
388
388
|
}, x = "X-Storage-Auth-Mode", B = "oauth2", _ = (n, e) => {
|
|
389
|
-
if (
|
|
390
|
-
throw new RangeError(`${e}: timeoutMs must be a positive integer of at most ${
|
|
389
|
+
if (v(n, e), n.timeoutMs !== void 0 && !M(n.timeoutMs))
|
|
390
|
+
throw new RangeError(`${e}: timeoutMs must be a positive integer of at most ${y}, got ${n.timeoutMs}`);
|
|
391
391
|
}, O = (n, e) => n.length > e ? !0 : n.length * 3 <= e ? !1 : new TextEncoder().encode(n).byteLength > e, C = /^[\w\-.~+/]+=*$/, J = (n, e) => {
|
|
392
392
|
const t = { [x]: B };
|
|
393
393
|
if (n.userOAuthToken) {
|
|
@@ -423,7 +423,7 @@ const E = {
|
|
|
423
423
|
} catch (r) {
|
|
424
424
|
throw r instanceof k ? t.signal?.aborted === !0 ? r.code === s.Canceled ? r : new k(r.rawMessage, s.Canceled, void 0, void 0, r) : r.code === s.ResourceExhausted ? new b(r.rawMessage, { cause: r }) : r : r;
|
|
425
425
|
}
|
|
426
|
-
const m = t.includeStreamingHints === !0 ? i.blockOffsets : void 0, w =
|
|
426
|
+
const m = t.includeStreamingHints === !0 ? i.blockOffsets : void 0, w = S * (m?.length ?? 0);
|
|
427
427
|
if (O(i.htmlContent, t.maxHtmlBytes - w))
|
|
428
428
|
throw new b(`the conversion's HTML${w > 0 ? " with its block offsets" : ""} is longer than maxHtmlBytes (${t.maxHtmlBytes})`);
|
|
429
429
|
const h = {
|
|
@@ -449,7 +449,7 @@ const E = {
|
|
|
449
449
|
if (H(n)) return new f("unavailable", n.rawMessage, { cause: n });
|
|
450
450
|
switch (n.code) {
|
|
451
451
|
case s.DeadlineExceeded:
|
|
452
|
-
return new
|
|
452
|
+
return new g(t ?? null, { cause: n });
|
|
453
453
|
case s.InvalidArgument:
|
|
454
454
|
return new f("invalid_argument", n.rawMessage, { cause: n });
|
|
455
455
|
case s.Internal:
|
|
@@ -474,7 +474,8 @@ const E = {
|
|
|
474
474
|
export {
|
|
475
475
|
E as M,
|
|
476
476
|
_ as a,
|
|
477
|
+
A as b,
|
|
477
478
|
U as c,
|
|
478
479
|
H as l,
|
|
479
|
-
|
|
480
|
+
L as s
|
|
480
481
|
};
|
|
@@ -15,6 +15,7 @@ export type MarkdownServiceClient = {
|
|
|
15
15
|
export declare const assertServiceOptions: (options: MarkdownServiceCallOptions, caller: string) => void;
|
|
16
16
|
export declare const sendConversion: (client: MarkdownServiceConnectClient, input: MarkdownServiceConversion, options: MarkdownServiceCallOptions) => Promise<ParseResult>;
|
|
17
17
|
export declare const lostTheService: (error: ConnectError) => boolean;
|
|
18
|
+
export declare const serviceFailureOf: (error: unknown, { signal, timeoutMs }: MarkdownServiceCallOptions) => unknown;
|
|
18
19
|
export declare const createMarkdownServiceClient: ({ transport }: {
|
|
19
20
|
readonly transport: Transport;
|
|
20
21
|
}) => MarkdownServiceClient;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
`frame.js` next to this file (`@aiquants/markdown/mermaid-frame`) bundles the drawing place's script of this package with Mermaid. It contains code of the following npm packages.
|
|
4
4
|
|
|
5
|
-
## @aiquants/markdown 13.
|
|
5
|
+
## @aiquants/markdown 13.2.0
|
|
6
6
|
|
|
7
7
|
```text
|
|
8
8
|
MIT License
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Transport } from "@connectrpc/connect";
|
|
2
2
|
import { ParseOptions, ParseResult } from "./conversion.ts";
|
|
3
|
+
import { MarkdownServiceClient } from "./markdownServiceClient.ts";
|
|
3
4
|
export declare const resolveBinaryPath: () => string | undefined;
|
|
4
5
|
export declare const reachableServiceTransport: (signal: AbortSignal) => Promise<Transport>;
|
|
5
6
|
export declare const parseMarkdown: (markdownText: string, markdownFilePath: string, workspaceRoot: string, userOAuthToken: string | undefined, options: ParseOptions) => Promise<ParseResult>;
|
|
7
|
+
export declare const nodeMarkdownServiceClient: MarkdownServiceClient;
|
package/dist/serviceClient.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./errors-BWZJx2MD.cjs"),e=require("./markdownServiceClient-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./errors-BWZJx2MD.cjs"),e=require("./markdownServiceClient-Dle7LnFB.cjs");exports.MAX_HTML_BYTES_LIMIT=r.MAX_HTML_BYTES_LIMIT;exports.MarkdownConversionError=r.MarkdownConversionError;exports.MarkdownConversionTimeoutError=r.MarkdownConversionTimeoutError;exports.MarkdownResourceExhaustedError=r.MarkdownResourceExhaustedError;exports.createMarkdownServiceClient=e.createMarkdownServiceClient;
|
package/dist/serviceClient.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiquants/markdown",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.2.0",
|
|
4
4
|
"description": "Markdown renderer for React with advanced features",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -184,10 +184,10 @@
|
|
|
184
184
|
"access": "public"
|
|
185
185
|
},
|
|
186
186
|
"optionalDependencies": {
|
|
187
|
-
"@aiquants/markdown-linux-x64": "13.
|
|
188
|
-
"@aiquants/markdown-linux-arm64": "13.
|
|
189
|
-
"@aiquants/markdown-darwin-x64": "13.
|
|
190
|
-
"@aiquants/markdown-darwin-arm64": "13.
|
|
187
|
+
"@aiquants/markdown-linux-x64": "13.2.0",
|
|
188
|
+
"@aiquants/markdown-linux-arm64": "13.2.0",
|
|
189
|
+
"@aiquants/markdown-darwin-x64": "13.2.0",
|
|
190
|
+
"@aiquants/markdown-darwin-arm64": "13.2.0"
|
|
191
191
|
},
|
|
192
192
|
"scripts": {
|
|
193
193
|
"build": "pnpm -w run workspace:build \"$PNPM_SCRIPT_SRC_DIR\"",
|