@fedify/fedify 2.0.1 → 2.0.2-dev.415
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.
- package/dist/{builder-CqPrSnE5.js → builder-B55ClH_D.js} +3 -3
- package/dist/client-BxMZiQaD.d.ts +224 -0
- package/dist/client-C97KOq3x.d.cts +222 -0
- package/dist/compat/mod.d.cts +6 -6
- package/dist/compat/mod.d.ts +6 -6
- package/dist/compat/transformers.test.js +11 -11
- package/dist/context-D3QkEtZd.d.cts +2494 -0
- package/dist/context-DZJhUmzF.d.ts +2496 -0
- package/dist/{deno-CIi8RNND.js → deno-D-Duks4b.js} +1 -1
- package/dist/{docloader-CmrEfaGw.js → docloader-Bb4MhBYJ.js} +2 -2
- package/dist/federation/builder.test.js +3 -3
- package/dist/federation/handler.test.js +19 -19
- package/dist/federation/idempotency.test.js +11 -11
- package/dist/federation/inbox.test.js +2 -2
- package/dist/federation/middleware.test.js +11 -11
- package/dist/federation/mod.cjs +4 -4
- package/dist/federation/mod.d.cts +6 -6
- package/dist/federation/mod.d.ts +6 -6
- package/dist/federation/mod.js +4 -4
- package/dist/federation/send.test.js +5 -5
- package/dist/federation/webfinger.test.js +11 -11
- package/dist/{http-CCsNu78I.js → http-C3ipH_7H.js} +1 -1
- package/dist/http-Cz3MlXAZ.d.cts +244 -0
- package/dist/{http-BjroyS-9.cjs → http-DGYGS8C8.cjs} +1 -1
- package/dist/http-DkHdFfrc.d.ts +246 -0
- package/dist/{http-Dvox_xrq.js → http-DnP0rGKj.js} +2 -2
- package/dist/{inbox-CiTdVhJQ.js → inbox-CbNZlhe6.js} +1 -1
- package/dist/{key-C7JS89OH.js → key-DChkqRrm.js} +1 -1
- package/dist/kv-BL4nlICN.d.cts +110 -0
- package/dist/kv-DXEUEP6z.d.ts +113 -0
- package/dist/{kv-cache-BqFnozz0.cjs → kv-cache-Bd2z9in6.cjs} +1 -1
- package/dist/{kv-cache-6b2ldIo-.js → kv-cache-CFQBoGCe.js} +1 -1
- package/dist/{ld-C8i1kViF.js → ld-CR9Xg8mN.js} +2 -2
- package/dist/{middleware-DqJ1cmZE.cjs → middleware-B1XHFs0D.cjs} +8 -83
- package/dist/{middleware-B3GuN6Gj.js → middleware-B9frafBa.js} +8 -83
- package/dist/middleware-Bt5MUXQg.cjs +12 -0
- package/dist/{middleware-0fnsG0v7.js → middleware-ByIcAfxE.js} +11 -11
- package/dist/{middleware-CfL_Pd6a.js → middleware-DhlkbIaH.js} +4 -4
- package/dist/{middleware-B4Bgz0MJ.js → middleware-OPyIzlKI.js} +14 -89
- package/dist/mod-CwZXZJ9d.d.ts +91 -0
- package/dist/mod-DPkRU3EK.d.cts +266 -0
- package/dist/mod-DUWcVv49.d.ts +268 -0
- package/dist/mod-DVwHUI_x.d.cts +80 -0
- package/dist/mod-DXsQakeS.d.cts +89 -0
- package/dist/mod-Di3W5OdP.d.cts +62 -0
- package/dist/mod-DnSsduJF.d.ts +64 -0
- package/dist/mod-DosD6NsG.d.ts +82 -0
- package/dist/mod.cjs +4 -4
- package/dist/mod.d.cts +9 -9
- package/dist/mod.d.ts +9 -9
- package/dist/mod.js +4 -4
- package/dist/nodeinfo/handler.test.js +11 -11
- package/dist/nodeinfo/mod.d.cts +1 -1
- package/dist/nodeinfo/mod.d.ts +1 -1
- package/dist/otel/mod.d.cts +145 -145
- package/dist/otel/mod.d.ts +145 -145
- package/dist/owner-1AbPBOOZ.d.cts +66 -0
- package/dist/{owner-BOSWh-ha.js → owner-DfXg2o90.js} +1 -1
- package/dist/owner-gd0Q9FuU.d.ts +68 -0
- package/dist/{proof-BeT_MFIx.js → proof-BTvHpR2_.js} +2 -2
- package/dist/{proof-D61EYfPl.js → proof-CNhYMIct.js} +1 -1
- package/dist/{proof-C8qvlfLD.cjs → proof-DnzISmKI.cjs} +1 -1
- package/dist/{send-D7lC06r9.js → send-DaEkUvnr.js} +2 -2
- package/dist/sig/http.test.js +3 -3
- package/dist/sig/key.test.js +2 -2
- package/dist/sig/ld.test.js +3 -3
- package/dist/sig/mod.cjs +2 -2
- package/dist/sig/mod.d.cts +3 -3
- package/dist/sig/mod.d.ts +3 -3
- package/dist/sig/mod.js +2 -2
- package/dist/sig/owner.test.js +3 -3
- package/dist/sig/proof.test.js +3 -3
- package/dist/testing/mod.d.ts +4 -23
- package/dist/utils/docloader.test.js +4 -4
- package/dist/utils/mod.cjs +2 -2
- package/dist/utils/mod.d.cts +3 -3
- package/dist/utils/mod.d.ts +3 -3
- package/dist/utils/mod.js +2 -2
- package/package.json +5 -5
- package/dist/client-CwkOPN13.d.cts +0 -222
- package/dist/client-a7NwzhA2.d.ts +0 -224
- package/dist/context-BdNW_8a3.d.cts +0 -2554
- package/dist/context-C-GVKcJR.d.ts +0 -2556
- package/dist/http-CCEu-x1_.d.cts +0 -253
- package/dist/http-CODSJcKx.d.ts +0 -255
- package/dist/kv-g9jFc34-.d.cts +0 -110
- package/dist/kv-jg_8SMc1.d.ts +0 -113
- package/dist/middleware-DILzU8Ot.cjs +0 -12
- package/dist/mod-5PNty1K9.d.cts +0 -80
- package/dist/mod-BcpEGTWV.d.cts +0 -62
- package/dist/mod-COO7VMcm.d.cts +0 -266
- package/dist/mod-CevNbUol.d.ts +0 -91
- package/dist/mod-CtO31FCx.d.ts +0 -64
- package/dist/mod-Da9fNDyC.d.ts +0 -82
- package/dist/mod-ErTjUJs9.d.cts +0 -89
- package/dist/mod-q2IR8UiH.d.ts +0 -268
- package/dist/owner-9yZ5Ibsb.d.cts +0 -66
- package/dist/owner-DQYAbVmX.d.ts +0 -68
package/dist/otel/mod.d.cts
CHANGED
|
@@ -1,229 +1,229 @@
|
|
|
1
|
-
import { KvKey, KvStore } from "../kv-
|
|
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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
* Signature verification details for an inbound activity.
|
|
14
|
+
*
|
|
15
|
+
* @since 1.10.0
|
|
16
|
+
*/
|
|
17
17
|
interface SignatureVerificationDetails {
|
|
18
18
|
/**
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
* Whether HTTP Signatures were verified.
|
|
20
|
+
*/
|
|
21
21
|
readonly httpSignaturesVerified: boolean;
|
|
22
22
|
/**
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
* The key ID used for HTTP signature verification, if available.
|
|
24
|
+
*/
|
|
25
25
|
readonly httpSignaturesKeyId?: string;
|
|
26
26
|
/**
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
* Whether Linked Data Signatures were verified.
|
|
28
|
+
*/
|
|
29
29
|
readonly ldSignaturesVerified: boolean;
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
|
|
41
|
-
|
|
40
|
+
* The trace ID from OpenTelemetry.
|
|
41
|
+
*/
|
|
42
42
|
readonly traceId: string;
|
|
43
43
|
/**
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
* The span ID from OpenTelemetry.
|
|
45
|
+
*/
|
|
46
46
|
readonly spanId: string;
|
|
47
47
|
/**
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
* The parent span ID, if any.
|
|
49
|
+
*/
|
|
50
50
|
readonly parentSpanId?: string;
|
|
51
51
|
/**
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
* Whether this is an inbound or outbound activity.
|
|
53
|
+
*/
|
|
54
54
|
readonly direction: ActivityDirection;
|
|
55
55
|
/**
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
* The ActivityPub activity type (e.g., "Create", "Follow", "Like").
|
|
57
|
+
*/
|
|
58
58
|
readonly activityType: string;
|
|
59
59
|
/**
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
* The activity's ID URL, if present.
|
|
61
|
+
*/
|
|
62
62
|
readonly activityId?: string;
|
|
63
63
|
/**
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
* The actor ID URL (sender of the activity).
|
|
65
|
+
*/
|
|
66
66
|
readonly actorId?: string;
|
|
67
67
|
/**
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
* The full JSON representation of the activity.
|
|
69
|
+
*/
|
|
70
70
|
readonly activityJson: string;
|
|
71
71
|
/**
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
* Whether the activity was verified (for inbound activities).
|
|
73
|
+
*/
|
|
74
74
|
readonly verified?: boolean;
|
|
75
75
|
/**
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
* Detailed signature verification information (for inbound activities).
|
|
77
|
+
*/
|
|
78
78
|
readonly signatureDetails?: SignatureVerificationDetails;
|
|
79
79
|
/**
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
* The timestamp when this record was created (ISO 8601 format).
|
|
81
|
+
*/
|
|
82
82
|
readonly timestamp: string;
|
|
83
83
|
/**
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
* The target inbox URL (for outbound activities).
|
|
85
|
+
*/
|
|
86
86
|
readonly inboxUrl?: string;
|
|
87
87
|
}
|
|
88
88
|
/**
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
89
|
+
* Summary information about a trace.
|
|
90
|
+
*
|
|
91
|
+
* @since 1.10.0
|
|
92
|
+
*/
|
|
93
93
|
interface TraceSummary {
|
|
94
94
|
/**
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
* The trace ID.
|
|
96
|
+
*/
|
|
97
97
|
readonly traceId: string;
|
|
98
98
|
/**
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
* The timestamp of the first activity in the trace.
|
|
100
|
+
*/
|
|
101
101
|
readonly timestamp: string;
|
|
102
102
|
/**
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
* The number of activities in the trace.
|
|
104
|
+
*/
|
|
105
105
|
readonly activityCount: number;
|
|
106
106
|
/**
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
* Activity types present in this trace.
|
|
108
|
+
*/
|
|
109
109
|
readonly activityTypes: readonly string[];
|
|
110
110
|
}
|
|
111
111
|
/**
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
112
|
+
* Options for configuring the {@link FedifySpanExporter}.
|
|
113
|
+
*
|
|
114
|
+
* @since 1.10.0
|
|
115
|
+
*/
|
|
116
116
|
interface FedifySpanExporterOptions {
|
|
117
117
|
/**
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
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
|
-
|
|
125
|
-
|
|
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
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
130
|
+
* Options for the {@link FedifySpanExporter.getRecentTraces} method.
|
|
131
|
+
*
|
|
132
|
+
* @since 1.10.0
|
|
133
|
+
*/
|
|
134
134
|
interface GetRecentTracesOptions {
|
|
135
135
|
/**
|
|
136
|
-
|
|
137
|
-
|
|
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
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
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
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
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
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
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
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
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
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
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
|
-
|
|
221
|
-
|
|
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
|
-
|
|
226
|
-
|
|
225
|
+
* Shuts down the exporter.
|
|
226
|
+
*/
|
|
227
227
|
shutdown(): Promise<void>;
|
|
228
228
|
}
|
|
229
229
|
//#endregion
|