@fedify/fedify 2.4.0-dev.1583 → 2.4.0-dev.1618

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 (158) hide show
  1. package/dist/{accept-CgDcxvjV.mjs → accept-8PiolDP7.mjs} +1 -1
  2. package/dist/{activity-listener-BeTGV3wc.mjs → activity-listener-BtTSxZWA.mjs} +1 -1
  3. package/dist/{assert-DvVHoIZ0.mjs → assert-CJ1KXcvv.mjs} +2 -2
  4. package/dist/{assert_equals-PBVKNMJd.mjs → assert_equals-BV7oLMxm.mjs} +1 -1
  5. package/dist/{assert_instance_of-CxoC8bVq.mjs → assert_instance_of-Q9KTBnrf.mjs} +2 -2
  6. package/dist/{assert_not_equals-C8vcTTA3.mjs → assert_not_equals-EPJPoxuf.mjs} +2 -2
  7. package/dist/{assert_rejects-DAdaaIWM.mjs → assert_rejects-EgstcQy5.mjs} +3 -3
  8. package/dist/{assert_strict_equals-BzqyKuYL.mjs → assert_strict_equals-Ec20AUwa.mjs} +2 -2
  9. package/dist/{assert_throws-zN79lgIC.mjs → assert_throws-NiFfqbnH.mjs} +2 -2
  10. package/dist/{builder-Doj1FmsW.mjs → builder-C4a7TAvq.mjs} +26 -4
  11. package/dist/{chunk-DDcVe30Y.cjs → chunk-Czpeue4M.cjs} +0 -1
  12. package/dist/{chunk-CRNNMoPX.js → chunk-D5IdezsZ.js} +1 -1
  13. package/dist/{circuit-breaker-hJBB6jwA.mjs → circuit-breaker-CBGyz5F7.mjs} +1 -1
  14. package/dist/{client-B_A6mfn3.mjs → client-CjF5IYQS.mjs} +1 -1
  15. package/dist/{codec-nfBU4Up4.mjs → codec-BBga-FWI.mjs} +1 -1
  16. package/dist/{collection-Dp5ky45w.mjs → collection-BIhlldqK.mjs} +1 -1
  17. package/dist/compat/mod.cjs +1 -2
  18. package/dist/compat/mod.d.cts +1 -1
  19. package/dist/compat/mod.d.ts +1 -1
  20. package/dist/compat/mod.js +2 -2
  21. package/dist/compat/outgoing-jsonld.test.d.mts +1 -1
  22. package/dist/compat/outgoing-jsonld.test.mjs +4 -4
  23. package/dist/compat/public-audience.test.d.mts +1 -1
  24. package/dist/compat/public-audience.test.mjs +4 -4
  25. package/dist/compat/transformers.test.d.mts +1 -1
  26. package/dist/compat/transformers.test.mjs +6 -6
  27. package/dist/{context-BBRTgkrs.mjs → context-BJXxPElm.mjs} +3 -2
  28. package/dist/{context-GfQA-CqB.d.ts → context-Zii1f5xS.d.ts} +97 -1
  29. package/dist/{context-BLe0NPtZ.d.cts → context-lxX6I7as.d.cts} +97 -1
  30. package/dist/{deno-Bkl9jNVs.mjs → deno-DepnPEgI.mjs} +2 -2
  31. package/dist/{docloader-f1XFaWWh.mjs → docloader-C_IefWRb.mjs} +3 -3
  32. package/dist/{esm-vrlUxr60.mjs → esm-yYQfPhIY.mjs} +1 -1
  33. package/dist/federation/builder.test.d.mts +1 -1
  34. package/dist/federation/builder.test.mjs +16 -6
  35. package/dist/federation/circuit-breaker.test.d.mts +1 -1
  36. package/dist/federation/circuit-breaker.test.mjs +6 -6
  37. package/dist/federation/collection.test.d.mts +1 -1
  38. package/dist/federation/collection.test.mjs +4 -4
  39. package/dist/federation/handler.test.d.mts +1 -1
  40. package/dist/federation/handler.test.mjs +14 -14
  41. package/dist/federation/idempotency.test.d.mts +1 -1
  42. package/dist/federation/idempotency.test.mjs +7 -7
  43. package/dist/federation/inbox.test.d.mts +1 -1
  44. package/dist/federation/inbox.test.mjs +4 -4
  45. package/dist/federation/keycache.test.d.mts +1 -1
  46. package/dist/federation/keycache.test.mjs +6 -6
  47. package/dist/federation/kv.test.d.mts +1 -1
  48. package/dist/federation/kv.test.mjs +4 -4
  49. package/dist/federation/metrics.test.d.mts +1 -1
  50. package/dist/federation/metrics.test.mjs +5 -5
  51. package/dist/federation/middleware.test.d.mts +1 -1
  52. package/dist/federation/middleware.test.mjs +470 -22
  53. package/dist/federation/mod.cjs +4 -3
  54. package/dist/federation/mod.d.cts +3 -3
  55. package/dist/federation/mod.d.ts +3 -3
  56. package/dist/federation/mod.js +2 -2
  57. package/dist/federation/mq.test.d.mts +1 -1
  58. package/dist/federation/mq.test.mjs +6 -6
  59. package/dist/federation/negotiation.test.d.mts +1 -1
  60. package/dist/federation/negotiation.test.mjs +5 -5
  61. package/dist/federation/retry.test.d.mts +1 -1
  62. package/dist/federation/retry.test.mjs +4 -4
  63. package/dist/federation/router.test.d.mts +1 -1
  64. package/dist/federation/router.test.mjs +6 -6
  65. package/dist/federation/send.test.d.mts +1 -1
  66. package/dist/federation/send.test.mjs +12 -12
  67. package/dist/federation/tasks/codec.test.d.mts +1 -1
  68. package/dist/federation/tasks/codec.test.mjs +2 -2
  69. package/dist/federation/tasks/enqueue.test.d.mts +1 -1
  70. package/dist/federation/tasks/enqueue.test.mjs +5 -5
  71. package/dist/federation/tasks/tasks.test.d.mts +1 -1
  72. package/dist/federation/tasks/tasks.test.mjs +7 -7
  73. package/dist/federation/temporal.test.d.mts +1 -1
  74. package/dist/federation/temporal.test.mjs +5 -5
  75. package/dist/federation/webfinger.test.d.mts +1 -1
  76. package/dist/federation/webfinger.test.mjs +7 -7
  77. package/dist/{http-BBkdx4Kd.mjs → http-CT7tcVBN.mjs} +5 -5
  78. package/dist/{http-jCq51U37.cjs → http-D5ylizT7.cjs} +4 -3
  79. package/dist/{http-CphHLbTC.js → http-DD07Erm7.js} +2 -2
  80. package/dist/{key-BBKNHoB9.mjs → key-C3t-PS3M.mjs} +3 -3
  81. package/dist/{keycache-CaOR6NYg.mjs → keycache-_DHqz5z_.mjs} +1 -1
  82. package/dist/{keys-CSYsOMFG.mjs → keys-Dbyd7bhl.mjs} +1 -1
  83. package/dist/{kv-CIvR3Non.mjs → kv-CXBAok3k.mjs} +1 -1
  84. package/dist/{kv-cache-D3KdEZAg.js → kv-cache-Bvv7Wp8h.js} +2 -2
  85. package/dist/{kv-cache-SVUAUYIs.mjs → kv-cache-CK273Baz.mjs} +2 -2
  86. package/dist/{kv-cache-B9Zvq4xB.cjs → kv-cache-DbFdquuM.cjs} +4 -3
  87. package/dist/{ld-DLyXLPDS.mjs → ld-D8wAPjxC.mjs} +4 -4
  88. package/dist/{metrics-BVRrGEXj.mjs → metrics-D1NrDWq-.mjs} +2 -2
  89. package/dist/{middleware-1AyOpRqz.mjs → middleware-BRunoF2v.mjs} +244 -24
  90. package/dist/{middleware-CzWfDAQY.mjs → middleware-CaP0k3AD.mjs} +2 -2
  91. package/dist/{middleware-B1jZw4xB.js → middleware-kQ-qwTDh.js} +249 -7
  92. package/dist/{middleware-DszmUorL.cjs → middleware-nmfhGFtV.cjs} +290 -39
  93. package/dist/{mod-Cmr39iWq.d.ts → mod-DLc2Ot6f.d.ts} +1 -1
  94. package/dist/{mod-B8Efb9qp.d.cts → mod-gOlPDuT8.d.cts} +1 -1
  95. package/dist/mod.cjs +7 -8
  96. package/dist/mod.d.cts +4 -4
  97. package/dist/mod.d.ts +4 -4
  98. package/dist/mod.js +8 -8
  99. package/dist/{mq-03vS-C9P.mjs → mq-llHKivST.mjs} +1 -1
  100. package/dist/{negotiation-m_L2nyS3.mjs → negotiation-RuwrPFqi.mjs} +1 -1
  101. package/dist/nodeinfo/client.test.d.mts +1 -1
  102. package/dist/nodeinfo/client.test.mjs +5 -5
  103. package/dist/nodeinfo/handler.test.d.mts +1 -1
  104. package/dist/nodeinfo/handler.test.mjs +6 -6
  105. package/dist/nodeinfo/mod.cjs +1 -2
  106. package/dist/nodeinfo/mod.js +2 -2
  107. package/dist/nodeinfo/types.test.d.mts +1 -1
  108. package/dist/nodeinfo/types.test.mjs +5 -5
  109. package/dist/otel/exporter.test.d.mts +1 -1
  110. package/dist/otel/exporter.test.mjs +4 -4
  111. package/dist/otel/mod.cjs +1 -2
  112. package/dist/otel/mod.js +1 -1
  113. package/dist/{outgoing-jsonld-BNL8AC14.mjs → outgoing-jsonld-URuqsICz.mjs} +2 -2
  114. package/dist/{owner-BukzQW4T.mjs → owner-BjdNNmKF.mjs} +3 -3
  115. package/dist/{proof-IDHRILpm.js → proof--HiDnLAE.js} +15 -4
  116. package/dist/{proof-BVglyYRW.mjs → proof-1Xy5Ur-T.mjs} +19 -7
  117. package/dist/{proof-DkeR_Fsm.cjs → proof-DcOiiLDF.cjs} +16 -4
  118. package/dist/{public-audience-c9zmYKgA.mjs → public-audience-Cr5MsnMq.mjs} +1 -1
  119. package/dist/{retry-DI4O-zYl.mjs → retry-DgFqeS5k.mjs} +1 -1
  120. package/dist/runtime/mod.cjs +1 -2
  121. package/dist/runtime/mod.js +2 -2
  122. package/dist/{send-D04Hz77b.mjs → send-ClJ4UcZL.mjs} +4 -4
  123. package/dist/sig/accept.test.d.mts +1 -1
  124. package/dist/sig/accept.test.mjs +2 -2
  125. package/dist/sig/http.test.d.mts +1 -1
  126. package/dist/sig/http.test.mjs +10 -10
  127. package/dist/sig/key.test.d.mts +1 -1
  128. package/dist/sig/key.test.mjs +7 -7
  129. package/dist/sig/ld.test.d.mts +1 -1
  130. package/dist/sig/ld.test.mjs +8 -8
  131. package/dist/sig/mod.cjs +2 -3
  132. package/dist/sig/mod.js +3 -3
  133. package/dist/sig/owner.test.d.mts +1 -1
  134. package/dist/sig/owner.test.mjs +7 -7
  135. package/dist/sig/proof.test.d.mts +1 -1
  136. package/dist/sig/proof.test.mjs +146 -9
  137. package/dist/{std__assert-Dh6uLf_q.mjs → std__assert-B2NnY9bq.mjs} +5 -5
  138. package/dist/temporal-polyfill-BCdTHexd.cjs +3565 -0
  139. package/dist/{temporal-xcPM9mxe.mjs → temporal-wA-b1IAz.mjs} +2 -2
  140. package/dist/testing/mod.d.mts +97 -1
  141. package/dist/testing/mod.mjs +3 -3
  142. package/dist/{testing-Dy-WhqpN.mjs → testing-CO7ftO8A.mjs} +3 -3
  143. package/dist/{transformers-NeAONrAq.cjs → transformers-DGwl-hD1.cjs} +1 -2
  144. package/dist/{transformers-BGMIq1cs.js → transformers-DXze6FUB.js} +1 -1
  145. package/dist/{types-KC4QAoxe.cjs → types-CPym83zc.cjs} +1 -2
  146. package/dist/{types-BFowWFTT.mjs → types-CrtdVuDP.mjs} +1 -1
  147. package/dist/{types-CAY3OdLq.js → types-DC1pNgJA.js} +1 -1
  148. package/dist/utils/docloader.test.d.mts +1 -1
  149. package/dist/utils/docloader.test.mjs +8 -8
  150. package/dist/utils/kv-cache.test.d.mts +1 -1
  151. package/dist/utils/kv-cache.test.mjs +2 -2
  152. package/dist/utils/mod.cjs +1 -2
  153. package/dist/utils/mod.js +2 -2
  154. package/dist/vocab/cjs.test.d.mts +1 -1
  155. package/dist/vocab/cjs.test.mjs +14 -1
  156. package/dist/vocab/mod.cjs +0 -1
  157. package/dist/vocab/mod.js +1 -1
  158. package/package.json +8 -8
@@ -1,7 +1,7 @@
1
- import { Temporal } from "@js-temporal/polyfill";
1
+ import { Temporal } from "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { c as getNormalizationContextLoader } from "./ld-DLyXLPDS.mjs";
4
+ import { c as getNormalizationContextLoader } from "./ld-D8wAPjxC.mjs";
5
5
  import jsonld from "@fedify/vocab-runtime/jsonld";
6
6
  //#region src/federation/temporal.ts
7
7
  function isPlainObject(value) {
@@ -1,4 +1,4 @@
1
- import { Temporal } from "@js-temporal/polyfill";
1
+ import { Temporal } from "temporal-polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
3
  import { ExportResultCode } from "@opentelemetry/core";
4
4
  import { Router } from "@fedify/uri-template";
@@ -434,6 +434,35 @@ type InboxListener<TContextData, TActivity extends Activity> = (context: InboxCo
434
434
  * @since 2.2.0
435
435
  */
436
436
  type OutboxListener<TContextData, TActivity extends Activity> = (context: OutboxContext<TContextData>, activity: TActivity) => void | Promise<void>;
437
+ /**
438
+ * A callback that finalizes a media upload posted to the media upload endpoint
439
+ * (the [ActivityPub Media Upload
440
+ * extension](https://www.w3.org/wiki/SocialCG/ActivityPub/MediaUpload)).
441
+ *
442
+ * The return value determines the HTTP response:
443
+ *
444
+ * - Returning a {@link Object} (the resource is fetchable right away) makes the
445
+ * endpoint respond with `201 Created` and a `Location` header pointing at the
446
+ * object's `id`.
447
+ * - Returning a {@link URL} (the resource is still being processed, e.g.
448
+ * transcoding) makes the endpoint respond with `202 Accepted` and a
449
+ * `Location` header pointing at the returned URL.
450
+ *
451
+ * @template TContextData The context data to pass to the {@link Context}.
452
+ * @param context The request context.
453
+ * @param identifier The identifier of the actor whose media upload endpoint
454
+ * received the request.
455
+ * @param file The uploaded file.
456
+ * @param object The parsed ActivityStreams object shell sent alongside the file.
457
+ * Since the client may send any subtype of {@link Object} and the
458
+ * shell lacks an `id`, the callback receives the base
459
+ * {@link Object} and narrows with `instanceof` as needed.
460
+ * @returns The finalized object (`201 Created`) or the URL at which it will
461
+ * become available (`202 Accepted`). It may be returned synchronously
462
+ * or wrapped in a `Promise`.
463
+ * @since 2.4.0
464
+ */
465
+ type MediaUploaderCallback<TContextData> = (context: RequestContext<TContextData>, identifier: string, file: File, object: Object$1) => Object$1 | URL | Promise<Object$1 | URL>;
437
466
  /**
438
467
  * The reason why an incoming activity could not be verified.
439
468
  *
@@ -1524,6 +1553,48 @@ interface Federatable<TContextData> extends TaskRegistry<TContextData> {
1524
1553
  * @since 2.2.0
1525
1554
  */
1526
1555
  setOutboxListeners(outboxPath: `${string}${Rfc6570Expression<"identifier">}${string}`): OutboxListenerSetters<TContextData>;
1556
+ /**
1557
+ * Registers a media upload endpoint for the [ActivityPub Media Upload
1558
+ * extension](https://www.w3.org/wiki/SocialCG/ActivityPub/MediaUpload).
1559
+ * Clients `POST` a `multipart/form-data` request with a `file` part (the
1560
+ * binary payload) and an `object` part (an ActivityStreams object shell) to
1561
+ * this endpoint. The actor should advertise this endpoint under
1562
+ * `endpoints.uploadMedia` using {@link Context.getMediaUploaderUri}.
1563
+ *
1564
+ * @example
1565
+ * ``` typescript
1566
+ * federation
1567
+ * .setMediaUploader(
1568
+ * "/users/{identifier}/media",
1569
+ * async (ctx, identifier, file, object) => {
1570
+ * const stored = await uploadToStorage(file);
1571
+ * return new Image({
1572
+ * id: ctx.getObjectUri(Image, { uuid: stored.uuid }),
1573
+ * url: new URL(stored.publicUrl),
1574
+ * mediaType: file.type,
1575
+ * name: object.name,
1576
+ * });
1577
+ * },
1578
+ * )
1579
+ * .authorize(async (ctx, identifier) => {
1580
+ * return ctx.request.headers.get("authorization") === `Bearer ${identifier}`;
1581
+ * });
1582
+ * ```
1583
+ *
1584
+ * @param path The URI path pattern for the media upload endpoint. The syntax
1585
+ * is based on URI Template
1586
+ * ([RFC 6570](https://tools.ietf.org/html/rfc6570)). The path
1587
+ * must have one variable: `{identifier}`.
1588
+ * @param callback A callback that finalizes the uploaded media and returns
1589
+ * either the created {@link Object} (`201 Created`) or the
1590
+ * {@link URL} at which it will become available
1591
+ * (`202 Accepted`).
1592
+ * @returns An object to configure the media upload endpoint.
1593
+ * @throws {RouterError} Thrown if the path pattern is invalid or a media
1594
+ * uploader is already registered.
1595
+ * @since 2.4.0
1596
+ */
1597
+ setMediaUploader(path: `${string}${Rfc6570Expression<"identifier">}${string}`, callback: MediaUploaderCallback<TContextData>): MediaUploaderSetters<TContextData>;
1527
1598
  /**
1528
1599
  * Registers a following collection dispatcher.
1529
1600
  * @param path The URI path pattern for the following collection. The syntax
@@ -2270,6 +2341,21 @@ interface OutboxListenerSetters<TContextData> {
2270
2341
  */
2271
2342
  authorize(predicate: AuthorizePredicate<TContextData>): OutboxListenerSetters<TContextData>;
2272
2343
  }
2344
+ /**
2345
+ * An object to configure the media upload endpoint registered through
2346
+ * {@link Federatable.setMediaUploader}.
2347
+ * @since 2.4.0
2348
+ */
2349
+ interface MediaUploaderSetters<TContextData> {
2350
+ /**
2351
+ * Registers a callback to authorize requests to the media upload endpoint.
2352
+ *
2353
+ * @param predicate A callback to authorize the request.
2354
+ * @returns The setters object so that settings can be chained.
2355
+ * @since 2.4.0
2356
+ */
2357
+ authorize(predicate: AuthorizePredicate<TContextData>): MediaUploaderSetters<TContextData>;
2358
+ }
2273
2359
  /**
2274
2360
  * Registry for inbox listeners for different activity types.
2275
2361
  */
@@ -2569,6 +2655,16 @@ interface Context<TContextData> {
2569
2655
  * @throws {RouterError} If no outbox dispatcher is available.
2570
2656
  */
2571
2657
  getOutboxUri(identifier: string): URL;
2658
+ /**
2659
+ * Builds the URI of an actor's media upload endpoint with the given
2660
+ * identifier. This is the endpoint advertised under `endpoints.uploadMedia`
2661
+ * in the actor document.
2662
+ * @param identifier The actor's identifier.
2663
+ * @returns The actor's media upload endpoint URI.
2664
+ * @throws {RouterError} If no media uploader is registered.
2665
+ * @since 2.4.0
2666
+ */
2667
+ getMediaUploaderUri(identifier: string): URL;
2572
2668
  /**
2573
2669
  * Builds the URI of the shared inbox.
2574
2670
  * @returns The shared inbox URI.
@@ -1,6 +1,6 @@
1
- import "@js-temporal/polyfill";
1
+ import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { a as testDefinitions, n as createOutboxContext, r as createRequestContext, t as createInboxContext } from "../context-BBRTgkrs.mjs";
5
- import { a as numberSchema, i as makeSchema, n as baseOptions, o as stringSchema, r as envelopeSchema, t as MockQueue } from "../testing-Dy-WhqpN.mjs";
4
+ import { a as testDefinitions, n as createOutboxContext, r as createRequestContext, t as createInboxContext } from "../context-BJXxPElm.mjs";
5
+ import { a as numberSchema, i as makeSchema, n as baseOptions, o as stringSchema, r as envelopeSchema, t as MockQueue } from "../testing-CO7ftO8A.mjs";
6
6
  export { MockQueue, baseOptions, createInboxContext, createOutboxContext, createRequestContext, envelopeSchema, makeSchema, numberSchema, stringSchema, testDefinitions };
@@ -1,8 +1,8 @@
1
- import "@js-temporal/polyfill";
1
+ import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { i as mockDocumentLoader } from "./context-BBRTgkrs.mjs";
5
- import { t as MemoryKvStore } from "./kv-CIvR3Non.mjs";
4
+ import { i as mockDocumentLoader } from "./context-BJXxPElm.mjs";
5
+ import { t as MemoryKvStore } from "./kv-CXBAok3k.mjs";
6
6
  import { Note } from "@fedify/vocab";
7
7
  //#region src/testing/tasks.ts
8
8
  /**
@@ -1,6 +1,5 @@
1
- const { Temporal } = require("@js-temporal/polyfill");
2
1
  const { URLPattern } = require("urlpattern-polyfill");
3
- require("./chunk-DDcVe30Y.cjs");
2
+ require("./chunk-Czpeue4M.cjs");
4
3
  //#region src/compat/transformers.ts
5
4
  const logger = (0, require("@logtape/logtape").getLogger)([
6
5
  "fedify",
@@ -1,4 +1,4 @@
1
- import { Temporal } from "@js-temporal/polyfill";
1
+ import { Temporal } from "temporal-polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
3
  import { getLogger } from "@logtape/logtape";
4
4
  //#region src/compat/transformers.ts
@@ -1,6 +1,5 @@
1
- const { Temporal } = require("@js-temporal/polyfill");
2
1
  const { URLPattern } = require("urlpattern-polyfill");
3
- require("./chunk-DDcVe30Y.cjs");
2
+ require("./chunk-Czpeue4M.cjs");
4
3
  let _logtape_logtape = require("@logtape/logtape");
5
4
  let _fedify_vocab_runtime = require("@fedify/vocab-runtime");
6
5
  //#region src/nodeinfo/client.ts
@@ -1,4 +1,4 @@
1
- import "@js-temporal/polyfill";
1
+ import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  //#region src/nodeinfo/types.ts
@@ -1,4 +1,4 @@
1
- import { Temporal } from "@js-temporal/polyfill";
1
+ import { Temporal } from "temporal-polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
3
  import { getLogger } from "@logtape/logtape";
4
4
  import { getUserAgent } from "@fedify/vocab-runtime";
@@ -1,2 +1,2 @@
1
- import { Temporal } from "@js-temporal/polyfill";
1
+ import { Temporal } from "temporal-polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
@@ -1,13 +1,13 @@
1
- import { Temporal } from "@js-temporal/polyfill";
1
+ import { Temporal } from "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { t as esm_default } from "../esm-vrlUxr60.mjs";
5
- import { t as assertEquals } from "../assert_equals-PBVKNMJd.mjs";
6
- import "../std__assert-Dh6uLf_q.mjs";
7
- import { t as assertRejects } from "../assert_rejects-DAdaaIWM.mjs";
8
- import { l as verifyRequest } from "../http-BBkdx4Kd.mjs";
9
- import { i as rsaPrivateKey2 } from "../keys-CSYsOMFG.mjs";
10
- import { t as getAuthenticatedDocumentLoader } from "../docloader-f1XFaWWh.mjs";
4
+ import { t as esm_default } from "../esm-yYQfPhIY.mjs";
5
+ import { t as assertEquals } from "../assert_equals-BV7oLMxm.mjs";
6
+ import "../std__assert-B2NnY9bq.mjs";
7
+ import { t as assertRejects } from "../assert_rejects-EgstcQy5.mjs";
8
+ import { l as verifyRequest } from "../http-CT7tcVBN.mjs";
9
+ import { i as rsaPrivateKey2 } from "../keys-Dbyd7bhl.mjs";
10
+ import { t as getAuthenticatedDocumentLoader } from "../docloader-C_IefWRb.mjs";
11
11
  import { mockDocumentLoader, test } from "@fedify/fixture";
12
12
  import { UrlError } from "@fedify/vocab-runtime";
13
13
  //#region src/utils/docloader.test.ts
@@ -1,2 +1,2 @@
1
- import { Temporal } from "@js-temporal/polyfill";
1
+ import { Temporal } from "temporal-polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
@@ -1,7 +1,7 @@
1
- import { Temporal } from "@js-temporal/polyfill";
1
+ import { Temporal } from "temporal-polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as kvCache, t as MockKvStore } from "../kv-cache-SVUAUYIs.mjs";
4
+ import { n as kvCache, t as MockKvStore } from "../kv-cache-CK273Baz.mjs";
5
5
  import { deepStrictEqual, throws } from "node:assert";
6
6
  import { createTestMeterProvider, mockDocumentLoader, test } from "@fedify/fixture";
7
7
  import { preloadedContexts } from "@fedify/vocab-runtime";
@@ -1,6 +1,5 @@
1
- const { Temporal } = require("@js-temporal/polyfill");
2
1
  const { URLPattern } = require("urlpattern-polyfill");
3
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
- const require_kv_cache = require("../kv-cache-B9Zvq4xB.cjs");
3
+ const require_kv_cache = require("../kv-cache-DbFdquuM.cjs");
5
4
  exports.getAuthenticatedDocumentLoader = require_kv_cache.getAuthenticatedDocumentLoader;
6
5
  exports.kvCache = require_kv_cache.kvCache;
package/dist/utils/mod.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Temporal } from "@js-temporal/polyfill";
1
+ import { Temporal } from "temporal-polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import { n as getAuthenticatedDocumentLoader, t as kvCache } from "../kv-cache-D3KdEZAg.js";
3
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "../kv-cache-Bvv7Wp8h.js";
4
4
  export { getAuthenticatedDocumentLoader, kvCache };
@@ -1,2 +1,2 @@
1
- import { Temporal } from "@js-temporal/polyfill";
1
+ import { Temporal } from "temporal-polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
@@ -1,4 +1,4 @@
1
- import "@js-temporal/polyfill";
1
+ import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { createRequire } from "node:module";
@@ -10,5 +10,18 @@ test("CommonJS vocab entry exports Object", { ignore: "Deno" in globalThis }, ()
10
10
  strictEqual(typeof vocab.Object, "function");
11
11
  strictEqual(typeof vocab.Update, "function");
12
12
  });
13
+ test("CommonJS entries load Temporal-backed modules", { ignore: "Deno" in globalThis }, () => {
14
+ const originalTemporal = globalThis.Temporal;
15
+ const require = createRequire(import.meta.url);
16
+ const fedify = require("../mod.cjs");
17
+ const federation = require("../federation/mod.cjs");
18
+ const sig = require("../sig/mod.cjs");
19
+ const utils = require("../utils/mod.cjs");
20
+ strictEqual(typeof fedify.createFederation, "function");
21
+ strictEqual(typeof federation.InProcessMessageQueue, "function");
22
+ strictEqual(typeof sig.signRequest, "function");
23
+ strictEqual(typeof utils.kvCache, "function");
24
+ strictEqual(globalThis.Temporal, originalTemporal);
25
+ });
13
26
  //#endregion
14
27
  export {};
@@ -1,4 +1,3 @@
1
- const { Temporal } = require("@js-temporal/polyfill");
2
1
  const { URLPattern } = require("urlpattern-polyfill");
3
2
  var _fedify_vocab = require("@fedify/vocab");
4
3
  Object.keys(_fedify_vocab).forEach(function(k) {
package/dist/vocab/mod.js CHANGED
@@ -1,3 +1,3 @@
1
- import { Temporal } from "@js-temporal/polyfill";
1
+ import { Temporal } from "temporal-polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
3
  export * from "@fedify/vocab";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/fedify",
3
- "version": "2.4.0-dev.1583+1a6f31cb",
3
+ "version": "2.4.0-dev.1618+58858243",
4
4
  "description": "An ActivityPub server framework",
5
5
  "keywords": [
6
6
  "ActivityPub",
@@ -136,7 +136,6 @@
136
136
  }
137
137
  },
138
138
  "dependencies": {
139
- "@js-temporal/polyfill": "^0.5.1",
140
139
  "@logtape/logtape": "^2.2.0",
141
140
  "@opentelemetry/api": "^1.9.1",
142
141
  "@opentelemetry/core": "^2.7.1",
@@ -150,11 +149,12 @@
150
149
  "json-canon": "^1.0.1",
151
150
  "jsonld": "^9.0.0",
152
151
  "structured-field-values": "^2.0.4",
152
+ "temporal-polyfill": "^1.0.1",
153
153
  "urlpattern-polyfill": "^10.1.0",
154
- "@fedify/uri-template": "2.4.0-dev.1583+1a6f31cb",
155
- "@fedify/vocab": "2.4.0-dev.1583+1a6f31cb",
156
- "@fedify/webfinger": "2.4.0-dev.1583+1a6f31cb",
157
- "@fedify/vocab-runtime": "2.4.0-dev.1583+1a6f31cb"
154
+ "@fedify/vocab": "2.4.0-dev.1618+58858243",
155
+ "@fedify/uri-template": "2.4.0-dev.1618+58858243",
156
+ "@fedify/vocab-runtime": "2.4.0-dev.1618+58858243",
157
+ "@fedify/webfinger": "2.4.0-dev.1618+58858243"
158
158
  },
159
159
  "devDependencies": {
160
160
  "@std/assert": "npm:@jsr/std__assert@^0.226.0",
@@ -166,8 +166,8 @@
166
166
  "tsx": "^4.21.0",
167
167
  "typescript": "^6.0.0",
168
168
  "wrangler": "^4.17.0",
169
- "@fedify/vocab-tools": "^2.4.0-dev.1583+1a6f31cb",
170
- "@fedify/fixture": "2.0.0"
169
+ "@fedify/fixture": "2.0.0",
170
+ "@fedify/vocab-tools": "^2.4.0-dev.1618+58858243"
171
171
  },
172
172
  "scripts": {
173
173
  "build:self": "tsdown",