@drfed/drfed 0.2.0-dev.685 → 0.2.0-dev.698
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -6
- package/dist/api-mail-parser.d.mts +1 -1
- package/dist/{api-mail-settings-BcGaqQ9f.d.mts → api-mail-settings-DK41LiGe.d.mts} +4 -4
- package/dist/{api-mail-settings-BcGaqQ9f.d.mts.map → api-mail-settings-DK41LiGe.d.mts.map} +1 -1
- package/dist/api-mail-settings.d.mts +1 -1
- package/dist/commands/account-program.d.mts +1 -1
- package/dist/commands/account-program.mjs +1 -1
- package/dist/commands/account.mjs +1 -1
- package/dist/commands/migrate-program.d.mts +1 -1
- package/dist/commands/migrate-program.mjs +1 -1
- package/dist/commands/migrate.mjs +1 -1
- package/dist/commands/web-program.d.mts +1 -1
- package/dist/commands/web-program.d.mts.map +1 -1
- package/dist/commands/web-program.mjs +5 -4
- package/dist/commands/web-program.mjs.map +1 -1
- package/dist/commands/web.mjs +1 -1
- package/dist/{configuration-DVVF7xNv.d.mts → configuration-368lwC4r.d.mts} +17 -3
- package/dist/{configuration-DVVF7xNv.d.mts.map → configuration-368lwC4r.d.mts.map} +1 -1
- package/dist/configuration.d.mts +2 -2
- package/dist/configuration.mjs +22 -5
- package/dist/configuration.mjs.map +1 -1
- package/dist/data-path.d.mts +1 -1
- package/dist/data-path.d.mts.map +1 -1
- package/dist/data-path.mjs +5 -4
- package/dist/data-path.mjs.map +1 -1
- package/dist/database-runtime.d.mts +1 -1
- package/dist/database-settings.d.mts +1 -1
- package/dist/diagnostics.d.mts +2 -2
- package/dist/index.mjs +2 -2
- package/dist/jmap-parser.d.mts +1 -1
- package/dist/{jmap-settings-BXNAF1ep.d.mts → jmap-settings-h6lwIv6a.d.mts} +4 -4
- package/dist/{jmap-settings-BXNAF1ep.d.mts.map → jmap-settings-h6lwIv6a.d.mts.map} +1 -1
- package/dist/jmap-settings.d.mts +1 -1
- package/dist/listen-defaults.d.mts +15 -0
- package/dist/listen-defaults.d.mts.map +1 -0
- package/dist/listen-defaults.mjs +23 -0
- package/dist/listen-defaults.mjs.map +1 -0
- package/dist/logging.d.mts +1 -1
- package/dist/{mail-parser-DyI4wuQp.d.mts → mail-parser-D7BM1mzn.d.mts} +2 -2
- package/dist/{mail-parser-DyI4wuQp.d.mts.map → mail-parser-D7BM1mzn.d.mts.map} +1 -1
- package/dist/mail-parser.d.mts +1 -1
- package/dist/mail-runtime.d.mts +1 -1
- package/dist/{mail-settings-DjWMAUaE.d.mts → mail-settings-DpY8GyiB.d.mts} +6 -6
- package/dist/{mail-settings-DjWMAUaE.d.mts.map → mail-settings-DpY8GyiB.d.mts.map} +1 -1
- package/dist/mail-settings.d.mts +1 -1
- package/dist/package-DmPqTLq6.mjs +6 -0
- package/dist/package-DmPqTLq6.mjs.map +1 -0
- package/dist/{parser-TANGHRjL.d.mts → parser-C0dRu62q.d.mts} +3 -3
- package/dist/{parser-TANGHRjL.d.mts.map → parser-C0dRu62q.d.mts.map} +1 -1
- package/dist/{parser-DGIQTgS7.mjs → parser-Czr4z4-a.mjs} +6 -5
- package/dist/parser-Czr4z4-a.mjs.map +1 -0
- package/dist/{secret-source-BeZx72Ue.d.mts → secret-source-CM9cHsZH.d.mts} +2 -2
- package/dist/{secret-source-BeZx72Ue.d.mts.map → secret-source-CM9cHsZH.d.mts.map} +1 -1
- package/dist/secret-source.d.mts +1 -1
- package/package.json +15 -10
- package/dist/package-D3PlyrNP.mjs +0 -6
- package/dist/package-D3PlyrNP.mjs.map +0 -1
- package/dist/parser-DGIQTgS7.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser-Czr4z4-a.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 lazyDefault,\n configurationSettings as settings,\n stringArray,\n} from \"./configuration.ts\";\nimport { resolveDatabaseSettings } from \"./database-settings.ts\";\nimport { defaultListenHost } from \"./listen-defaults.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 lazyDefault(() => ({\n host: defaultListenHost(bindings.env),\n port: 8888,\n })),\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":";;;;;;;;;;;;;;;;AAqDA,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,aAAa;EAAC;EAAkB;EAAkB;CAAI;CACtD,sBAAsB,CAAC,0BAA0B;CACjD,GAAG;CACH,UAAU,wBAAwB;CAClC,WAAW,wBAAwB;CACnC,WAAW,wBAAwB;CACnC,YAAY,CAAC,iBAAiB,IAAI;AACpC;AAGA,MAAM,YAAY,UAAkB;;;;;AAMpC,SAAgB,aACd,UACA,OAA4B,UAC5B;CACA,MAAM,EAAE,SAAS;CACjB,MAAM,UAAU,cAAc,EAAE,aAAa,KAAK,CAAC;CACnD,MAAM,OAAO,WAAW,EAAE,SAAS,SAAS,CAAC;CAC7C,MAAM,cAAc,QAAQ;EAC1B,KAAK;EACL,KAAK;EACL,SAAS;CACX,CAAC;CACD,MAAM,SAAS,MAAM,EAAE,WAAW,KAAK,CAAC;CACxC,MAAM,UAAU,oBAAoB,QAAQ;CAC5C,MAAM,SAAS,OAAO,gBAAgB;EACpC,SAAS,KACP,OAAO,GAAG,iBAAiB,SAAS,SAAS,EAC3C,aAAa,OAAO,4BACtB,CAAC,GACDA,sBAAS,QACT,SACA,UACA,mBAAmB;GACjB,MAAM,kBAAkB,SAAS,GAAG;GACpC,MAAM;EACR,EAAE,CACJ;EACA,YAAY,KACV,OAAO,GAAG,iBAAiB,YAAY,MAAM,EA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,aAAa,MAAM,GACrE,MAAM,IAAI,MACR,kEACF;CAEF,MAAM,WAAW,wBACf;EACE,UAAU,OAAO;EACjB,aAAa,OAAO;CACtB,GACA,GACF;CACA,MAAM,OAAO,oBAAoB,OAAO,MAAM,GAAG;CACjD,OAAO;EACL,aAAa,OAAO;EACpB,SAAS,SAAS,OAAO,SAAS,yBAAyB;EAC3D,YAAY;EACZ;EACA;EACA;EACA,WAAW,OAAO,WAAW;EAC7B,MAAM,KAAK;EACX,gBAAgB,KAAK;EACrB,MAAM,OAAO;EACb;EACA,SAAS;GACP,GAAG,SAAS;GACZ,SAAS,SAAS,OAAO,SAAS,2BAA2B;GAC7D,eAAe,SACb,OAAO,sBACP,iCACF;EACF;EACA,YAAY,wBAAwB;GAClC,YAAY,OAAO;GACnB,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"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as Sourced } from "./configuration-368lwC4r.mjs";
|
|
2
2
|
//#region src/secret-source.d.ts
|
|
3
3
|
/** A credential variant selected without reading its file. */
|
|
4
4
|
type SecretSource = {
|
|
@@ -18,4 +18,4 @@ declare function resolveSecretSource(literal: Sourced<string | undefined> | unde
|
|
|
18
18
|
declare function readSecretSource(source: SecretSource, field: string, signal?: AbortSignal): Promise<string>;
|
|
19
19
|
//#endregion
|
|
20
20
|
export { readSecretSource as n, resolveSecretSource as r, SecretSource as t };
|
|
21
|
-
//# sourceMappingURL=secret-source-
|
|
21
|
+
//# sourceMappingURL=secret-source-CM9cHsZH.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secret-source-
|
|
1
|
+
{"version":3,"file":"secret-source-CM9cHsZH.d.mts","names":[],"sources":["../src/secret-source.ts"],"mappings":";;;KA0BY;WACG;WAA0B;;WAC1B;WAAuB;;;;;iBAYtB,oBACd,SAAS,yCACT,MAAM,yCACN,eACA,eACC;;;;iBAuBmB,iBACpB,QAAQ,cACR,eACA,SAAS,cACR"}
|
package/dist/secret-source.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as readSecretSource, r as resolveSecretSource, t as SecretSource } from "./secret-source-
|
|
1
|
+
import { n as readSecretSource, r as resolveSecretSource, t as SecretSource } from "./secret-source-CM9cHsZH.mjs";
|
|
2
2
|
export { SecretSource, readSecretSource, resolveSecretSource };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@drfed/drfed",
|
|
3
|
-
"version": "0.2.0-dev.
|
|
3
|
+
"version": "0.2.0-dev.698",
|
|
4
4
|
"description": "The main entrypoint program for DrFed.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ActivityPub",
|
|
@@ -82,6 +82,10 @@
|
|
|
82
82
|
"types": "./dist/data-path.d.mts",
|
|
83
83
|
"default": "./dist/data-path.mjs"
|
|
84
84
|
},
|
|
85
|
+
"./listen-defaults": {
|
|
86
|
+
"types": "./dist/listen-defaults.d.mts",
|
|
87
|
+
"default": "./dist/listen-defaults.mjs"
|
|
88
|
+
},
|
|
85
89
|
"./postgres-settings": {
|
|
86
90
|
"types": "./dist/postgres-settings.d.mts",
|
|
87
91
|
"default": "./dist/postgres-settings.mjs"
|
|
@@ -191,6 +195,7 @@
|
|
|
191
195
|
"src/database-settings.ts",
|
|
192
196
|
"src/diagnostics.ts",
|
|
193
197
|
"src/data-path.ts",
|
|
198
|
+
"src/listen-defaults.ts",
|
|
194
199
|
"src/postgres-settings.ts",
|
|
195
200
|
"src/database-runtime.ts",
|
|
196
201
|
"src/commands/migrate.ts",
|
|
@@ -227,10 +232,10 @@
|
|
|
227
232
|
"typescript": "^7.0.2"
|
|
228
233
|
},
|
|
229
234
|
"dependencies": {
|
|
230
|
-
"@drfed/federation": "0.2.0-dev.
|
|
231
|
-
"@drfed/graphql": "0.2.0-dev.
|
|
232
|
-
"@drfed/models": "0.2.0-dev.
|
|
233
|
-
"@drfed/web": "0.2.0-dev.
|
|
235
|
+
"@drfed/federation": "0.2.0-dev.698",
|
|
236
|
+
"@drfed/graphql": "0.2.0-dev.698",
|
|
237
|
+
"@drfed/models": "0.2.0-dev.698",
|
|
238
|
+
"@drfed/web": "0.2.0-dev.698",
|
|
234
239
|
"@electric-sql/pglite": "^0.5.3",
|
|
235
240
|
"@fedify/fedify": "2.4.3",
|
|
236
241
|
"@fedify/pglite": "2.4.3",
|
|
@@ -273,13 +278,13 @@
|
|
|
273
278
|
},
|
|
274
279
|
"drfedBuild": {
|
|
275
280
|
"enabled": true,
|
|
276
|
-
"version": "0.2.0-dev.
|
|
277
|
-
"fullVersion": "0.2.0-dev.
|
|
281
|
+
"version": "0.2.0-dev.698",
|
|
282
|
+
"fullVersion": "0.2.0-dev.698+a80d1c44",
|
|
278
283
|
"baseVersion": "0.2.0",
|
|
279
284
|
"channel": "dev",
|
|
280
|
-
"sha": "
|
|
281
|
-
"runNumber": "
|
|
282
|
-
"runId": "
|
|
285
|
+
"sha": "a80d1c448f1ec71d663a27b5fb811d8b1678580b",
|
|
286
|
+
"runNumber": "698",
|
|
287
|
+
"runId": "41597194656",
|
|
283
288
|
"ref": "refs/heads/main",
|
|
284
289
|
"workflow": ".github/workflows/main.yaml"
|
|
285
290
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"package-D3PlyrNP.mjs","names":[],"sources":["../package.json"],"sourcesContent":[""],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
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,aAAa;EAAC;EAAkB;EAAkB;CAAI;CACtD,sBAAsB,CAAC,0BAA0B;CACjD,GAAG;CACH,UAAU,wBAAwB;CAClC,WAAW,wBAAwB;CACnC,WAAW,wBAAwB;CACnC,YAAY,CAAC,iBAAiB,IAAI;AACpC;AAGA,MAAM,YAAY,UAAkB;;;;;AAMpC,SAAgB,aACd,UACA,OAA4B,UAC5B;CACA,MAAM,EAAE,SAAS;CACjB,MAAM,UAAU,cAAc,EAAE,aAAa,KAAK,CAAC;CACnD,MAAM,OAAO,WAAW,EAAE,SAAS,SAAS,CAAC;CAC7C,MAAM,cAAc,QAAQ;EAC1B,KAAK;EACL,KAAK;EACL,SAAS;CACX,CAAC;CACD,MAAM,SAAS,MAAM,EAAE,WAAW,KAAK,CAAC;CACxC,MAAM,UAAU,oBAAoB,QAAQ;CAC5C,MAAM,SAAS,OAAO,gBAAgB;EACpC,SAAS,KACP,OAAO,GAAG,iBAAiB,SAAS,SAAS,EAC3C,aAAa,OAAO,4BACtB,CAAC,GACDA,sBAAS,QACT,SACA,UACA;GA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