@drfed/drfed 0.0.0-stage → 0.1.0-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +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-7FOUqcPO.mjs +6 -0
- package/dist/package-7FOUqcPO.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 +275 -3
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { NonEmptyString, ValueParser } from "@optique/core/valueparser";
|
|
2
|
+
//#region src/valueparser.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Delegate file suggestions to the shell without validating inactive paths.
|
|
5
|
+
* @returns A string parser with Optique's native file suggestions.
|
|
6
|
+
*/
|
|
7
|
+
declare function suggestedPath(): ValueParser<"sync", string>;
|
|
8
|
+
/**
|
|
9
|
+
* Suggest known values while leaving validation to the selected provider.
|
|
10
|
+
* @returns A string parser with static Optique choice suggestions.
|
|
11
|
+
*/
|
|
12
|
+
declare function suggestedString(choices: readonly string[], metavar?: NonEmptyString): ValueParser<"sync", string>;
|
|
13
|
+
/**
|
|
14
|
+
* Options for the {@link rootOrigin} value parser.
|
|
15
|
+
*/
|
|
16
|
+
interface RootOriginOptions {
|
|
17
|
+
/**
|
|
18
|
+
* The metavariable name for this parser. This is used in help messages to
|
|
19
|
+
* indicate what kind of value this parser expects.
|
|
20
|
+
* @default `"ORIGIN"`
|
|
21
|
+
*/
|
|
22
|
+
readonly metavar?: NonEmptyString;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Creates a {@link ValueParser} for the origin a DrFed deployment is served
|
|
26
|
+
* from.
|
|
27
|
+
*
|
|
28
|
+
* Parsing and normalization are Optique's `origin()`: the input is canonical-
|
|
29
|
+
* ized rather than rejected, so `HTTPS://DrFed.NET/` and
|
|
30
|
+
* `https://drfed.net:443/path` both come out as `https://drfed.net`, and the
|
|
31
|
+
* root zone's trailing dot is stripped. Only HTTP and HTTPS are accepted.
|
|
32
|
+
*
|
|
33
|
+
* Two further constraints are DrFed's own, because this origin is not just any
|
|
34
|
+
* origin. Every instance is a subdomain of it, and `foo.127.0.0.1` is not a
|
|
35
|
+
* host name at all, so an IP address is refused. Login mail is sent from
|
|
36
|
+
* `noreply@` at its host name, and the mail library will not build a message
|
|
37
|
+
* whose domain runs past the 253 octets DNS allows, so a longer host is
|
|
38
|
+
* refused too. Both are caught here, at the boundary, rather than surfacing
|
|
39
|
+
* later as an instance nobody can address or a login that never arrives.
|
|
40
|
+
* @param options Configuration options for the parser.
|
|
41
|
+
* @returns A {@link ValueParser} producing the deployment's root origin.
|
|
42
|
+
*/
|
|
43
|
+
declare function rootOrigin(options?: RootOriginOptions): ValueParser<"sync", URL>;
|
|
44
|
+
//#endregion
|
|
45
|
+
export { RootOriginOptions, rootOrigin, suggestedPath, suggestedString };
|
|
46
|
+
//# sourceMappingURL=valueparser.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"valueparser.d.mts","names":[],"sources":["../src/valueparser.ts"],"mappings":";;;;;;iBAgCgB,iBAAiB;;;;;iBAcjB,gBACd,4BACA,UAAS,iBACR;;;;UAyBc;;;;;;WAMN,UAAU;;;;;;;;;;;;;;;;;;;;;iBAkDL,WACd,UAAS,oBACR,oBAAoB"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { message } from "@optique/core/message";
|
|
2
|
+
import { choice, ensureNonEmptyString, origin, string } from "@optique/core/valueparser";
|
|
3
|
+
import { path } from "@optique/run/valueparser";
|
|
4
|
+
//#region src/valueparser.ts
|
|
5
|
+
/**
|
|
6
|
+
* Delegate file suggestions to the shell without validating inactive paths.
|
|
7
|
+
* @returns A string parser with Optique's native file suggestions.
|
|
8
|
+
*/
|
|
9
|
+
function suggestedPath() {
|
|
10
|
+
const suggestions = path({
|
|
11
|
+
type: "file",
|
|
12
|
+
metavar: "FILE"
|
|
13
|
+
});
|
|
14
|
+
return {
|
|
15
|
+
...string({ metavar: "FILE" }),
|
|
16
|
+
suggest(prefix) {
|
|
17
|
+
return suggestions.suggest?.(prefix) ?? [];
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Suggest known values while leaving validation to the selected provider.
|
|
23
|
+
* @returns A string parser with static Optique choice suggestions.
|
|
24
|
+
*/
|
|
25
|
+
function suggestedString(choices, metavar = "VALUE") {
|
|
26
|
+
const suggestions = choice(choices);
|
|
27
|
+
return {
|
|
28
|
+
...string({ metavar }),
|
|
29
|
+
suggest(prefix) {
|
|
30
|
+
return suggestions.suggest?.(prefix) ?? [];
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* A host name that the WHATWG URL parser has canonicalized into a dotted-quad
|
|
36
|
+
* IPv4 address. Matching the canonical form is enough, because the parser
|
|
37
|
+
* turns every other spelling (`0x7f.1`, `2130706433`, …) into it.
|
|
38
|
+
*/
|
|
39
|
+
const IPV4_PATTERN = /^\d{1,3}(?:\.\d{1,3}){3}$/u;
|
|
40
|
+
/**
|
|
41
|
+
* The greatest length a domain name may have, in octets.
|
|
42
|
+
*/
|
|
43
|
+
const MAX_HOSTNAME_LENGTH = 253;
|
|
44
|
+
/**
|
|
45
|
+
* Applies the two rules that are DrFed's own to an origin the wrapped parser
|
|
46
|
+
* has already accepted, so that `parse()` and `validate()` cannot come to
|
|
47
|
+
* different conclusions about the same value.
|
|
48
|
+
* @param result The inner parser's successful result.
|
|
49
|
+
* @param input What to name in an error message.
|
|
50
|
+
* @returns The result unchanged, or a failure explaining which rule it broke.
|
|
51
|
+
*/
|
|
52
|
+
function check(result, input) {
|
|
53
|
+
const { hostname } = result.value;
|
|
54
|
+
if (hostname.startsWith("[") || IPV4_PATTERN.test(hostname)) return {
|
|
55
|
+
success: false,
|
|
56
|
+
error: message`${input} names an IP address rather than a domain, which cannot take a subdomain.`
|
|
57
|
+
};
|
|
58
|
+
if (hostname.length > MAX_HOSTNAME_LENGTH) return {
|
|
59
|
+
success: false,
|
|
60
|
+
error: message`The host name of ${input} is longer than the ${String(MAX_HOSTNAME_LENGTH)} characters a domain name may have.`
|
|
61
|
+
};
|
|
62
|
+
return result;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Creates a {@link ValueParser} for the origin a DrFed deployment is served
|
|
66
|
+
* from.
|
|
67
|
+
*
|
|
68
|
+
* Parsing and normalization are Optique's `origin()`: the input is canonical-
|
|
69
|
+
* ized rather than rejected, so `HTTPS://DrFed.NET/` and
|
|
70
|
+
* `https://drfed.net:443/path` both come out as `https://drfed.net`, and the
|
|
71
|
+
* root zone's trailing dot is stripped. Only HTTP and HTTPS are accepted.
|
|
72
|
+
*
|
|
73
|
+
* Two further constraints are DrFed's own, because this origin is not just any
|
|
74
|
+
* origin. Every instance is a subdomain of it, and `foo.127.0.0.1` is not a
|
|
75
|
+
* host name at all, so an IP address is refused. Login mail is sent from
|
|
76
|
+
* `noreply@` at its host name, and the mail library will not build a message
|
|
77
|
+
* whose domain runs past the 253 octets DNS allows, so a longer host is
|
|
78
|
+
* refused too. Both are caught here, at the boundary, rather than surfacing
|
|
79
|
+
* later as an instance nobody can address or a login that never arrives.
|
|
80
|
+
* @param options Configuration options for the parser.
|
|
81
|
+
* @returns A {@link ValueParser} producing the deployment's root origin.
|
|
82
|
+
*/
|
|
83
|
+
function rootOrigin(options = {}) {
|
|
84
|
+
const metavar = options.metavar ?? "ORIGIN";
|
|
85
|
+
ensureNonEmptyString(metavar);
|
|
86
|
+
const inner = origin({
|
|
87
|
+
allowedProtocols: ["http:", "https:"],
|
|
88
|
+
metavar
|
|
89
|
+
});
|
|
90
|
+
return {
|
|
91
|
+
mode: "sync",
|
|
92
|
+
metavar,
|
|
93
|
+
get placeholder() {
|
|
94
|
+
return inner.placeholder;
|
|
95
|
+
},
|
|
96
|
+
parse(input) {
|
|
97
|
+
const result = inner.parse(input);
|
|
98
|
+
return result.success ? check(result, input) : result;
|
|
99
|
+
},
|
|
100
|
+
validate(value) {
|
|
101
|
+
const result = inner.validate?.(value) ?? {
|
|
102
|
+
success: true,
|
|
103
|
+
value
|
|
104
|
+
};
|
|
105
|
+
return result.success ? check(result, value.href) : result;
|
|
106
|
+
},
|
|
107
|
+
format(value) {
|
|
108
|
+
return inner.format(value);
|
|
109
|
+
},
|
|
110
|
+
normalize(value) {
|
|
111
|
+
return inner.normalize?.(value) ?? value;
|
|
112
|
+
},
|
|
113
|
+
suggest(prefix) {
|
|
114
|
+
return inner.suggest?.(prefix) ?? [];
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
//#endregion
|
|
119
|
+
export { rootOrigin, suggestedPath, suggestedString };
|
|
120
|
+
|
|
121
|
+
//# sourceMappingURL=valueparser.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"valueparser.mjs","names":[],"sources":["../src/valueparser.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 { message } from \"@optique/core/message\";\nimport {\n type NonEmptyString,\n type ValueParser,\n type ValueParserResult,\n choice,\n ensureNonEmptyString,\n origin,\n string,\n} from \"@optique/core/valueparser\";\nimport { path } from \"@optique/run/valueparser\";\n\n/**\n * Delegate file suggestions to the shell without validating inactive paths.\n * @returns A string parser with Optique's native file suggestions.\n */\nexport function suggestedPath(): ValueParser<\"sync\", string> {\n const suggestions = path({ type: \"file\", metavar: \"FILE\" });\n return {\n ...string({ metavar: \"FILE\" }),\n suggest(prefix) {\n return suggestions.suggest?.(prefix) ?? [];\n },\n };\n}\n\n/**\n * Suggest known values while leaving validation to the selected provider.\n * @returns A string parser with static Optique choice suggestions.\n */\nexport function suggestedString(\n choices: readonly string[],\n metavar: NonEmptyString = \"VALUE\",\n): ValueParser<\"sync\", string> {\n const suggestions = choice(choices);\n return {\n ...string({ metavar }),\n suggest(prefix) {\n return suggestions.suggest?.(prefix) ?? [];\n },\n };\n}\n\n/**\n * A host name that the WHATWG URL parser has canonicalized into a dotted-quad\n * IPv4 address. Matching the canonical form is enough, because the parser\n * turns every other spelling (`0x7f.1`, `2130706433`, …) into it.\n */\nconst IPV4_PATTERN = /^\\d{1,3}(?:\\.\\d{1,3}){3}$/u;\n\n/**\n * The greatest length a domain name may have, in octets.\n */\nconst MAX_HOSTNAME_LENGTH = 253;\n\n/**\n * Options for the {@link rootOrigin} value parser.\n */\nexport interface RootOriginOptions {\n /**\n * The metavariable name for this parser. This is used in help messages to\n * indicate what kind of value this parser expects.\n * @default `\"ORIGIN\"`\n */\n readonly metavar?: NonEmptyString;\n}\n\n/**\n * Applies the two rules that are DrFed's own to an origin the wrapped parser\n * has already accepted, so that `parse()` and `validate()` cannot come to\n * different conclusions about the same value.\n * @param result The inner parser's successful result.\n * @param input What to name in an error message.\n * @returns The result unchanged, or a failure explaining which rule it broke.\n */\nfunction check(\n result: { readonly success: true; readonly value: URL },\n input: string,\n): ValueParserResult<URL> {\n const { hostname } = result.value;\n if (hostname.startsWith(\"[\") || IPV4_PATTERN.test(hostname)) {\n return {\n success: false,\n error: message`${input} names an IP address rather than a domain, which cannot take a subdomain.`,\n };\n }\n if (hostname.length > MAX_HOSTNAME_LENGTH) {\n return {\n success: false,\n error: message`The host name of ${input} is longer than the ${String(MAX_HOSTNAME_LENGTH)} characters a domain name may have.`,\n };\n }\n return result;\n}\n\n/**\n * Creates a {@link ValueParser} for the origin a DrFed deployment is served\n * from.\n *\n * Parsing and normalization are Optique's `origin()`: the input is canonical-\n * ized rather than rejected, so `HTTPS://DrFed.NET/` and\n * `https://drfed.net:443/path` both come out as `https://drfed.net`, and the\n * root zone's trailing dot is stripped. Only HTTP and HTTPS are accepted.\n *\n * Two further constraints are DrFed's own, because this origin is not just any\n * origin. Every instance is a subdomain of it, and `foo.127.0.0.1` is not a\n * host name at all, so an IP address is refused. Login mail is sent from\n * `noreply@` at its host name, and the mail library will not build a message\n * whose domain runs past the 253 octets DNS allows, so a longer host is\n * refused too. Both are caught here, at the boundary, rather than surfacing\n * later as an instance nobody can address or a login that never arrives.\n * @param options Configuration options for the parser.\n * @returns A {@link ValueParser} producing the deployment's root origin.\n */\nexport function rootOrigin(\n options: RootOriginOptions = {},\n): ValueParser<\"sync\", URL> {\n const metavar = options.metavar ?? \"ORIGIN\";\n ensureNonEmptyString(metavar);\n const inner = origin({\n allowedProtocols: [\"http:\", \"https:\"],\n metavar,\n });\n return {\n mode: \"sync\",\n metavar,\n // Delegated one member at a time rather than spread: `placeholder` is a\n // getter on the parser being wrapped, and spreading would call it once and\n // hand every caller the same mutable `URL`.\n get placeholder(): URL {\n return inner.placeholder;\n },\n parse(input: string) {\n const result = inner.parse(input);\n return result.success ? check(result, input) : result;\n },\n // Optique validates a fallback value, such as one from an environment\n // variable, through this rather than through `parse()`. Without it the\n // check degrades to `format()` followed by `parse()`, and since `format()`\n // emits only the origin, a value carrying credentials would be laundered\n // into an accepted one.\n validate(value: URL) {\n const result = inner.validate?.(value) ?? { success: true, value };\n return result.success ? check(result, value.href) : result;\n },\n format(value: URL): string {\n return inner.format(value);\n },\n normalize(value: URL): URL {\n return inner.normalize?.(value) ?? value;\n },\n suggest(prefix: string) {\n return inner.suggest?.(prefix) ?? [];\n },\n };\n}\n"],"mappings":";;;;;;;;AAgCA,SAAgB,gBAA6C;CAC3D,MAAM,cAAc,KAAK;EAAE,MAAM;EAAQ,SAAS;CAAO,CAAC;CAC1D,OAAO;EACL,GAAG,OAAO,EAAE,SAAS,OAAO,CAAC;EAC7B,QAAQ,QAAQ;GACd,OAAO,YAAY,UAAU,MAAM,KAAK,CAAC;EAC3C;CACF;AACF;;;;;AAMA,SAAgB,gBACd,SACA,UAA0B,SACG;CAC7B,MAAM,cAAc,OAAO,OAAO;CAClC,OAAO;EACL,GAAG,OAAO,EAAE,QAAQ,CAAC;EACrB,QAAQ,QAAQ;GACd,OAAO,YAAY,UAAU,MAAM,KAAK,CAAC;EAC3C;CACF;AACF;;;;;;AAOA,MAAM,eAAe;;;;AAKrB,MAAM,sBAAsB;;;;;;;;;AAsB5B,SAAS,MACP,QACA,OACwB;CACxB,MAAM,EAAE,aAAa,OAAO;CAC5B,IAAI,SAAS,WAAW,GAAG,KAAK,aAAa,KAAK,QAAQ,GACxD,OAAO;EACL,SAAS;EACT,OAAO,OAAO,GAAG,MAAM;CACzB;CAEF,IAAI,SAAS,SAAS,qBACpB,OAAO;EACL,SAAS;EACT,OAAO,OAAO,oBAAoB,MAAM,sBAAsB,OAAO,mBAAmB,EAAE;CAC5F;CAEF,OAAO;AACT;;;;;;;;;;;;;;;;;;;;AAqBA,SAAgB,WACd,UAA6B,CAAC,GACJ;CAC1B,MAAM,UAAU,QAAQ,WAAW;CACnC,qBAAqB,OAAO;CAC5B,MAAM,QAAQ,OAAO;EACnB,kBAAkB,CAAC,SAAS,QAAQ;EACpC;CACF,CAAC;CACD,OAAO;EACL,MAAM;EACN;EAIA,IAAI,cAAmB;GACrB,OAAO,MAAM;EACf;EACA,MAAM,OAAe;GACnB,MAAM,SAAS,MAAM,MAAM,KAAK;GAChC,OAAO,OAAO,UAAU,MAAM,QAAQ,KAAK,IAAI;EACjD;EAMA,SAAS,OAAY;GACnB,MAAM,SAAS,MAAM,WAAW,KAAK,KAAK;IAAE,SAAS;IAAM;GAAM;GACjE,OAAO,OAAO,UAAU,MAAM,QAAQ,MAAM,IAAI,IAAI;EACtD;EACA,OAAO,OAAoB;GACzB,OAAO,MAAM,OAAO,KAAK;EAC3B;EACA,UAAU,OAAiB;GACzB,OAAO,MAAM,YAAY,KAAK,KAAK;EACrC;EACA,QAAQ,QAAgB;GACtB,OAAO,MAAM,UAAU,MAAM,KAAK,CAAC;EACrC;CACF;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,278 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@drfed/drfed",
|
|
3
|
-
"version": "0.0.0
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.0-dev.0",
|
|
4
|
+
"description": "The main entrypoint program for DrFed.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"ActivityPub",
|
|
7
|
+
"fediverse",
|
|
8
|
+
"federation",
|
|
9
|
+
"debugger"
|
|
10
|
+
],
|
|
11
|
+
"author": {
|
|
12
|
+
"name": "DrFed team",
|
|
13
|
+
"url": "https://drfed.org/"
|
|
14
|
+
},
|
|
15
|
+
"maintainers": [
|
|
16
|
+
{
|
|
17
|
+
"name": "ChanHaeng Lee",
|
|
18
|
+
"email": "2chanhaeng@gmail.com",
|
|
19
|
+
"url": "https://chomu.dev/"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"name": "Hong Minhee",
|
|
23
|
+
"email": "hong@minhee.org",
|
|
24
|
+
"url": "https://hongminhee.org/"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "Hyeonseo Kim",
|
|
28
|
+
"email": "dodok8@gmail.com",
|
|
29
|
+
"url": "https://hackers.pub/@gaebalgom"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"name": "Jiwon Kwon",
|
|
33
|
+
"email": "work@kwonjiwon.org",
|
|
34
|
+
"url": "https://kwonjiwon.org/"
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
"license": "AGPL-3.0-only",
|
|
38
|
+
"engines": {
|
|
39
|
+
"node": ">=26.0.0"
|
|
40
|
+
},
|
|
41
|
+
"type": "module",
|
|
42
|
+
"main": "dist/index.mjs",
|
|
43
|
+
"types": "dist/index.d.mts",
|
|
44
|
+
"exports": {
|
|
45
|
+
".": {
|
|
46
|
+
"types": "./dist/index.d.mts",
|
|
47
|
+
"default": "./dist/index.mjs"
|
|
48
|
+
},
|
|
49
|
+
"./valueparser": {
|
|
50
|
+
"types": "./dist/valueparser.d.mts",
|
|
51
|
+
"default": "./dist/valueparser.mjs"
|
|
52
|
+
},
|
|
53
|
+
"./serving": {
|
|
54
|
+
"types": "./dist/serving.d.mts",
|
|
55
|
+
"default": "./dist/serving.mjs"
|
|
56
|
+
},
|
|
57
|
+
"./query-logger": {
|
|
58
|
+
"types": "./dist/query-logger.d.mts",
|
|
59
|
+
"default": "./dist/query-logger.mjs"
|
|
60
|
+
},
|
|
61
|
+
"./resources": {
|
|
62
|
+
"types": "./dist/resources.d.mts",
|
|
63
|
+
"default": "./dist/resources.mjs"
|
|
64
|
+
},
|
|
65
|
+
"./operations": {
|
|
66
|
+
"types": "./dist/operations.d.mts",
|
|
67
|
+
"default": "./dist/operations.mjs"
|
|
68
|
+
},
|
|
69
|
+
"./configuration": {
|
|
70
|
+
"types": "./dist/configuration.d.mts",
|
|
71
|
+
"default": "./dist/configuration.mjs"
|
|
72
|
+
},
|
|
73
|
+
"./database-settings": {
|
|
74
|
+
"types": "./dist/database-settings.d.mts",
|
|
75
|
+
"default": "./dist/database-settings.mjs"
|
|
76
|
+
},
|
|
77
|
+
"./diagnostics": {
|
|
78
|
+
"types": "./dist/diagnostics.d.mts",
|
|
79
|
+
"default": "./dist/diagnostics.mjs"
|
|
80
|
+
},
|
|
81
|
+
"./data-path": {
|
|
82
|
+
"types": "./dist/data-path.d.mts",
|
|
83
|
+
"default": "./dist/data-path.mjs"
|
|
84
|
+
},
|
|
85
|
+
"./postgres-settings": {
|
|
86
|
+
"types": "./dist/postgres-settings.d.mts",
|
|
87
|
+
"default": "./dist/postgres-settings.mjs"
|
|
88
|
+
},
|
|
89
|
+
"./database-runtime": {
|
|
90
|
+
"types": "./dist/database-runtime.d.mts",
|
|
91
|
+
"default": "./dist/database-runtime.mjs"
|
|
92
|
+
},
|
|
93
|
+
"./commands/migrate": {
|
|
94
|
+
"types": "./dist/commands/migrate.d.mts",
|
|
95
|
+
"default": "./dist/commands/migrate.mjs"
|
|
96
|
+
},
|
|
97
|
+
"./commands/migrate-program": {
|
|
98
|
+
"types": "./dist/commands/migrate-program.d.mts",
|
|
99
|
+
"default": "./dist/commands/migrate-program.mjs"
|
|
100
|
+
},
|
|
101
|
+
"./commands/account": {
|
|
102
|
+
"types": "./dist/commands/account.d.mts",
|
|
103
|
+
"default": "./dist/commands/account.mjs"
|
|
104
|
+
},
|
|
105
|
+
"./commands/account-program": {
|
|
106
|
+
"types": "./dist/commands/account-program.d.mts",
|
|
107
|
+
"default": "./dist/commands/account-program.mjs"
|
|
108
|
+
},
|
|
109
|
+
"./commands/account-create": {
|
|
110
|
+
"types": "./dist/commands/account-create.d.mts",
|
|
111
|
+
"default": "./dist/commands/account-create.mjs"
|
|
112
|
+
},
|
|
113
|
+
"./logging": {
|
|
114
|
+
"types": "./dist/logging.d.mts",
|
|
115
|
+
"default": "./dist/logging.mjs"
|
|
116
|
+
},
|
|
117
|
+
"./commands/web": {
|
|
118
|
+
"types": "./dist/commands/web.d.mts",
|
|
119
|
+
"default": "./dist/commands/web.mjs"
|
|
120
|
+
},
|
|
121
|
+
"./commands/web-program": {
|
|
122
|
+
"types": "./dist/commands/web-program.d.mts",
|
|
123
|
+
"default": "./dist/commands/web-program.mjs"
|
|
124
|
+
},
|
|
125
|
+
"./smtp-settings": {
|
|
126
|
+
"types": "./dist/smtp-settings.d.mts",
|
|
127
|
+
"default": "./dist/smtp-settings.mjs"
|
|
128
|
+
},
|
|
129
|
+
"./mail-parser": {
|
|
130
|
+
"types": "./dist/mail-parser.d.mts",
|
|
131
|
+
"default": "./dist/mail-parser.mjs"
|
|
132
|
+
},
|
|
133
|
+
"./mail-settings": {
|
|
134
|
+
"types": "./dist/mail-settings.d.mts",
|
|
135
|
+
"default": "./dist/mail-settings.mjs"
|
|
136
|
+
},
|
|
137
|
+
"./mail-runtime": {
|
|
138
|
+
"types": "./dist/mail-runtime.d.mts",
|
|
139
|
+
"default": "./dist/mail-runtime.mjs"
|
|
140
|
+
},
|
|
141
|
+
"./secret-source": {
|
|
142
|
+
"types": "./dist/secret-source.d.mts",
|
|
143
|
+
"default": "./dist/secret-source.mjs"
|
|
144
|
+
},
|
|
145
|
+
"./jmap-parser": {
|
|
146
|
+
"types": "./dist/jmap-parser.d.mts",
|
|
147
|
+
"default": "./dist/jmap-parser.mjs"
|
|
148
|
+
},
|
|
149
|
+
"./jmap-settings": {
|
|
150
|
+
"types": "./dist/jmap-settings.d.mts",
|
|
151
|
+
"default": "./dist/jmap-settings.mjs"
|
|
152
|
+
},
|
|
153
|
+
"./jmap-runtime": {
|
|
154
|
+
"types": "./dist/jmap-runtime.d.mts",
|
|
155
|
+
"default": "./dist/jmap-runtime.mjs"
|
|
156
|
+
},
|
|
157
|
+
"./api-mail-parser": {
|
|
158
|
+
"types": "./dist/api-mail-parser.d.mts",
|
|
159
|
+
"default": "./dist/api-mail-parser.mjs"
|
|
160
|
+
},
|
|
161
|
+
"./api-mail-settings": {
|
|
162
|
+
"types": "./dist/api-mail-settings.d.mts",
|
|
163
|
+
"default": "./dist/api-mail-settings.mjs"
|
|
164
|
+
},
|
|
165
|
+
"./bounded-mail-runtime": {
|
|
166
|
+
"types": "./dist/bounded-mail-runtime.d.mts",
|
|
167
|
+
"default": "./dist/bounded-mail-runtime.mjs"
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
"files": [
|
|
171
|
+
"bin/",
|
|
172
|
+
"completions/",
|
|
173
|
+
"dist/",
|
|
174
|
+
"README.md"
|
|
175
|
+
],
|
|
176
|
+
"bin": {
|
|
177
|
+
"drfed-server": "bin/drfed-server.mjs",
|
|
178
|
+
"drfed-migrate": "bin/drfed-migrate.mjs",
|
|
179
|
+
"drfed-account": "bin/drfed-account.mjs",
|
|
180
|
+
"drfed-web": "bin/drfed-web.mjs"
|
|
181
|
+
},
|
|
182
|
+
"tsdown": {
|
|
183
|
+
"entry": [
|
|
184
|
+
"src/index.ts",
|
|
185
|
+
"src/valueparser.ts",
|
|
186
|
+
"src/serving.ts",
|
|
187
|
+
"src/query-logger.ts",
|
|
188
|
+
"src/resources.ts",
|
|
189
|
+
"src/operations.ts",
|
|
190
|
+
"src/configuration.ts",
|
|
191
|
+
"src/database-settings.ts",
|
|
192
|
+
"src/diagnostics.ts",
|
|
193
|
+
"src/data-path.ts",
|
|
194
|
+
"src/postgres-settings.ts",
|
|
195
|
+
"src/database-runtime.ts",
|
|
196
|
+
"src/commands/migrate.ts",
|
|
197
|
+
"src/commands/migrate-program.ts",
|
|
198
|
+
"src/commands/account.ts",
|
|
199
|
+
"src/commands/account-program.ts",
|
|
200
|
+
"src/commands/account-create.ts",
|
|
201
|
+
"src/logging.ts",
|
|
202
|
+
"src/commands/web.ts",
|
|
203
|
+
"src/commands/web-program.ts",
|
|
204
|
+
"src/smtp-settings.ts",
|
|
205
|
+
"src/mail-parser.ts",
|
|
206
|
+
"src/mail-settings.ts",
|
|
207
|
+
"src/mail-runtime.ts",
|
|
208
|
+
"src/secret-source.ts",
|
|
209
|
+
"src/jmap-parser.ts",
|
|
210
|
+
"src/jmap-settings.ts",
|
|
211
|
+
"src/jmap-runtime.ts",
|
|
212
|
+
"src/api-mail-parser.ts",
|
|
213
|
+
"src/api-mail-settings.ts",
|
|
214
|
+
"src/bounded-mail-runtime.ts"
|
|
215
|
+
],
|
|
216
|
+
"dts": {
|
|
217
|
+
"sourcemap": true,
|
|
218
|
+
"tsconfig": "../../tsconfig.drfed.json"
|
|
219
|
+
},
|
|
220
|
+
"sourcemap": true
|
|
221
|
+
},
|
|
222
|
+
"devDependencies": {
|
|
223
|
+
"@fedify/vocab": "2.4.3",
|
|
224
|
+
"@logtape/testing-node": "2.3.0-dev.840",
|
|
225
|
+
"@types/node": "^26.0.0",
|
|
226
|
+
"tsdown": "^0.22.14",
|
|
227
|
+
"typescript": "^7.0.2"
|
|
228
|
+
},
|
|
229
|
+
"dependencies": {
|
|
230
|
+
"@electric-sql/pglite": "^0.5.3",
|
|
231
|
+
"@fedify/fedify": "2.4.3",
|
|
232
|
+
"@fedify/pglite": "2.4.3",
|
|
233
|
+
"@fedify/postgres": "2.4.3",
|
|
234
|
+
"@logtape/drizzle-orm": "^2.2.2",
|
|
235
|
+
"@logtape/file": "2.3.0-dev.840",
|
|
236
|
+
"@logtape/logtape": "2.3.0-dev.840",
|
|
237
|
+
"@optique/config": "1.3.5",
|
|
238
|
+
"@optique/core": "^1.3.5",
|
|
239
|
+
"@optique/env": "1.3.5",
|
|
240
|
+
"@optique/logtape": "^1.3.5",
|
|
241
|
+
"@optique/run": "^1.3.5",
|
|
242
|
+
"@upyo/core": "0.6.0",
|
|
243
|
+
"@upyo/jmap": "0.6.0",
|
|
244
|
+
"@upyo/lettermint": "0.6.0",
|
|
245
|
+
"@upyo/logtape": "0.6.0",
|
|
246
|
+
"@upyo/smtp": "0.6.0",
|
|
247
|
+
"drizzle-orm": "1.0.0-beta.22",
|
|
248
|
+
"graphql": "^16.14.2",
|
|
249
|
+
"postgres": "^3.4.9",
|
|
250
|
+
"smol-toml": "^1.9.1",
|
|
251
|
+
"srvx": "^0.11.16",
|
|
252
|
+
"valibot": "1.4.2",
|
|
253
|
+
"@upyo/maileroo": "0.6.0",
|
|
254
|
+
"@upyo/mailtrap": "0.6.0",
|
|
255
|
+
"@upyo/mailgun": "0.6.0",
|
|
256
|
+
"@upyo/plunk": "0.6.0",
|
|
257
|
+
"@upyo/resend": "0.6.0",
|
|
258
|
+
"@upyo/retry": "0.6.0",
|
|
259
|
+
"@upyo/sendgrid": "0.6.0",
|
|
260
|
+
"@upyo/ses": "0.6.0",
|
|
261
|
+
"@drfed/federation": "0.1.0",
|
|
262
|
+
"@drfed/models": "0.1.0",
|
|
263
|
+
"@drfed/web": "0.1.0",
|
|
264
|
+
"@drfed/graphql": "0.1.0"
|
|
265
|
+
},
|
|
266
|
+
"repository": {
|
|
267
|
+
"type": "git",
|
|
268
|
+
"url": "https://github.com/fedify-dev/drfed.git",
|
|
269
|
+
"directory": "packages/drfed"
|
|
270
|
+
},
|
|
271
|
+
"publishConfig": {
|
|
272
|
+
"access": "public"
|
|
273
|
+
},
|
|
274
|
+
"scripts": {
|
|
275
|
+
"build": "tsdown",
|
|
276
|
+
"test": "node --test"
|
|
277
|
+
}
|
|
6
278
|
}
|