@yolk-sdk/emulators 0.1.0-canary.96
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 +21 -0
- package/README.md +2135 -0
- package/dist/anthropic.d.mts +269 -0
- package/dist/anthropic.d.mts.map +1 -0
- package/dist/anthropic.mjs +177 -0
- package/dist/anthropic.mjs.map +1 -0
- package/dist/chat-completions.d.mts +288 -0
- package/dist/chat-completions.d.mts.map +1 -0
- package/dist/chat-completions.mjs +451 -0
- package/dist/chat-completions.mjs.map +1 -0
- package/dist/codex.d.mts +265 -0
- package/dist/codex.d.mts.map +1 -0
- package/dist/codex.mjs +199 -0
- package/dist/codex.mjs.map +1 -0
- package/dist/dropbox/api.d.mts +63 -0
- package/dist/dropbox/api.d.mts.map +1 -0
- package/dist/dropbox/api.mjs +565 -0
- package/dist/dropbox/api.mjs.map +1 -0
- package/dist/dropbox/state.d.mts +136 -0
- package/dist/dropbox/state.d.mts.map +1 -0
- package/dist/dropbox/state.mjs +209 -0
- package/dist/dropbox/state.mjs.map +1 -0
- package/dist/dropbox.d.mts +79 -0
- package/dist/dropbox.d.mts.map +1 -0
- package/dist/dropbox.mjs +124 -0
- package/dist/dropbox.mjs.map +1 -0
- package/dist/email-fixtures.d.mts +36 -0
- package/dist/email-fixtures.d.mts.map +1 -0
- package/dist/email-fixtures.mjs +1080 -0
- package/dist/email-fixtures.mjs.map +1 -0
- package/dist/email.d.mts +160 -0
- package/dist/email.d.mts.map +1 -0
- package/dist/email.mjs +608 -0
- package/dist/email.mjs.map +1 -0
- package/dist/emulator-compose.d.mts +40 -0
- package/dist/emulator-compose.d.mts.map +1 -0
- package/dist/emulator-compose.mjs +91 -0
- package/dist/emulator-compose.mjs.map +1 -0
- package/dist/emulator-http.d.mts +53 -0
- package/dist/emulator-http.d.mts.map +1 -0
- package/dist/emulator-http.mjs +117 -0
- package/dist/emulator-http.mjs.map +1 -0
- package/dist/emulator-kernel.d.mts +176 -0
- package/dist/emulator-kernel.d.mts.map +1 -0
- package/dist/emulator-kernel.mjs +413 -0
- package/dist/emulator-kernel.mjs.map +1 -0
- package/dist/fixture-route.d.mts +129 -0
- package/dist/fixture-route.d.mts.map +1 -0
- package/dist/fixture-route.mjs +257 -0
- package/dist/fixture-route.mjs.map +1 -0
- package/dist/fortnox/api.d.mts +92 -0
- package/dist/fortnox/api.d.mts.map +1 -0
- package/dist/fortnox/api.mjs +750 -0
- package/dist/fortnox/api.mjs.map +1 -0
- package/dist/fortnox/state.d.mts +533 -0
- package/dist/fortnox/state.d.mts.map +1 -0
- package/dist/fortnox/state.mjs +612 -0
- package/dist/fortnox/state.mjs.map +1 -0
- package/dist/fortnox.d.mts +128 -0
- package/dist/fortnox.d.mts.map +1 -0
- package/dist/fortnox.mjs +403 -0
- package/dist/fortnox.mjs.map +1 -0
- package/dist/gateway-evaluate-recordings.d.mts +12 -0
- package/dist/gateway-evaluate-recordings.d.mts.map +1 -0
- package/dist/gateway-evaluate-recordings.mjs +128 -0
- package/dist/gateway-evaluate-recordings.mjs.map +1 -0
- package/dist/gateway.d.mts +272 -0
- package/dist/gateway.d.mts.map +1 -0
- package/dist/gateway.mjs +400 -0
- package/dist/gateway.mjs.map +1 -0
- package/dist/github/api.d.mts +63 -0
- package/dist/github/api.d.mts.map +1 -0
- package/dist/github/api.mjs +527 -0
- package/dist/github/api.mjs.map +1 -0
- package/dist/github/state.d.mts +272 -0
- package/dist/github/state.d.mts.map +1 -0
- package/dist/github/state.mjs +303 -0
- package/dist/github/state.mjs.map +1 -0
- package/dist/github.d.mts +77 -0
- package/dist/github.d.mts.map +1 -0
- package/dist/github.mjs +180 -0
- package/dist/github.mjs.map +1 -0
- package/dist/google/calendar.d.mts +10 -0
- package/dist/google/calendar.d.mts.map +1 -0
- package/dist/google/calendar.mjs +252 -0
- package/dist/google/calendar.mjs.map +1 -0
- package/dist/google/drive.d.mts +8 -0
- package/dist/google/drive.d.mts.map +1 -0
- package/dist/google/drive.mjs +252 -0
- package/dist/google/drive.mjs.map +1 -0
- package/dist/google/gmail.d.mts +10 -0
- package/dist/google/gmail.d.mts.map +1 -0
- package/dist/google/gmail.mjs +591 -0
- package/dist/google/gmail.mjs.map +1 -0
- package/dist/google/shared.d.mts +107 -0
- package/dist/google/shared.d.mts.map +1 -0
- package/dist/google/shared.mjs +146 -0
- package/dist/google/shared.mjs.map +1 -0
- package/dist/google/state.d.mts +385 -0
- package/dist/google/state.d.mts.map +1 -0
- package/dist/google/state.mjs +496 -0
- package/dist/google/state.mjs.map +1 -0
- package/dist/google.d.mts +75 -0
- package/dist/google.d.mts.map +1 -0
- package/dist/google.mjs +210 -0
- package/dist/google.mjs.map +1 -0
- package/dist/linkedin-search/api.d.mts +45 -0
- package/dist/linkedin-search/api.d.mts.map +1 -0
- package/dist/linkedin-search/api.mjs +181 -0
- package/dist/linkedin-search/api.mjs.map +1 -0
- package/dist/linkedin-search/state.d.mts +123 -0
- package/dist/linkedin-search/state.d.mts.map +1 -0
- package/dist/linkedin-search/state.mjs +261 -0
- package/dist/linkedin-search/state.mjs.map +1 -0
- package/dist/linkedin-search.d.mts +69 -0
- package/dist/linkedin-search.d.mts.map +1 -0
- package/dist/linkedin-search.mjs +158 -0
- package/dist/linkedin-search.mjs.map +1 -0
- package/dist/mcp/api.d.mts +44 -0
- package/dist/mcp/api.d.mts.map +1 -0
- package/dist/mcp/api.mjs +557 -0
- package/dist/mcp/api.mjs.map +1 -0
- package/dist/mcp/recordings.d.mts +40 -0
- package/dist/mcp/recordings.d.mts.map +1 -0
- package/dist/mcp/recordings.mjs +2390 -0
- package/dist/mcp/recordings.mjs.map +1 -0
- package/dist/mcp/state.d.mts +71 -0
- package/dist/mcp/state.d.mts.map +1 -0
- package/dist/mcp/state.mjs +83 -0
- package/dist/mcp/state.mjs.map +1 -0
- package/dist/mcp.d.mts +84 -0
- package/dist/mcp.d.mts.map +1 -0
- package/dist/mcp.mjs +241 -0
- package/dist/mcp.mjs.map +1 -0
- package/dist/messages.d.mts +183 -0
- package/dist/messages.d.mts.map +1 -0
- package/dist/messages.mjs +532 -0
- package/dist/messages.mjs.map +1 -0
- package/dist/microsoft/api.d.mts +47 -0
- package/dist/microsoft/api.d.mts.map +1 -0
- package/dist/microsoft/api.mjs +178 -0
- package/dist/microsoft/api.mjs.map +1 -0
- package/dist/microsoft/calendar.d.mts +30 -0
- package/dist/microsoft/calendar.d.mts.map +1 -0
- package/dist/microsoft/calendar.mjs +271 -0
- package/dist/microsoft/calendar.mjs.map +1 -0
- package/dist/microsoft/drive.d.mts +36 -0
- package/dist/microsoft/drive.d.mts.map +1 -0
- package/dist/microsoft/drive.mjs +298 -0
- package/dist/microsoft/drive.mjs.map +1 -0
- package/dist/microsoft/graph.d.mts +198 -0
- package/dist/microsoft/graph.d.mts.map +1 -0
- package/dist/microsoft/graph.mjs +264 -0
- package/dist/microsoft/graph.mjs.map +1 -0
- package/dist/microsoft/mail.d.mts +48 -0
- package/dist/microsoft/mail.d.mts.map +1 -0
- package/dist/microsoft/mail.mjs +488 -0
- package/dist/microsoft/mail.mjs.map +1 -0
- package/dist/microsoft/state.d.mts +480 -0
- package/dist/microsoft/state.d.mts.map +1 -0
- package/dist/microsoft/state.mjs +625 -0
- package/dist/microsoft/state.mjs.map +1 -0
- package/dist/microsoft.d.mts +168 -0
- package/dist/microsoft.d.mts.map +1 -0
- package/dist/microsoft.mjs +483 -0
- package/dist/microsoft.mjs.map +1 -0
- package/dist/node.d.mts +47 -0
- package/dist/node.d.mts.map +1 -0
- package/dist/node.mjs +178 -0
- package/dist/node.mjs.map +1 -0
- package/dist/notion/api.d.mts +51 -0
- package/dist/notion/api.d.mts.map +1 -0
- package/dist/notion/api.mjs +507 -0
- package/dist/notion/api.mjs.map +1 -0
- package/dist/notion/state.d.mts +329 -0
- package/dist/notion/state.d.mts.map +1 -0
- package/dist/notion/state.mjs +432 -0
- package/dist/notion/state.mjs.map +1 -0
- package/dist/notion.d.mts +72 -0
- package/dist/notion.d.mts.map +1 -0
- package/dist/notion.mjs +127 -0
- package/dist/notion.mjs.map +1 -0
- package/dist/openai.d.mts +165 -0
- package/dist/openai.d.mts.map +1 -0
- package/dist/openai.mjs +141 -0
- package/dist/openai.mjs.map +1 -0
- package/dist/opencode-recordings.d.mts +7 -0
- package/dist/opencode-recordings.d.mts.map +1 -0
- package/dist/opencode-recordings.mjs +222 -0
- package/dist/opencode-recordings.mjs.map +1 -0
- package/dist/opencode.d.mts +70 -0
- package/dist/opencode.d.mts.map +1 -0
- package/dist/opencode.mjs +217 -0
- package/dist/opencode.mjs.map +1 -0
- package/dist/r2-fixtures.d.mts +36 -0
- package/dist/r2-fixtures.d.mts.map +1 -0
- package/dist/r2-fixtures.mjs +245 -0
- package/dist/r2-fixtures.mjs.map +1 -0
- package/dist/r2-guard.d.mts +43 -0
- package/dist/r2-guard.d.mts.map +1 -0
- package/dist/r2-guard.mjs +215 -0
- package/dist/r2-guard.mjs.map +1 -0
- package/dist/r2.d.mts +166 -0
- package/dist/r2.d.mts.map +1 -0
- package/dist/r2.mjs +517 -0
- package/dist/r2.mjs.map +1 -0
- package/dist/responses.d.mts +231 -0
- package/dist/responses.d.mts.map +1 -0
- package/dist/responses.mjs +556 -0
- package/dist/responses.mjs.map +1 -0
- package/dist/route-evidence.d.mts +45 -0
- package/dist/route-evidence.d.mts.map +1 -0
- package/dist/route-evidence.mjs +56 -0
- package/dist/route-evidence.mjs.map +1 -0
- package/dist/router.d.mts +93 -0
- package/dist/router.d.mts.map +1 -0
- package/dist/router.mjs +259 -0
- package/dist/router.mjs.map +1 -0
- package/dist/stateful-core.d.mts +17 -0
- package/dist/stateful-core.d.mts.map +1 -0
- package/dist/stateful-core.mjs +41 -0
- package/dist/stateful-core.mjs.map +1 -0
- package/dist/stateful-emulator.d.mts +565 -0
- package/dist/stateful-emulator.d.mts.map +1 -0
- package/dist/stateful-emulator.mjs +1228 -0
- package/dist/stateful-emulator.mjs.map +1 -0
- package/dist/stateful-secrets.d.mts +84 -0
- package/dist/stateful-secrets.d.mts.map +1 -0
- package/dist/stateful-secrets.mjs +216 -0
- package/dist/stateful-secrets.mjs.map +1 -0
- package/dist/subscription-usage-recordings.d.mts +9 -0
- package/dist/subscription-usage-recordings.d.mts.map +1 -0
- package/dist/subscription-usage-recordings.mjs +53 -0
- package/dist/subscription-usage-recordings.mjs.map +1 -0
- package/dist/subscription-usage.d.mts +53 -0
- package/dist/subscription-usage.d.mts.map +1 -0
- package/dist/subscription-usage.mjs +21 -0
- package/dist/subscription-usage.mjs.map +1 -0
- package/dist/telegram/api.d.mts +34 -0
- package/dist/telegram/api.d.mts.map +1 -0
- package/dist/telegram/api.mjs +257 -0
- package/dist/telegram/api.mjs.map +1 -0
- package/dist/telegram/state.d.mts +128 -0
- package/dist/telegram/state.d.mts.map +1 -0
- package/dist/telegram/state.mjs +154 -0
- package/dist/telegram/state.mjs.map +1 -0
- package/dist/telegram.d.mts +62 -0
- package/dist/telegram.d.mts.map +1 -0
- package/dist/telegram.mjs +127 -0
- package/dist/telegram.mjs.map +1 -0
- package/dist/todoist/api.d.mts +55 -0
- package/dist/todoist/api.d.mts.map +1 -0
- package/dist/todoist/api.mjs +415 -0
- package/dist/todoist/api.mjs.map +1 -0
- package/dist/todoist/state.d.mts +275 -0
- package/dist/todoist/state.d.mts.map +1 -0
- package/dist/todoist/state.mjs +345 -0
- package/dist/todoist/state.mjs.map +1 -0
- package/dist/todoist.d.mts +68 -0
- package/dist/todoist.d.mts.map +1 -0
- package/dist/todoist.mjs +181 -0
- package/dist/todoist.mjs.map +1 -0
- package/dist/xai.d.mts +267 -0
- package/dist/xai.d.mts.map +1 -0
- package/dist/xai.mjs +252 -0
- package/dist/xai.mjs.map +1 -0
- package/package.json +157 -0
- package/src/anthropic.ts +289 -0
- package/src/chat-completions.ts +924 -0
- package/src/codex.ts +296 -0
- package/src/dropbox/api.ts +1084 -0
- package/src/dropbox/state.ts +364 -0
- package/src/dropbox.ts +203 -0
- package/src/email-fixtures.ts +1297 -0
- package/src/email.ts +1108 -0
- package/src/emulator-compose.ts +147 -0
- package/src/emulator-http.ts +184 -0
- package/src/emulator-kernel.ts +844 -0
- package/src/fixture-route.ts +561 -0
- package/src/fortnox/api.ts +1352 -0
- package/src/fortnox/state.ts +798 -0
- package/src/fortnox.ts +801 -0
- package/src/gateway-evaluate-recordings.ts +153 -0
- package/src/gateway.ts +530 -0
- package/src/github/api.ts +986 -0
- package/src/github/state.ts +439 -0
- package/src/github.ts +271 -0
- package/src/google/calendar.ts +486 -0
- package/src/google/drive.ts +471 -0
- package/src/google/gmail.ts +1011 -0
- package/src/google/shared.ts +321 -0
- package/src/google/state.ts +686 -0
- package/src/google.ts +298 -0
- package/src/linkedin-search/api.ts +363 -0
- package/src/linkedin-search/state.ts +373 -0
- package/src/linkedin-search.ts +241 -0
- package/src/mcp/api.ts +995 -0
- package/src/mcp/recordings.ts +2665 -0
- package/src/mcp/state.ts +125 -0
- package/src/mcp.ts +319 -0
- package/src/messages.ts +844 -0
- package/src/microsoft/api.ts +426 -0
- package/src/microsoft/calendar.ts +491 -0
- package/src/microsoft/drive.ts +541 -0
- package/src/microsoft/graph.ts +550 -0
- package/src/microsoft/mail.ts +833 -0
- package/src/microsoft/state.ts +822 -0
- package/src/microsoft.ts +982 -0
- package/src/node.ts +293 -0
- package/src/notion/api.ts +976 -0
- package/src/notion/state.ts +512 -0
- package/src/notion.ts +210 -0
- package/src/openai.ts +198 -0
- package/src/opencode-recordings.ts +257 -0
- package/src/opencode.ts +271 -0
- package/src/r2-fixtures.ts +295 -0
- package/src/r2-guard.ts +323 -0
- package/src/r2.ts +890 -0
- package/src/responses.ts +901 -0
- package/src/route-evidence.ts +90 -0
- package/src/router.ts +490 -0
- package/src/stateful-core.ts +70 -0
- package/src/stateful-emulator.ts +2571 -0
- package/src/stateful-secrets.ts +299 -0
- package/src/subscription-usage-recordings.ts +77 -0
- package/src/subscription-usage.ts +68 -0
- package/src/telegram/api.ts +437 -0
- package/src/telegram/state.ts +229 -0
- package/src/telegram.ts +227 -0
- package/src/todoist/api.ts +736 -0
- package/src/todoist/state.ts +456 -0
- package/src/todoist.ts +316 -0
- package/src/xai.ts +341 -0
package/dist/node.mjs
ADDED
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { Data, Effect, Predicate } from "effect";
|
|
2
|
+
import { Buffer } from "node:buffer";
|
|
3
|
+
import { createServer } from "node:http";
|
|
4
|
+
//#region src/node.ts
|
|
5
|
+
/**
|
|
6
|
+
* Node boundary: serve an emulator fetch handler on loopback.
|
|
7
|
+
*
|
|
8
|
+
* This is the only module in the package that imports `node:` builtins.
|
|
9
|
+
* Servers bind to `127.0.0.1` only. Streamed response bodies are written
|
|
10
|
+
* chunk by chunk (honoring backpressure) so progressive delivery survives the
|
|
11
|
+
* socket, and an erroring body stream destroys the connection mid-response,
|
|
12
|
+
* the way a dropped upstream does.
|
|
13
|
+
*
|
|
14
|
+
* @experimental
|
|
15
|
+
*/
|
|
16
|
+
/** The only host emulator servers bind to. */
|
|
17
|
+
const emulatorServerHost = "127.0.0.1";
|
|
18
|
+
/** Serving failed: a refused host, an invalid port, or a listen error. */
|
|
19
|
+
var EmulatorServeError = class extends Data.TaggedError("EmulatorServeError") {
|
|
20
|
+
get message() {
|
|
21
|
+
switch (this.reason) {
|
|
22
|
+
case "host-not-allowed": return `Emulator servers bind to ${emulatorServerHost} only`;
|
|
23
|
+
case "invalid-port": return "Emulator server port must be an integer from 0 to 65535";
|
|
24
|
+
case "listen-failed": return "Emulator server could not listen";
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
const validateOptions = (options) => {
|
|
29
|
+
if (options.host !== void 0 && options.host !== "127.0.0.1") return new EmulatorServeError({ reason: "host-not-allowed" });
|
|
30
|
+
const port = options.port ?? 0;
|
|
31
|
+
if (!Number.isInteger(port) || port < 0 || port > 65535) return new EmulatorServeError({ reason: "invalid-port" });
|
|
32
|
+
};
|
|
33
|
+
const readBody = (incoming) => new Promise((resolve, reject) => {
|
|
34
|
+
const chunks = [];
|
|
35
|
+
incoming.on("data", (chunk) => {
|
|
36
|
+
chunks.push(Predicate.isString(chunk) ? Buffer.from(chunk) : chunk);
|
|
37
|
+
});
|
|
38
|
+
incoming.on("end", () => resolve(new Uint8Array(Buffer.concat(chunks))));
|
|
39
|
+
incoming.on("error", reject);
|
|
40
|
+
});
|
|
41
|
+
const toWebRequest = async (incoming, origin) => {
|
|
42
|
+
const headers = new Headers();
|
|
43
|
+
for (const [name, value] of Object.entries(incoming.headers)) if (Array.isArray(value)) for (const item of value) headers.append(name, item);
|
|
44
|
+
else if (value !== void 0) headers.set(name, value);
|
|
45
|
+
const method = incoming.method ?? "GET";
|
|
46
|
+
const body = await readBody(incoming);
|
|
47
|
+
const init = {
|
|
48
|
+
method,
|
|
49
|
+
headers
|
|
50
|
+
};
|
|
51
|
+
if (method !== "GET" && method !== "HEAD" && body.byteLength > 0) init.body = body;
|
|
52
|
+
return new Request(new URL(incoming.url ?? "/", origin), init);
|
|
53
|
+
};
|
|
54
|
+
const waitForDrain = (outgoing) => new Promise((resolve) => {
|
|
55
|
+
const done = () => {
|
|
56
|
+
outgoing.off("drain", done);
|
|
57
|
+
outgoing.off("close", done);
|
|
58
|
+
resolve();
|
|
59
|
+
};
|
|
60
|
+
outgoing.on("drain", done);
|
|
61
|
+
outgoing.on("close", done);
|
|
62
|
+
});
|
|
63
|
+
/**
|
|
64
|
+
* Write a web `Response` to a Node response: status and headers first, then
|
|
65
|
+
* each body chunk as soon as the handler produces it. A body stream error
|
|
66
|
+
* destroys the socket mid-response.
|
|
67
|
+
*/
|
|
68
|
+
const writeResponse = async (outgoing, response) => {
|
|
69
|
+
outgoing.statusCode = response.status;
|
|
70
|
+
if (response.statusText.length > 0) outgoing.statusMessage = response.statusText;
|
|
71
|
+
response.headers.forEach((value, name) => {
|
|
72
|
+
if (name !== "set-cookie") outgoing.setHeader(name, value);
|
|
73
|
+
});
|
|
74
|
+
const cookies = response.headers.getSetCookie();
|
|
75
|
+
if (cookies.length > 0) outgoing.setHeader("set-cookie", cookies);
|
|
76
|
+
if (response.body === null) {
|
|
77
|
+
outgoing.end();
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
outgoing.flushHeaders();
|
|
81
|
+
const reader = response.body.getReader();
|
|
82
|
+
outgoing.on("close", () => {
|
|
83
|
+
if (!outgoing.writableFinished) reader.cancel().catch(() => void 0);
|
|
84
|
+
});
|
|
85
|
+
const pump = async () => {
|
|
86
|
+
const { done, value } = await reader.read();
|
|
87
|
+
if (done || outgoing.destroyed) {
|
|
88
|
+
outgoing.end();
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
if (!outgoing.write(value)) await waitForDrain(outgoing);
|
|
92
|
+
return pump();
|
|
93
|
+
};
|
|
94
|
+
await pump().catch(() => {
|
|
95
|
+
outgoing.destroy();
|
|
96
|
+
});
|
|
97
|
+
};
|
|
98
|
+
const handleRequest = (handler, origin, incoming, outgoing) => toWebRequest(incoming, origin).then(handler).then((response) => writeResponse(outgoing, response), () => {
|
|
99
|
+
if (outgoing.headersSent) {
|
|
100
|
+
outgoing.destroy();
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
outgoing.statusCode = 500;
|
|
104
|
+
outgoing.setHeader("content-type", "text/plain");
|
|
105
|
+
outgoing.end("emulator handler failed");
|
|
106
|
+
}).catch(() => {
|
|
107
|
+
outgoing.destroy();
|
|
108
|
+
});
|
|
109
|
+
/**
|
|
110
|
+
* Serve a fetch handler on `127.0.0.1` (Promise variant, for hosts without an
|
|
111
|
+
* Effect runtime). Rejects with `EmulatorServeError` for a non-loopback host,
|
|
112
|
+
* an invalid port, or a listen failure.
|
|
113
|
+
*/
|
|
114
|
+
const startFetchHandlerServer = (handler, options = {}) => {
|
|
115
|
+
const invalid = validateOptions(options);
|
|
116
|
+
if (invalid !== void 0) return Promise.reject(invalid);
|
|
117
|
+
const sockets = /* @__PURE__ */ new Set();
|
|
118
|
+
const server = createServer();
|
|
119
|
+
let origin = "";
|
|
120
|
+
server.on("connection", (socket) => {
|
|
121
|
+
socket.setNoDelay(true);
|
|
122
|
+
sockets.add(socket);
|
|
123
|
+
socket.on("close", () => sockets.delete(socket));
|
|
124
|
+
});
|
|
125
|
+
server.on("request", (incoming, outgoing) => {
|
|
126
|
+
handleRequest(handler, origin, incoming, outgoing);
|
|
127
|
+
});
|
|
128
|
+
let closing;
|
|
129
|
+
const close = () => {
|
|
130
|
+
closing ??= new Promise((resolve) => {
|
|
131
|
+
server.close(() => resolve());
|
|
132
|
+
for (const socket of sockets) socket.destroy();
|
|
133
|
+
});
|
|
134
|
+
return closing;
|
|
135
|
+
};
|
|
136
|
+
return new Promise((resolve, reject) => {
|
|
137
|
+
server.once("error", (cause) => reject(new EmulatorServeError({
|
|
138
|
+
reason: "listen-failed",
|
|
139
|
+
cause
|
|
140
|
+
})));
|
|
141
|
+
server.listen(options.port ?? 0, emulatorServerHost, () => {
|
|
142
|
+
const address = server.address();
|
|
143
|
+
if (address === null || Predicate.isString(address)) {
|
|
144
|
+
close();
|
|
145
|
+
reject(new EmulatorServeError({ reason: "listen-failed" }));
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
origin = `http://${emulatorServerHost}:${address.port}`;
|
|
149
|
+
resolve({
|
|
150
|
+
url: origin,
|
|
151
|
+
close
|
|
152
|
+
});
|
|
153
|
+
});
|
|
154
|
+
});
|
|
155
|
+
};
|
|
156
|
+
/**
|
|
157
|
+
* Serve a fetch handler on `127.0.0.1` as a scoped resource: the server
|
|
158
|
+
* closes when the scope closes (or earlier via `close`). Fails with
|
|
159
|
+
* `EmulatorServeError` for a non-loopback host, an invalid port, or a listen
|
|
160
|
+
* failure.
|
|
161
|
+
*/
|
|
162
|
+
const serveFetchHandler = (handler, options = {}) => Effect.acquireRelease(Effect.suspend(() => {
|
|
163
|
+
const invalid = validateOptions(options);
|
|
164
|
+
return invalid === void 0 ? Effect.tryPromise({
|
|
165
|
+
try: () => startFetchHandlerServer(handler, options),
|
|
166
|
+
catch: (cause) => cause instanceof EmulatorServeError ? cause : new EmulatorServeError({
|
|
167
|
+
reason: "listen-failed",
|
|
168
|
+
cause
|
|
169
|
+
})
|
|
170
|
+
}) : Effect.fail(invalid);
|
|
171
|
+
}), (server) => Effect.promise(() => server.close())).pipe(Effect.map((server) => ({
|
|
172
|
+
url: server.url,
|
|
173
|
+
close: Effect.promise(() => server.close())
|
|
174
|
+
})));
|
|
175
|
+
//#endregion
|
|
176
|
+
export { EmulatorServeError, emulatorServerHost, serveFetchHandler, startFetchHandlerServer };
|
|
177
|
+
|
|
178
|
+
//# sourceMappingURL=node.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.mjs","names":[],"sources":["../src/node.ts"],"sourcesContent":["/**\n * Node boundary: serve an emulator fetch handler on loopback.\n *\n * This is the only module in the package that imports `node:` builtins.\n * Servers bind to `127.0.0.1` only. Streamed response bodies are written\n * chunk by chunk (honoring backpressure) so progressive delivery survives the\n * socket, and an erroring body stream destroys the connection mid-response,\n * the way a dropped upstream does.\n *\n * @experimental\n */\nimport { Buffer } from 'node:buffer'\nimport { createServer, type IncomingMessage, type ServerResponse } from 'node:http'\nimport type { Socket } from 'node:net'\nimport { Data, Effect, Predicate, type Scope } from 'effect'\n\n/** A fetch handler, such as the one returned by an emulator factory. */\nexport type FetchHandler = (request: Request) => Promise<Response>\n\nexport type ServeFetchHandlerOptions = {\n /** TCP port; `0` (default) picks a free port. */\n readonly port?: number\n /** Only `127.0.0.1` is accepted (the default); any other host is refused. */\n readonly host?: string\n}\n\n/** The only host emulator servers bind to. */\nexport const emulatorServerHost = '127.0.0.1'\n\n/** Serving failed: a refused host, an invalid port, or a listen error. */\nexport class EmulatorServeError extends Data.TaggedError('EmulatorServeError')<{\n readonly reason: 'host-not-allowed' | 'invalid-port' | 'listen-failed'\n readonly cause?: unknown\n}> {\n override get message(): string {\n switch (this.reason) {\n case 'host-not-allowed':\n return `Emulator servers bind to ${emulatorServerHost} only`\n case 'invalid-port':\n return 'Emulator server port must be an integer from 0 to 65535'\n case 'listen-failed':\n return 'Emulator server could not listen'\n }\n }\n}\n\n/** A running loopback server (Promise variant). `close` is idempotent. */\nexport type RunningFetchHandlerServer = {\n /** Base URL, for example `http://127.0.0.1:43123`. */\n readonly url: string\n readonly close: () => Promise<void>\n}\n\n/** A running loopback server (Effect variant). `close` is idempotent. */\nexport type ServedFetchHandler = {\n readonly url: string\n readonly close: Effect.Effect<void>\n}\n\nconst validateOptions = (options: ServeFetchHandlerOptions): EmulatorServeError | undefined => {\n if (options.host !== undefined && options.host !== emulatorServerHost) {\n return new EmulatorServeError({ reason: 'host-not-allowed' })\n }\n\n const port = options.port ?? 0\n\n if (!Number.isInteger(port) || port < 0 || port > 65535) {\n return new EmulatorServeError({ reason: 'invalid-port' })\n }\n\n return undefined\n}\n\nconst readBody = (incoming: IncomingMessage): Promise<Uint8Array<ArrayBuffer>> =>\n new Promise((resolve, reject) => {\n const chunks: Array<Buffer> = []\n\n incoming.on('data', (chunk: Buffer | string) => {\n chunks.push(Predicate.isString(chunk) ? Buffer.from(chunk) : chunk)\n })\n incoming.on('end', () => resolve(new Uint8Array(Buffer.concat(chunks))))\n incoming.on('error', reject)\n })\n\nconst toWebRequest = async (incoming: IncomingMessage, origin: string): Promise<Request> => {\n const headers = new Headers()\n\n for (const [name, value] of Object.entries(incoming.headers)) {\n if (Array.isArray(value)) {\n for (const item of value) headers.append(name, item)\n } else if (value !== undefined) {\n headers.set(name, value)\n }\n }\n\n const method = incoming.method ?? 'GET'\n const body = await readBody(incoming)\n const init: RequestInit = { method, headers }\n\n if (method !== 'GET' && method !== 'HEAD' && body.byteLength > 0) {\n init.body = body\n }\n\n return new Request(new URL(incoming.url ?? '/', origin), init)\n}\n\nconst waitForDrain = (outgoing: ServerResponse): Promise<void> =>\n new Promise(resolve => {\n const done = () => {\n outgoing.off('drain', done)\n outgoing.off('close', done)\n resolve()\n }\n\n outgoing.on('drain', done)\n outgoing.on('close', done)\n })\n\n/**\n * Write a web `Response` to a Node response: status and headers first, then\n * each body chunk as soon as the handler produces it. A body stream error\n * destroys the socket mid-response.\n */\nconst writeResponse = async (outgoing: ServerResponse, response: Response): Promise<void> => {\n outgoing.statusCode = response.status\n\n if (response.statusText.length > 0) {\n outgoing.statusMessage = response.statusText\n }\n\n response.headers.forEach((value, name) => {\n if (name !== 'set-cookie') outgoing.setHeader(name, value)\n })\n\n const cookies = response.headers.getSetCookie()\n\n if (cookies.length > 0) {\n outgoing.setHeader('set-cookie', cookies)\n }\n\n if (response.body === null) {\n outgoing.end()\n\n return\n }\n\n outgoing.flushHeaders()\n\n const reader = response.body.getReader()\n\n outgoing.on('close', () => {\n if (!outgoing.writableFinished) {\n reader.cancel().catch(() => undefined)\n }\n })\n\n const pump = async (): Promise<void> => {\n const { done, value } = await reader.read()\n\n if (done || outgoing.destroyed) {\n outgoing.end()\n\n return\n }\n\n if (!outgoing.write(value)) {\n await waitForDrain(outgoing)\n }\n\n return pump()\n }\n\n // Destroy without an error argument: the client sees a dropped connection, and no unhandled\n // 'error' event is emitted on the response.\n await pump().catch(() => {\n outgoing.destroy()\n })\n}\n\nconst handleRequest = (\n handler: FetchHandler,\n origin: string,\n incoming: IncomingMessage,\n outgoing: ServerResponse\n): Promise<void> =>\n toWebRequest(incoming, origin)\n .then(handler)\n .then(\n response => writeResponse(outgoing, response),\n () => {\n if (outgoing.headersSent) {\n outgoing.destroy()\n\n return\n }\n\n outgoing.statusCode = 500\n outgoing.setHeader('content-type', 'text/plain')\n outgoing.end('emulator handler failed')\n }\n )\n // A response that cannot be written (for example an invalid header value) drops the connection.\n .catch(() => {\n outgoing.destroy()\n })\n\n/**\n * Serve a fetch handler on `127.0.0.1` (Promise variant, for hosts without an\n * Effect runtime). Rejects with `EmulatorServeError` for a non-loopback host,\n * an invalid port, or a listen failure.\n */\nexport const startFetchHandlerServer = (\n handler: FetchHandler,\n options: ServeFetchHandlerOptions = {}\n): Promise<RunningFetchHandlerServer> => {\n const invalid = validateOptions(options)\n\n if (invalid !== undefined) {\n return Promise.reject(invalid)\n }\n\n const sockets = new Set<Socket>()\n const server = createServer()\n let origin = ''\n\n server.on('connection', socket => {\n socket.setNoDelay(true)\n sockets.add(socket)\n socket.on('close', () => sockets.delete(socket))\n })\n\n server.on('request', (incoming: IncomingMessage, outgoing: ServerResponse) => {\n void handleRequest(handler, origin, incoming, outgoing)\n })\n\n let closing: Promise<void> | undefined\n\n const close = (): Promise<void> => {\n closing ??= new Promise(resolve => {\n server.close(() => resolve())\n\n for (const socket of sockets) socket.destroy()\n })\n\n return closing\n }\n\n return new Promise((resolve, reject) => {\n server.once('error', cause =>\n reject(new EmulatorServeError({ reason: 'listen-failed', cause }))\n )\n server.listen(options.port ?? 0, emulatorServerHost, () => {\n const address = server.address()\n\n if (address === null || Predicate.isString(address)) {\n void close()\n reject(new EmulatorServeError({ reason: 'listen-failed' }))\n\n return\n }\n\n origin = `http://${emulatorServerHost}:${address.port}`\n resolve({ url: origin, close })\n })\n })\n}\n\n/**\n * Serve a fetch handler on `127.0.0.1` as a scoped resource: the server\n * closes when the scope closes (or earlier via `close`). Fails with\n * `EmulatorServeError` for a non-loopback host, an invalid port, or a listen\n * failure.\n */\nexport const serveFetchHandler = (\n handler: FetchHandler,\n options: ServeFetchHandlerOptions = {}\n): Effect.Effect<ServedFetchHandler, EmulatorServeError, Scope.Scope> =>\n Effect.acquireRelease(\n Effect.suspend(() => {\n const invalid = validateOptions(options)\n\n return invalid === undefined\n ? Effect.tryPromise({\n try: () => startFetchHandlerServer(handler, options),\n catch: cause =>\n cause instanceof EmulatorServeError\n ? cause\n : new EmulatorServeError({ reason: 'listen-failed', cause })\n })\n : Effect.fail(invalid)\n }),\n server => Effect.promise(() => server.close())\n ).pipe(Effect.map(server => ({ url: server.url, close: Effect.promise(() => server.close()) })))\n"],"mappings":";;;;;;;;;;;;;;;;AA2BA,MAAa,qBAAqB;;AAGlC,IAAa,qBAAb,cAA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M,CAAC;EAChC,CAAC;CACH,CAAC;AACH;;;;;;;AAQA,MAAa,qBACX,SACA,UAAoC,CAAC,MAErC,OAAO,eACL,OAAO,cAAc;CACnB,MAAM,UAAU,gBAAgB,OAAO;CAEvC,OAAO,YAAY,KAAA,IACf,OAAO,WAAW;EAChB,WAAW,wBAAwB,SAAS,OAAO;EACnD,QAAO,UACL,iBAAiB,qBACb,QACA,IAAI,mBAAmB;GAAE,QAAQ;GAAiB;EAAM,CAAC;CACjE,CAAC,IACD,OAAO,KAAK,OAAO;AACzB,CAAC,IACD,WAAU,OAAO,cAAc,OAAO,MAAM,CAAC,CAC/C,EAAE,KAAK,OAAO,KAAI,YAAW;CAAE,KAAK,OAAO;CAAK,OAAO,OAAO,cAAc,OAAO,MAAM,CAAC;AAAE,EAAE,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { StatefulRoute } from "../stateful-emulator.mjs";
|
|
2
|
+
import { NotionEmulatorState } from "./state.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/notion/api.d.ts
|
|
5
|
+
/** API version prefix of every Notion route. */
|
|
6
|
+
declare const notionEmulatorBasePath = "/v1";
|
|
7
|
+
/** The only `Notion-Version` the emulator answers (every fixture sends it). */
|
|
8
|
+
declare const notionEmulatorVersion = "2025-09-03";
|
|
9
|
+
/** Drill knobs (tests only): each makes the emulator disagree with one conformance claim. */
|
|
10
|
+
type NotionEmulatorDrills = {
|
|
11
|
+
/** A later search page starts one result early, repeating the previous page's last result. */readonly searchRepeatsResults?: boolean; /** `GET /v1/users/me` answers a person instead of the bot user. */
|
|
12
|
+
readonly botUserAsPerson?: boolean; /** Error envelopes carry a `status` other than the HTTP status. */
|
|
13
|
+
readonly envelopeStatusMismatch?: boolean; /** Page reads answer title rich text without `plain_text`. */
|
|
14
|
+
readonly omitTitlePlainText?: boolean; /** A later block children page starts one block early, repeating a block. */
|
|
15
|
+
readonly blockCursorRepeats?: boolean; /** The property id path segment is decoded twice, so a re-encoded id is not found. */
|
|
16
|
+
readonly rejectDoubleEncodedPropertyId?: boolean; /** Data source rows answer a `database_id` parent instead of their data source. */
|
|
17
|
+
readonly rowParentAsDatabase?: boolean; /** A trashed page reads back as 404 `object_not_found`. */
|
|
18
|
+
readonly trashedPageNotFound?: boolean;
|
|
19
|
+
};
|
|
20
|
+
declare const notionEmulatorDrillKnobs: ReadonlyArray<keyof NotionEmulatorDrills>;
|
|
21
|
+
/** A cursor this emulator issued: where its list continues, and the list it was issued for. */
|
|
22
|
+
type NotionIssuedCursor = {
|
|
23
|
+
readonly offset: number; /** The whole list as rendered when the cursor was issued; any change is not emulated. */
|
|
24
|
+
readonly fingerprint: string;
|
|
25
|
+
};
|
|
26
|
+
type NotionApiEnv = {
|
|
27
|
+
/** Clock in epoch milliseconds (created page timestamps only). */readonly now: () => number;
|
|
28
|
+
readonly drills: Readonly<Record<keyof NotionEmulatorDrills, boolean>>; /** Issued cursors by list and value (runtime-only; cleared by reset and seed). */
|
|
29
|
+
readonly cursors: Map<string, NotionIssuedCursor>; /** Property cursor numbers; never reset, so a cursor issued before a reset is never reissued. */
|
|
30
|
+
readonly propertyCursorCounter: {
|
|
31
|
+
next: number;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* The cursor generation: advanced by every reset and seed (never rewound). Search and block
|
|
35
|
+
* cursors are the next result's id only in the generation that first issued that id for that
|
|
36
|
+
* list; a later generation issues a distinct value, so a cursor from before a reset or seed is
|
|
37
|
+
* never accepted again, even after the same first-page request.
|
|
38
|
+
*/
|
|
39
|
+
readonly generation: {
|
|
40
|
+
current: number;
|
|
41
|
+
}; /** The generation that first issued each list's raw id cursor (never cleared). */
|
|
42
|
+
readonly firstIssued: Map<string, number>;
|
|
43
|
+
};
|
|
44
|
+
/** The origin every Notion fixture records; another origin is not emulated. */
|
|
45
|
+
declare const notionEmulatorOrigin = "https://api.notion.com";
|
|
46
|
+
type Route = StatefulRoute<NotionEmulatorState, NotionApiEnv>;
|
|
47
|
+
/** The route table: evidence plus handlers. `notionEmulatorRoutes` is its evidence part. */
|
|
48
|
+
declare const notionApiRoutes: ReadonlyArray<Route>;
|
|
49
|
+
//#endregion
|
|
50
|
+
export { NotionApiEnv, NotionEmulatorDrills, NotionIssuedCursor, notionApiRoutes, notionEmulatorBasePath, notionEmulatorDrillKnobs, notionEmulatorOrigin, notionEmulatorVersion };
|
|
51
|
+
//# sourceMappingURL=api.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.mts","names":[],"sources":["../../src/notion/api.ts"],"mappings":";;;;;cAuCa,sBAAA;AAAb;AAAA,cAGa,qBAAA;;KAWD,oBAAA;EAduB,uGAgBxB,oBAAA,YAbuB;EAAA,SAevB,eAAA,YAfuB;EAAA,SAiBvB,sBAAA,YANC;EAAA,SAQD,kBAAA;WAEA,kBAAA,YARA;EAAA,SAUA,6BAAA,YANA;EAAA,SAQA,mBAAA,YAJA;EAAA,SAMA,mBAAA;AAAA;AAAA,cAGE,wBAAA,EAA0B,aAAa,OAAO,oBAAA;;KAY/C,kBAAA;EAAA,SACD,MAAA,UAJV;EAAA,SAMU,WAAW;AAAA;AAAA,KAGV,YAAA;EANA,2EAQD,GAAA;EAAA,SACA,MAAA,EAAQ,QAAA,CAAS,MAAA,OAAa,oBAAA,aAR9B;EAAA,SAUA,OAAA,EAAS,GAAA,SAAY,kBAAA,GALpB;EAAA,SAOD,qBAAA;IAAyB,IAAA;EAAA;EAJR;;;;;;EAAA,SAWjB,UAAA;IAAc,OAAA;EAAA,GAXN;EAAA,SAaR,WAAA,EAAa,GAAA;AAAA;;cAIX,oBAAA;AAAA,KAER,KAAA,GAAQ,aAAA,CAAc,mBAAA,EAAqB,YAAA;;cAo1BnC,eAAA,EAAiB,aAAa,CAAC,KAAA"}
|