@fedify/fedify 2.0.1 → 2.0.2-dev.407

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/{builder-CqPrSnE5.js → builder-CmXCvILP.js} +3 -3
  2. package/dist/client-BxMZiQaD.d.ts +224 -0
  3. package/dist/client-C97KOq3x.d.cts +222 -0
  4. package/dist/compat/mod.d.cts +6 -6
  5. package/dist/compat/mod.d.ts +6 -6
  6. package/dist/compat/transformers.test.js +11 -11
  7. package/dist/context-Dy5ro7zD.d.ts +2515 -0
  8. package/dist/context-o4OhjMHe.d.cts +2513 -0
  9. package/dist/{deno-CIi8RNND.js → deno-r4zOZb6i.js} +1 -1
  10. package/dist/{docloader-CmrEfaGw.js → docloader-B3FBDYHA.js} +2 -2
  11. package/dist/federation/builder.test.js +3 -3
  12. package/dist/federation/handler.test.js +11 -11
  13. package/dist/federation/idempotency.test.js +11 -11
  14. package/dist/federation/inbox.test.js +2 -2
  15. package/dist/federation/middleware.test.js +11 -11
  16. package/dist/federation/mod.cjs +4 -4
  17. package/dist/federation/mod.d.cts +6 -6
  18. package/dist/federation/mod.d.ts +6 -6
  19. package/dist/federation/mod.js +4 -4
  20. package/dist/federation/send.test.js +5 -5
  21. package/dist/federation/webfinger.test.js +11 -11
  22. package/dist/{http-Dvox_xrq.js → http-B2qDw-ld.js} +2 -2
  23. package/dist/{http-BjroyS-9.cjs → http-BeDhqNdl.cjs} +1 -1
  24. package/dist/{http-CCsNu78I.js → http-Cu7-n4zt.js} +1 -1
  25. package/dist/http-Cz3MlXAZ.d.cts +244 -0
  26. package/dist/http-DkHdFfrc.d.ts +246 -0
  27. package/dist/{inbox-CiTdVhJQ.js → inbox-COVt7NM_.js} +1 -1
  28. package/dist/{key-C7JS89OH.js → key-D3c7zdQ4.js} +1 -1
  29. package/dist/kv-BL4nlICN.d.cts +110 -0
  30. package/dist/kv-DXEUEP6z.d.ts +113 -0
  31. package/dist/{kv-cache-BqFnozz0.cjs → kv-cache-BXA2Q9DI.cjs} +1 -1
  32. package/dist/{kv-cache-6b2ldIo-.js → kv-cache-CtV4175p.js} +1 -1
  33. package/dist/{ld-C8i1kViF.js → ld-B5-SoHWy.js} +2 -2
  34. package/dist/middleware-BDtfAFen.cjs +12 -0
  35. package/dist/{middleware-DqJ1cmZE.cjs → middleware-BjvalmrW.cjs} +4 -4
  36. package/dist/{middleware-CfL_Pd6a.js → middleware-CyrPv2j3.js} +4 -4
  37. package/dist/{middleware-B3GuN6Gj.js → middleware-D1v2KqML.js} +4 -4
  38. package/dist/{middleware-B4Bgz0MJ.js → middleware-Dp0_BtQF.js} +10 -10
  39. package/dist/{middleware-0fnsG0v7.js → middleware-DsPC0qJ_.js} +11 -11
  40. package/dist/mod-Bm_GwNTL.d.cts +80 -0
  41. package/dist/mod-CIR7gJW8.d.ts +64 -0
  42. package/dist/mod-CwZXZJ9d.d.ts +91 -0
  43. package/dist/mod-DPkRU3EK.d.cts +266 -0
  44. package/dist/mod-DQWhp0xs.d.ts +82 -0
  45. package/dist/mod-DUWcVv49.d.ts +268 -0
  46. package/dist/mod-DXsQakeS.d.cts +89 -0
  47. package/dist/mod-DwqZ5l67.d.cts +62 -0
  48. package/dist/mod.cjs +4 -4
  49. package/dist/mod.d.cts +9 -9
  50. package/dist/mod.d.ts +9 -9
  51. package/dist/mod.js +4 -4
  52. package/dist/nodeinfo/handler.test.js +11 -11
  53. package/dist/nodeinfo/mod.d.cts +1 -1
  54. package/dist/nodeinfo/mod.d.ts +1 -1
  55. package/dist/otel/mod.d.cts +145 -145
  56. package/dist/otel/mod.d.ts +145 -145
  57. package/dist/owner-1AbPBOOZ.d.cts +66 -0
  58. package/dist/{owner-BOSWh-ha.js → owner-KwXXBWZ3.js} +1 -1
  59. package/dist/owner-gd0Q9FuU.d.ts +68 -0
  60. package/dist/{proof-C8qvlfLD.cjs → proof-BcQ-0Eck.cjs} +1 -1
  61. package/dist/{proof-D61EYfPl.js → proof-DqYaOkxv.js} +1 -1
  62. package/dist/{proof-BeT_MFIx.js → proof-S-df7nOa.js} +2 -2
  63. package/dist/{send-D7lC06r9.js → send-BFqsdYMW.js} +2 -2
  64. package/dist/sig/http.test.js +3 -3
  65. package/dist/sig/key.test.js +2 -2
  66. package/dist/sig/ld.test.js +3 -3
  67. package/dist/sig/mod.cjs +2 -2
  68. package/dist/sig/mod.d.cts +3 -3
  69. package/dist/sig/mod.d.ts +3 -3
  70. package/dist/sig/mod.js +2 -2
  71. package/dist/sig/owner.test.js +3 -3
  72. package/dist/sig/proof.test.js +3 -3
  73. package/dist/utils/docloader.test.js +4 -4
  74. package/dist/utils/mod.cjs +2 -2
  75. package/dist/utils/mod.d.cts +3 -3
  76. package/dist/utils/mod.d.ts +3 -3
  77. package/dist/utils/mod.js +2 -2
  78. package/package.json +6 -6
  79. package/dist/client-CwkOPN13.d.cts +0 -222
  80. package/dist/client-a7NwzhA2.d.ts +0 -224
  81. package/dist/context-BdNW_8a3.d.cts +0 -2554
  82. package/dist/context-C-GVKcJR.d.ts +0 -2556
  83. package/dist/http-CCEu-x1_.d.cts +0 -253
  84. package/dist/http-CODSJcKx.d.ts +0 -255
  85. package/dist/kv-g9jFc34-.d.cts +0 -110
  86. package/dist/kv-jg_8SMc1.d.ts +0 -113
  87. package/dist/middleware-DILzU8Ot.cjs +0 -12
  88. package/dist/mod-5PNty1K9.d.cts +0 -80
  89. package/dist/mod-BcpEGTWV.d.cts +0 -62
  90. package/dist/mod-COO7VMcm.d.cts +0 -266
  91. package/dist/mod-CevNbUol.d.ts +0 -91
  92. package/dist/mod-CtO31FCx.d.ts +0 -64
  93. package/dist/mod-Da9fNDyC.d.ts +0 -82
  94. package/dist/mod-ErTjUJs9.d.cts +0 -89
  95. package/dist/mod-q2IR8UiH.d.ts +0 -268
  96. package/dist/owner-9yZ5Ibsb.d.cts +0 -66
  97. package/dist/owner-DQYAbVmX.d.ts +0 -68
@@ -1,229 +1,229 @@
1
- import { KvKey, KvStore } from "../kv-g9jFc34-.cjs";
1
+ import { KvKey, KvStore } from "../kv-BL4nlICN.cjs";
2
2
  import { ReadableSpan, SpanExporter } from "@opentelemetry/sdk-trace-base";
3
3
  import { ExportResultCode } from "@opentelemetry/core";
4
4
 
5
5
  //#region src/otel/exporter.d.ts
6
6
  /**
7
- * The direction of an activity in the trace.
8
- *
9
- * @since 1.10.0
10
- */
7
+ * The direction of an activity in the trace.
8
+ *
9
+ * @since 1.10.0
10
+ */
11
11
  type ActivityDirection = "inbound" | "outbound";
12
12
  /**
13
- * Signature verification details for an inbound activity.
14
- *
15
- * @since 1.10.0
16
- */
13
+ * Signature verification details for an inbound activity.
14
+ *
15
+ * @since 1.10.0
16
+ */
17
17
  interface SignatureVerificationDetails {
18
18
  /**
19
- * Whether HTTP Signatures were verified.
20
- */
19
+ * Whether HTTP Signatures were verified.
20
+ */
21
21
  readonly httpSignaturesVerified: boolean;
22
22
  /**
23
- * The key ID used for HTTP signature verification, if available.
24
- */
23
+ * The key ID used for HTTP signature verification, if available.
24
+ */
25
25
  readonly httpSignaturesKeyId?: string;
26
26
  /**
27
- * Whether Linked Data Signatures were verified.
28
- */
27
+ * Whether Linked Data Signatures were verified.
28
+ */
29
29
  readonly ldSignaturesVerified: boolean;
30
30
  }
31
31
  /**
32
- * A record of an activity captured from a trace span.
33
- * This interface stores the activity data along with trace context
34
- * for distributed tracing support.
35
- *
36
- * @since 1.10.0
37
- */
32
+ * A record of an activity captured from a trace span.
33
+ * This interface stores the activity data along with trace context
34
+ * for distributed tracing support.
35
+ *
36
+ * @since 1.10.0
37
+ */
38
38
  interface TraceActivityRecord {
39
39
  /**
40
- * The trace ID from OpenTelemetry.
41
- */
40
+ * The trace ID from OpenTelemetry.
41
+ */
42
42
  readonly traceId: string;
43
43
  /**
44
- * The span ID from OpenTelemetry.
45
- */
44
+ * The span ID from OpenTelemetry.
45
+ */
46
46
  readonly spanId: string;
47
47
  /**
48
- * The parent span ID, if any.
49
- */
48
+ * The parent span ID, if any.
49
+ */
50
50
  readonly parentSpanId?: string;
51
51
  /**
52
- * Whether this is an inbound or outbound activity.
53
- */
52
+ * Whether this is an inbound or outbound activity.
53
+ */
54
54
  readonly direction: ActivityDirection;
55
55
  /**
56
- * The ActivityPub activity type (e.g., "Create", "Follow", "Like").
57
- */
56
+ * The ActivityPub activity type (e.g., "Create", "Follow", "Like").
57
+ */
58
58
  readonly activityType: string;
59
59
  /**
60
- * The activity's ID URL, if present.
61
- */
60
+ * The activity's ID URL, if present.
61
+ */
62
62
  readonly activityId?: string;
63
63
  /**
64
- * The actor ID URL (sender of the activity).
65
- */
64
+ * The actor ID URL (sender of the activity).
65
+ */
66
66
  readonly actorId?: string;
67
67
  /**
68
- * The full JSON representation of the activity.
69
- */
68
+ * The full JSON representation of the activity.
69
+ */
70
70
  readonly activityJson: string;
71
71
  /**
72
- * Whether the activity was verified (for inbound activities).
73
- */
72
+ * Whether the activity was verified (for inbound activities).
73
+ */
74
74
  readonly verified?: boolean;
75
75
  /**
76
- * Detailed signature verification information (for inbound activities).
77
- */
76
+ * Detailed signature verification information (for inbound activities).
77
+ */
78
78
  readonly signatureDetails?: SignatureVerificationDetails;
79
79
  /**
80
- * The timestamp when this record was created (ISO 8601 format).
81
- */
80
+ * The timestamp when this record was created (ISO 8601 format).
81
+ */
82
82
  readonly timestamp: string;
83
83
  /**
84
- * The target inbox URL (for outbound activities).
85
- */
84
+ * The target inbox URL (for outbound activities).
85
+ */
86
86
  readonly inboxUrl?: string;
87
87
  }
88
88
  /**
89
- * Summary information about a trace.
90
- *
91
- * @since 1.10.0
92
- */
89
+ * Summary information about a trace.
90
+ *
91
+ * @since 1.10.0
92
+ */
93
93
  interface TraceSummary {
94
94
  /**
95
- * The trace ID.
96
- */
95
+ * The trace ID.
96
+ */
97
97
  readonly traceId: string;
98
98
  /**
99
- * The timestamp of the first activity in the trace.
100
- */
99
+ * The timestamp of the first activity in the trace.
100
+ */
101
101
  readonly timestamp: string;
102
102
  /**
103
- * The number of activities in the trace.
104
- */
103
+ * The number of activities in the trace.
104
+ */
105
105
  readonly activityCount: number;
106
106
  /**
107
- * Activity types present in this trace.
108
- */
107
+ * Activity types present in this trace.
108
+ */
109
109
  readonly activityTypes: readonly string[];
110
110
  }
111
111
  /**
112
- * Options for configuring the {@link FedifySpanExporter}.
113
- *
114
- * @since 1.10.0
115
- */
112
+ * Options for configuring the {@link FedifySpanExporter}.
113
+ *
114
+ * @since 1.10.0
115
+ */
116
116
  interface FedifySpanExporterOptions {
117
117
  /**
118
- * The time-to-live for stored trace data.
119
- * If not specified, data will be stored indefinitely
120
- * (or until manually deleted).
121
- */
118
+ * The time-to-live for stored trace data.
119
+ * If not specified, data will be stored indefinitely
120
+ * (or until manually deleted).
121
+ */
122
122
  readonly ttl?: Temporal.Duration;
123
123
  /**
124
- * The key prefix for storing trace data in the KvStore.
125
- * Defaults to `["fedify", "traces"]`.
126
- */
124
+ * The key prefix for storing trace data in the KvStore.
125
+ * Defaults to `["fedify", "traces"]`.
126
+ */
127
127
  readonly keyPrefix?: KvKey;
128
128
  }
129
129
  /**
130
- * Options for the {@link FedifySpanExporter.getRecentTraces} method.
131
- *
132
- * @since 1.10.0
133
- */
130
+ * Options for the {@link FedifySpanExporter.getRecentTraces} method.
131
+ *
132
+ * @since 1.10.0
133
+ */
134
134
  interface GetRecentTracesOptions {
135
135
  /**
136
- * Maximum number of traces to return.
137
- * If not specified, returns all available traces.
138
- */
136
+ * Maximum number of traces to return.
137
+ * If not specified, returns all available traces.
138
+ */
139
139
  limit?: number;
140
140
  }
141
141
  /**
142
- * A SpanExporter that persists ActivityPub activity traces to a
143
- * {@link KvStore}. This enables distributed tracing across multiple
144
- * nodes in a Fedify deployment.
145
- *
146
- * The exporter captures activity data from OpenTelemetry span events
147
- * (`activitypub.activity.received` and `activitypub.activity.sent`)
148
- * and stores them in the KvStore with trace context preserved.
149
- *
150
- * @example Basic usage with MemoryKvStore
151
- * ```typescript ignore
152
- * import { MemoryKvStore } from "@fedify/fedify";
153
- * import { FedifySpanExporter } from "@fedify/fedify/otel";
154
- * import {
155
- * BasicTracerProvider,
156
- * SimpleSpanProcessor,
157
- * } from "@opentelemetry/sdk-trace-base";
158
- *
159
- * const kv = new MemoryKvStore();
160
- * const exporter = new FedifySpanExporter(kv, {
161
- * ttl: Temporal.Duration.from({ hours: 1 }),
162
- * });
163
- *
164
- * const provider = new BasicTracerProvider({
165
- * spanProcessors: [new SimpleSpanProcessor(exporter)],
166
- * });
167
- * ```
168
- *
169
- * @example Querying stored traces
170
- * ```typescript ignore
171
- * import { MemoryKvStore } from "@fedify/fedify";
172
- * import { FedifySpanExporter } from "@fedify/fedify/otel";
173
- *
174
- * const kv = new MemoryKvStore();
175
- * const exporter = new FedifySpanExporter(kv);
176
- * const traceId = "abc123";
177
- *
178
- * // Get all activities for a specific trace
179
- * const activities = await exporter.getActivitiesByTraceId(traceId);
180
- *
181
- * // Get recent traces
182
- * const recentTraces = await exporter.getRecentTraces({ limit: 100 });
183
- * ```
184
- *
185
- * @since 1.10.0
186
- */
142
+ * A SpanExporter that persists ActivityPub activity traces to a
143
+ * {@link KvStore}. This enables distributed tracing across multiple
144
+ * nodes in a Fedify deployment.
145
+ *
146
+ * The exporter captures activity data from OpenTelemetry span events
147
+ * (`activitypub.activity.received` and `activitypub.activity.sent`)
148
+ * and stores them in the KvStore with trace context preserved.
149
+ *
150
+ * @example Basic usage with MemoryKvStore
151
+ * ```typescript ignore
152
+ * import { MemoryKvStore } from "@fedify/fedify";
153
+ * import { FedifySpanExporter } from "@fedify/fedify/otel";
154
+ * import {
155
+ * BasicTracerProvider,
156
+ * SimpleSpanProcessor,
157
+ * } from "@opentelemetry/sdk-trace-base";
158
+ *
159
+ * const kv = new MemoryKvStore();
160
+ * const exporter = new FedifySpanExporter(kv, {
161
+ * ttl: Temporal.Duration.from({ hours: 1 }),
162
+ * });
163
+ *
164
+ * const provider = new BasicTracerProvider({
165
+ * spanProcessors: [new SimpleSpanProcessor(exporter)],
166
+ * });
167
+ * ```
168
+ *
169
+ * @example Querying stored traces
170
+ * ```typescript ignore
171
+ * import { MemoryKvStore } from "@fedify/fedify";
172
+ * import { FedifySpanExporter } from "@fedify/fedify/otel";
173
+ *
174
+ * const kv = new MemoryKvStore();
175
+ * const exporter = new FedifySpanExporter(kv);
176
+ * const traceId = "abc123";
177
+ *
178
+ * // Get all activities for a specific trace
179
+ * const activities = await exporter.getActivitiesByTraceId(traceId);
180
+ *
181
+ * // Get recent traces
182
+ * const recentTraces = await exporter.getRecentTraces({ limit: 100 });
183
+ * ```
184
+ *
185
+ * @since 1.10.0
186
+ */
187
187
  declare class FedifySpanExporter implements SpanExporter {
188
188
  #private;
189
189
  /**
190
- * Creates a new FedifySpanExporter.
191
- *
192
- * @param kv The KvStore to persist trace data to.
193
- * @param options Configuration options.
194
- */
190
+ * Creates a new FedifySpanExporter.
191
+ *
192
+ * @param kv The KvStore to persist trace data to.
193
+ * @param options Configuration options.
194
+ */
195
195
  constructor(kv: KvStore, options?: FedifySpanExporterOptions);
196
196
  /**
197
- * Exports spans to the KvStore.
198
- *
199
- * @param spans The spans to export.
200
- * @param resultCallback Callback to invoke with the export result.
201
- */
197
+ * Exports spans to the KvStore.
198
+ *
199
+ * @param spans The spans to export.
200
+ * @param resultCallback Callback to invoke with the export result.
201
+ */
202
202
  export(spans: ReadableSpan[], resultCallback: (result: {
203
203
  code: ExportResultCode;
204
204
  }) => void): void;
205
205
  /**
206
- * Gets all activity records for a specific trace ID.
207
- *
208
- * @param traceId The trace ID to query.
209
- * @returns An array of activity records belonging to the trace.
210
- */
206
+ * Gets all activity records for a specific trace ID.
207
+ *
208
+ * @param traceId The trace ID to query.
209
+ * @returns An array of activity records belonging to the trace.
210
+ */
211
211
  getActivitiesByTraceId(traceId: string): Promise<TraceActivityRecord[]>;
212
212
  /**
213
- * Gets recent traces with summary information.
214
- *
215
- * @param options Options for the query.
216
- * @returns An array of trace summaries.
217
- */
213
+ * Gets recent traces with summary information.
214
+ *
215
+ * @param options Options for the query.
216
+ * @returns An array of trace summaries.
217
+ */
218
218
  getRecentTraces(options?: GetRecentTracesOptions): Promise<TraceSummary[]>;
219
219
  /**
220
- * Forces the exporter to flush any buffered data.
221
- * This is a no-op because we write directly to the KvStore without buffering.
222
- */
220
+ * Forces the exporter to flush any buffered data.
221
+ * This is a no-op because we write directly to the KvStore without buffering.
222
+ */
223
223
  forceFlush(): Promise<void>;
224
224
  /**
225
- * Shuts down the exporter.
226
- */
225
+ * Shuts down the exporter.
226
+ */
227
227
  shutdown(): Promise<void>;
228
228
  }
229
229
  //#endregion