@fedify/fedify 1.9.0-pr.428.1587 → 1.9.0-pr.431.1597

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.
Files changed (153) hide show
  1. package/dist/actor-CHOM_AN3.d.cts +128 -0
  2. package/dist/actor-CfaqWvJb.cjs +37783 -0
  3. package/dist/{actor-CRWrH2fJ.js → actor-Detmisdi.js} +190 -190
  4. package/dist/{actor-BAyhNMtT.js → actor-Dw7av4Zk.js} +1 -1
  5. package/dist/{authdocloader-DuPcJhwz.js → authdocloader-5UJ5Gme-.js} +6 -6
  6. package/dist/authdocloader-BVYv0Ct8.cjs +58 -0
  7. package/dist/{authdocloader-C1iaSe2N.js → authdocloader-ZlLoXSxM.js} +3 -3
  8. package/dist/{builder-DLD2OVGE.js → builder-BbKfqPmR.js} +4 -4
  9. package/dist/chunk-DqRYRqnO.cjs +34 -0
  10. package/dist/{client-PZOCn5-Y.js → client-DgRjF0ha.js} +1 -1
  11. package/dist/client-DjT_tegg.d.cts +294 -0
  12. package/dist/compat/mod.cjs +10 -0
  13. package/dist/compat/mod.d.cts +13 -0
  14. package/dist/compat/mod.js +5 -5
  15. package/dist/compat/transformers.test.js +16 -16
  16. package/dist/compat-DmDDELst.cjs +4 -0
  17. package/dist/compat-nxUqe4Z-.js +4 -0
  18. package/dist/context-KXVF2AhH.d.cts +2261 -0
  19. package/dist/{docloader-6Si9l3iy.js → docloader-BKf9RWX4.js} +4 -4
  20. package/dist/docloader-D-MrRyHl.d.cts +219 -0
  21. package/dist/docloader-eqgyMp7h.cjs +4682 -0
  22. package/dist/{esm-WCi84Tv_.js → esm-B_ZjJ1sB.js} +1 -1
  23. package/dist/federation/builder.test.js +5 -5
  24. package/dist/federation/collection.test.js +3 -3
  25. package/dist/federation/handler.test.js +17 -17
  26. package/dist/federation/inbox.test.js +4 -4
  27. package/dist/federation/keycache.test.js +4 -4
  28. package/dist/federation/kv.test.js +3 -3
  29. package/dist/federation/middleware.test.js +18 -18
  30. package/dist/federation/mod.cjs +29 -0
  31. package/dist/federation/mod.d.cts +13 -0
  32. package/dist/federation/mod.js +15 -15
  33. package/dist/federation/mq.test.js +3 -3
  34. package/dist/federation/retry.test.js +3 -3
  35. package/dist/federation/router.test.js +3 -3
  36. package/dist/federation/send.test.js +10 -10
  37. package/dist/{federation-CMX7WzeL.js → federation-D1U8YY9t.js} +3 -3
  38. package/dist/federation-H2_En3j5.cjs +244 -0
  39. package/dist/http-B_zBcsai.d.cts +253 -0
  40. package/dist/{http-CFiUVZfi.js → http-C5XLveZw.js} +2 -2
  41. package/dist/{http-DEm-ammv.js → http-CwlUFNG4.js} +6 -6
  42. package/dist/http-_vjuGcXn.cjs +826 -0
  43. package/dist/{inbox-VMSM478g.js → inbox-sVXiVBbT.js} +1 -1
  44. package/dist/key-19P2dWvf.cjs +290 -0
  45. package/dist/{key-CdGoFWIl.js → key-BCWvPOkD.js} +5 -5
  46. package/dist/key-CsQ7J8-m.js +10 -0
  47. package/dist/key-Dt7qJaQT.cjs +10 -0
  48. package/dist/{key-LefgNv9I.js → key-Jrnr66vx.js} +2 -2
  49. package/dist/{key-D3__azaY.js → key-lpATOAE4.js} +3 -3
  50. package/dist/{keycache-9EJyq0-_.js → keycache-ogQInQck.js} +1 -1
  51. package/dist/{keys-Dn0SWAWf.js → keys-DcGsKtHW.js} +1 -1
  52. package/dist/kv-63Cil1MD.d.cts +81 -0
  53. package/dist/{ld-Dgthw_5_.js → ld-BSE4jnyK.js} +2 -2
  54. package/dist/lookup-D96ipStp.cjs +137 -0
  55. package/dist/{lookup-D0EUk78B.js → lookup-D_-F1hLw.js} +4 -4
  56. package/dist/{lookup-Bj_u3eYM.js → lookup-DdxOle8f.js} +1 -1
  57. package/dist/middleware-B0f850Ei.cjs +17 -0
  58. package/dist/middleware-B2DFqtJ-.cjs +4240 -0
  59. package/dist/middleware-COHAbwGs.js +17 -0
  60. package/dist/{middleware-dku9cdga.js → middleware-CuTcPjfP.js} +13 -13
  61. package/dist/middleware-Dt7C7qpw.js +26 -0
  62. package/dist/{middleware-CqVZVdeM.js → middleware-T_y4Bnvw.js} +14 -14
  63. package/dist/mod-C2tOeRkN.d.cts +1 -0
  64. package/dist/mod-C3CGxYoF.d.cts +102 -0
  65. package/dist/mod-COw_caPC.d.cts +266 -0
  66. package/dist/mod-FZd39qVq.d.cts +1 -0
  67. package/dist/mod-NKH_G-IY.d.cts +289 -0
  68. package/dist/mod-YfAcrVbP.d.cts +80 -0
  69. package/dist/mod-jQ4OODsl.d.cts +113 -0
  70. package/dist/mod.cjs +152 -0
  71. package/dist/mod.d.cts +17 -0
  72. package/dist/mod.js +20 -20
  73. package/dist/mq-B7R1Q-M5.d.cts +140 -0
  74. package/dist/nodeinfo/client.test.js +5 -5
  75. package/dist/nodeinfo/handler.test.js +16 -16
  76. package/dist/nodeinfo/mod.cjs +13 -0
  77. package/dist/nodeinfo/mod.d.cts +5 -0
  78. package/dist/nodeinfo/mod.js +6 -6
  79. package/dist/nodeinfo/semver.test.js +3 -3
  80. package/dist/nodeinfo/types.test.js +3 -3
  81. package/dist/nodeinfo-Co9lJrWl.cjs +4 -0
  82. package/dist/nodeinfo-DfycQ8Wf.js +4 -0
  83. package/dist/owner-C9Ry0TOI.d.cts +67 -0
  84. package/dist/{owner-QgsLL0FU.js → owner-DJtc8evi.js} +2 -2
  85. package/dist/{proof-B4xoN40A.js → proof-9OMp0o4n.js} +2 -2
  86. package/dist/{proof-E_33BNCY.js → proof-BuPk23Er.js} +6 -6
  87. package/dist/proof-CRHppbRk.cjs +673 -0
  88. package/dist/runtime/authdocloader.test.js +9 -9
  89. package/dist/runtime/docloader.test.js +4 -4
  90. package/dist/runtime/key.test.js +5 -5
  91. package/dist/runtime/langstr.test.js +3 -3
  92. package/dist/runtime/mod.cjs +25 -0
  93. package/dist/runtime/mod.d.cts +6 -0
  94. package/dist/runtime/mod.js +10 -10
  95. package/dist/runtime/multibase/multibase.test.js +3 -3
  96. package/dist/runtime/url.test.js +3 -3
  97. package/dist/runtime-C58AJWSv.cjs +4 -0
  98. package/dist/runtime-DPYEDf-o.js +4 -0
  99. package/dist/{send-ByaKiMsV.js → send-cXerEJm9.js} +2 -2
  100. package/dist/sig/http.test.js +8 -8
  101. package/dist/sig/key.test.js +6 -6
  102. package/dist/sig/ld.test.js +7 -7
  103. package/dist/sig/mod.cjs +30 -0
  104. package/dist/sig/mod.d.cts +8 -0
  105. package/dist/sig/mod.js +10 -10
  106. package/dist/sig/owner.test.js +7 -7
  107. package/dist/sig/proof.test.js +7 -7
  108. package/dist/sig-ByHXzqUi.cjs +4 -0
  109. package/dist/sig-Cj3tk-ig.js +4 -0
  110. package/dist/testing/docloader.test.js +3 -3
  111. package/dist/testing/mod.js +3 -3
  112. package/dist/{testing-DK6Jj8Bp.js → testing-BX6IA3LR.js} +2 -2
  113. package/dist/{transformers-Dna8Fg7k.js → transformers-BFT6d7J5.js} +3 -3
  114. package/dist/transformers-CoBS-oFG.cjs +116 -0
  115. package/dist/{type-CKxYS9Sh.js → type-DF9yoIpt.js} +186 -186
  116. package/dist/types-DcKQIzdO.cjs +488 -0
  117. package/dist/{types-DNXXKtNN.js → types-Q17QxOOC.js} +4 -4
  118. package/dist/vocab/actor.test.js +5 -5
  119. package/dist/vocab/lookup.test.js +4 -4
  120. package/dist/vocab/mod.cjs +87 -0
  121. package/dist/vocab/mod.d.cts +6 -0
  122. package/dist/vocab/mod.js +7 -7
  123. package/dist/vocab/type.test.js +3 -3
  124. package/dist/vocab/vocab.test.js +4 -4
  125. package/dist/{vocab-BXEmH50Y.js → vocab-BUc_4ZsW.js} +6 -6
  126. package/dist/vocab-BzGg7ltX.d.cts +14629 -0
  127. package/dist/vocab-Du8FV6H1.cjs +282 -0
  128. package/dist/webfinger/handler.test.js +16 -16
  129. package/dist/webfinger/lookup.test.js +4 -4
  130. package/dist/webfinger/mod.cjs +9 -0
  131. package/dist/webfinger/mod.d.cts +4 -0
  132. package/dist/webfinger/mod.js +6 -6
  133. package/dist/webfinger-BjOEdFPs.cjs +4 -0
  134. package/dist/webfinger-De_bU0iE.js +4 -0
  135. package/dist/x/cfworkers.cjs +100 -0
  136. package/dist/x/cfworkers.d.cts +59 -0
  137. package/dist/x/cfworkers.js +3 -3
  138. package/dist/x/cfworkers.test.js +3 -3
  139. package/dist/x/hono.cjs +61 -0
  140. package/dist/x/hono.d.cts +54 -0
  141. package/dist/x/hono.js +3 -3
  142. package/dist/x/sveltekit.cjs +69 -0
  143. package/dist/x/sveltekit.d.cts +46 -0
  144. package/dist/x/sveltekit.js +3 -3
  145. package/package.json +68 -12
  146. package/dist/compat-Bb5myD13.js +0 -4
  147. package/dist/key-CiJCx5-9.js +0 -10
  148. package/dist/middleware-1wWyj5B6.js +0 -26
  149. package/dist/middleware-BxSWANLr.js +0 -17
  150. package/dist/nodeinfo-CyEbLjHs.js +0 -4
  151. package/dist/runtime-BSkOVUWM.js +0 -4
  152. package/dist/sig-BXJO--F9.js +0 -4
  153. package/dist/webfinger-C3GIyXIg.js +0 -4
@@ -3,7 +3,7 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { Application, Group, Organization, Person, Service, deno_default, getTypeId, lookupWebFinger } from "./type-CKxYS9Sh.js";
6
+ import { Application, Group, Organization, Person, Service, deno_default, getTypeId, lookupWebFinger } from "./type-DF9yoIpt.js";
7
7
  import { SpanStatusCode, trace } from "@opentelemetry/api";
8
8
  import { domainToASCII, domainToUnicode } from "node:url";
9
9
 
@@ -1,10 +1,10 @@
1
1
 
2
- import { Temporal } from "@js-temporal/polyfill";
3
- import { URLPattern } from "urlpattern-polyfill";
4
-
5
- import { UrlError, createRequest, getRemoteDocument, logRequest, validatePublicUrl } from "./docloader-6Si9l3iy.js";
6
- import { validateCryptoKey } from "./key-CdGoFWIl.js";
7
- import { doubleKnock } from "./http-DEm-ammv.js";
2
+ import { Temporal } from "@js-temporal/polyfill";
3
+ import { URLPattern } from "urlpattern-polyfill";
4
+
5
+ import { UrlError, createRequest, getRemoteDocument, logRequest, validatePublicUrl } from "./docloader-BKf9RWX4.js";
6
+ import { validateCryptoKey } from "./key-BCWvPOkD.js";
7
+ import { doubleKnock } from "./http-CwlUFNG4.js";
8
8
  import { getLogger } from "@logtape/logtape";
9
9
 
10
10
  //#region src/runtime/authdocloader.ts
@@ -0,0 +1,58 @@
1
+
2
+ const { Temporal } = require("@js-temporal/polyfill");
3
+ const { URLPattern } = require("urlpattern-polyfill");
4
+
5
+ const require_chunk = require('./chunk-DqRYRqnO.cjs');
6
+ const require_docloader = require('./docloader-eqgyMp7h.cjs');
7
+ const require_key = require('./key-19P2dWvf.cjs');
8
+ const require_http = require('./http-_vjuGcXn.cjs');
9
+ const __logtape_logtape = require_chunk.__toESM(require("@logtape/logtape"));
10
+
11
+ //#region src/runtime/authdocloader.ts
12
+ const logger = (0, __logtape_logtape.getLogger)([
13
+ "fedify",
14
+ "runtime",
15
+ "docloader"
16
+ ]);
17
+ /**
18
+ * Gets an authenticated {@link DocumentLoader} for the given identity.
19
+ * Note that an authenticated document loader intentionally does not cache
20
+ * the fetched documents.
21
+ * @param identity The identity to get the document loader for.
22
+ * The actor's key pair.
23
+ * @param options The options for the document loader.
24
+ * @returns The authenticated document loader.
25
+ * @throws {TypeError} If the key is invalid or unsupported.
26
+ * @since 0.4.0
27
+ */
28
+ function getAuthenticatedDocumentLoader(identity, { allowPrivateAddress, userAgent, specDeterminer, tracerProvider } = {}) {
29
+ require_key.validateCryptoKey(identity.privateKey);
30
+ async function load(url, options) {
31
+ if (!allowPrivateAddress) try {
32
+ await require_docloader.validatePublicUrl(url);
33
+ } catch (error) {
34
+ if (error instanceof require_docloader.UrlError) logger.error("Disallowed private URL: {url}", {
35
+ url,
36
+ error
37
+ });
38
+ throw error;
39
+ }
40
+ const originalRequest = require_docloader.createRequest(url, { userAgent });
41
+ const response = await require_http.doubleKnock(originalRequest, identity, {
42
+ specDeterminer,
43
+ log: require_docloader.logRequest,
44
+ tracerProvider,
45
+ signal: options?.signal
46
+ });
47
+ return require_docloader.getRemoteDocument(url, response, load);
48
+ }
49
+ return load;
50
+ }
51
+
52
+ //#endregion
53
+ Object.defineProperty(exports, 'getAuthenticatedDocumentLoader', {
54
+ enumerable: true,
55
+ get: function () {
56
+ return getAuthenticatedDocumentLoader;
57
+ }
58
+ });
@@ -3,9 +3,9 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { UrlError, createRequest, getRemoteDocument, logRequest, validatePublicUrl } from "./type-CKxYS9Sh.js";
7
- import { validateCryptoKey } from "./key-LefgNv9I.js";
8
- import { doubleKnock } from "./http-CFiUVZfi.js";
6
+ import { UrlError, createRequest, getRemoteDocument, logRequest, validatePublicUrl } from "./type-DF9yoIpt.js";
7
+ import { validateCryptoKey } from "./key-Jrnr66vx.js";
8
+ import { doubleKnock } from "./http-C5XLveZw.js";
9
9
  import { getLogger } from "@logtape/logtape";
10
10
 
11
11
  //#region src/runtime/authdocloader.ts
@@ -3,9 +3,9 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { deno_default, getTypeId } from "./type-CKxYS9Sh.js";
7
- import { Router, RouterError } from "./lookup-Bj_u3eYM.js";
8
- import { InboxListenerSet } from "./inbox-VMSM478g.js";
6
+ import { deno_default, getTypeId } from "./type-DF9yoIpt.js";
7
+ import { Router, RouterError } from "./lookup-DdxOle8f.js";
8
+ import { InboxListenerSet } from "./inbox-sVXiVBbT.js";
9
9
  import { getLogger } from "@logtape/logtape";
10
10
  import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
11
11
 
@@ -42,7 +42,7 @@ var FederationBuilderImpl = class {
42
42
  this.collectionTypeIds = {};
43
43
  }
44
44
  async build(options) {
45
- const { FederationImpl } = await import("./middleware-1wWyj5B6.js");
45
+ const { FederationImpl } = await import("./middleware-Dt7C7qpw.js");
46
46
  const f = new FederationImpl(options);
47
47
  const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
48
48
  f.router = this.router.clone();
@@ -0,0 +1,34 @@
1
+
2
+ const { Temporal } = require("@js-temporal/polyfill");
3
+ const { URLPattern } = require("urlpattern-polyfill");
4
+
5
+ //#region rolldown:runtime
6
+ var __create = Object.create;
7
+ var __defProp = Object.defineProperty;
8
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
9
+ var __getOwnPropNames = Object.getOwnPropertyNames;
10
+ var __getProtoOf = Object.getPrototypeOf;
11
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
14
+ key = keys[i];
15
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
+ get: ((k) => from[k]).bind(null, key),
17
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
+ });
19
+ }
20
+ return to;
21
+ };
22
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
23
+ value: mod,
24
+ enumerable: true
25
+ }) : target, mod));
26
+
27
+ //#endregion
28
+
29
+ Object.defineProperty(exports, '__toESM', {
30
+ enumerable: true,
31
+ get: function () {
32
+ return __toESM;
33
+ }
34
+ });
@@ -3,7 +3,7 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { getUserAgent } from "./type-CKxYS9Sh.js";
6
+ import { getUserAgent } from "./type-DF9yoIpt.js";
7
7
  import { parseSemVer } from "./semver-dArNLkR9.js";
8
8
  import { getLogger } from "@logtape/logtape";
9
9
 
@@ -0,0 +1,294 @@
1
+ import { GetUserAgentOptions } from "./docloader-D-MrRyHl.cjs";
2
+
3
+ //#region src/nodeinfo/semver.d.ts
4
+ /**
5
+ * A SemVer object parsed into its constituent parts.
6
+ * @since 1.2.0
7
+ */
8
+ interface SemVer {
9
+ /** The major version */
10
+ major: number;
11
+ /** The minor version */
12
+ minor: number;
13
+ /** The patch version */
14
+ patch: number;
15
+ /**
16
+ * The prerelease version
17
+ *
18
+ * @default {[]}
19
+ */
20
+ prerelease?: (string | number)[];
21
+ /**
22
+ * The build metadata
23
+ *
24
+ * @default {[]}
25
+ */
26
+ build?: string[];
27
+ }
28
+ /**
29
+ * Attempt to parse a string as a semantic version, returning a SemVer object.
30
+ *
31
+ * @example Usage
32
+ * ```ts
33
+ * import { parseSemVer } from "@fedify/fedify/nodeinfo";
34
+ * import { assertEquals } from "@std/assert";
35
+ *
36
+ * const version = parseSemVer("1.2.3");
37
+ * assertEquals(version, {
38
+ * major: 1,
39
+ * minor: 2,
40
+ * patch: 3,
41
+ * prerelease: [],
42
+ * build: [],
43
+ * });
44
+ * ```
45
+ *
46
+ * @throws {TypeError} If the input string is invalid.
47
+ * @param value The version string to parse
48
+ * @returns A valid SemVer
49
+ * @since 1.2.0
50
+ */
51
+ declare function parseSemVer(value: string): SemVer;
52
+ /**
53
+ * Format a SemVer object into a string.
54
+ *
55
+ * @example Usage
56
+ * ```ts
57
+ * import { formatSemVer } from "@fedify/fedify/nodeinfo";
58
+ * import { assertEquals } from "@std/assert";
59
+ *
60
+ * const semver = {
61
+ * major: 1,
62
+ * minor: 2,
63
+ * patch: 3,
64
+ * };
65
+ * assertEquals(formatSemVer(semver), "1.2.3");
66
+ * ```
67
+ *
68
+ * @param version The SemVer to format
69
+ * @returns The string representation of a semantic version.
70
+ * @since 1.2.0
71
+ */
72
+ declare function formatSemVer(version: SemVer): string;
73
+ //#endregion
74
+ //#region src/nodeinfo/types.d.ts
75
+ /**
76
+ * The type of the result of parsing JSON.
77
+ */
78
+ type JsonValue = {
79
+ [key: string]: JsonValue | undefined;
80
+ } | JsonValue[] | string | number | boolean | null;
81
+ /**
82
+ * A NodeInfo object as defined in the NodeInfo 2.1 schema.
83
+ */
84
+ interface NodeInfo {
85
+ /**
86
+ * Metadata about server software in use.
87
+ */
88
+ software: Software;
89
+ /**
90
+ * The protocols supported on this server. At least one protocol must be
91
+ * supported.
92
+ */
93
+ protocols: Protocol[];
94
+ /**
95
+ * The third party sites this server can connect to via their application API.
96
+ */
97
+ services?: Services;
98
+ /**
99
+ * Whether this server allows open self-registration. Defaults to `false`.
100
+ */
101
+ openRegistrations?: boolean;
102
+ /**
103
+ * Usage statistics for this server.
104
+ */
105
+ usage: Usage;
106
+ /**
107
+ * Free form key value pairs for software specific values.
108
+ * Clients should not rely on any specific key present.
109
+ */
110
+ metadata?: Record<string, JsonValue>;
111
+ }
112
+ /**
113
+ * Metadata about server software in use.
114
+ */
115
+ interface Software {
116
+ /**
117
+ * The canonical name of this server software. This must comply with
118
+ * pattern `/^[a-z0-9-]+$/`.
119
+ */
120
+ name: string;
121
+ /**
122
+ * The version of this server software.
123
+ * @see {@link parseSemVer}
124
+ */
125
+ version: SemVer;
126
+ /**
127
+ * The URL of the source code repository of this server software.
128
+ */
129
+ repository?: URL;
130
+ /**
131
+ * The URL of the homepage of this server software.
132
+ */
133
+ homepage?: URL;
134
+ }
135
+ /**
136
+ * The protocols supported on this server.
137
+ */
138
+ type Protocol = "activitypub" | "buddycloud" | "dfrn" | "diaspora" | "libertree" | "ostatus" | "pumpio" | "tent" | "xmpp" | "zot";
139
+ /**
140
+ * The third party sites this server can connect to via their application API.
141
+ */
142
+ interface Services {
143
+ /**
144
+ * The third party sites this server can retrieve messages from for combined
145
+ * display with regular traffic.
146
+ */
147
+ inbound?: InboundService[];
148
+ /**
149
+ * The third party sites this server can publish messages to on the behalf
150
+ * of a user.
151
+ */
152
+ outbound?: OutboundService[];
153
+ }
154
+ /**
155
+ * The third party sites this server can retrieve messages from for combined
156
+ * display with regular traffic.
157
+ */
158
+ type InboundService = "atom1.0" | "gnusocial" | "imap" | "pnut" | "pop3" | "pumpio" | "rss2.0" | "twitter";
159
+ /**
160
+ * The third party sites this server can publish messages to on the behalf
161
+ * of a user.
162
+ */
163
+ type OutboundService = "atom1.0" | "blogger" | "buddycloud" | "diaspora" | "dreamwidth" | "drupal" | "facebook" | "friendica" | "gnusocial" | "google" | "insanejournal" | "libertree" | "linkedin" | "livejournal" | "mediagoblin" | "myspace" | "pinterest" | "pnut" | "posterous" | "pumpio" | "redmatrix" | "rss2.0" | "smtp" | "tent" | "tumblr" | "twitter" | "wordpress" | "xmpp";
164
+ /**
165
+ * Usage statistics for this server.
166
+ */
167
+ interface Usage {
168
+ /**
169
+ * Statistics about the users of this server.
170
+ */
171
+ users: {
172
+ /**
173
+ * The total amount of on this server registered users. This number
174
+ * has to be an integer greater than or equal to zero.
175
+ */
176
+ total?: number;
177
+ /**
178
+ * The amount of users that signed in at least once in the last 180 days.
179
+ * This number has to be an integer greater than or equal to zero.
180
+ */
181
+ activeHalfyear?: number;
182
+ /**
183
+ * The amount of users that signed in at least once in the last 30 days.
184
+ * This number has to be an integer greater than or equal to zero.
185
+ */
186
+ activeMonth?: number;
187
+ };
188
+ /**
189
+ * The amount of posts that were made by users that are registered on this
190
+ * server. This number has to be an integer greater than or equal to zero.
191
+ */
192
+ localPosts: number;
193
+ /**
194
+ * The amount of comments that were made by users that are registered on this
195
+ * server. This number has to be an integer greater than or equal to zero.
196
+ */
197
+ localComments: number;
198
+ }
199
+ /**
200
+ * Converts a {@link NodeInfo} object to a JSON value.
201
+ * @param nodeInfo The {@link NodeInfo} object to convert.
202
+ * @returns The JSON value that complies with the NodeInfo schema.
203
+ * @throws {TypeError} If the {@link NodeInfo} object is invalid.
204
+ */
205
+ declare function nodeInfoToJson(nodeInfo: NodeInfo): JsonValue;
206
+ //#endregion
207
+ //#region src/nodeinfo/client.d.ts
208
+ /**
209
+ * Options for {@link getNodeInfo} function.
210
+ * @since 1.2.0
211
+ */
212
+ interface GetNodeInfoOptions {
213
+ /**
214
+ * Whether to directly fetch the NodeInfo document from the given URL.
215
+ * Otherwise, the NodeInfo document will be fetched from the `.well-known`
216
+ * location of the given URL.
217
+ *
218
+ * Turned off by default.
219
+ */
220
+ direct?: boolean;
221
+ /**
222
+ * How strictly to parse the NodeInfo document.
223
+ *
224
+ * - `"strict"`: Parse the NodeInfo document strictly. If the document is
225
+ * invalid, `undefined` is returned. This is the default.
226
+ * - `"best-effort"`: Try to parse the NodeInfo document even if it is
227
+ * invalid.
228
+ * - `"none"`: Do not parse the NodeInfo document. The function will return
229
+ * the raw JSON value.
230
+ */
231
+ parse?: "strict" | "best-effort" | "none";
232
+ /**
233
+ * The options for making `User-Agent` header.
234
+ * If a string is given, it is used as the `User-Agent` header value.
235
+ * If an object is given, it is passed to {@link getUserAgent} to generate
236
+ * the `User-Agent` header value.
237
+ * @since 1.3.0
238
+ */
239
+ userAgent?: GetUserAgentOptions | string;
240
+ }
241
+ /**
242
+ * Fetches a NodeInfo document from the given URL.
243
+ * @param url The base URL of the server. If `options.direct` is turned off
244
+ * (default), the NodeInfo document will be fetched from
245
+ * the `.well-known` location of this URL (hence the only origin
246
+ * of the URL is used). If `options.direct` is turned on,
247
+ * the NodeInfo document will be fetched from the given URL.
248
+ * @param options Options for fetching the NodeInfo document.
249
+ * @returns The NodeInfo document if it could be fetched successfully.
250
+ * Otherwise, `undefined` is returned.
251
+ * @since 1.2.0
252
+ */
253
+ declare function getNodeInfo(url: URL | string, options?: GetNodeInfoOptions & {
254
+ parse?: "strict" | "best-effort";
255
+ }): Promise<NodeInfo | undefined>;
256
+ /**
257
+ * Fetches a NodeInfo document from the given URL.
258
+ * @param url The base URL of the server. If `options.direct` is turned off
259
+ * (default), the NodeInfo document will be fetched from
260
+ * the `.well-known` location of this URL (hence the only origin
261
+ * of the URL is used). If `options.direct` is turned on,
262
+ * the NodeInfo document will be fetched from the given URL.
263
+ * @param options Options for fetching the NodeInfo document.
264
+ * @returns The NodeInfo document if it could be fetched successfully.
265
+ * Otherwise, `undefined` is returned.
266
+ * @since 1.2.0
267
+ */
268
+ declare function getNodeInfo(url: URL | string, options: GetNodeInfoOptions & {
269
+ parse: "none";
270
+ }): Promise<JsonValue | undefined>;
271
+ /**
272
+ * Options for {@link parseNodeInfo} function.
273
+ * @since 1.2.0
274
+ */
275
+ interface ParseNodeInfoOptions {
276
+ /**
277
+ * Whether to try to parse the NodeInfo document even if it is invalid.
278
+ * If turned on, the function will return a best-effort result.
279
+ *
280
+ * Turned off by default.
281
+ */
282
+ tryBestEffort?: boolean;
283
+ }
284
+ /**
285
+ * Parses a NodeInfo document.
286
+ * @param data A JSON value that complies with the NodeInfo schema.
287
+ * @param options Options for parsing the NodeInfo document.
288
+ * @returns The parsed NodeInfo document if it is valid. Otherwise, `null`
289
+ * is returned.
290
+ * @since 1.2.0
291
+ */
292
+ declare function parseNodeInfo(data: unknown, options?: ParseNodeInfoOptions): NodeInfo | null;
293
+ //#endregion
294
+ export { GetNodeInfoOptions, InboundService, JsonValue, NodeInfo, OutboundService, ParseNodeInfoOptions, Protocol, SemVer, Services, Software, Usage, formatSemVer, getNodeInfo, nodeInfoToJson, parseNodeInfo, parseSemVer };
@@ -0,0 +1,10 @@
1
+
2
+ const { Temporal } = require("@js-temporal/polyfill");
3
+ const { URLPattern } = require("urlpattern-polyfill");
4
+
5
+ const require_transformers = require('../transformers-CoBS-oFG.cjs');
6
+ require('../compat-DmDDELst.cjs');
7
+
8
+ exports.actorDehydrator = require_transformers.actorDehydrator;
9
+ exports.autoIdAssigner = require_transformers.autoIdAssigner;
10
+ exports.getDefaultActivityTransformers = require_transformers.getDefaultActivityTransformers;
@@ -0,0 +1,13 @@
1
+ import "../kv-63Cil1MD.cjs";
2
+ import "../docloader-D-MrRyHl.cjs";
3
+ import "../client-DjT_tegg.cjs";
4
+ import "../vocab-BzGg7ltX.cjs";
5
+ import "../actor-CHOM_AN3.cjs";
6
+ import "../http-B_zBcsai.cjs";
7
+ import "../owner-C9Ry0TOI.cjs";
8
+ import "../mod-NKH_G-IY.cjs";
9
+ import "../mod-jQ4OODsl.cjs";
10
+ import { ActivityTransformer } from "../context-KXVF2AhH.cjs";
11
+ import "../mq-B7R1Q-M5.cjs";
12
+ import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "../mod-YfAcrVbP.cjs";
13
+ export { ActivityTransformer, actorDehydrator, autoIdAssigner, getDefaultActivityTransformers };
@@ -1,8 +1,8 @@
1
1
 
2
- import { Temporal } from "@js-temporal/polyfill";
3
- import { URLPattern } from "urlpattern-polyfill";
4
-
5
- import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "../transformers-Dna8Fg7k.js";
6
- import "../compat-Bb5myD13.js";
2
+ import { Temporal } from "@js-temporal/polyfill";
3
+ import { URLPattern } from "urlpattern-polyfill";
4
+
5
+ import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "../transformers-BFT6d7J5.js";
6
+ import "../compat-nxUqe4Z-.js";
7
7
 
8
8
  export { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers };
@@ -3,30 +3,30 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { Follow, Person } from "../type-CKxYS9Sh.js";
6
+ import { Follow, Person } from "../type-DF9yoIpt.js";
7
7
  import { assertEquals } from "../assert_equals-DSbWqCm3.js";
8
8
  import { assert } from "../assert-MZs1qjMx.js";
9
9
  import { assertInstanceOf } from "../assert_instance_of-DHz7EHNU.js";
10
10
  import { MemoryKvStore } from "../kv-CRZrzyXm.js";
11
- import { FederationImpl, actorDehydrator, autoIdAssigner } from "../middleware-dku9cdga.js";
11
+ import { FederationImpl, actorDehydrator, autoIdAssigner } from "../middleware-CuTcPjfP.js";
12
12
  import "../semver-dArNLkR9.js";
13
- import "../client-PZOCn5-Y.js";
14
- import "../lookup-Bj_u3eYM.js";
13
+ import "../client-DgRjF0ha.js";
14
+ import "../lookup-DdxOle8f.js";
15
15
  import "../types-BIgY6c-l.js";
16
- import "../actor-BAyhNMtT.js";
17
- import "../key-LefgNv9I.js";
18
- import "../http-CFiUVZfi.js";
19
- import "../authdocloader-C1iaSe2N.js";
20
- import "../ld-Dgthw_5_.js";
21
- import "../owner-QgsLL0FU.js";
22
- import "../proof-B4xoN40A.js";
23
- import "../inbox-VMSM478g.js";
24
- import "../builder-DLD2OVGE.js";
16
+ import "../actor-Dw7av4Zk.js";
17
+ import "../key-Jrnr66vx.js";
18
+ import "../http-C5XLveZw.js";
19
+ import "../authdocloader-ZlLoXSxM.js";
20
+ import "../ld-BSE4jnyK.js";
21
+ import "../owner-DJtc8evi.js";
22
+ import "../proof-9OMp0o4n.js";
23
+ import "../inbox-sVXiVBbT.js";
24
+ import "../builder-BbKfqPmR.js";
25
25
  import "../collection-CSzG2j1P.js";
26
- import "../keycache-9EJyq0-_.js";
26
+ import "../keycache-ogQInQck.js";
27
27
  import "../retry-D4GJ670a.js";
28
- import "../send-ByaKiMsV.js";
29
- import { test } from "../testing-DK6Jj8Bp.js";
28
+ import "../send-cXerEJm9.js";
29
+ import { test } from "../testing-BX6IA3LR.js";
30
30
 
31
31
  //#region src/compat/transformers.test.ts
32
32
  const federation = new FederationImpl({ kv: new MemoryKvStore() });
@@ -0,0 +1,4 @@
1
+
2
+ const { Temporal } = require("@js-temporal/polyfill");
3
+ const { URLPattern } = require("urlpattern-polyfill");
4
+
@@ -0,0 +1,4 @@
1
+
2
+ import { Temporal } from "@js-temporal/polyfill";
3
+ import { URLPattern } from "urlpattern-polyfill";
4
+