@drfed/drfed 0.0.0-stage → 0.1.0-dev.561
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 +661 -0
- package/README.md +1198 -2
- package/bin/drfed-account.mjs +20 -0
- package/bin/drfed-migrate.mjs +20 -0
- package/bin/drfed-server.mjs +20 -0
- package/bin/drfed-web.mjs +20 -0
- package/completions/bash/drfed-account +219 -0
- package/completions/bash/drfed-migrate +219 -0
- package/completions/bash/drfed-server +219 -0
- package/completions/bash/drfed-web +219 -0
- package/completions/fish/drfed-account.fish +264 -0
- package/completions/fish/drfed-migrate.fish +264 -0
- package/completions/fish/drfed-server.fish +264 -0
- package/completions/fish/drfed-web.fish +264 -0
- package/completions/nu/drfed-account.nu +293 -0
- package/completions/nu/drfed-migrate.nu +293 -0
- package/completions/nu/drfed-server.nu +293 -0
- package/completions/nu/drfed-web.nu +293 -0
- package/completions/pwsh/drfed-account.ps1 +183 -0
- package/completions/pwsh/drfed-migrate.ps1 +183 -0
- package/completions/pwsh/drfed-server.ps1 +183 -0
- package/completions/pwsh/drfed-web.ps1 +183 -0
- package/completions/zsh/_drfed-account +145 -0
- package/completions/zsh/_drfed-migrate +145 -0
- package/completions/zsh/_drfed-server +145 -0
- package/completions/zsh/_drfed-web +145 -0
- package/dist/api-mail-parser.d.mts +106 -0
- package/dist/api-mail-parser.d.mts.map +1 -0
- package/dist/api-mail-parser.mjs +145 -0
- package/dist/api-mail-parser.mjs.map +1 -0
- package/dist/api-mail-settings-BcGaqQ9f.d.mts +142 -0
- package/dist/api-mail-settings-BcGaqQ9f.d.mts.map +1 -0
- package/dist/api-mail-settings.d.mts +2 -0
- package/dist/api-mail-settings.mjs +272 -0
- package/dist/api-mail-settings.mjs.map +1 -0
- package/dist/bounded-mail-runtime.d.mts +9 -0
- package/dist/bounded-mail-runtime.d.mts.map +1 -0
- package/dist/bounded-mail-runtime.mjs +66 -0
- package/dist/bounded-mail-runtime.mjs.map +1 -0
- package/dist/commands/account-create.d.mts +37 -0
- package/dist/commands/account-create.d.mts.map +1 -0
- package/dist/commands/account-create.mjs +87 -0
- package/dist/commands/account-create.mjs.map +1 -0
- package/dist/commands/account-program.d.mts +223 -0
- package/dist/commands/account-program.d.mts.map +1 -0
- package/dist/commands/account-program.mjs +116 -0
- package/dist/commands/account-program.mjs.map +1 -0
- package/dist/commands/account.d.mts +6 -0
- package/dist/commands/account.d.mts.map +1 -0
- package/dist/commands/account.mjs +91 -0
- package/dist/commands/account.mjs.map +1 -0
- package/dist/commands/migrate-program.d.mts +219 -0
- package/dist/commands/migrate-program.d.mts.map +1 -0
- package/dist/commands/migrate-program.mjs +116 -0
- package/dist/commands/migrate-program.mjs.map +1 -0
- package/dist/commands/migrate.d.mts +6 -0
- package/dist/commands/migrate.d.mts.map +1 -0
- package/dist/commands/migrate.mjs +85 -0
- package/dist/commands/migrate.mjs.map +1 -0
- package/dist/commands/web-program.d.mts +213 -0
- package/dist/commands/web-program.d.mts.map +1 -0
- package/dist/commands/web-program.mjs +112 -0
- package/dist/commands/web-program.mjs.map +1 -0
- package/dist/commands/web.d.mts +6 -0
- package/dist/commands/web.d.mts.map +1 -0
- package/dist/commands/web.mjs +184 -0
- package/dist/commands/web.mjs.map +1 -0
- package/dist/configuration-DVVF7xNv.d.mts +432 -0
- package/dist/configuration-DVVF7xNv.d.mts.map +1 -0
- package/dist/configuration.d.mts +2 -0
- package/dist/configuration.mjs +469 -0
- package/dist/configuration.mjs.map +1 -0
- package/dist/data-path.d.mts +9 -0
- package/dist/data-path.d.mts.map +1 -0
- package/dist/data-path.mjs +21 -0
- package/dist/data-path.mjs.map +1 -0
- package/dist/database-runtime.d.mts +26 -0
- package/dist/database-runtime.d.mts.map +1 -0
- package/dist/database-runtime.mjs +92 -0
- package/dist/database-runtime.mjs.map +1 -0
- package/dist/database-settings.d.mts +36 -0
- package/dist/database-settings.d.mts.map +1 -0
- package/dist/database-settings.mjs +67 -0
- package/dist/database-settings.mjs.map +1 -0
- package/dist/diagnostics.d.mts +29 -0
- package/dist/diagnostics.d.mts.map +1 -0
- package/dist/diagnostics.mjs +61 -0
- package/dist/diagnostics.mjs.map +1 -0
- package/dist/index.d.mts +5 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +344 -0
- package/dist/index.mjs.map +1 -0
- package/dist/jmap-parser.d.mts +35 -0
- package/dist/jmap-parser.d.mts.map +1 -0
- package/dist/jmap-parser.mjs +42 -0
- package/dist/jmap-parser.mjs.map +1 -0
- package/dist/jmap-runtime.d.mts +10 -0
- package/dist/jmap-runtime.d.mts.map +1 -0
- package/dist/jmap-runtime.mjs +17 -0
- package/dist/jmap-runtime.mjs.map +1 -0
- package/dist/jmap-settings-BXNAF1ep.d.mts +41 -0
- package/dist/jmap-settings-BXNAF1ep.d.mts.map +1 -0
- package/dist/jmap-settings.d.mts +2 -0
- package/dist/jmap-settings.mjs +104 -0
- package/dist/jmap-settings.mjs.map +1 -0
- package/dist/logging.d.mts +33 -0
- package/dist/logging.d.mts.map +1 -0
- package/dist/logging.mjs +56 -0
- package/dist/logging.mjs.map +1 -0
- package/dist/mail-parser-DyI4wuQp.d.mts +246 -0
- package/dist/mail-parser-DyI4wuQp.d.mts.map +1 -0
- package/dist/mail-parser.d.mts +2 -0
- package/dist/mail-parser.mjs +100 -0
- package/dist/mail-parser.mjs.map +1 -0
- package/dist/mail-runtime-YROIQ8up.mjs +314 -0
- package/dist/mail-runtime-YROIQ8up.mjs.map +1 -0
- package/dist/mail-runtime.d.mts +68 -0
- package/dist/mail-runtime.d.mts.map +1 -0
- package/dist/mail-runtime.mjs +2 -0
- package/dist/mail-settings-BD1TQ0rt.mjs +427 -0
- package/dist/mail-settings-BD1TQ0rt.mjs.map +1 -0
- package/dist/mail-settings-DjWMAUaE.d.mts +80 -0
- package/dist/mail-settings-DjWMAUaE.d.mts.map +1 -0
- package/dist/mail-settings.d.mts +2 -0
- package/dist/mail-settings.mjs +2 -0
- package/dist/operations.d.mts +32 -0
- package/dist/operations.d.mts.map +1 -0
- package/dist/operations.mjs +55 -0
- package/dist/operations.mjs.map +1 -0
- package/dist/package-D1pbtLwn.mjs +6 -0
- package/dist/package-D1pbtLwn.mjs.map +1 -0
- package/dist/parser-DGIQTgS7.mjs +178 -0
- package/dist/parser-DGIQTgS7.mjs.map +1 -0
- package/dist/parser-TANGHRjL.d.mts +305 -0
- package/dist/parser-TANGHRjL.d.mts.map +1 -0
- package/dist/postgres-settings.d.mts +20 -0
- package/dist/postgres-settings.d.mts.map +1 -0
- package/dist/postgres-settings.mjs +60 -0
- package/dist/postgres-settings.mjs.map +1 -0
- package/dist/query-logger.d.mts +9 -0
- package/dist/query-logger.d.mts.map +1 -0
- package/dist/query-logger.mjs +17 -0
- package/dist/query-logger.mjs.map +1 -0
- package/dist/resources.d.mts +20 -0
- package/dist/resources.d.mts.map +1 -0
- package/dist/resources.mjs +34 -0
- package/dist/resources.mjs.map +1 -0
- package/dist/secret-source-BeZx72Ue.d.mts +21 -0
- package/dist/secret-source-BeZx72Ue.d.mts.map +1 -0
- package/dist/secret-source.d.mts +2 -0
- package/dist/secret-source.mjs +58 -0
- package/dist/secret-source.mjs.map +1 -0
- package/dist/serving.d.mts +82 -0
- package/dist/serving.d.mts.map +1 -0
- package/dist/serving.mjs +138 -0
- package/dist/serving.mjs.map +1 -0
- package/dist/smtp-settings.d.mts +11 -0
- package/dist/smtp-settings.d.mts.map +1 -0
- package/dist/smtp-settings.mjs +38 -0
- package/dist/smtp-settings.mjs.map +1 -0
- package/dist/valueparser.d.mts +46 -0
- package/dist/valueparser.d.mts.map +1 -0
- package/dist/valueparser.mjs +121 -0
- package/dist/valueparser.mjs.map +1 -0
- package/package.json +287 -3
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
//#region src/operations.ts
|
|
2
|
+
/** Track asynchronous work so shutdown can refuse new work and await existing work. */
|
|
3
|
+
var OperationRegistry = class {
|
|
4
|
+
#abort = new AbortController();
|
|
5
|
+
#active = /* @__PURE__ */ new Set();
|
|
6
|
+
/**
|
|
7
|
+
* A shared cancellation signal for operations owned by this registry.
|
|
8
|
+
* @returns The cancellation signal shared by registered operations.
|
|
9
|
+
*/
|
|
10
|
+
get signal() {
|
|
11
|
+
return this.#abort.signal;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Register before invoking an operation, including operations that reject.
|
|
15
|
+
* @returns The operation's result; the caller remains responsible for errors.
|
|
16
|
+
*/
|
|
17
|
+
run(operation) {
|
|
18
|
+
if (this.signal.aborted) return Promise.reject(this.signal.reason);
|
|
19
|
+
return this.track((signal) => {
|
|
20
|
+
signal.throwIfAborted();
|
|
21
|
+
return operation(signal);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Track a continuation of work already admitted by the runtime.
|
|
26
|
+
* The caller must prevent new requests and stop background producers before
|
|
27
|
+
* draining. Continuations remain allowed so accepted requests can finish.
|
|
28
|
+
* @returns The continuation's result; the caller remains responsible for errors.
|
|
29
|
+
*/
|
|
30
|
+
track(operation) {
|
|
31
|
+
const task = Promise.resolve().then(() => operation(this.signal));
|
|
32
|
+
this.#active.add(task);
|
|
33
|
+
const forget = () => {
|
|
34
|
+
this.#active.delete(task);
|
|
35
|
+
};
|
|
36
|
+
task.then(forget, forget);
|
|
37
|
+
return task;
|
|
38
|
+
}
|
|
39
|
+
/** Refuse new work and signal existing operations to stop. */
|
|
40
|
+
abort() {
|
|
41
|
+
this.#abort.abort();
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Abort and await all registered work, even if an operation rejected.
|
|
45
|
+
* @returns Completion after every active operation has settled.
|
|
46
|
+
*/
|
|
47
|
+
async drain() {
|
|
48
|
+
this.abort();
|
|
49
|
+
while (this.#active.size > 0) await Promise.allSettled([...this.#active]);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
//#endregion
|
|
53
|
+
export { OperationRegistry };
|
|
54
|
+
|
|
55
|
+
//# sourceMappingURL=operations.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations.mjs","names":["#abort","#active"],"sources":["../src/operations.ts"],"sourcesContent":["// DrFed: A web-based platform for developing and debugging ActivityPub apps\n// Copyright (C) 2026 DrFed team\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see <https://www.gnu.org/licenses/>.\n\n/** Track asynchronous work so shutdown can refuse new work and await existing work. */\nexport class OperationRegistry {\n readonly #abort = new AbortController();\n readonly #active = new Set<Promise<unknown>>();\n\n /**\n * A shared cancellation signal for operations owned by this registry.\n * @returns The cancellation signal shared by registered operations.\n */\n get signal(): AbortSignal {\n return this.#abort.signal;\n }\n\n /**\n * Register before invoking an operation, including operations that reject.\n * @returns The operation's result; the caller remains responsible for errors.\n */\n run<T>(operation: (signal: AbortSignal) => T | Promise<T>): Promise<T> {\n if (this.signal.aborted) return Promise.reject(this.signal.reason);\n return this.track((signal) => {\n signal.throwIfAborted();\n return operation(signal);\n });\n }\n\n /**\n * Track a continuation of work already admitted by the runtime.\n * The caller must prevent new requests and stop background producers before\n * draining. Continuations remain allowed so accepted requests can finish.\n * @returns The continuation's result; the caller remains responsible for errors.\n */\n track<T>(operation: (signal: AbortSignal) => T | Promise<T>): Promise<T> {\n // Register first so reentrant shutdown cannot miss the operation.\n // oxlint-disable-next-line promise/prefer-await-to-then\n const task = Promise.resolve().then(() => operation(this.signal));\n this.#active.add(task);\n const forget = () => {\n this.#active.delete(task);\n };\n // Both handlers resolve; tracking must not create an unhandled rejection.\n // oxlint-disable-next-line promise/prefer-await-to-then\n void task.then(forget, forget);\n return task;\n }\n\n /** Refuse new work and signal existing operations to stop. */\n abort(): void {\n this.#abort.abort();\n }\n\n /**\n * Abort and await all registered work, even if an operation rejected.\n * @returns Completion after every active operation has settled.\n */\n async drain(): Promise<void> {\n this.abort();\n // Existing requests may register their next resolver while draining.\n // oxlint-disable-next-line no-unmodified-loop-condition\n while (this.#active.size > 0) {\n // oxlint-disable-next-line no-await-in-loop\n await Promise.allSettled([...this.#active]);\n }\n }\n}\n"],"mappings":";;AAiBA,IAAa,oBAAb,MAA+B;CAC7B,SAAkB,IAAI,gBAAgB;CACtC,0BAAmB,IAAI,IAAsB;;;;;CAM7C,IAAI,SAAsB;EACxB,OAAO,KAAKA,OAAO;CACrB;;;;;CAMA,IAAO,WAAgE;EACrE,IAAI,KAAK,OAAO,SAAS,OAAO,QAAQ,OAAO,KAAK,OAAO,MAAM;EACjE,OAAO,KAAK,OAAO,WAAW;GAC5B,OAAO,eAAe;GACtB,OAAO,UAAU,MAAM;EACzB,CAAC;CACH;;;;;;;CAQA,MAAS,WAAgE;EAGvE,MAAM,OAAO,QAAQ,QAAQ,CAAC,CAAC,WAAW,UAAU,KAAK,MAAM,CAAC;EAChE,KAAKC,QAAQ,IAAI,IAAI;EACrB,MAAM,eAAe;GACnB,KAAKA,QAAQ,OAAO,IAAI;EAC1B;EAGA,KAAU,KAAK,QAAQ,MAAM;EAC7B,OAAO;CACT;;CAGA,QAAc;EACZ,KAAKD,OAAO,MAAM;CACpB;;;;;CAMA,MAAM,QAAuB;EAC3B,KAAK,MAAM;EAGX,OAAO,KAAKC,QAAQ,OAAO,GAEzB,MAAM,QAAQ,WAAW,CAAC,GAAG,KAAKA,OAAO,CAAC;CAE9C;AACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-D1pbtLwn.mjs","names":[],"sources":["../package.json"],"sourcesContent":[""],"mappings":""}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { configurationBoolean, configurationProvenance, configurationSettings, stringArray } from "./configuration.mjs";
|
|
2
|
+
import { resolveDatabaseSettings } from "./database-settings.mjs";
|
|
3
|
+
import { rootOrigin } from "./valueparser.mjs";
|
|
4
|
+
import { createLoggingParser, loggingValueOptionNames, resolveLogging } from "./logging.mjs";
|
|
5
|
+
import { createMailParser, mailValueOptionNames } from "./mail-parser.mjs";
|
|
6
|
+
import { t as resolveMailSettings } from "./mail-settings-BD1TQ0rt.mjs";
|
|
7
|
+
import { message } from "@optique/core/message";
|
|
8
|
+
import { map, multiple, optional, withDefault } from "@optique/core/modifiers";
|
|
9
|
+
import { email, integer, origin, socketAddress, string, url } from "@optique/core/valueparser";
|
|
10
|
+
import { classifyHost } from "@drfed/federation/origin";
|
|
11
|
+
import { conditional, merge, object, or } from "@optique/core/constructs";
|
|
12
|
+
import { flag, option } from "@optique/core/primitives";
|
|
13
|
+
import { path } from "@optique/run/valueparser";
|
|
14
|
+
//#region src/parser.ts
|
|
15
|
+
/** Shared value-option spellings for strict parsing and metadata arity. */
|
|
16
|
+
const valueOptionNames = {
|
|
17
|
+
configPath: ["--config"],
|
|
18
|
+
address: ["--listen", "-l"],
|
|
19
|
+
rootOrigin: ["--root-origin", "-r"],
|
|
20
|
+
loginOrigins: ["--login-origin"],
|
|
21
|
+
publicOrigin: ["--public-origin"],
|
|
22
|
+
emailFrom: ["--email-from", "-f"],
|
|
23
|
+
dataPath: [
|
|
24
|
+
"--pglite-data-path",
|
|
25
|
+
"--data-path",
|
|
26
|
+
"-d"
|
|
27
|
+
],
|
|
28
|
+
postgresUrl: [
|
|
29
|
+
"--postgres-url",
|
|
30
|
+
"--database-url",
|
|
31
|
+
"-D"
|
|
32
|
+
],
|
|
33
|
+
migrationLockTimeout: ["--migration-lock-timeout"],
|
|
34
|
+
...mailValueOptionNames,
|
|
35
|
+
logLevel: loggingValueOptionNames.logLevel,
|
|
36
|
+
logFormat: loggingValueOptionNames.logFormat,
|
|
37
|
+
logOutput: loggingValueOptionNames.logOutput,
|
|
38
|
+
outputFile: ["--output-file", "-o"]
|
|
39
|
+
};
|
|
40
|
+
const identity = (value) => value;
|
|
41
|
+
/**
|
|
42
|
+
* Construct a fresh parser from shared bindings without creating resources.
|
|
43
|
+
* @returns The server and schema-output parser.
|
|
44
|
+
*/
|
|
45
|
+
function createParser(bindings, mode = "server") {
|
|
46
|
+
const { bind } = bindings;
|
|
47
|
+
const address = socketAddress({ requirePort: true });
|
|
48
|
+
const root = rootOrigin({ metavar: "ORIGIN" });
|
|
49
|
+
const lockTimeout = integer({
|
|
50
|
+
min: 1,
|
|
51
|
+
max: 2147483647,
|
|
52
|
+
metavar: "MILLISECONDS"
|
|
53
|
+
});
|
|
54
|
+
const sender = email({ lowercase: true });
|
|
55
|
+
const logging = createLoggingParser(bindings);
|
|
56
|
+
const server = object("DrFed server", {
|
|
57
|
+
address: bind(option(...valueOptionNames.address, address, { description: message`The address to listen on.` }), configurationSettings.listen, address, identity, {
|
|
58
|
+
host: "localhost",
|
|
59
|
+
port: 8888
|
|
60
|
+
}),
|
|
61
|
+
rootOrigin: bind(option(...valueOptionNames.rootOrigin, root, { description: message`The root origin whose subdomains name instances. Required through CLI, environment or configuration.` }), configurationSettings.rootOrigin, root, identity),
|
|
62
|
+
web: bind(or(flag("--web", { description: message`Serve the frontend alongside GraphQL on the same port. This is the default.` }), map(flag("--no-web", { description: message`Serve GraphQL and federation without the frontend; login origins must be explicit.` }), () => false)), configurationSettings.web, configurationBoolean(), String, true),
|
|
63
|
+
publicOrigin: bind(map(option(...valueOptionNames.publicOrigin, origin({ allowedProtocols: ["http:", "https:"] }), { description: message`The public HTTP or HTTPS frontend origin. Defaults to the root origin; unused with --no-web.` }), (value) => value.origin), configurationSettings.publicOrigin, string(), identity),
|
|
64
|
+
loginOrigins: bind(multiple(map(option(...valueOptionNames.loginOrigins, origin({ allowedProtocols: ["http:", "https:"] }), { description: message`An HTTP or HTTPS frontend origin allowed in login links. Repeat to replace the configured list. Defaults to the public web origin when serving the frontend.` }), (value) => value.origin), { min: 1 }), configurationSettings.loginOrigins, stringArray(), JSON.stringify),
|
|
65
|
+
emailFrom: bind(option(...valueOptionNames.emailFrom, sender, { description: message`The login mail sender. Defaults to noreply at the root origin's host name.` }), configurationSettings.emailFrom, sender, identity),
|
|
66
|
+
dataPath: bind(option(...valueOptionNames.dataPath, path({
|
|
67
|
+
metavar: "DIRECTORY",
|
|
68
|
+
type: "directory"
|
|
69
|
+
}), { description: message`PGlite data directory. Cannot accompany a PostgreSQL selector at the same source.` }), configurationSettings.dataPath, string(), identity),
|
|
70
|
+
postgresUrl: bind(map(option(...valueOptionNames.postgresUrl, url({ allowedProtocols: ["postgres:", "postgresql:"] }), { description: message`PostgreSQL connection URL. Cannot accompany a PGlite selector at the same source.` }), (value) => value.href), configurationSettings.postgresUrl, string(), identity),
|
|
71
|
+
migrate: bind(or(flag("--migrate", { description: message`Apply database migrations on startup.` }), map(flag("--no-migrate", "-M", { description: message`Require exact ready migration history without applying SQL or upgrading metadata.` }), () => false)), configurationSettings.migrate, configurationBoolean(), String, true),
|
|
72
|
+
migrationLockTimeout: bind(option(...valueOptionNames.migrationLockTimeout, lockTimeout, { description: message`Maximum PostgreSQL migration connection and lock wait in milliseconds. PGlite ownership conflicts fail immediately.` }), configurationSettings.migrationLockTimeout, lockTimeout, String, 3e4),
|
|
73
|
+
mail: createMailParser(bindings),
|
|
74
|
+
seed: option("--dev-seed", {
|
|
75
|
+
description: message`Seed initial development data.`,
|
|
76
|
+
hidden: true
|
|
77
|
+
}),
|
|
78
|
+
logging,
|
|
79
|
+
printConfig: withDefault(flag("--print-config", { description: message`Print effective settings and their sources, with secrets redacted, then exit without opening runtime resources.` }), false)
|
|
80
|
+
});
|
|
81
|
+
const schema = object("GraphQL schema generation", {
|
|
82
|
+
ignoredLogging: object({
|
|
83
|
+
level: optional(option(...valueOptionNames.logLevel, string(), { hidden: true })),
|
|
84
|
+
format: optional(option(...valueOptionNames.logFormat, string(), { hidden: true })),
|
|
85
|
+
output: optional(option(...valueOptionNames.logOutput, string(), { hidden: true }))
|
|
86
|
+
}),
|
|
87
|
+
outputFile: withDefault(option(...valueOptionNames.outputFile, path({
|
|
88
|
+
type: "file",
|
|
89
|
+
allowCreate: true
|
|
90
|
+
}), { description: message`Schema output file. Use - for stdout.` }), "-")
|
|
91
|
+
});
|
|
92
|
+
return merge(object({ configPath: optional(bindings.bindConfigPath(option(...valueOptionNames.configPath, path({
|
|
93
|
+
metavar: "FILE",
|
|
94
|
+
type: "file"
|
|
95
|
+
}), { description: message`Read this TOML file. No configuration files are searched automatically.` }))) }), object({ mode: mode === "schema" ? map(merge(object({ generateGraphqlSchema: flag("--generate-graphql-schema") }), schema), (value) => ["schema", value]) : conditional(map(flag("--generate-graphql-schema", { description: message`Generate GraphQL schema and exit.` }), () => "schema"), { schema }, server) }));
|
|
96
|
+
}
|
|
97
|
+
function required(value, error) {
|
|
98
|
+
if (value?.value === void 0) throw new Error(error);
|
|
99
|
+
return value.value;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Resolve domain constraints only after the source contexts have completed.
|
|
103
|
+
* @returns Plain startup options; no database, mail or log sink is created.
|
|
104
|
+
*/
|
|
105
|
+
function resolveOptions(options, cwd = process.cwd()) {
|
|
106
|
+
if (options.mode[0] === "schema") return {
|
|
107
|
+
generateGraphqlSchema: true,
|
|
108
|
+
outputFile: options.mode[1].outputFile
|
|
109
|
+
};
|
|
110
|
+
const server = options.mode[1];
|
|
111
|
+
const logging = resolveLogging(server.logging, cwd);
|
|
112
|
+
const root = required(server.rootOrigin, "Missing option --root-origin or server.root_origin (DRFED_ROOT_ORIGIN).");
|
|
113
|
+
const web = required(server.web, "Missing web serving policy.");
|
|
114
|
+
let publicOrigin;
|
|
115
|
+
if (web) {
|
|
116
|
+
const supplied = server.publicOrigin?.value;
|
|
117
|
+
if (supplied === void 0) publicOrigin = new URL(root.origin);
|
|
118
|
+
else {
|
|
119
|
+
const parsed = origin({ allowedProtocols: ["http:", "https:"] }).parse(supplied);
|
|
120
|
+
if (!parsed.success) throw new Error("Invalid public origin; expected an HTTP or HTTPS origin without credentials.");
|
|
121
|
+
publicOrigin = parsed.value;
|
|
122
|
+
}
|
|
123
|
+
if (classifyHost(publicOrigin, root) !== "admin") throw new Error("The public web origin cannot name an instance or a deeper subdomain.");
|
|
124
|
+
}
|
|
125
|
+
const origins = server.loginOrigins?.value ?? (publicOrigin === void 0 ? [] : [publicOrigin.origin]);
|
|
126
|
+
if (origins.length === 0) throw new Error("Expected at least 1 values, but got only 0.");
|
|
127
|
+
const loginOrigins = /* @__PURE__ */ new Set();
|
|
128
|
+
for (const value of origins) {
|
|
129
|
+
const parsed = origin({ allowedProtocols: ["http:", "https:"] }).parse(value);
|
|
130
|
+
if (!parsed.success) throw new Error("Invalid login origin; expected an HTTP or HTTPS origin.");
|
|
131
|
+
loginOrigins.add(parsed.value.origin);
|
|
132
|
+
}
|
|
133
|
+
if (publicOrigin !== void 0 && !loginOrigins.has(publicOrigin.origin)) throw new Error("The configured login origins must include the public web origin.");
|
|
134
|
+
const database = resolveDatabaseSettings({
|
|
135
|
+
dataPath: server.dataPath,
|
|
136
|
+
postgresUrl: server.postgresUrl
|
|
137
|
+
}, cwd);
|
|
138
|
+
const mail = resolveMailSettings(server.mail, cwd);
|
|
139
|
+
return {
|
|
140
|
+
printConfig: server.printConfig,
|
|
141
|
+
address: required(server.address, "Missing listen address."),
|
|
142
|
+
rootOrigin: root,
|
|
143
|
+
web,
|
|
144
|
+
publicOrigin,
|
|
145
|
+
loginOrigins,
|
|
146
|
+
emailFrom: server.emailFrom?.value,
|
|
147
|
+
mail: mail.mail,
|
|
148
|
+
mailDiagnostic: mail.diagnostic,
|
|
149
|
+
seed: server.seed,
|
|
150
|
+
logging,
|
|
151
|
+
drizzle: {
|
|
152
|
+
...database.database,
|
|
153
|
+
migrate: required(server.migrate, "Missing migration policy."),
|
|
154
|
+
lockTimeoutMs: required(server.migrationLockTimeout, "Missing migration lock timeout.")
|
|
155
|
+
},
|
|
156
|
+
provenance: configurationProvenance({
|
|
157
|
+
rootOrigin: server.rootOrigin,
|
|
158
|
+
web: server.web,
|
|
159
|
+
publicOrigin: server.publicOrigin,
|
|
160
|
+
address: server.address,
|
|
161
|
+
loginOrigins: server.loginOrigins,
|
|
162
|
+
emailFrom: server.emailFrom,
|
|
163
|
+
dataPath: server.dataPath,
|
|
164
|
+
postgresUrl: server.postgresUrl,
|
|
165
|
+
migrate: server.migrate,
|
|
166
|
+
migrationLockTimeout: server.migrationLockTimeout,
|
|
167
|
+
...server.mail,
|
|
168
|
+
logLevel: server.logging.level,
|
|
169
|
+
logFormat: server.logging.format,
|
|
170
|
+
logOutput: server.logging.output
|
|
171
|
+
}),
|
|
172
|
+
ignored: [...database.ignored, ...mail.ignored]
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
//#endregion
|
|
176
|
+
export { resolveOptions as n, valueOptionNames as r, createParser as t };
|
|
177
|
+
|
|
178
|
+
//# sourceMappingURL=parser-DGIQTgS7.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser-DGIQTgS7.mjs","names":["settings"],"sources":["../src/parser.ts"],"sourcesContent":["// DrFed: A web-based platform for developing and debugging ActivityPub apps\n// Copyright (C) 2026 DrFed team\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see <https://www.gnu.org/licenses/>.\n\nimport { classifyHost } from \"@drfed/federation/origin\";\nimport { conditional, merge, object, or } from \"@optique/core/constructs\";\nimport { message } from \"@optique/core/message\";\nimport { map, multiple, optional, withDefault } from \"@optique/core/modifiers\";\nimport type { InferValue } from \"@optique/core/parser\";\nimport { flag, option } from \"@optique/core/primitives\";\nimport {\n email,\n integer,\n origin,\n socketAddress,\n string,\n url,\n} from \"@optique/core/valueparser\";\nimport { path } from \"@optique/run/valueparser\";\n\nimport {\n type Sourced,\n configurationBoolean,\n configurationProvenance,\n type createConfigurationBindings,\n configurationSettings as settings,\n stringArray,\n} from \"./configuration.ts\";\nimport { resolveDatabaseSettings } from \"./database-settings.ts\";\nimport {\n createLoggingParser,\n loggingValueOptionNames,\n resolveLogging,\n} from \"./logging.ts\";\nimport { createMailParser, mailValueOptionNames } from \"./mail-parser.ts\";\nimport { resolveMailSettings } from \"./mail-settings.ts\";\nimport { rootOrigin } from \"./valueparser.ts\";\n\n/** Shared value-option spellings for strict parsing and metadata arity. */\nexport const valueOptionNames = {\n configPath: [\"--config\"],\n address: [\"--listen\", \"-l\"],\n rootOrigin: [\"--root-origin\", \"-r\"],\n loginOrigins: [\"--login-origin\"],\n publicOrigin: [\"--public-origin\"],\n emailFrom: [\"--email-from\", \"-f\"],\n dataPath: [\"--pglite-data-path\", \"--data-path\", \"-d\"],\n postgresUrl: [\"--postgres-url\", \"--database-url\", \"-D\"],\n migrationLockTimeout: [\"--migration-lock-timeout\"],\n ...mailValueOptionNames,\n logLevel: loggingValueOptionNames.logLevel,\n logFormat: loggingValueOptionNames.logFormat,\n logOutput: loggingValueOptionNames.logOutput,\n outputFile: [\"--output-file\", \"-o\"],\n} as const;\n\ntype Bindings = ReturnType<typeof createConfigurationBindings>;\nconst identity = (value: string) => value;\n\n/**\n * Construct a fresh parser from shared bindings without creating resources.\n * @returns The server and schema-output parser.\n */\nexport function createParser(\n bindings: Bindings,\n mode: \"server\" | \"schema\" = \"server\",\n) {\n const { bind } = bindings;\n const address = socketAddress({ requirePort: true });\n const root = rootOrigin({ metavar: \"ORIGIN\" });\n const lockTimeout = integer({\n min: 1,\n max: 2_147_483_647,\n metavar: \"MILLISECONDS\",\n });\n const sender = email({ lowercase: true });\n const logging = createLoggingParser(bindings);\n const server = object(\"DrFed server\", {\n address: bind(\n option(...valueOptionNames.address, address, {\n description: message`The address to listen on.`,\n }),\n settings.listen,\n address,\n identity,\n { host: \"localhost\", port: 8888 },\n ),\n rootOrigin: bind(\n option(...valueOptionNames.rootOrigin, root, {\n description: message`The root origin whose subdomains name instances. Required through CLI, environment or configuration.`,\n }),\n settings.rootOrigin,\n root,\n identity,\n ),\n web: bind(\n or(\n flag(\"--web\", {\n description: message`Serve the frontend alongside GraphQL on the same port. This is the default.`,\n }),\n map(\n flag(\"--no-web\", {\n description: message`Serve GraphQL and federation without the frontend; login origins must be explicit.`,\n }),\n () => false,\n ),\n ),\n settings.web,\n configurationBoolean(),\n String,\n true,\n ),\n publicOrigin: bind(\n map(\n option(\n ...valueOptionNames.publicOrigin,\n origin({ allowedProtocols: [\"http:\", \"https:\"] }),\n {\n description: message`The public HTTP or HTTPS frontend origin. Defaults to the root origin; unused with --no-web.`,\n },\n ),\n (value) => value.origin,\n ),\n settings.publicOrigin,\n string(),\n identity,\n ),\n loginOrigins: bind(\n multiple(\n map(\n option(\n ...valueOptionNames.loginOrigins,\n origin({ allowedProtocols: [\"http:\", \"https:\"] }),\n {\n description: message`An HTTP or HTTPS frontend origin allowed in login links. Repeat to replace the configured list. Defaults to the public web origin when serving the frontend.`,\n },\n ),\n (value) => value.origin,\n ),\n { min: 1 },\n ),\n settings.loginOrigins,\n stringArray(),\n JSON.stringify,\n ),\n emailFrom: bind(\n option(...valueOptionNames.emailFrom, sender, {\n description: message`The login mail sender. Defaults to noreply at the root origin's host name.`,\n }),\n settings.emailFrom,\n sender,\n identity,\n ),\n dataPath: bind(\n option(\n ...valueOptionNames.dataPath,\n path({ metavar: \"DIRECTORY\", type: \"directory\" }),\n {\n description: message`PGlite data directory. Cannot accompany a PostgreSQL selector at the same source.`,\n },\n ),\n settings.dataPath,\n string(),\n identity,\n ),\n postgresUrl: bind(\n map(\n option(\n ...valueOptionNames.postgresUrl,\n url({ allowedProtocols: [\"postgres:\", \"postgresql:\"] }),\n {\n description: message`PostgreSQL connection URL. Cannot accompany a PGlite selector at the same source.`,\n },\n ),\n (value) => value.href,\n ),\n settings.postgresUrl,\n string(),\n identity,\n ),\n migrate: bind(\n or(\n flag(\"--migrate\", {\n description: message`Apply database migrations on startup.`,\n }),\n map(\n flag(\"--no-migrate\", \"-M\", {\n description: message`Require exact ready migration history without applying SQL or upgrading metadata.`,\n }),\n () => false,\n ),\n ),\n settings.migrate,\n configurationBoolean(),\n String,\n true,\n ),\n migrationLockTimeout: bind(\n option(...valueOptionNames.migrationLockTimeout, lockTimeout, {\n description: message`Maximum PostgreSQL migration connection and lock wait in milliseconds. PGlite ownership conflicts fail immediately.`,\n }),\n settings.migrationLockTimeout,\n lockTimeout,\n String,\n 30_000,\n ),\n mail: createMailParser(bindings),\n seed: option(\"--dev-seed\", {\n description: message`Seed initial development data.`,\n hidden: true,\n }),\n logging,\n printConfig: withDefault(\n flag(\"--print-config\", {\n description: message`Print effective settings and their sources, with secrets redacted, then exit without opening runtime resources.`,\n }),\n false,\n ),\n });\n const schema = object(\"GraphQL schema generation\", {\n // Preserve the historical logging spellings for schema invocations,\n // but do not bind or validate operational values in this projection.\n ignoredLogging: object({\n level: optional(\n option(...valueOptionNames.logLevel, string(), { hidden: true }),\n ),\n format: optional(\n option(...valueOptionNames.logFormat, string(), { hidden: true }),\n ),\n output: optional(\n option(...valueOptionNames.logOutput, string(), { hidden: true }),\n ),\n }),\n outputFile: withDefault(\n option(\n ...valueOptionNames.outputFile,\n path({ type: \"file\", allowCreate: true }),\n {\n description: message`Schema output file. Use - for stdout.`,\n },\n ),\n \"-\",\n ),\n });\n return merge(\n object({\n configPath: optional(\n bindings.bindConfigPath(\n option(\n ...valueOptionNames.configPath,\n path({ metavar: \"FILE\", type: \"file\" }),\n {\n description: message`Read this TOML file. No configuration files are searched automatically.`,\n },\n ),\n ),\n ),\n }),\n object({\n mode:\n mode === \"schema\"\n ? map(\n merge(\n object({\n generateGraphqlSchema: flag(\"--generate-graphql-schema\"),\n }),\n schema,\n ),\n (value) => [\"schema\", value] as const,\n )\n : conditional(\n map(\n flag(\"--generate-graphql-schema\", {\n description: message`Generate GraphQL schema and exit.`,\n }),\n () => \"schema\" as const,\n ),\n { schema },\n server,\n ),\n }),\n );\n}\n\ntype RawOptions = InferValue<ReturnType<typeof createParser>>;\nexport type SchemaGeneratorOptions = {\n readonly generateGraphqlSchema: true;\n readonly outputFile: string;\n};\n\nfunction required<T>(\n value: Sourced<T | undefined> | undefined,\n error: string,\n): T {\n if (value?.value === undefined) throw new Error(error);\n return value.value;\n}\n\n/**\n * Resolve domain constraints only after the source contexts have completed.\n * @returns Plain startup options; no database, mail or log sink is created.\n */\nexport function resolveOptions(options: RawOptions, cwd = process.cwd()) {\n if (options.mode[0] === \"schema\") {\n const schema: SchemaGeneratorOptions = {\n generateGraphqlSchema: true,\n outputFile: options.mode[1].outputFile,\n };\n return schema;\n }\n const server = options.mode[1];\n const logging = resolveLogging(server.logging, cwd);\n const root = required(\n server.rootOrigin,\n \"Missing option --root-origin or server.root_origin (DRFED_ROOT_ORIGIN).\",\n );\n const web = required(server.web, \"Missing web serving policy.\");\n let publicOrigin: URL | undefined;\n if (web) {\n const supplied = server.publicOrigin?.value;\n if (supplied === undefined) publicOrigin = new URL(root.origin);\n else {\n const parsed = origin({ allowedProtocols: [\"http:\", \"https:\"] }).parse(\n supplied,\n );\n if (!parsed.success) {\n throw new Error(\n \"Invalid public origin; expected an HTTP or HTTPS origin without credentials.\",\n );\n }\n publicOrigin = parsed.value;\n }\n if (classifyHost(publicOrigin, root) !== \"admin\") {\n throw new Error(\n \"The public web origin cannot name an instance or a deeper subdomain.\",\n );\n }\n }\n const origins =\n server.loginOrigins?.value ??\n (publicOrigin === undefined ? [] : [publicOrigin.origin]);\n if (origins.length === 0) {\n throw new Error(\"Expected at least 1 values, but got only 0.\");\n }\n const loginOrigins = new Set<string>();\n for (const value of origins) {\n const parsed = origin({ allowedProtocols: [\"http:\", \"https:\"] }).parse(\n value,\n );\n if (!parsed.success) {\n throw new Error(\n \"Invalid login origin; expected an HTTP or HTTPS origin.\",\n );\n }\n loginOrigins.add(parsed.value.origin);\n }\n if (publicOrigin !== undefined && !loginOrigins.has(publicOrigin.origin)) {\n throw new Error(\n \"The configured login origins must include the public web origin.\",\n );\n }\n const database = resolveDatabaseSettings(\n {\n dataPath: server.dataPath,\n postgresUrl: server.postgresUrl,\n },\n cwd,\n );\n const mail = resolveMailSettings(server.mail, cwd);\n return {\n printConfig: server.printConfig,\n address: required(server.address, \"Missing listen address.\"),\n rootOrigin: root,\n web,\n publicOrigin,\n loginOrigins,\n emailFrom: server.emailFrom?.value,\n mail: mail.mail,\n mailDiagnostic: mail.diagnostic,\n seed: server.seed,\n logging,\n drizzle: {\n ...database.database,\n migrate: required(server.migrate, \"Missing migration policy.\"),\n lockTimeoutMs: required(\n server.migrationLockTimeout,\n \"Missing migration lock timeout.\",\n ),\n },\n provenance: configurationProvenance({\n rootOrigin: server.rootOrigin,\n web: server.web,\n publicOrigin: server.publicOrigin,\n address: server.address,\n loginOrigins: server.loginOrigins,\n emailFrom: server.emailFrom,\n dataPath: server.dataPath,\n postgresUrl: server.postgresUrl,\n migrate: server.migrate,\n migrationLockTimeout: server.migrationLockTimeout,\n ...server.mail,\n logLevel: server.logging.level,\n logFormat: server.logging.format,\n logOutput: server.logging.output,\n }),\n ignored: [...database.ignored, ...mail.ignored],\n };\n}\n\nexport type Options = ReturnType<typeof resolveOptions>;\nexport type ServerOptions = Exclude<\n Options,\n { generateGraphqlSchema: unknown }\n>;\n"],"mappings":";;;;;;;;;;;;;;;AAmDA,MAAa,mBAAmB;CAC9B,YAAY,CAAC,UAAU;CACvB,SAAS,CAAC,YAAY,IAAI;CAC1B,YAAY,CAAC,iBAAiB,IAAI;CAClC,cAAc,CAAC,gBAAgB;CAC/B,cAAc,CAAC,iBAAiB;CAChC,WAAW,CAAC,gBAAgB,IAAI;CAChC,UAAU;EAAC;EAAsB;EAAe;CAAI;CACpD,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,KAAK,OAAO;GACZ,cAAc,OAAO;GACrB,SAAS,OAAO;GAChB,cAAc,OAAO;GACrB,WAAW,OAAO;GAClB,UAAU,OAAO;GACjB,aAAa,OAAO;GACpB,SAAS,OAAO;GAChB,sBAAsB,OAAO;GAC7B,GAAG,OAAO;GACV,UAAU,OAAO,QAAQ;GACzB,WAAW,OAAO,QAAQ;GAC1B,WAAW,OAAO,QAAQ;EAC5B,CAAC;EACD,SAAS,CAAC,GAAG,SAAS,SAAS,GAAG,KAAK,OAAO;CAChD;AACF"}
|
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
import { m as createConfigurationBindings, o as ConfigurationSource, s as Sourced } from "./configuration-DVVF7xNv.mjs";
|
|
2
|
+
import { n as MailSettings } from "./mail-settings-DjWMAUaE.mjs";
|
|
3
|
+
import { InferValue } from "@optique/core/parser";
|
|
4
|
+
//#region src/parser.d.ts
|
|
5
|
+
type Bindings = ReturnType<typeof createConfigurationBindings>;
|
|
6
|
+
/**
|
|
7
|
+
* Construct a fresh parser from shared bindings without creating resources.
|
|
8
|
+
* @returns The server and schema-output parser.
|
|
9
|
+
*/
|
|
10
|
+
declare function createParser(bindings: Bindings, mode?: "server" | "schema"): import("@optique/core/parser").Parser<"sync", {
|
|
11
|
+
readonly configPath: Sourced<string> | undefined;
|
|
12
|
+
} & {
|
|
13
|
+
readonly mode: readonly ["schema", {
|
|
14
|
+
readonly generateGraphqlSchema: true;
|
|
15
|
+
} & {
|
|
16
|
+
readonly ignoredLogging: {
|
|
17
|
+
readonly level: string | undefined;
|
|
18
|
+
readonly format: string | undefined;
|
|
19
|
+
readonly output: string | undefined;
|
|
20
|
+
};
|
|
21
|
+
readonly outputFile: string;
|
|
22
|
+
}] | (readonly [undefined, {
|
|
23
|
+
readonly address: Sourced<import("@optique/core/valueparser").SocketAddressValue | undefined> | undefined;
|
|
24
|
+
readonly rootOrigin: Sourced<URL | undefined> | undefined;
|
|
25
|
+
readonly web: Sourced<boolean | undefined> | undefined;
|
|
26
|
+
readonly publicOrigin: Sourced<string | undefined> | undefined;
|
|
27
|
+
readonly loginOrigins: Sourced<readonly string[] | undefined> | undefined;
|
|
28
|
+
readonly emailFrom: Sourced<string | undefined> | undefined;
|
|
29
|
+
readonly dataPath: Sourced<string | undefined> | undefined;
|
|
30
|
+
readonly postgresUrl: Sourced<string | undefined> | undefined;
|
|
31
|
+
readonly migrate: Sourced<boolean | undefined> | undefined;
|
|
32
|
+
readonly migrationLockTimeout: Sourced<number | undefined> | undefined;
|
|
33
|
+
readonly mail: {
|
|
34
|
+
readonly mailApiKey: Sourced<string | undefined> | undefined;
|
|
35
|
+
readonly mailApiKeyFile: Sourced<string | undefined> | undefined;
|
|
36
|
+
readonly plunkApiKey: Sourced<string | undefined> | undefined;
|
|
37
|
+
readonly plunkApiKeyFile: Sourced<string | undefined> | undefined;
|
|
38
|
+
readonly plunkBaseUrl: Sourced<string | undefined> | undefined;
|
|
39
|
+
readonly plunkTimeout: Sourced<string | undefined> | undefined;
|
|
40
|
+
readonly resendApiKey: Sourced<string | undefined> | undefined;
|
|
41
|
+
readonly resendApiKeyFile: Sourced<string | undefined> | undefined;
|
|
42
|
+
readonly resendBaseUrl: Sourced<string | undefined> | undefined;
|
|
43
|
+
readonly resendTimeout: Sourced<string | undefined> | undefined;
|
|
44
|
+
readonly resendRetries: Sourced<string | undefined> | undefined;
|
|
45
|
+
readonly sesAuth: Sourced<string | undefined> | undefined;
|
|
46
|
+
readonly sesAccessKeyId: Sourced<string | undefined> | undefined;
|
|
47
|
+
readonly sesAccessKeyIdFile: Sourced<string | undefined> | undefined;
|
|
48
|
+
readonly sesSecretAccessKey: Sourced<string | undefined> | undefined;
|
|
49
|
+
readonly sesSecretAccessKeyFile: Sourced<string | undefined> | undefined;
|
|
50
|
+
readonly sesSessionToken: Sourced<string | undefined> | undefined;
|
|
51
|
+
readonly sesSessionTokenFile: Sourced<string | undefined> | undefined;
|
|
52
|
+
readonly sesRegion: Sourced<string | undefined> | undefined;
|
|
53
|
+
readonly sesTimeout: Sourced<string | undefined> | undefined;
|
|
54
|
+
readonly sendgridApiKey: Sourced<string | undefined> | undefined;
|
|
55
|
+
readonly sendgridApiKeyFile: Sourced<string | undefined> | undefined;
|
|
56
|
+
readonly sendgridBaseUrl: Sourced<string | undefined> | undefined;
|
|
57
|
+
readonly sendgridTimeout: Sourced<string | undefined> | undefined;
|
|
58
|
+
readonly mailgunApiKey: Sourced<string | undefined> | undefined;
|
|
59
|
+
readonly mailgunApiKeyFile: Sourced<string | undefined> | undefined;
|
|
60
|
+
readonly mailgunDomain: Sourced<string | undefined> | undefined;
|
|
61
|
+
readonly mailgunRegion: Sourced<string | undefined> | undefined;
|
|
62
|
+
readonly mailgunBaseUrl: Sourced<string | undefined> | undefined;
|
|
63
|
+
readonly mailgunTimeout: Sourced<string | undefined> | undefined;
|
|
64
|
+
readonly mailtrapApiToken: Sourced<string | undefined> | undefined;
|
|
65
|
+
readonly mailtrapApiTokenFile: Sourced<string | undefined> | undefined;
|
|
66
|
+
readonly mailtrapSandbox: Sourced<string | undefined> | undefined;
|
|
67
|
+
readonly mailtrapInboxId: Sourced<string | undefined> | undefined;
|
|
68
|
+
readonly mailtrapSendBaseUrl: Sourced<string | undefined> | undefined;
|
|
69
|
+
readonly mailtrapSandboxBaseUrl: Sourced<string | undefined> | undefined;
|
|
70
|
+
readonly mailtrapTimeout: Sourced<string | undefined> | undefined;
|
|
71
|
+
readonly mailerooApiKey: Sourced<string | undefined> | undefined;
|
|
72
|
+
readonly mailerooApiKeyFile: Sourced<string | undefined> | undefined;
|
|
73
|
+
readonly mailerooBaseUrl: Sourced<string | undefined> | undefined;
|
|
74
|
+
readonly mailerooTimeout: Sourced<string | undefined> | undefined;
|
|
75
|
+
readonly lettermintApiToken: Sourced<string | undefined> | undefined;
|
|
76
|
+
readonly lettermintApiTokenFile: Sourced<string | undefined> | undefined;
|
|
77
|
+
readonly lettermintBaseUrl: Sourced<string | undefined> | undefined;
|
|
78
|
+
readonly lettermintRoute: Sourced<string | undefined> | undefined;
|
|
79
|
+
readonly lettermintTimeout: Sourced<string | undefined> | undefined;
|
|
80
|
+
readonly lettermintRetries: Sourced<string | undefined> | undefined;
|
|
81
|
+
readonly jmapSessionUrl: Sourced<string | undefined> | undefined;
|
|
82
|
+
readonly jmapBearerToken: Sourced<string | undefined> | undefined;
|
|
83
|
+
readonly jmapBearerTokenFile: Sourced<string | undefined> | undefined;
|
|
84
|
+
readonly jmapUser: Sourced<string | undefined> | undefined;
|
|
85
|
+
readonly jmapPassword: Sourced<string | undefined> | undefined;
|
|
86
|
+
readonly jmapPasswordFile: Sourced<string | undefined> | undefined;
|
|
87
|
+
readonly jmapAccountId: Sourced<string | undefined> | undefined;
|
|
88
|
+
readonly jmapIdentityId: Sourced<string | undefined> | undefined;
|
|
89
|
+
readonly jmapBaseUrl: Sourced<string | undefined> | undefined;
|
|
90
|
+
readonly jmapTimeout: Sourced<string | undefined> | undefined;
|
|
91
|
+
readonly jmapSessionCacheTtl: Sourced<string | undefined> | undefined;
|
|
92
|
+
readonly mailTransport: Sourced<string | undefined> | undefined;
|
|
93
|
+
readonly smtpUrl: Sourced<string | undefined> | undefined;
|
|
94
|
+
readonly mailLogContent: Sourced<string | undefined> | undefined;
|
|
95
|
+
readonly smtpHost: Sourced<string | undefined> | undefined;
|
|
96
|
+
readonly smtpPort: Sourced<string | undefined> | undefined;
|
|
97
|
+
readonly smtpTls: Sourced<string | undefined> | undefined;
|
|
98
|
+
readonly smtpUser: Sourced<string | undefined> | undefined;
|
|
99
|
+
readonly smtpPassword: Sourced<string | undefined> | undefined;
|
|
100
|
+
readonly smtpPasswordFile: Sourced<string | undefined> | undefined;
|
|
101
|
+
readonly smtpAuthMethod: Sourced<string | undefined> | undefined;
|
|
102
|
+
readonly smtpAccessToken: Sourced<string | undefined> | undefined;
|
|
103
|
+
readonly smtpAccessTokenFile: Sourced<string | undefined> | undefined;
|
|
104
|
+
readonly smtpConnectionTimeout: Sourced<string | undefined> | undefined;
|
|
105
|
+
readonly smtpSocketTimeout: Sourced<string | undefined> | undefined;
|
|
106
|
+
readonly smtpPoolSize: Sourced<string | undefined> | undefined;
|
|
107
|
+
readonly smtpLocalName: Sourced<string | undefined> | undefined;
|
|
108
|
+
readonly smtpCaFile: Sourced<string | undefined> | undefined;
|
|
109
|
+
readonly smtpCertFile: Sourced<string | undefined> | undefined;
|
|
110
|
+
readonly smtpKeyFile: Sourced<string | undefined> | undefined;
|
|
111
|
+
};
|
|
112
|
+
readonly seed: boolean;
|
|
113
|
+
readonly logging: {
|
|
114
|
+
readonly level: Sourced<"debug" | "error" | "fatal" | "info" | "trace" | "warning" | undefined> | undefined;
|
|
115
|
+
readonly format: Sourced<import("@logtape/logtape").TextFormatter | undefined> | undefined;
|
|
116
|
+
readonly output: Sourced<string | undefined> | undefined;
|
|
117
|
+
};
|
|
118
|
+
readonly printConfig: boolean;
|
|
119
|
+
}] | readonly ["schema", {
|
|
120
|
+
readonly ignoredLogging: {
|
|
121
|
+
readonly level: string | undefined;
|
|
122
|
+
readonly format: string | undefined;
|
|
123
|
+
readonly output: string | undefined;
|
|
124
|
+
};
|
|
125
|
+
readonly outputFile: string;
|
|
126
|
+
}]);
|
|
127
|
+
}, Record<string | symbol, unknown>> & import("@optique/core/modifiers").ParserModifiers<"sync", {
|
|
128
|
+
readonly configPath: Sourced<string> | undefined;
|
|
129
|
+
} & {
|
|
130
|
+
readonly mode: readonly ["schema", {
|
|
131
|
+
readonly generateGraphqlSchema: true;
|
|
132
|
+
} & {
|
|
133
|
+
readonly ignoredLogging: {
|
|
134
|
+
readonly level: string | undefined;
|
|
135
|
+
readonly format: string | undefined;
|
|
136
|
+
readonly output: string | undefined;
|
|
137
|
+
};
|
|
138
|
+
readonly outputFile: string;
|
|
139
|
+
}] | (readonly [undefined, {
|
|
140
|
+
readonly address: Sourced<import("@optique/core/valueparser").SocketAddressValue | undefined> | undefined;
|
|
141
|
+
readonly rootOrigin: Sourced<URL | undefined> | undefined;
|
|
142
|
+
readonly web: Sourced<boolean | undefined> | undefined;
|
|
143
|
+
readonly publicOrigin: Sourced<string | undefined> | undefined;
|
|
144
|
+
readonly loginOrigins: Sourced<readonly string[] | undefined> | undefined;
|
|
145
|
+
readonly emailFrom: Sourced<string | undefined> | undefined;
|
|
146
|
+
readonly dataPath: Sourced<string | undefined> | undefined;
|
|
147
|
+
readonly postgresUrl: Sourced<string | undefined> | undefined;
|
|
148
|
+
readonly migrate: Sourced<boolean | undefined> | undefined;
|
|
149
|
+
readonly migrationLockTimeout: Sourced<number | undefined> | undefined;
|
|
150
|
+
readonly mail: {
|
|
151
|
+
readonly mailApiKey: Sourced<string | undefined> | undefined;
|
|
152
|
+
readonly mailApiKeyFile: Sourced<string | undefined> | undefined;
|
|
153
|
+
readonly plunkApiKey: Sourced<string | undefined> | undefined;
|
|
154
|
+
readonly plunkApiKeyFile: Sourced<string | undefined> | undefined;
|
|
155
|
+
readonly plunkBaseUrl: Sourced<string | undefined> | undefined;
|
|
156
|
+
readonly plunkTimeout: Sourced<string | undefined> | undefined;
|
|
157
|
+
readonly resendApiKey: Sourced<string | undefined> | undefined;
|
|
158
|
+
readonly resendApiKeyFile: Sourced<string | undefined> | undefined;
|
|
159
|
+
readonly resendBaseUrl: Sourced<string | undefined> | undefined;
|
|
160
|
+
readonly resendTimeout: Sourced<string | undefined> | undefined;
|
|
161
|
+
readonly resendRetries: Sourced<string | undefined> | undefined;
|
|
162
|
+
readonly sesAuth: Sourced<string | undefined> | undefined;
|
|
163
|
+
readonly sesAccessKeyId: Sourced<string | undefined> | undefined;
|
|
164
|
+
readonly sesAccessKeyIdFile: Sourced<string | undefined> | undefined;
|
|
165
|
+
readonly sesSecretAccessKey: Sourced<string | undefined> | undefined;
|
|
166
|
+
readonly sesSecretAccessKeyFile: Sourced<string | undefined> | undefined;
|
|
167
|
+
readonly sesSessionToken: Sourced<string | undefined> | undefined;
|
|
168
|
+
readonly sesSessionTokenFile: Sourced<string | undefined> | undefined;
|
|
169
|
+
readonly sesRegion: Sourced<string | undefined> | undefined;
|
|
170
|
+
readonly sesTimeout: Sourced<string | undefined> | undefined;
|
|
171
|
+
readonly sendgridApiKey: Sourced<string | undefined> | undefined;
|
|
172
|
+
readonly sendgridApiKeyFile: Sourced<string | undefined> | undefined;
|
|
173
|
+
readonly sendgridBaseUrl: Sourced<string | undefined> | undefined;
|
|
174
|
+
readonly sendgridTimeout: Sourced<string | undefined> | undefined;
|
|
175
|
+
readonly mailgunApiKey: Sourced<string | undefined> | undefined;
|
|
176
|
+
readonly mailgunApiKeyFile: Sourced<string | undefined> | undefined;
|
|
177
|
+
readonly mailgunDomain: Sourced<string | undefined> | undefined;
|
|
178
|
+
readonly mailgunRegion: Sourced<string | undefined> | undefined;
|
|
179
|
+
readonly mailgunBaseUrl: Sourced<string | undefined> | undefined;
|
|
180
|
+
readonly mailgunTimeout: Sourced<string | undefined> | undefined;
|
|
181
|
+
readonly mailtrapApiToken: Sourced<string | undefined> | undefined;
|
|
182
|
+
readonly mailtrapApiTokenFile: Sourced<string | undefined> | undefined;
|
|
183
|
+
readonly mailtrapSandbox: Sourced<string | undefined> | undefined;
|
|
184
|
+
readonly mailtrapInboxId: Sourced<string | undefined> | undefined;
|
|
185
|
+
readonly mailtrapSendBaseUrl: Sourced<string | undefined> | undefined;
|
|
186
|
+
readonly mailtrapSandboxBaseUrl: Sourced<string | undefined> | undefined;
|
|
187
|
+
readonly mailtrapTimeout: Sourced<string | undefined> | undefined;
|
|
188
|
+
readonly mailerooApiKey: Sourced<string | undefined> | undefined;
|
|
189
|
+
readonly mailerooApiKeyFile: Sourced<string | undefined> | undefined;
|
|
190
|
+
readonly mailerooBaseUrl: Sourced<string | undefined> | undefined;
|
|
191
|
+
readonly mailerooTimeout: Sourced<string | undefined> | undefined;
|
|
192
|
+
readonly lettermintApiToken: Sourced<string | undefined> | undefined;
|
|
193
|
+
readonly lettermintApiTokenFile: Sourced<string | undefined> | undefined;
|
|
194
|
+
readonly lettermintBaseUrl: Sourced<string | undefined> | undefined;
|
|
195
|
+
readonly lettermintRoute: Sourced<string | undefined> | undefined;
|
|
196
|
+
readonly lettermintTimeout: Sourced<string | undefined> | undefined;
|
|
197
|
+
readonly lettermintRetries: Sourced<string | undefined> | undefined;
|
|
198
|
+
readonly jmapSessionUrl: Sourced<string | undefined> | undefined;
|
|
199
|
+
readonly jmapBearerToken: Sourced<string | undefined> | undefined;
|
|
200
|
+
readonly jmapBearerTokenFile: Sourced<string | undefined> | undefined;
|
|
201
|
+
readonly jmapUser: Sourced<string | undefined> | undefined;
|
|
202
|
+
readonly jmapPassword: Sourced<string | undefined> | undefined;
|
|
203
|
+
readonly jmapPasswordFile: Sourced<string | undefined> | undefined;
|
|
204
|
+
readonly jmapAccountId: Sourced<string | undefined> | undefined;
|
|
205
|
+
readonly jmapIdentityId: Sourced<string | undefined> | undefined;
|
|
206
|
+
readonly jmapBaseUrl: Sourced<string | undefined> | undefined;
|
|
207
|
+
readonly jmapTimeout: Sourced<string | undefined> | undefined;
|
|
208
|
+
readonly jmapSessionCacheTtl: Sourced<string | undefined> | undefined;
|
|
209
|
+
readonly mailTransport: Sourced<string | undefined> | undefined;
|
|
210
|
+
readonly smtpUrl: Sourced<string | undefined> | undefined;
|
|
211
|
+
readonly mailLogContent: Sourced<string | undefined> | undefined;
|
|
212
|
+
readonly smtpHost: Sourced<string | undefined> | undefined;
|
|
213
|
+
readonly smtpPort: Sourced<string | undefined> | undefined;
|
|
214
|
+
readonly smtpTls: Sourced<string | undefined> | undefined;
|
|
215
|
+
readonly smtpUser: Sourced<string | undefined> | undefined;
|
|
216
|
+
readonly smtpPassword: Sourced<string | undefined> | undefined;
|
|
217
|
+
readonly smtpPasswordFile: Sourced<string | undefined> | undefined;
|
|
218
|
+
readonly smtpAuthMethod: Sourced<string | undefined> | undefined;
|
|
219
|
+
readonly smtpAccessToken: Sourced<string | undefined> | undefined;
|
|
220
|
+
readonly smtpAccessTokenFile: Sourced<string | undefined> | undefined;
|
|
221
|
+
readonly smtpConnectionTimeout: Sourced<string | undefined> | undefined;
|
|
222
|
+
readonly smtpSocketTimeout: Sourced<string | undefined> | undefined;
|
|
223
|
+
readonly smtpPoolSize: Sourced<string | undefined> | undefined;
|
|
224
|
+
readonly smtpLocalName: Sourced<string | undefined> | undefined;
|
|
225
|
+
readonly smtpCaFile: Sourced<string | undefined> | undefined;
|
|
226
|
+
readonly smtpCertFile: Sourced<string | undefined> | undefined;
|
|
227
|
+
readonly smtpKeyFile: Sourced<string | undefined> | undefined;
|
|
228
|
+
};
|
|
229
|
+
readonly seed: boolean;
|
|
230
|
+
readonly logging: {
|
|
231
|
+
readonly level: Sourced<"debug" | "error" | "fatal" | "info" | "trace" | "warning" | undefined> | undefined;
|
|
232
|
+
readonly format: Sourced<import("@logtape/logtape").TextFormatter | undefined> | undefined;
|
|
233
|
+
readonly output: Sourced<string | undefined> | undefined;
|
|
234
|
+
};
|
|
235
|
+
readonly printConfig: boolean;
|
|
236
|
+
}] | readonly ["schema", {
|
|
237
|
+
readonly ignoredLogging: {
|
|
238
|
+
readonly level: string | undefined;
|
|
239
|
+
readonly format: string | undefined;
|
|
240
|
+
readonly output: string | undefined;
|
|
241
|
+
};
|
|
242
|
+
readonly outputFile: string;
|
|
243
|
+
}]);
|
|
244
|
+
}, Record<string | symbol, unknown>>;
|
|
245
|
+
type RawOptions = InferValue<ReturnType<typeof createParser>>;
|
|
246
|
+
type SchemaGeneratorOptions = {
|
|
247
|
+
readonly generateGraphqlSchema: true;
|
|
248
|
+
readonly outputFile: string;
|
|
249
|
+
};
|
|
250
|
+
/**
|
|
251
|
+
* Resolve domain constraints only after the source contexts have completed.
|
|
252
|
+
* @returns Plain startup options; no database, mail or log sink is created.
|
|
253
|
+
*/
|
|
254
|
+
declare function resolveOptions(options: RawOptions, cwd?: string): SchemaGeneratorOptions | {
|
|
255
|
+
printConfig: boolean;
|
|
256
|
+
address: import("@optique/core/valueparser").SocketAddressValue;
|
|
257
|
+
rootOrigin: URL;
|
|
258
|
+
web: boolean;
|
|
259
|
+
publicOrigin: URL | undefined;
|
|
260
|
+
loginOrigins: Set<string>;
|
|
261
|
+
emailFrom: string | undefined;
|
|
262
|
+
mail: MailSettings;
|
|
263
|
+
mailDiagnostic: {
|
|
264
|
+
[k: string]: {
|
|
265
|
+
source: ConfigurationSource;
|
|
266
|
+
configPath?: string;
|
|
267
|
+
value: unknown;
|
|
268
|
+
};
|
|
269
|
+
};
|
|
270
|
+
seed: boolean;
|
|
271
|
+
logging: {
|
|
272
|
+
logLevel: "debug" | "error" | "fatal" | "info" | "trace" | "warning";
|
|
273
|
+
logOutput: import("@optique/logtape").LogOutput;
|
|
274
|
+
};
|
|
275
|
+
drizzle: {
|
|
276
|
+
driver: "postgres";
|
|
277
|
+
databaseUrl: URL;
|
|
278
|
+
dataPath?: never;
|
|
279
|
+
migrate: boolean;
|
|
280
|
+
lockTimeoutMs: number;
|
|
281
|
+
} | {
|
|
282
|
+
databaseUrl?: never;
|
|
283
|
+
driver: "pglite";
|
|
284
|
+
dataPath: string;
|
|
285
|
+
migrate: boolean;
|
|
286
|
+
lockTimeoutMs: number;
|
|
287
|
+
};
|
|
288
|
+
provenance: {
|
|
289
|
+
[k: string]: {
|
|
290
|
+
source: ConfigurationSource;
|
|
291
|
+
configPath?: string;
|
|
292
|
+
};
|
|
293
|
+
};
|
|
294
|
+
ignored: {
|
|
295
|
+
field: string;
|
|
296
|
+
source: ConfigurationSource;
|
|
297
|
+
}[];
|
|
298
|
+
};
|
|
299
|
+
type Options = ReturnType<typeof resolveOptions>;
|
|
300
|
+
type ServerOptions = Exclude<Options, {
|
|
301
|
+
generateGraphqlSchema: unknown;
|
|
302
|
+
}>;
|
|
303
|
+
//#endregion
|
|
304
|
+
export { ServerOptions as t };
|
|
305
|
+
//# sourceMappingURL=parser-TANGHRjL.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser-TANGHRjL.d.mts","names":[],"sources":["../src/parser.ts"],"mappings":";;;;KAoEK,WAAW,kBAAkB;;;;;iBAOlB,aACd,UAAU,UACV,4DAAoC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyNrC;KAEI,aAAa,WAAW,kBAAkB;KACnC;WACD;WACA;;;;;;iBAeK,eAAe,SAAS,YAAY,eAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA2G3D,UAAU,kBAAkB;KAC5B,gBAAgB,QAC1B;EACE"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//#region src/postgres-settings.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Resolve the same single-host connection and TLS policy for both database drivers.
|
|
4
|
+
* Unsupported URL features are rejected without opening a connection.
|
|
5
|
+
* @returns Normalized URLs and explicit runtime transport options.
|
|
6
|
+
*/
|
|
7
|
+
declare function resolvePostgresConnection(url: URL): {
|
|
8
|
+
runtimeUrl: string;
|
|
9
|
+
options: string;
|
|
10
|
+
applicationName: string;
|
|
11
|
+
password: string;
|
|
12
|
+
host: string;
|
|
13
|
+
database: string;
|
|
14
|
+
user: string;
|
|
15
|
+
port: number;
|
|
16
|
+
tls: boolean;
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
export { resolvePostgresConnection };
|
|
20
|
+
//# sourceMappingURL=postgres-settings.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postgres-settings.d.mts","names":[],"sources":["../src/postgres-settings.ts"],"mappings":";;;;;;iBAgCgB,0BAA0B,KAAK"}
|