@fedify/fedify 2.1.31 → 2.1.32

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 (97) hide show
  1. package/dist/attachment-arrays-DZ4JHJD8.mjs +111 -0
  2. package/dist/{builder-isMRh_I6.mjs → builder--sc-rozj.mjs} +3 -3
  3. package/dist/callback-BARPujV7.d.mts +2388 -0
  4. package/dist/{client-BIBzqEIp.d.cts → client-9DPcy_Yx.d.ts} +16 -0
  5. package/dist/{client-jE7oGvRh.d.ts → client-B3ruDgWg.d.cts} +16 -0
  6. package/dist/{client-BZr7TGyu.mjs → client-cpPaW7Ww.mjs} +86 -11
  7. package/dist/compat/attachment-arrays.test.d.mts +2 -0
  8. package/dist/compat/attachment-arrays.test.mjs +254 -0
  9. package/dist/compat/mod.d.cts +1 -1
  10. package/dist/compat/mod.d.ts +1 -1
  11. package/dist/compat/transformers.test.mjs +1 -1
  12. package/dist/{context-C0uGVzgk.d.ts → context-DE2YrQwM.d.ts} +30 -13
  13. package/dist/{context-CLaLxi49.d.cts → context-y6ZUQCMf.d.cts} +30 -13
  14. package/dist/{deno-CiaJqTcu.mjs → deno-L23b3Hba.mjs} +1 -1
  15. package/dist/{docloader-DOrwedT7.mjs → docloader-DUXr9k_O.mjs} +2 -2
  16. package/dist/federation/attachment-responses.test.d.mts +2 -0
  17. package/dist/federation/attachment-responses.test.mjs +182 -0
  18. package/dist/federation/builder.test.mjs +1 -1
  19. package/dist/federation/collection.test.mjs +1 -1
  20. package/dist/federation/delivery-attachments.test.d.mts +2 -0
  21. package/dist/federation/delivery-attachments.test.mjs +280 -0
  22. package/dist/federation/handler.test.mjs +208 -16
  23. package/dist/federation/idempotency.test.mjs +2 -2
  24. package/dist/federation/inbox.test.mjs +1 -1
  25. package/dist/federation/middleware.test.mjs +1185 -8
  26. package/dist/federation/mod.cjs +1 -1
  27. package/dist/federation/mod.d.cts +2 -2
  28. package/dist/federation/mod.d.ts +2 -2
  29. package/dist/federation/mod.js +1 -1
  30. package/dist/federation/negotiation.test.mjs +1 -1
  31. package/dist/federation/retry.test.mjs +1 -1
  32. package/dist/federation/send.test.mjs +283 -3
  33. package/dist/federation/temporal.test.mjs +25 -1
  34. package/dist/federation/webfinger.test.mjs +1 -1
  35. package/dist/{http-Crml3gei.js → http-BtbMAgTA.js} +6 -4
  36. package/dist/{http-9IFUxdkp.d.cts → http-C8qLHs_Z.d.cts} +3 -3
  37. package/dist/{http-CRiVlZd5.cjs → http-D5woFKA_.cjs} +6 -4
  38. package/dist/{http-SbfezERn.d.ts → http-D8WmcRAF.d.ts} +3 -3
  39. package/dist/{http-A9mP2uM7.mjs → http-HX6wVyJh.mjs} +6 -4
  40. package/dist/{inbox-KESLudq4.mjs → inbox-CL7A0HXT.mjs} +1 -1
  41. package/dist/{key-Dg6-DV_O.mjs → key-Dai3f5yI.mjs} +3 -2
  42. package/dist/{kv-cache-Cqmm-yQa.cjs → kv-cache-B0V_e231.cjs} +1 -1
  43. package/dist/{kv-cache-DQcyZL5T.js → kv-cache-BsDg-cT8.js} +1 -1
  44. package/dist/{ld-COjDN6Nb.mjs → ld-DN6x1iZ8.mjs} +153 -21
  45. package/dist/ld-signature-DoZcbsZR.mjs +23 -0
  46. package/dist/{middleware-BtDQUCcz.cjs → middleware-Cl6k5Hrm.cjs} +1 -1
  47. package/dist/{middleware-BbgR7xOI.cjs → middleware-CrfRuKCf.cjs} +561 -101
  48. package/dist/{middleware-COFlKeYn.mjs → middleware-DiquMgtt.mjs} +378 -89
  49. package/dist/{middleware-DIW5S_5L.js → middleware-DunNtbo9.js} +560 -101
  50. package/dist/{middleware-CuQvczZd.mjs → middleware-SnQS8eIb.mjs} +1 -1
  51. package/dist/{mod-LOEOKbYd.d.cts → mod-CehHJOV4.d.cts} +30 -13
  52. package/dist/{mod-CFRocFeQ.d.ts → mod-DLJpnqdw.d.ts} +1 -1
  53. package/dist/{mod-C7w-QVUv.d.ts → mod-Mh3oIuRK.d.ts} +30 -13
  54. package/dist/{mod-BRnwh2oy.d.ts → mod-REfljt0T.d.ts} +3 -3
  55. package/dist/{mod-Co7LEK9X.d.cts → mod-UvIGUHqW.d.cts} +3 -3
  56. package/dist/{mod-CGUH8Ujp.d.cts → mod-sTa1Zzxk.d.cts} +1 -1
  57. package/dist/mod.cjs +5 -5
  58. package/dist/mod.d.cts +8 -8
  59. package/dist/mod.d.ts +8 -8
  60. package/dist/mod.js +5 -5
  61. package/dist/nodeinfo/client.test.mjs +432 -5
  62. package/dist/nodeinfo/handler.test.mjs +1 -1
  63. package/dist/nodeinfo/mod.cjs +1 -1
  64. package/dist/nodeinfo/mod.d.cts +1 -1
  65. package/dist/nodeinfo/mod.d.ts +1 -1
  66. package/dist/nodeinfo/mod.js +1 -1
  67. package/dist/nodeinfo/types.test.mjs +1 -1
  68. package/dist/{owner-CFHq61cq.mjs → owner-DwyDorZI.mjs} +2 -2
  69. package/dist/{proof-0JkSC_pT.cjs → proof-Be-4K4jn.cjs} +193 -46
  70. package/dist/{proof-KSHlbPCG.mjs → proof-DYjmyrHh.mjs} +38 -13
  71. package/dist/{proof-DzksJFK7.js → proof-Du4-5SHY.js} +187 -46
  72. package/dist/{send-DaDe2YCb.mjs → send-BGSfQkIK.mjs} +92 -21
  73. package/dist/sig/http.test.mjs +2 -2
  74. package/dist/sig/key-types.test.d.mts +218 -0
  75. package/dist/sig/key-types.test.mjs +8 -0
  76. package/dist/sig/key.test.mjs +2 -2
  77. package/dist/sig/ld.test.mjs +573 -8
  78. package/dist/sig/mod.cjs +2 -2
  79. package/dist/sig/mod.d.cts +3 -3
  80. package/dist/sig/mod.d.ts +3 -3
  81. package/dist/sig/mod.js +2 -2
  82. package/dist/sig/owner.test.mjs +1 -1
  83. package/dist/sig/proof.test.mjs +95 -3
  84. package/dist/{temporal-DNGH8o2E.mjs → temporal-CNCchWly.mjs} +3 -5
  85. package/dist/testing/mod.d.mts +2 -2203
  86. package/dist/{types-DOvyymM4.cjs → types-B5wRhemi.cjs} +85 -10
  87. package/dist/{types-B1_pRFE_.js → types-CXy2lRVU.js} +86 -11
  88. package/dist/utils/docloader.test.mjs +2 -2
  89. package/dist/utils/mod.cjs +1 -1
  90. package/dist/utils/mod.d.cts +1 -1
  91. package/dist/utils/mod.d.ts +1 -1
  92. package/dist/utils/mod.js +1 -1
  93. package/package.json +6 -6
  94. /package/dist/{collection-BD6-SZ6O.mjs → collection-DnoYNwBC.mjs} +0 -0
  95. /package/dist/{negotiation-BehA2uul.mjs → negotiation-xb0QR3u_.mjs} +0 -0
  96. /package/dist/{retry-B_E3V_Dx.mjs → retry-CI1flGDD.mjs} +0 -0
  97. /package/dist/{types-DCP0WLdt.mjs → types-s4mCTGkT.mjs} +0 -0
package/dist/sig/mod.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { C as exportJwk, D as importJwk, E as generateCryptoKeyPair, S as KeyCache, T as fetchKeyDetailed, _ as validateAcceptSignature, a as VerifyRequestDetailedResult, b as FetchKeyOptions, c as signRequest, d as AcceptSignatureMember, f as AcceptSignatureParameters, g as parseAcceptSignature, h as fulfillAcceptSignature, i as SignRequestOptions, l as verifyRequest, m as formatAcceptSignature, n as HttpMessageSignaturesSpecDeterminer, o as VerifyRequestFailureReason, p as FulfillAcceptSignatureResult, r as Rfc9421SignRequestOptions, s as VerifyRequestOptions, t as HttpMessageSignaturesSpec, u as verifyRequestDetailed, v as FetchKeyDetailedResult, w as fetchKey, x as FetchKeyResult, y as FetchKeyErrorResult } from "../http-SbfezERn.js";
2
+ import { C as exportJwk, D as importJwk, E as generateCryptoKeyPair, S as KeyCache, T as fetchKeyDetailed, _ as validateAcceptSignature, a as VerifyRequestDetailedResult, b as FetchKeyOptions, c as signRequest, d as AcceptSignatureMember, f as AcceptSignatureParameters, g as parseAcceptSignature, h as fulfillAcceptSignature, i as SignRequestOptions, l as verifyRequest, m as formatAcceptSignature, n as HttpMessageSignaturesSpecDeterminer, o as VerifyRequestFailureReason, p as FulfillAcceptSignatureResult, r as Rfc9421SignRequestOptions, s as VerifyRequestOptions, t as HttpMessageSignaturesSpec, u as verifyRequestDetailed, v as FetchKeyDetailedResult, w as fetchKey, x as FetchKeyResult, y as FetchKeyErrorResult } from "../http-D8WmcRAF.js";
3
3
  import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "../owner-CiBPcC6F.js";
4
- import { _ as verifyJsonLd, a as createProof, c as verifyProof, d as VerifyJsonLdOptions, f as VerifySignatureOptions, g as signJsonLd, h as detachSignature, i as VerifyProofOptions, l as CreateSignatureOptions, m as createSignature, n as SignObjectOptions, o as signObject, p as attachSignature, r as VerifyObjectOptions, s as verifyObject, t as CreateProofOptions, u as SignJsonLdOptions, v as verifySignature } from "../mod-C7w-QVUv.js";
5
- export { AcceptSignatureMember, AcceptSignatureParameters, CreateProofOptions, CreateSignatureOptions, DoesActorOwnKeyOptions, FetchKeyDetailedResult, FetchKeyErrorResult, FetchKeyOptions, FetchKeyResult, FulfillAcceptSignatureResult, GetKeyOwnerOptions, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, Rfc9421SignRequestOptions, SignJsonLdOptions, SignObjectOptions, SignRequestOptions, VerifyJsonLdOptions, VerifyObjectOptions, VerifyProofOptions, VerifyRequestDetailedResult, VerifyRequestFailureReason, VerifyRequestOptions, VerifySignatureOptions, attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, exportJwk, fetchKey, fetchKeyDetailed, formatAcceptSignature, fulfillAcceptSignature, generateCryptoKeyPair, getKeyOwner, importJwk, parseAcceptSignature, signJsonLd, signObject, signRequest, validateAcceptSignature, verifyJsonLd, verifyObject, verifyProof, verifyRequest, verifyRequestDetailed, verifySignature };
4
+ import { _ as detachSignature, a as VerifyObjectOptions, b as verifySignature, c as signObject, d as CreateSignatureOptions, f as SignJsonLdOptions, g as createSignature, h as attachSignature, i as SignObjectOptions, l as verifyObject, m as VerifySignatureOptions, n as CryptoKeyPairLike, o as VerifyProofOptions, p as VerifyJsonLdOptions, r as CreateProofOptions, s as createProof, t as CryptoKeyLike, u as verifyProof, v as signJsonLd, y as verifyJsonLd } from "../mod-Mh3oIuRK.js";
5
+ export { AcceptSignatureMember, AcceptSignatureParameters, CreateProofOptions, CreateSignatureOptions, CryptoKeyLike, CryptoKeyPairLike, DoesActorOwnKeyOptions, FetchKeyDetailedResult, FetchKeyErrorResult, FetchKeyOptions, FetchKeyResult, FulfillAcceptSignatureResult, GetKeyOwnerOptions, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, Rfc9421SignRequestOptions, SignJsonLdOptions, SignObjectOptions, SignRequestOptions, VerifyJsonLdOptions, VerifyObjectOptions, VerifyProofOptions, VerifyRequestDetailedResult, VerifyRequestFailureReason, VerifyRequestOptions, VerifySignatureOptions, attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, exportJwk, fetchKey, fetchKeyDetailed, formatAcceptSignature, fulfillAcceptSignature, generateCryptoKeyPair, getKeyOwner, importJwk, parseAcceptSignature, signJsonLd, signObject, signRequest, validateAcceptSignature, verifyJsonLd, verifyObject, verifyProof, verifyRequest, verifyRequestDetailed, verifySignature };
package/dist/sig/mod.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import { _ as validateAcceptSignature, a as verifyRequestDetailed, c as fetchKey, d as importJwk, g as parseAcceptSignature, h as fulfillAcceptSignature, i as verifyRequest, l as fetchKeyDetailed, m as formatAcceptSignature, o as exportJwk, r as signRequest, u as generateCryptoKeyPair } from "../http-Crml3gei.js";
4
- import { _ as signJsonLd, a as doesActorOwnKey, b as verifySignature, d as createSignature, f as detachSignature, i as verifyProof, l as attachSignature, n as signObject, o as getKeyOwner, r as verifyObject, t as createProof, y as verifyJsonLd } from "../proof-DzksJFK7.js";
3
+ import { _ as validateAcceptSignature, a as verifyRequestDetailed, c as fetchKey, d as importJwk, g as parseAcceptSignature, h as fulfillAcceptSignature, i as verifyRequest, l as fetchKeyDetailed, m as formatAcceptSignature, o as exportJwk, r as signRequest, u as generateCryptoKeyPair } from "../http-BtbMAgTA.js";
4
+ import { a as doesActorOwnKey, b as verifyJsonLd, d as createSignature, i as verifyProof, l as attachSignature, n as signObject, o as getKeyOwner, p as detachSignature, r as verifyObject, t as createProof, v as signJsonLd, x as verifySignature } from "../proof-Du4-5SHY.js";
5
5
  export { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, exportJwk, fetchKey, fetchKeyDetailed, formatAcceptSignature, fulfillAcceptSignature, generateCryptoKeyPair, getKeyOwner, importJwk, parseAcceptSignature, signJsonLd, signObject, signRequest, validateAcceptSignature, verifyJsonLd, verifyObject, verifyProof, verifyRequest, verifyRequestDetailed, verifySignature };
@@ -6,7 +6,7 @@ import "../std__assert-DflMZha5.mjs";
6
6
  import { r as assertFalse } from "../assert_throws-D4DNWrux.mjs";
7
7
  import { t as assert } from "../assert-BhQd8QHP.mjs";
8
8
  import { o as rsaPublicKey1, s as rsaPublicKey2 } from "../keys-CtZLJq76.mjs";
9
- import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-CFHq61cq.mjs";
9
+ import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-DwyDorZI.mjs";
10
10
  import { createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
11
11
  import { Create, CryptographicKey, lookupObject } from "@fedify/vocab";
12
12
  //#region src/sig/owner.test.ts
@@ -6,9 +6,10 @@ import "../std__assert-DflMZha5.mjs";
6
6
  import { n as assertInstanceOf } from "../assert-BhQd8QHP.mjs";
7
7
  import { t as assertRejects } from "../assert_rejects-WyYSTDDX.mjs";
8
8
  import { i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-CtZLJq76.mjs";
9
- import { i as verifyProof, n as signObject, r as verifyObject, t as createProof } from "../proof-KSHlbPCG.mjs";
9
+ import { _ as verifySignature, c as detachSignature, m as signJsonLd } from "../ld-DN6x1iZ8.mjs";
10
+ import { i as verifyProof, n as signObject, r as verifyObject, t as createProof } from "../proof-DYjmyrHh.mjs";
10
11
  import { mockDocumentLoader, test } from "@fedify/fixture";
11
- import { Create, DataIntegrityProof, Multikey, Note, Place } from "@fedify/vocab";
12
+ import { Create, DataIntegrityProof, Multikey, Note, OrderedCollectionPage, Place } from "@fedify/vocab";
12
13
  import { decodeMultibase, importMultibaseKey } from "@fedify/vocab-runtime";
13
14
  import { decodeHex, encodeHex } from "byte-encodings/hex";
14
15
  //#region src/sig/proof.test.ts
@@ -48,7 +49,7 @@ test("createProof()", async () => {
48
49
  assertEquals(proof.verificationMethodId, ed25519PublicKey.id);
49
50
  assertEquals(proof.proofPurpose, "assertionMethod");
50
51
  console.log(encodeHex(proof.proofValue));
51
- assertEquals(proof.proofValue, decodeHex("860dda2bec0ab493ae9b0223ac4133ee82246d7d75d6505be2d6c53755a34454dcb05feae02403ac51faf853d2e873d467f32a252d3b15a9f025e3ed0750b90b"));
52
+ assertEquals(proof.proofValue, decodeHex("61ebc804b4e12259d7a9a19b244071eaeed8e662150cbdd8005175492eeb9d78216a31c0aa458d8da66c868ba71c8a4da9f56d547499df7a97a4edc975e7840f"));
52
53
  assertEquals(proof.created, created);
53
54
  assertEquals(await verifyProof(await create.toJsonLd({
54
55
  format: "compact",
@@ -152,6 +153,71 @@ test("signObject()", async () => {
152
153
  contextLoader: mockDocumentLoader
153
154
  }), TypeError, "Unsupported algorithm");
154
155
  });
156
+ test("collection serialization preserves cached object integrity proofs", async () => {
157
+ const options = {
158
+ documentLoader: mockDocumentLoader,
159
+ contextLoader: mockDocumentLoader
160
+ };
161
+ const source = await (await signObject(fep8b32TestVectorActivity, fep8b32TestVectorPrivateKey, fep8b32TestVectorKeyId, {
162
+ ...options,
163
+ created: Temporal.Instant.from("2023-02-24T23:36:38Z")
164
+ })).toJsonLd(options);
165
+ assertInstanceOf(await verifyObject(Create, source, options), Create);
166
+ const cached = await Create.fromJsonLd(source, options);
167
+ const json = await new OrderedCollectionPage({
168
+ id: new URL("https://server.example/outbox?page=1"),
169
+ items: [cached]
170
+ }).toJsonLd(options);
171
+ assertEquals(json.orderedItems[0], source);
172
+ assertEquals(await cached.toJsonLd(), source);
173
+ assertInstanceOf(await verifyObject(Create, json.orderedItems[0], options), Create);
174
+ const restored = await OrderedCollectionPage.fromJsonLd(json, options);
175
+ const items = await Array.fromAsync(restored.getItems(options));
176
+ assertEquals(items.length, 1);
177
+ assertEquals(await items[0].toJsonLd(), source);
178
+ });
179
+ test("signObject() migrates proofs from an older context", async () => {
180
+ const oldContext = [
181
+ "https://w3id.org/identity/v1",
182
+ "https://www.w3.org/ns/activitystreams",
183
+ "https://w3id.org/security/data-integrity/v1"
184
+ ];
185
+ const oldJson = await (await signObject(new Create({
186
+ id: new URL("https://example.com/activities/1"),
187
+ actor: new URL("https://example.com/users/alice")
188
+ }), ed25519PrivateKey, ed25519Multikey.id, {
189
+ contextLoader: mockDocumentLoader,
190
+ context: oldContext
191
+ })).toJsonLd({
192
+ format: "compact",
193
+ contextLoader: mockDocumentLoader,
194
+ context: oldContext
195
+ });
196
+ const json = await (await signObject(await Create.fromJsonLd(oldJson, {
197
+ contextLoader: mockDocumentLoader,
198
+ documentLoader: mockDocumentLoader
199
+ }), ed25519PrivateKey, ed25519Multikey.id, { contextLoader: mockDocumentLoader })).toJsonLd({
200
+ format: "compact",
201
+ contextLoader: mockDocumentLoader
202
+ });
203
+ const proofs = Array.isArray(json.proof) ? json.proof : [json.proof];
204
+ assertEquals(proofs.length, 1);
205
+ assertEquals(proofs[0].verificationMethod, ed25519Multikey.id.href);
206
+ });
207
+ test("signObject() skips context comparison for proofless objects", async () => {
208
+ const activity = new Create({
209
+ id: new URL("https://example.com/activities/1"),
210
+ actor: new URL("https://example.com/users/alice")
211
+ });
212
+ let unformattedSerializations = 0;
213
+ const originalToJsonLd = activity.toJsonLd.bind(activity);
214
+ Object.defineProperty(activity, "toJsonLd", { value: async (options) => {
215
+ if (options?.format == null) unformattedSerializations++;
216
+ return await originalToJsonLd(options);
217
+ } });
218
+ await signObject(activity, ed25519PrivateKey, ed25519Multikey.id, { contextLoader: mockDocumentLoader });
219
+ assertEquals(unformattedSerializations, 0);
220
+ });
155
221
  test("verifyProof()", async () => {
156
222
  const cache = {};
157
223
  const options = {
@@ -210,6 +276,32 @@ test("verifyProof()", async () => {
210
276
  }, proof, options), null);
211
277
  assertEquals(await verifyProof(jsonLd, proof.clone({ created: Temporal.Now.instant() }), options), null);
212
278
  });
279
+ test("signJsonLd() does not invalidate an existing proof", async () => {
280
+ const options = {
281
+ documentLoader: mockDocumentLoader,
282
+ contextLoader: mockDocumentLoader
283
+ };
284
+ const note = new Note({
285
+ id: new URL("https://example.com/notes/1"),
286
+ attribution: new URL("https://example.com/users/alice"),
287
+ content: "Hello"
288
+ });
289
+ const proof = await createProof(note, ed25519PrivateKey, ed25519PublicKey.id, options);
290
+ const withProof = {
291
+ ...await note.toJsonLd({
292
+ format: "compact",
293
+ contextLoader: mockDocumentLoader
294
+ }),
295
+ proof: await proof.toJsonLd({
296
+ format: "compact",
297
+ contextLoader: mockDocumentLoader
298
+ })
299
+ };
300
+ const signed = await signJsonLd(withProof, rsaPrivateKey2, rsaPublicKey2.id, options);
301
+ assertEquals(signed["@context"], withProof["@context"]);
302
+ assertEquals(await verifyProof(detachSignature(signed), proof, options), ed25519Multikey);
303
+ assertEquals(await verifySignature(signed, options), rsaPublicKey2);
304
+ });
213
305
  test("verifyObject()", async () => {
214
306
  const options = {
215
307
  documentLoader: mockDocumentLoader,
@@ -1,15 +1,13 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { c as getNormalizationContextLoader } from "./ld-COjDN6Nb.mjs";
4
+ import { l as getNormalizationContextLoader } from "./ld-DN6x1iZ8.mjs";
5
5
  import jsonld from "@fedify/vocab-runtime/jsonld";
6
+ import { normalizeDateTimeLiteral } from "@fedify/vocab-runtime/temporal";
6
7
  //#region src/federation/temporal.ts
7
8
  function isPlainObject(value) {
8
9
  return typeof value === "object" && value != null && !Array.isArray(value);
9
10
  }
10
- function normalizeDateTimeLiteral(value) {
11
- return value.substring(19).match(/[Z+-]/) ? value : value + "Z";
12
- }
13
11
  function isMalformedDateTimeLiteral(value) {
14
12
  if (typeof value !== "string") return false;
15
13
  try {
@@ -51,7 +49,7 @@ function hasMalformedExpandedQuestionClosedLiteral(value) {
51
49
  if (typeof literal === "boolean") return false;
52
50
  if (typeof literal !== "string") return false;
53
51
  if (value["@type"] !== XSD_DATE_TIME_IRI) return false;
54
- if (new Date(literal).toString() === "Invalid Date") return false;
52
+ if (new Date(literal).toString() === "Invalid Date" && new Date(normalizeDateTimeLiteral(literal)).toString() === "Invalid Date") return false;
55
53
  return isMalformedDateTimeLiteral(literal);
56
54
  }
57
55
  function hasMalformedExpandedDurationLiteral(value) {