@fedify/fedify 2.4.0-dev.2010 → 2.4.0-dev.2027

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 (96) hide show
  1. package/dist/{assert-CebeUf0C.mjs → assert-D1Eafmd_.mjs} +1 -1
  2. package/dist/{assert_equals-CBlRfA-_.mjs → assert_equals-Z6IcEbWU.mjs} +2 -28
  3. package/dist/{assert_exists-DtzkXC47.mjs → assert_exists-cffSpJ7X.mjs} +1 -1
  4. package/dist/{assert_false-3pLLLsO4.mjs → assert_false-CPdRnc3E.mjs} +1 -1
  5. package/dist/{assert_greater_or_equal-BApOTh1h.mjs → assert_greater_or_equal-BlafOF4-.mjs} +2 -1
  6. package/dist/{assert_instance_of-g3WcyYNR.mjs → assert_instance_of-mrXWWNY-.mjs} +1 -1
  7. package/dist/{assert_not_equals-BN7yDMWe.mjs → assert_not_equals-CpPK2t89.mjs} +2 -1
  8. package/dist/{assert_rejects-wFbSPn1O.mjs → assert_rejects-CTptdYck.mjs} +2 -2
  9. package/dist/{assert_strict_equals-Bpjl4Psw.mjs → assert_strict_equals-CYvBmkpC.mjs} +2 -1
  10. package/dist/{assert_throws-BJ5wuvR2.mjs → assert_throws-BYITOvPO.mjs} +2 -1
  11. package/dist/assertion_error-B-cx0fFA.mjs +31 -0
  12. package/dist/{builder-asm96yV1.mjs → builder-BM255b90.mjs} +2 -2
  13. package/dist/compat/outgoing-jsonld.test.mjs +71 -3
  14. package/dist/compat/public-audience.test.mjs +3 -3
  15. package/dist/compat/secured-document.test.d.mts +2 -0
  16. package/dist/compat/secured-document.test.mjs +58 -0
  17. package/dist/compat/transformers.test.mjs +4 -4
  18. package/dist/{compound-proof-7UIAueLV.mjs → compound-proof-CPvNisT2.mjs} +1 -1
  19. package/dist/{deno-Ckq9TwCv.mjs → deno-BcZNXlJn.mjs} +1 -1
  20. package/dist/{docloader-DUKEPG-O.mjs → docloader-iHi0-9mK.mjs} +2 -2
  21. package/dist/federation/builder.test.mjs +5 -5
  22. package/dist/federation/circuit-breaker.test.mjs +3 -3
  23. package/dist/federation/collection.test.mjs +2 -2
  24. package/dist/federation/compound-fanout.test.d.mts +2 -0
  25. package/dist/federation/compound-fanout.test.mjs +228 -0
  26. package/dist/federation/handler-compound-proof.test.mjs +5 -5
  27. package/dist/federation/handler.test.mjs +11 -11
  28. package/dist/federation/idempotency.test.mjs +4 -4
  29. package/dist/federation/inbox.test.mjs +2 -2
  30. package/dist/federation/keycache.test.mjs +3 -3
  31. package/dist/federation/kv.test.mjs +2 -2
  32. package/dist/federation/metrics.test.mjs +4 -4
  33. package/dist/federation/middleware.test.mjs +17 -17
  34. package/dist/federation/mod.cjs +1 -1
  35. package/dist/federation/mod.js +1 -1
  36. package/dist/federation/mq.test.mjs +7 -6
  37. package/dist/federation/negotiation.test.mjs +3 -3
  38. package/dist/federation/retry.test.mjs +3 -2
  39. package/dist/federation/router.test.mjs +5 -5
  40. package/dist/federation/send.test.mjs +11 -11
  41. package/dist/federation/tasks/enqueue.test.mjs +1 -1
  42. package/dist/federation/tasks/tasks.test.mjs +2 -2
  43. package/dist/federation/temporal.test.mjs +4 -4
  44. package/dist/federation/webfinger.test.mjs +4 -4
  45. package/dist/{federation-CgbvMauV.cjs → federation-C0ijTwhx.cjs} +21 -5
  46. package/dist/{http-DQBfmkrS.cjs → http-CWXKwHPv.cjs} +1 -1
  47. package/dist/{http-DQA2JOEJ.js → http-KZWtR1H8.js} +1 -1
  48. package/dist/{http-DZaAutqg.mjs → http-fIK5D83n.mjs} +3 -3
  49. package/dist/{key-zxzx01Ec.mjs → key-Xb1hVVZO.mjs} +2 -2
  50. package/dist/{kv-cache-CbrUX90H.mjs → kv-cache-CU1rmQFB.mjs} +1 -1
  51. package/dist/{kv-cache-sy8OMNT8.cjs → kv-cache-Dos4tOWb.cjs} +1 -1
  52. package/dist/{kv-cache-BBoePTOJ.js → kv-cache-HOO6BsuW.js} +1 -1
  53. package/dist/{ld-CD_TN0e8.mjs → ld-DFHvxLtx.mjs} +3 -3
  54. package/dist/{metrics-B47Cm5gK.mjs → metrics-D7RydU_p.mjs} +1 -1
  55. package/dist/{middleware-pHwDTAnq.mjs → middleware-BsYD_ufs.mjs} +32 -16
  56. package/dist/{middleware-U_Gannqi.mjs → middleware-DgU5bJnn.mjs} +1 -1
  57. package/dist/{middleware-U0OIuqwD.js → middleware-iffqYoTV.js} +21 -5
  58. package/dist/{mod-UDwMjuHM.d.ts → mod-CNRAxXEb.d.ts} +1 -5
  59. package/dist/{mod-CbKDOnCt.d.cts → mod-CVQFWefn.d.cts} +1 -5
  60. package/dist/mod.cjs +4 -4
  61. package/dist/mod.d.cts +1 -1
  62. package/dist/mod.d.ts +1 -1
  63. package/dist/mod.js +4 -4
  64. package/dist/nodeinfo/client.test.mjs +2 -2
  65. package/dist/nodeinfo/handler.test.mjs +3 -3
  66. package/dist/nodeinfo/types.test.mjs +3 -3
  67. package/dist/otel/exporter.test.mjs +2 -2
  68. package/dist/{outgoing-jsonld-B5Ne7JoL.mjs → outgoing-jsonld-4IJqPYos.mjs} +11 -9
  69. package/dist/{owner-BNKC3s6G.js → owner-B7lgRMdU.js} +127 -35
  70. package/dist/{owner-u3IJRhVx.mjs → owner-D53bUI-n.mjs} +2 -2
  71. package/dist/{owner--mNatWct.cjs → owner-DffLVeYC.cjs} +126 -34
  72. package/dist/{proof-D3te0SP-.mjs → proof-4ADU3qy0.mjs} +80 -23
  73. package/dist/{public-audience-Cc2YJ3ip.mjs → public-audience--klBIOk1.mjs} +13 -9
  74. package/dist/secured-document-CxzZZ9nL.mjs +35 -0
  75. package/dist/{send-CDr0Zivk.mjs → send-n-W6bG7y.mjs} +3 -3
  76. package/dist/sig/compound-proof-discovery.test.mjs +3 -3
  77. package/dist/sig/compound-proof-verification.test.mjs +5 -5
  78. package/dist/sig/compound-proof.test.mjs +145 -58
  79. package/dist/sig/http.test.mjs +11 -10
  80. package/dist/sig/key.test.mjs +6 -6
  81. package/dist/sig/ld.test.mjs +9 -9
  82. package/dist/sig/mod.cjs +2 -2
  83. package/dist/sig/mod.d.cts +1 -1
  84. package/dist/sig/mod.d.ts +1 -1
  85. package/dist/sig/mod.js +2 -2
  86. package/dist/sig/owner.test.mjs +5 -5
  87. package/dist/sig/proof.test.mjs +9 -9
  88. package/dist/std__assert-DvMDRPes.mjs +8 -0
  89. package/dist/{temporal-DKhVF_Uk.mjs → temporal-BFUyXrYg.mjs} +1 -1
  90. package/dist/testing/kv.test.mjs +2 -2
  91. package/dist/utils/docloader.test.mjs +5 -5
  92. package/dist/utils/kv-cache.test.mjs +1 -1
  93. package/dist/utils/mod.cjs +1 -1
  94. package/dist/utils/mod.js +1 -1
  95. package/package.json +6 -6
  96. package/dist/std__assert-CxFT0MNt.mjs +0 -8
@@ -1,7 +1,7 @@
1
1
  import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { l as AssertionError } from "./assert_equals-CBlRfA-_.mjs";
4
+ import { t as AssertionError } from "./assertion_error-B-cx0fFA.mjs";
5
5
  //#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert.js
6
6
  /**
7
7
  * Make an assertion, error will be thrown if `expr` does not have truthy value.
@@ -1,33 +1,7 @@
1
1
  import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- //#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assertion_error.js
5
- /**
6
- * Error thrown when an assertion fails.
7
- *
8
- * @example Usage
9
- * ```ts no-eval
10
- * import { AssertionError } from "@std/assert/assertion-error";
11
- *
12
- * throw new AssertionError("Assertion failed");
13
- * ```
14
- */ var AssertionError = class extends Error {
15
- /** Constructs a new instance.
16
- *
17
- * @example Usage
18
- * ```ts no-eval
19
- * import { AssertionError } from "@std/assert/assertion-error";
20
- *
21
- * throw new AssertionError("Assertion failed");
22
- * ```
23
- *
24
- * @param message The error message.
25
- */ constructor(message) {
26
- super(message);
27
- this.name = "AssertionError";
28
- }
29
- };
30
- //#endregion
4
+ import { t as AssertionError } from "./assertion_error-B-cx0fFA.mjs";
31
5
  //#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/equal.js
32
6
  function isKeyedCollection(x) {
33
7
  return [Symbol.iterator, "size"].every((k) => k in x);
@@ -1010,4 +984,4 @@ const NON_WHITESPACE_REGEXP = /\S/;
1010
984
  throw new AssertionError(message);
1011
985
  }
1012
986
  //#endregion
1013
- export { red as a, equal as c, buildMessage as i, AssertionError as l, diffStr as n, stripAnsiCode as o, diff as r, format as s, assertEquals as t };
987
+ export { red as a, equal as c, buildMessage as i, diffStr as n, stripAnsiCode as o, diff as r, format as s, assertEquals as t };
@@ -1,7 +1,7 @@
1
1
  import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { l as AssertionError } from "./assert_equals-CBlRfA-_.mjs";
4
+ import { t as AssertionError } from "./assertion_error-B-cx0fFA.mjs";
5
5
  //#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_exists.js
6
6
  /**
7
7
  * Make an assertion that actual is not null or undefined.
@@ -1,7 +1,7 @@
1
1
  import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { l as AssertionError } from "./assert_equals-CBlRfA-_.mjs";
4
+ import { t as AssertionError } from "./assertion_error-B-cx0fFA.mjs";
5
5
  //#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_false.js
6
6
  /**
7
7
  * Make an assertion, error will be thrown if `expr` have truthy value.
@@ -1,7 +1,8 @@
1
1
  import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { l as AssertionError, s as format } from "./assert_equals-CBlRfA-_.mjs";
4
+ import { t as AssertionError } from "./assertion_error-B-cx0fFA.mjs";
5
+ import { s as format } from "./assert_equals-Z6IcEbWU.mjs";
5
6
  //#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_greater_or_equal.js
6
7
  /**
7
8
  * Make an assertion that `actual` is greater than or equal to `expected`.
@@ -1,7 +1,7 @@
1
1
  import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { l as AssertionError } from "./assert_equals-CBlRfA-_.mjs";
4
+ import { t as AssertionError } from "./assertion_error-B-cx0fFA.mjs";
5
5
  //#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_instance_of.js
6
6
  /**
7
7
  * Make an assertion that `obj` is an instance of `type`.
@@ -1,7 +1,8 @@
1
1
  import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { c as equal, l as AssertionError } from "./assert_equals-CBlRfA-_.mjs";
4
+ import { t as AssertionError } from "./assertion_error-B-cx0fFA.mjs";
5
+ import { c as equal } from "./assert_equals-Z6IcEbWU.mjs";
5
6
  //#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_not_equals.js
6
7
  /**
7
8
  * Make an assertion that `actual` and `expected` are not equal, deeply.
@@ -1,8 +1,8 @@
1
1
  import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { l as AssertionError } from "./assert_equals-CBlRfA-_.mjs";
5
- import { n as assertIsError } from "./assert_throws-BJ5wuvR2.mjs";
4
+ import { t as AssertionError } from "./assertion_error-B-cx0fFA.mjs";
5
+ import { n as assertIsError } from "./assert_throws-BYITOvPO.mjs";
6
6
  //#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_rejects.js
7
7
  async function assertRejects(fn, errorClassOrMsg, msgIncludesOrMsg, msg) {
8
8
  let ErrorClass = void 0;
@@ -1,7 +1,8 @@
1
1
  import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { a as red, i as buildMessage, l as AssertionError, n as diffStr, r as diff, s as format } from "./assert_equals-CBlRfA-_.mjs";
4
+ import { t as AssertionError } from "./assertion_error-B-cx0fFA.mjs";
5
+ import { a as red, i as buildMessage, n as diffStr, r as diff, s as format } from "./assert_equals-Z6IcEbWU.mjs";
5
6
  //#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_strict_equals.js
6
7
  /**
7
8
  * Make an assertion that `actual` and `expected` are equal using
@@ -1,7 +1,8 @@
1
1
  import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { l as AssertionError, o as stripAnsiCode } from "./assert_equals-CBlRfA-_.mjs";
4
+ import { t as AssertionError } from "./assertion_error-B-cx0fFA.mjs";
5
+ import { o as stripAnsiCode } from "./assert_equals-Z6IcEbWU.mjs";
5
6
  //#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_is_error.js
6
7
  /**
7
8
  * Make an assertion that `error` is an `Error`.
@@ -0,0 +1,31 @@
1
+ import "temporal-polyfill";
2
+ import "urlpattern-polyfill";
3
+ globalThis.addEventListener = () => {};
4
+ //#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assertion_error.js
5
+ /**
6
+ * Error thrown when an assertion fails.
7
+ *
8
+ * @example Usage
9
+ * ```ts no-eval
10
+ * import { AssertionError } from "@std/assert/assertion-error";
11
+ *
12
+ * throw new AssertionError("Assertion failed");
13
+ * ```
14
+ */ var AssertionError = class extends Error {
15
+ /** Constructs a new instance.
16
+ *
17
+ * @example Usage
18
+ * ```ts no-eval
19
+ * import { AssertionError } from "@std/assert/assertion-error";
20
+ *
21
+ * throw new AssertionError("Assertion failed");
22
+ * ```
23
+ *
24
+ * @param message The error message.
25
+ */ constructor(message) {
26
+ super(message);
27
+ this.name = "AssertionError";
28
+ }
29
+ };
30
+ //#endregion
31
+ export { AssertionError as t };
@@ -1,7 +1,7 @@
1
1
  import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as version, t as name } from "./deno-Ckq9TwCv.mjs";
4
+ import { n as version, t as name } from "./deno-BcZNXlJn.mjs";
5
5
  import { t as ActivityListenerSet } from "./activity-listener-C-BSbKI7.mjs";
6
6
  import { getLogger } from "@logtape/logtape";
7
7
  import { Router, RouterError, assertPath } from "@fedify/uri-template";
@@ -85,7 +85,7 @@ var FederationBuilderImpl = class {
85
85
  * specified.
86
86
  */
87
87
  async build(options) {
88
- const { FederationImpl } = await import("./middleware-U_Gannqi.mjs");
88
+ const { FederationImpl } = await import("./middleware-DgU5bJnn.mjs");
89
89
  const f = new FederationImpl(options);
90
90
  const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
91
91
  f.router = this.router.clone();
@@ -1,9 +1,9 @@
1
1
  import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { t as assertEquals } from "../assert_equals-CBlRfA-_.mjs";
5
- import { t as assertStrictEquals } from "../assert_strict_equals-Bpjl4Psw.mjs";
6
- import { n as normalizeAttachmentArrays, r as normalizeOutgoingActivityJsonLd, t as isPreloadedContextAttachmentSafe } from "../outgoing-jsonld-B5Ne7JoL.mjs";
4
+ import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
5
+ import { t as assertStrictEquals } from "../assert_strict_equals-CYvBmkpC.mjs";
6
+ import { n as normalizeAttachmentArrays, r as normalizeOutgoingActivityJsonLd, t as isPreloadedContextAttachmentSafe } from "../outgoing-jsonld-4IJqPYos.mjs";
7
7
  import { Create, Document, Note, PUBLIC_COLLECTION } from "@fedify/vocab";
8
8
  import { mockDocumentLoader, test } from "@fedify/fixture";
9
9
  //#region src/compat/outgoing-jsonld.test.ts
@@ -185,5 +185,73 @@ test("normalizeOutgoingActivityJsonLd() applies outgoing JSON-LD workarounds", a
185
185
  const normalizedObject = normalized.object;
186
186
  assertEquals(Array.isArray(normalizedObject.attachment), true);
187
187
  });
188
+ const securedChild = {
189
+ "@context": ["https://www.w3.org/ns/activitystreams", "https://w3id.org/security/data-integrity/v1"],
190
+ id: "ap://did:key:z6Mkabc/objects/1",
191
+ type: "Note",
192
+ content: "Hello",
193
+ to: "as:Public",
194
+ attachment: {
195
+ type: "Document",
196
+ mediaType: "image/png",
197
+ url: "https://example.com/image.png"
198
+ },
199
+ proof: {
200
+ "@context": ["https://www.w3.org/ns/activitystreams", "https://w3id.org/security/data-integrity/v1"],
201
+ type: "DataIntegrityProof",
202
+ cryptosuite: "eddsa-jcs-2022",
203
+ created: "2023-02-24T23:36:38Z",
204
+ verificationMethod: "did:key:z6Mkabc#z6Mkabc",
205
+ proofPurpose: "assertionMethod",
206
+ proofValue: "z3FXQ"
207
+ }
208
+ };
209
+ function compoundWithSecuredChild() {
210
+ return {
211
+ "@context": ["https://www.w3.org/ns/activitystreams", "https://w3id.org/security/data-integrity/v1"],
212
+ id: "ap://did:key:z6Mkdef/activities/1",
213
+ type: "Create",
214
+ actor: "ap://did:key:z6Mkdef/actor",
215
+ to: "as:Public",
216
+ object: structuredClone(securedChild)
217
+ };
218
+ }
219
+ test("normalizeOutgoingActivityJsonLd() can preserve a nested secured child", async () => {
220
+ const preserved = await normalizeOutgoingActivityJsonLd(compoundWithSecuredChild(), mockDocumentLoader, { preserveNestedSecuredDocuments: true });
221
+ assertEquals(preserved.to, PUBLIC_COLLECTION.href);
222
+ assertEquals(preserved.object, securedChild);
223
+ });
224
+ test("normalizeOutgoingActivityJsonLd() rewrites a nested secured child by default", async () => {
225
+ const normalized = await normalizeOutgoingActivityJsonLd(compoundWithSecuredChild(), mockDocumentLoader);
226
+ const child = normalized.object;
227
+ assertEquals(normalized.to, PUBLIC_COLLECTION.href);
228
+ assertEquals(child.to, PUBLIC_COLLECTION.href);
229
+ assertEquals(child.attachment, [securedChild.attachment]);
230
+ });
231
+ test("normalizeOutgoingActivityJsonLd() only preserves a complete secured child", async () => {
232
+ const cases = {
233
+ "no proof": (child) => delete child.proof,
234
+ "null proof": (child) => child.proof = null,
235
+ "proof set": (child) => child.proof = [securedChild.proof],
236
+ "proof without a verification method": (child) => delete child.proof.verificationMethod,
237
+ "incomplete proof": (child) => delete child.proof.cryptosuite,
238
+ "empty proof value": (child) => child.proof.proofValue = ""
239
+ };
240
+ for (const [name, mutate] of Object.entries(cases)) {
241
+ const input = compoundWithSecuredChild();
242
+ mutate(input.object);
243
+ const child = (await normalizeOutgoingActivityJsonLd(input, mockDocumentLoader, { preserveNestedSecuredDocuments: true })).object;
244
+ assertEquals(child.to, PUBLIC_COLLECTION.href, name);
245
+ assertEquals(child.attachment, [securedChild.attachment], name);
246
+ }
247
+ });
248
+ test("normalizeOutgoingActivityJsonLd() still normalizes a top-level secured document", async () => {
249
+ const normalized = await normalizeOutgoingActivityJsonLd({
250
+ ...structuredClone(securedChild),
251
+ id: "ap://did:key:z6Mkabc/objects/top-level"
252
+ }, mockDocumentLoader, { preserveNestedSecuredDocuments: true });
253
+ assertEquals(normalized.to, PUBLIC_COLLECTION.href);
254
+ assertEquals(normalized.attachment, [securedChild.attachment]);
255
+ });
188
256
  //#endregion
189
257
  export {};
@@ -1,9 +1,9 @@
1
1
  import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { t as assertEquals } from "../assert_equals-CBlRfA-_.mjs";
5
- import { t as assertNotEquals } from "../assert_not_equals-BN7yDMWe.mjs";
6
- import { t as normalizePublicAudience } from "../public-audience-Cc2YJ3ip.mjs";
4
+ import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
5
+ import { t as assertNotEquals } from "../assert_not_equals-CpPK2t89.mjs";
6
+ import { t as normalizePublicAudience } from "../public-audience--klBIOk1.mjs";
7
7
  import { Create, Follow, Note, PUBLIC_COLLECTION } from "@fedify/vocab";
8
8
  import { test } from "@fedify/fixture";
9
9
  import { getDocumentLoader, preloadedContexts } from "@fedify/vocab-runtime";
@@ -0,0 +1,2 @@
1
+ import { Temporal } from "temporal-polyfill";
2
+ import { URLPattern } from "urlpattern-polyfill";
@@ -0,0 +1,58 @@
1
+ import "temporal-polyfill";
2
+ import "urlpattern-polyfill";
3
+ globalThis.addEventListener = () => {};
4
+ import { t as assert } from "../assert-D1Eafmd_.mjs";
5
+ import { t as isSelfContainedSecuredDocument } from "../secured-document-CxzZZ9nL.mjs";
6
+ import { test } from "@fedify/fixture";
7
+ //#region src/compat/secured-document.test.ts
8
+ function securedDocument() {
9
+ return {
10
+ "@context": ["https://www.w3.org/ns/activitystreams", "https://w3id.org/security/data-integrity/v1"],
11
+ id: "ap://did:key:z6Mkabc/objects/1",
12
+ type: "Note",
13
+ content: "Hello",
14
+ proof: {
15
+ "@context": ["https://www.w3.org/ns/activitystreams", "https://w3id.org/security/data-integrity/v1"],
16
+ type: "DataIntegrityProof",
17
+ cryptosuite: "eddsa-jcs-2022",
18
+ created: "2023-02-24T23:36:38Z",
19
+ verificationMethod: "did:key:z6Mkabc#z6Mkabc",
20
+ proofPurpose: "assertionMethod",
21
+ proofValue: "z3FXQ"
22
+ }
23
+ };
24
+ }
25
+ test("isSelfContainedSecuredDocument() accepts a complete secured document", () => {
26
+ assert(isSelfContainedSecuredDocument(securedDocument()));
27
+ const expandedType = securedDocument();
28
+ expandedType.proof.type = "https://w3id.org/security#DataIntegrityProof";
29
+ assert(isSelfContainedSecuredDocument(expandedType));
30
+ const typeArray = securedDocument();
31
+ typeArray.proof.type = ["DataIntegrityProof"];
32
+ assert(isSelfContainedSecuredDocument(typeArray));
33
+ });
34
+ test("isSelfContainedSecuredDocument() rejects anything less", () => {
35
+ assert(!isSelfContainedSecuredDocument(null));
36
+ assert(!isSelfContainedSecuredDocument("string"));
37
+ assert(!isSelfContainedSecuredDocument([securedDocument()]));
38
+ for (const mutate of [
39
+ (d) => delete d["@context"],
40
+ (d) => d["@context"] = null,
41
+ (d) => delete d.proof,
42
+ (d) => d.proof = null,
43
+ (d) => d.proof = [d.proof],
44
+ (d) => d.proof.type = "SomethingElse",
45
+ (d) => delete d.proof.cryptosuite,
46
+ (d) => delete d.proof.created,
47
+ (d) => delete d.proof.verificationMethod,
48
+ (d) => delete d.proof.proofPurpose,
49
+ (d) => d.proof.proofValue = "",
50
+ (d) => d.proof.proofValue = 42
51
+ ]) {
52
+ const document = securedDocument();
53
+ mutate(document);
54
+ assert(!isSelfContainedSecuredDocument(document));
55
+ }
56
+ });
57
+ //#endregion
58
+ export {};
@@ -2,10 +2,10 @@ import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
5
- import { t as assertEquals } from "../assert_equals-CBlRfA-_.mjs";
6
- import { t as assertInstanceOf } from "../assert_instance_of-g3WcyYNR.mjs";
7
- import { t as assert } from "../assert-CebeUf0C.mjs";
8
- import { b as autoIdAssigner, n as FederationImpl, y as actorDehydrator } from "../middleware-pHwDTAnq.mjs";
5
+ import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
6
+ import { t as assertInstanceOf } from "../assert_instance_of-mrXWWNY-.mjs";
7
+ import { t as assert } from "../assert-D1Eafmd_.mjs";
8
+ import { b as autoIdAssigner, n as FederationImpl, y as actorDehydrator } from "../middleware-BsYD_ufs.mjs";
9
9
  import { Follow, Person } from "@fedify/vocab";
10
10
  import { test } from "@fedify/fixture";
11
11
  //#region src/compat/transformers.test.ts
@@ -1,7 +1,7 @@
1
1
  import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { i as verifyMapLocalProof, s as verifyPortableObjectProofPolicy } from "./proof-D3te0SP-.mjs";
4
+ import { i as verifyMapLocalProof, s as verifyPortableObjectProofPolicy } from "./proof-4ADU3qy0.mjs";
5
5
  //#region src/sig/compound-proof.ts
6
6
  const textEncoder = new TextEncoder();
7
7
  const PORTABLE_OBJECT_ID_PATTERN = /^ap(?:\+ef61)?:\/\//i;
@@ -3,6 +3,6 @@ import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  //#region deno.json
5
5
  var name = "@fedify/fedify";
6
- var version = "2.4.0-dev.2010+498229f4";
6
+ var version = "2.4.0-dev.2027+fcf88bfc";
7
7
  //#endregion
8
8
  export { version as n, name as t };
@@ -1,8 +1,8 @@
1
1
  import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { s as validateCryptoKey } from "./key-zxzx01Ec.mjs";
5
- import { n as doubleKnock } from "./http-DZaAutqg.mjs";
4
+ import { s as validateCryptoKey } from "./key-Xb1hVVZO.mjs";
5
+ import { n as doubleKnock } from "./http-fIK5D83n.mjs";
6
6
  import { getLogger } from "@logtape/logtape";
7
7
  import { curry } from "es-toolkit";
8
8
  import { UrlError, createActivityPubRequest, getRemoteDocument, logRequest, validatePublicUrl } from "@fedify/vocab-runtime";
@@ -2,11 +2,11 @@ import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
5
- import { t as assertEquals } from "../assert_equals-CBlRfA-_.mjs";
6
- import { t as assertExists } from "../assert_exists-DtzkXC47.mjs";
7
- import { t as assertThrows } from "../assert_throws-BJ5wuvR2.mjs";
8
- import "../std__assert-CxFT0MNt.mjs";
9
- import { r as createFederationBuilder } from "../builder-asm96yV1.mjs";
5
+ import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
6
+ import { t as assertExists } from "../assert_exists-cffSpJ7X.mjs";
7
+ import { t as assertThrows } from "../assert_throws-BYITOvPO.mjs";
8
+ import "../std__assert-DvMDRPes.mjs";
9
+ import { r as createFederationBuilder } from "../builder-BM255b90.mjs";
10
10
  import { DisallowedOperatorError, DisallowedVarSpecModifierError, DuplicateRouteVariableError, RouteTemplateOptionsNotMatchedError, RouterError } from "@fedify/uri-template";
11
11
  import { Activity, Note, Person } from "@fedify/vocab";
12
12
  import { test } from "@fedify/fixture";
@@ -2,9 +2,9 @@ import { Temporal } from "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
5
- import { t as assertEquals } from "../assert_equals-CBlRfA-_.mjs";
6
- import { t as assertThrows } from "../assert_throws-BJ5wuvR2.mjs";
7
- import "../std__assert-CxFT0MNt.mjs";
5
+ import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
6
+ import { t as assertThrows } from "../assert_throws-BYITOvPO.mjs";
7
+ import "../std__assert-DvMDRPes.mjs";
8
8
  import { n as normalizeCircuitBreakerOptions, r as parseCircuitBreakerKvState, t as CircuitBreaker } from "../circuit-breaker-C5NqoLBJ.mjs";
9
9
  import { t as markCircuitBreakerLegacySweepDone } from "../circuit-breaker-test-utils-DW6YC_Pe.mjs";
10
10
  import { test } from "@fedify/fixture";
@@ -1,8 +1,8 @@
1
1
  import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { t as assertEquals } from "../assert_equals-CBlRfA-_.mjs";
5
- import "../std__assert-CxFT0MNt.mjs";
4
+ import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
5
+ import "../std__assert-DvMDRPes.mjs";
6
6
  import { n as digest, t as buildCollectionSynchronizationHeader } from "../collection-CnnP1UAv.mjs";
7
7
  import { test } from "@fedify/fixture";
8
8
  import { decodeHex } from "byte-encodings/hex";
@@ -0,0 +1,2 @@
1
+ import { Temporal } from "temporal-polyfill";
2
+ import { URLPattern } from "urlpattern-polyfill";