@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.
Files changed (98) hide show
  1. package/dist/{builder-CqPrSnE5.js → builder-B55ClH_D.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-D3QkEtZd.d.cts +2494 -0
  8. package/dist/context-DZJhUmzF.d.ts +2496 -0
  9. package/dist/{deno-CIi8RNND.js → deno-D-Duks4b.js} +1 -1
  10. package/dist/{docloader-CmrEfaGw.js → docloader-Bb4MhBYJ.js} +2 -2
  11. package/dist/federation/builder.test.js +3 -3
  12. package/dist/federation/handler.test.js +19 -19
  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-CCsNu78I.js → http-C3ipH_7H.js} +1 -1
  23. package/dist/http-Cz3MlXAZ.d.cts +244 -0
  24. package/dist/{http-BjroyS-9.cjs → http-DGYGS8C8.cjs} +1 -1
  25. package/dist/http-DkHdFfrc.d.ts +246 -0
  26. package/dist/{http-Dvox_xrq.js → http-DnP0rGKj.js} +2 -2
  27. package/dist/{inbox-CiTdVhJQ.js → inbox-CbNZlhe6.js} +1 -1
  28. package/dist/{key-C7JS89OH.js → key-DChkqRrm.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-Bd2z9in6.cjs} +1 -1
  32. package/dist/{kv-cache-6b2ldIo-.js → kv-cache-CFQBoGCe.js} +1 -1
  33. package/dist/{ld-C8i1kViF.js → ld-CR9Xg8mN.js} +2 -2
  34. package/dist/{middleware-DqJ1cmZE.cjs → middleware-B1XHFs0D.cjs} +8 -83
  35. package/dist/{middleware-B3GuN6Gj.js → middleware-B9frafBa.js} +8 -83
  36. package/dist/middleware-Bt5MUXQg.cjs +12 -0
  37. package/dist/{middleware-0fnsG0v7.js → middleware-ByIcAfxE.js} +11 -11
  38. package/dist/{middleware-CfL_Pd6a.js → middleware-DhlkbIaH.js} +4 -4
  39. package/dist/{middleware-B4Bgz0MJ.js → middleware-OPyIzlKI.js} +14 -89
  40. package/dist/mod-CwZXZJ9d.d.ts +91 -0
  41. package/dist/mod-DPkRU3EK.d.cts +266 -0
  42. package/dist/mod-DUWcVv49.d.ts +268 -0
  43. package/dist/mod-DVwHUI_x.d.cts +80 -0
  44. package/dist/mod-DXsQakeS.d.cts +89 -0
  45. package/dist/mod-Di3W5OdP.d.cts +62 -0
  46. package/dist/mod-DnSsduJF.d.ts +64 -0
  47. package/dist/mod-DosD6NsG.d.ts +82 -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-DfXg2o90.js} +1 -1
  59. package/dist/owner-gd0Q9FuU.d.ts +68 -0
  60. package/dist/{proof-BeT_MFIx.js → proof-BTvHpR2_.js} +2 -2
  61. package/dist/{proof-D61EYfPl.js → proof-CNhYMIct.js} +1 -1
  62. package/dist/{proof-C8qvlfLD.cjs → proof-DnzISmKI.cjs} +1 -1
  63. package/dist/{send-D7lC06r9.js → send-DaEkUvnr.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/testing/mod.d.ts +4 -23
  74. package/dist/utils/docloader.test.js +4 -4
  75. package/dist/utils/mod.cjs +2 -2
  76. package/dist/utils/mod.d.cts +3 -3
  77. package/dist/utils/mod.d.ts +3 -3
  78. package/dist/utils/mod.js +2 -2
  79. package/package.json +5 -5
  80. package/dist/client-CwkOPN13.d.cts +0 -222
  81. package/dist/client-a7NwzhA2.d.ts +0 -224
  82. package/dist/context-BdNW_8a3.d.cts +0 -2554
  83. package/dist/context-C-GVKcJR.d.ts +0 -2556
  84. package/dist/http-CCEu-x1_.d.cts +0 -253
  85. package/dist/http-CODSJcKx.d.ts +0 -255
  86. package/dist/kv-g9jFc34-.d.cts +0 -110
  87. package/dist/kv-jg_8SMc1.d.ts +0 -113
  88. package/dist/middleware-DILzU8Ot.cjs +0 -12
  89. package/dist/mod-5PNty1K9.d.cts +0 -80
  90. package/dist/mod-BcpEGTWV.d.cts +0 -62
  91. package/dist/mod-COO7VMcm.d.cts +0 -266
  92. package/dist/mod-CevNbUol.d.ts +0 -91
  93. package/dist/mod-CtO31FCx.d.ts +0 -64
  94. package/dist/mod-Da9fNDyC.d.ts +0 -82
  95. package/dist/mod-ErTjUJs9.d.cts +0 -89
  96. package/dist/mod-q2IR8UiH.d.ts +0 -268
  97. package/dist/owner-9yZ5Ibsb.d.cts +0 -66
  98. package/dist/owner-DQYAbVmX.d.ts +0 -68
@@ -1,231 +1,231 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import { KvKey, KvStore } from "../kv-jg_8SMc1.js";
3
+ import { KvKey, KvStore } from "../kv-DXEUEP6z.js";
4
4
  import { ExportResultCode } from "@opentelemetry/core";
5
5
  import { ReadableSpan, SpanExporter } from "@opentelemetry/sdk-trace-base";
6
6
 
7
7
  //#region src/otel/exporter.d.ts
8
8
  /**
9
- * The direction of an activity in the trace.
10
- *
11
- * @since 1.10.0
12
- */
9
+ * The direction of an activity in the trace.
10
+ *
11
+ * @since 1.10.0
12
+ */
13
13
  type ActivityDirection = "inbound" | "outbound";
14
14
  /**
15
- * Signature verification details for an inbound activity.
16
- *
17
- * @since 1.10.0
18
- */
15
+ * Signature verification details for an inbound activity.
16
+ *
17
+ * @since 1.10.0
18
+ */
19
19
  interface SignatureVerificationDetails {
20
20
  /**
21
- * Whether HTTP Signatures were verified.
22
- */
21
+ * Whether HTTP Signatures were verified.
22
+ */
23
23
  readonly httpSignaturesVerified: boolean;
24
24
  /**
25
- * The key ID used for HTTP signature verification, if available.
26
- */
25
+ * The key ID used for HTTP signature verification, if available.
26
+ */
27
27
  readonly httpSignaturesKeyId?: string;
28
28
  /**
29
- * Whether Linked Data Signatures were verified.
30
- */
29
+ * Whether Linked Data Signatures were verified.
30
+ */
31
31
  readonly ldSignaturesVerified: boolean;
32
32
  }
33
33
  /**
34
- * A record of an activity captured from a trace span.
35
- * This interface stores the activity data along with trace context
36
- * for distributed tracing support.
37
- *
38
- * @since 1.10.0
39
- */
34
+ * A record of an activity captured from a trace span.
35
+ * This interface stores the activity data along with trace context
36
+ * for distributed tracing support.
37
+ *
38
+ * @since 1.10.0
39
+ */
40
40
  interface TraceActivityRecord {
41
41
  /**
42
- * The trace ID from OpenTelemetry.
43
- */
42
+ * The trace ID from OpenTelemetry.
43
+ */
44
44
  readonly traceId: string;
45
45
  /**
46
- * The span ID from OpenTelemetry.
47
- */
46
+ * The span ID from OpenTelemetry.
47
+ */
48
48
  readonly spanId: string;
49
49
  /**
50
- * The parent span ID, if any.
51
- */
50
+ * The parent span ID, if any.
51
+ */
52
52
  readonly parentSpanId?: string;
53
53
  /**
54
- * Whether this is an inbound or outbound activity.
55
- */
54
+ * Whether this is an inbound or outbound activity.
55
+ */
56
56
  readonly direction: ActivityDirection;
57
57
  /**
58
- * The ActivityPub activity type (e.g., "Create", "Follow", "Like").
59
- */
58
+ * The ActivityPub activity type (e.g., "Create", "Follow", "Like").
59
+ */
60
60
  readonly activityType: string;
61
61
  /**
62
- * The activity's ID URL, if present.
63
- */
62
+ * The activity's ID URL, if present.
63
+ */
64
64
  readonly activityId?: string;
65
65
  /**
66
- * The actor ID URL (sender of the activity).
67
- */
66
+ * The actor ID URL (sender of the activity).
67
+ */
68
68
  readonly actorId?: string;
69
69
  /**
70
- * The full JSON representation of the activity.
71
- */
70
+ * The full JSON representation of the activity.
71
+ */
72
72
  readonly activityJson: string;
73
73
  /**
74
- * Whether the activity was verified (for inbound activities).
75
- */
74
+ * Whether the activity was verified (for inbound activities).
75
+ */
76
76
  readonly verified?: boolean;
77
77
  /**
78
- * Detailed signature verification information (for inbound activities).
79
- */
78
+ * Detailed signature verification information (for inbound activities).
79
+ */
80
80
  readonly signatureDetails?: SignatureVerificationDetails;
81
81
  /**
82
- * The timestamp when this record was created (ISO 8601 format).
83
- */
82
+ * The timestamp when this record was created (ISO 8601 format).
83
+ */
84
84
  readonly timestamp: string;
85
85
  /**
86
- * The target inbox URL (for outbound activities).
87
- */
86
+ * The target inbox URL (for outbound activities).
87
+ */
88
88
  readonly inboxUrl?: string;
89
89
  }
90
90
  /**
91
- * Summary information about a trace.
92
- *
93
- * @since 1.10.0
94
- */
91
+ * Summary information about a trace.
92
+ *
93
+ * @since 1.10.0
94
+ */
95
95
  interface TraceSummary {
96
96
  /**
97
- * The trace ID.
98
- */
97
+ * The trace ID.
98
+ */
99
99
  readonly traceId: string;
100
100
  /**
101
- * The timestamp of the first activity in the trace.
102
- */
101
+ * The timestamp of the first activity in the trace.
102
+ */
103
103
  readonly timestamp: string;
104
104
  /**
105
- * The number of activities in the trace.
106
- */
105
+ * The number of activities in the trace.
106
+ */
107
107
  readonly activityCount: number;
108
108
  /**
109
- * Activity types present in this trace.
110
- */
109
+ * Activity types present in this trace.
110
+ */
111
111
  readonly activityTypes: readonly string[];
112
112
  }
113
113
  /**
114
- * Options for configuring the {@link FedifySpanExporter}.
115
- *
116
- * @since 1.10.0
117
- */
114
+ * Options for configuring the {@link FedifySpanExporter}.
115
+ *
116
+ * @since 1.10.0
117
+ */
118
118
  interface FedifySpanExporterOptions {
119
119
  /**
120
- * The time-to-live for stored trace data.
121
- * If not specified, data will be stored indefinitely
122
- * (or until manually deleted).
123
- */
120
+ * The time-to-live for stored trace data.
121
+ * If not specified, data will be stored indefinitely
122
+ * (or until manually deleted).
123
+ */
124
124
  readonly ttl?: Temporal.Duration;
125
125
  /**
126
- * The key prefix for storing trace data in the KvStore.
127
- * Defaults to `["fedify", "traces"]`.
128
- */
126
+ * The key prefix for storing trace data in the KvStore.
127
+ * Defaults to `["fedify", "traces"]`.
128
+ */
129
129
  readonly keyPrefix?: KvKey;
130
130
  }
131
131
  /**
132
- * Options for the {@link FedifySpanExporter.getRecentTraces} method.
133
- *
134
- * @since 1.10.0
135
- */
132
+ * Options for the {@link FedifySpanExporter.getRecentTraces} method.
133
+ *
134
+ * @since 1.10.0
135
+ */
136
136
  interface GetRecentTracesOptions {
137
137
  /**
138
- * Maximum number of traces to return.
139
- * If not specified, returns all available traces.
140
- */
138
+ * Maximum number of traces to return.
139
+ * If not specified, returns all available traces.
140
+ */
141
141
  limit?: number;
142
142
  }
143
143
  /**
144
- * A SpanExporter that persists ActivityPub activity traces to a
145
- * {@link KvStore}. This enables distributed tracing across multiple
146
- * nodes in a Fedify deployment.
147
- *
148
- * The exporter captures activity data from OpenTelemetry span events
149
- * (`activitypub.activity.received` and `activitypub.activity.sent`)
150
- * and stores them in the KvStore with trace context preserved.
151
- *
152
- * @example Basic usage with MemoryKvStore
153
- * ```typescript ignore
154
- * import { MemoryKvStore } from "@fedify/fedify";
155
- * import { FedifySpanExporter } from "@fedify/fedify/otel";
156
- * import {
157
- * BasicTracerProvider,
158
- * SimpleSpanProcessor,
159
- * } from "@opentelemetry/sdk-trace-base";
160
- *
161
- * const kv = new MemoryKvStore();
162
- * const exporter = new FedifySpanExporter(kv, {
163
- * ttl: Temporal.Duration.from({ hours: 1 }),
164
- * });
165
- *
166
- * const provider = new BasicTracerProvider({
167
- * spanProcessors: [new SimpleSpanProcessor(exporter)],
168
- * });
169
- * ```
170
- *
171
- * @example Querying stored traces
172
- * ```typescript ignore
173
- * import { MemoryKvStore } from "@fedify/fedify";
174
- * import { FedifySpanExporter } from "@fedify/fedify/otel";
175
- *
176
- * const kv = new MemoryKvStore();
177
- * const exporter = new FedifySpanExporter(kv);
178
- * const traceId = "abc123";
179
- *
180
- * // Get all activities for a specific trace
181
- * const activities = await exporter.getActivitiesByTraceId(traceId);
182
- *
183
- * // Get recent traces
184
- * const recentTraces = await exporter.getRecentTraces({ limit: 100 });
185
- * ```
186
- *
187
- * @since 1.10.0
188
- */
144
+ * A SpanExporter that persists ActivityPub activity traces to a
145
+ * {@link KvStore}. This enables distributed tracing across multiple
146
+ * nodes in a Fedify deployment.
147
+ *
148
+ * The exporter captures activity data from OpenTelemetry span events
149
+ * (`activitypub.activity.received` and `activitypub.activity.sent`)
150
+ * and stores them in the KvStore with trace context preserved.
151
+ *
152
+ * @example Basic usage with MemoryKvStore
153
+ * ```typescript ignore
154
+ * import { MemoryKvStore } from "@fedify/fedify";
155
+ * import { FedifySpanExporter } from "@fedify/fedify/otel";
156
+ * import {
157
+ * BasicTracerProvider,
158
+ * SimpleSpanProcessor,
159
+ * } from "@opentelemetry/sdk-trace-base";
160
+ *
161
+ * const kv = new MemoryKvStore();
162
+ * const exporter = new FedifySpanExporter(kv, {
163
+ * ttl: Temporal.Duration.from({ hours: 1 }),
164
+ * });
165
+ *
166
+ * const provider = new BasicTracerProvider({
167
+ * spanProcessors: [new SimpleSpanProcessor(exporter)],
168
+ * });
169
+ * ```
170
+ *
171
+ * @example Querying stored traces
172
+ * ```typescript ignore
173
+ * import { MemoryKvStore } from "@fedify/fedify";
174
+ * import { FedifySpanExporter } from "@fedify/fedify/otel";
175
+ *
176
+ * const kv = new MemoryKvStore();
177
+ * const exporter = new FedifySpanExporter(kv);
178
+ * const traceId = "abc123";
179
+ *
180
+ * // Get all activities for a specific trace
181
+ * const activities = await exporter.getActivitiesByTraceId(traceId);
182
+ *
183
+ * // Get recent traces
184
+ * const recentTraces = await exporter.getRecentTraces({ limit: 100 });
185
+ * ```
186
+ *
187
+ * @since 1.10.0
188
+ */
189
189
  declare class FedifySpanExporter implements SpanExporter {
190
190
  #private;
191
191
  /**
192
- * Creates a new FedifySpanExporter.
193
- *
194
- * @param kv The KvStore to persist trace data to.
195
- * @param options Configuration options.
196
- */
192
+ * Creates a new FedifySpanExporter.
193
+ *
194
+ * @param kv The KvStore to persist trace data to.
195
+ * @param options Configuration options.
196
+ */
197
197
  constructor(kv: KvStore, options?: FedifySpanExporterOptions);
198
198
  /**
199
- * Exports spans to the KvStore.
200
- *
201
- * @param spans The spans to export.
202
- * @param resultCallback Callback to invoke with the export result.
203
- */
199
+ * Exports spans to the KvStore.
200
+ *
201
+ * @param spans The spans to export.
202
+ * @param resultCallback Callback to invoke with the export result.
203
+ */
204
204
  export(spans: ReadableSpan[], resultCallback: (result: {
205
205
  code: ExportResultCode;
206
206
  }) => void): void;
207
207
  /**
208
- * Gets all activity records for a specific trace ID.
209
- *
210
- * @param traceId The trace ID to query.
211
- * @returns An array of activity records belonging to the trace.
212
- */
208
+ * Gets all activity records for a specific trace ID.
209
+ *
210
+ * @param traceId The trace ID to query.
211
+ * @returns An array of activity records belonging to the trace.
212
+ */
213
213
  getActivitiesByTraceId(traceId: string): Promise<TraceActivityRecord[]>;
214
214
  /**
215
- * Gets recent traces with summary information.
216
- *
217
- * @param options Options for the query.
218
- * @returns An array of trace summaries.
219
- */
215
+ * Gets recent traces with summary information.
216
+ *
217
+ * @param options Options for the query.
218
+ * @returns An array of trace summaries.
219
+ */
220
220
  getRecentTraces(options?: GetRecentTracesOptions): Promise<TraceSummary[]>;
221
221
  /**
222
- * Forces the exporter to flush any buffered data.
223
- * This is a no-op because we write directly to the KvStore without buffering.
224
- */
222
+ * Forces the exporter to flush any buffered data.
223
+ * This is a no-op because we write directly to the KvStore without buffering.
224
+ */
225
225
  forceFlush(): Promise<void>;
226
226
  /**
227
- * Shuts down the exporter.
228
- */
227
+ * Shuts down the exporter.
228
+ */
229
229
  shutdown(): Promise<void>;
230
230
  }
231
231
  //#endregion
@@ -0,0 +1,66 @@
1
+ import { Activity, Actor, CryptographicKey } from "@fedify/vocab";
2
+ import { DocumentLoader } from "@fedify/vocab-runtime";
3
+ import { TracerProvider } from "@opentelemetry/api";
4
+
5
+ //#region src/sig/owner.d.ts
6
+ /**
7
+ * Options for {@link doesActorOwnKey}.
8
+ * @since 0.8.0
9
+ */
10
+ interface DoesActorOwnKeyOptions {
11
+ /**
12
+ * The document loader to use for fetching the actor.
13
+ */
14
+ documentLoader?: DocumentLoader;
15
+ /**
16
+ * The context loader to use for JSON-LD context retrieval.
17
+ */
18
+ contextLoader?: DocumentLoader;
19
+ /**
20
+ * The OpenTelemetry tracer provider to use for tracing. If omitted,
21
+ * the global tracer provider is used.
22
+ * @since 1.3.0
23
+ */
24
+ tracerProvider?: TracerProvider;
25
+ }
26
+ /**
27
+ * Checks if the actor of the given activity owns the specified key.
28
+ * @param activity The activity to check.
29
+ * @param key The public key to check.
30
+ * @param options Options for checking the key ownership.
31
+ * @returns Whether the actor is the owner of the key.
32
+ */
33
+ declare function doesActorOwnKey(activity: Activity, key: CryptographicKey, options: DoesActorOwnKeyOptions): Promise<boolean>;
34
+ /**
35
+ * Options for {@link getKeyOwner}.
36
+ * @since 0.8.0
37
+ */
38
+ interface GetKeyOwnerOptions {
39
+ /**
40
+ * The document loader to use for fetching the key and its owner.
41
+ */
42
+ documentLoader?: DocumentLoader;
43
+ /**
44
+ * The context loader to use for JSON-LD context retrieval.
45
+ */
46
+ contextLoader?: DocumentLoader;
47
+ /**
48
+ * The OpenTelemetry tracer provider to use for tracing. If omitted,
49
+ * the global tracer provider is used.
50
+ * @since 1.3.0
51
+ */
52
+ tracerProvider?: TracerProvider;
53
+ }
54
+ /**
55
+ * Gets the actor that owns the specified key. Returns `null` if the key has no
56
+ * known owner.
57
+ *
58
+ * @param keyId The ID of the key to check, or the key itself.
59
+ * @param options Options for getting the key owner.
60
+ * @returns The actor that owns the key, or `null` if the key has no known
61
+ * owner.
62
+ * @since 0.7.0
63
+ */
64
+ declare function getKeyOwner(keyId: URL | CryptographicKey, options: GetKeyOwnerOptions): Promise<Actor | null>;
65
+ //#endregion
66
+ export { DoesActorOwnKeyOptions, GetKeyOwnerOptions, doesActorOwnKey, getKeyOwner };
@@ -3,7 +3,7 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { deno_default } from "./deno-CIi8RNND.js";
6
+ import { deno_default } from "./deno-D-Duks4b.js";
7
7
  import { CryptographicKey, Object as Object$1, isActor } from "@fedify/vocab";
8
8
  import { getDocumentLoader } from "@fedify/vocab-runtime";
9
9
  import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
@@ -0,0 +1,68 @@
1
+ import { Temporal } from "@js-temporal/polyfill";
2
+ import { URLPattern } from "urlpattern-polyfill";
3
+ import { Activity, Actor, CryptographicKey } from "@fedify/vocab";
4
+ import { TracerProvider } from "@opentelemetry/api";
5
+ import { DocumentLoader } from "@fedify/vocab-runtime";
6
+
7
+ //#region src/sig/owner.d.ts
8
+ /**
9
+ * Options for {@link doesActorOwnKey}.
10
+ * @since 0.8.0
11
+ */
12
+ interface DoesActorOwnKeyOptions {
13
+ /**
14
+ * The document loader to use for fetching the actor.
15
+ */
16
+ documentLoader?: DocumentLoader;
17
+ /**
18
+ * The context loader to use for JSON-LD context retrieval.
19
+ */
20
+ contextLoader?: DocumentLoader;
21
+ /**
22
+ * The OpenTelemetry tracer provider to use for tracing. If omitted,
23
+ * the global tracer provider is used.
24
+ * @since 1.3.0
25
+ */
26
+ tracerProvider?: TracerProvider;
27
+ }
28
+ /**
29
+ * Checks if the actor of the given activity owns the specified key.
30
+ * @param activity The activity to check.
31
+ * @param key The public key to check.
32
+ * @param options Options for checking the key ownership.
33
+ * @returns Whether the actor is the owner of the key.
34
+ */
35
+ declare function doesActorOwnKey(activity: Activity, key: CryptographicKey, options: DoesActorOwnKeyOptions): Promise<boolean>;
36
+ /**
37
+ * Options for {@link getKeyOwner}.
38
+ * @since 0.8.0
39
+ */
40
+ interface GetKeyOwnerOptions {
41
+ /**
42
+ * The document loader to use for fetching the key and its owner.
43
+ */
44
+ documentLoader?: DocumentLoader;
45
+ /**
46
+ * The context loader to use for JSON-LD context retrieval.
47
+ */
48
+ contextLoader?: DocumentLoader;
49
+ /**
50
+ * The OpenTelemetry tracer provider to use for tracing. If omitted,
51
+ * the global tracer provider is used.
52
+ * @since 1.3.0
53
+ */
54
+ tracerProvider?: TracerProvider;
55
+ }
56
+ /**
57
+ * Gets the actor that owns the specified key. Returns `null` if the key has no
58
+ * known owner.
59
+ *
60
+ * @param keyId The ID of the key to check, or the key itself.
61
+ * @param options Options for getting the key owner.
62
+ * @returns The actor that owns the key, or `null` if the key has no known
63
+ * owner.
64
+ * @since 0.7.0
65
+ */
66
+ declare function getKeyOwner(keyId: URL | CryptographicKey, options: GetKeyOwnerOptions): Promise<Actor | null>;
67
+ //#endregion
68
+ export { DoesActorOwnKeyOptions, GetKeyOwnerOptions, doesActorOwnKey, getKeyOwner };
@@ -3,8 +3,8 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { deno_default } from "./deno-CIi8RNND.js";
7
- import { fetchKey, validateCryptoKey } from "./key-C7JS89OH.js";
6
+ import { deno_default } from "./deno-D-Duks4b.js";
7
+ import { fetchKey, validateCryptoKey } from "./key-DChkqRrm.js";
8
8
  import { getLogger } from "@logtape/logtape";
9
9
  import { Activity, DataIntegrityProof, Multikey, getTypeId } from "@fedify/vocab";
10
10
  import { SpanStatusCode, trace } from "@opentelemetry/api";
@@ -2,7 +2,7 @@
2
2
  import { Temporal } from "@js-temporal/polyfill";
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
 
5
- import { deno_default, fetchKey, validateCryptoKey } from "./http-CCsNu78I.js";
5
+ import { deno_default, fetchKey, validateCryptoKey } from "./http-C3ipH_7H.js";
6
6
  import { getLogger } from "@logtape/logtape";
7
7
  import { Activity, CryptographicKey, DataIntegrityProof, Multikey, Object as Object$1, getTypeId, isActor } from "@fedify/vocab";
8
8
  import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
@@ -3,7 +3,7 @@
3
3
  const { URLPattern } = require("urlpattern-polyfill");
4
4
 
5
5
  const require_chunk = require('./chunk-CGaQZ11T.cjs');
6
- const require_http = require('./http-BjroyS-9.cjs');
6
+ const require_http = require('./http-DGYGS8C8.cjs');
7
7
  const __logtape_logtape = require_chunk.__toESM(require("@logtape/logtape"));
8
8
  const __fedify_vocab = require_chunk.__toESM(require("@fedify/vocab"));
9
9
  const __opentelemetry_api = require_chunk.__toESM(require("@opentelemetry/api"));
@@ -3,8 +3,8 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { deno_default } from "./deno-CIi8RNND.js";
7
- import { doubleKnock } from "./http-Dvox_xrq.js";
6
+ import { deno_default } from "./deno-D-Duks4b.js";
7
+ import { doubleKnock } from "./http-DnP0rGKj.js";
8
8
  import { getLogger } from "@logtape/logtape";
9
9
  import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
10
10
 
@@ -7,9 +7,9 @@ import { mockDocumentLoader, test } from "../dist-B5f6a8Tt.js";
7
7
  import { assertEquals } from "../assert_equals-DSbWqCm3.js";
8
8
  import { assert } from "../assert-MZs1qjMx.js";
9
9
  import "../assert_instance_of-DHz7EHNU.js";
10
- import "../deno-CIi8RNND.js";
11
- import { exportJwk } from "../key-C7JS89OH.js";
12
- import { createRfc9421SignatureBase, doubleKnock, formatRfc9421Signature, formatRfc9421SignatureParameters, parseRfc9421Signature, parseRfc9421SignatureInput, signRequest, timingSafeEqual, verifyRequest } from "../http-Dvox_xrq.js";
10
+ import "../deno-D-Duks4b.js";
11
+ import { exportJwk } from "../key-DChkqRrm.js";
12
+ import { createRfc9421SignatureBase, doubleKnock, formatRfc9421Signature, formatRfc9421SignatureParameters, parseRfc9421Signature, parseRfc9421SignatureInput, signRequest, timingSafeEqual, verifyRequest } from "../http-DnP0rGKj.js";
13
13
  import { assertExists, assertStringIncludes } from "../std__assert-DWivtrGR.js";
14
14
  import { assertFalse, assertRejects } from "../assert_rejects-Ce45JcFg.js";
15
15
  import { assertThrows } from "../assert_throws-BNXdRGWP.js";
@@ -7,8 +7,8 @@ import { mockDocumentLoader, test } from "../dist-B5f6a8Tt.js";
7
7
  import { assertEquals } from "../assert_equals-DSbWqCm3.js";
8
8
  import "../assert-MZs1qjMx.js";
9
9
  import "../assert_instance_of-DHz7EHNU.js";
10
- import "../deno-CIi8RNND.js";
11
- import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk, validateCryptoKey } from "../key-C7JS89OH.js";
10
+ import "../deno-D-Duks4b.js";
11
+ import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk, validateCryptoKey } from "../key-DChkqRrm.js";
12
12
  import "../std__assert-DWivtrGR.js";
13
13
  import { assertRejects } from "../assert_rejects-Ce45JcFg.js";
14
14
  import { assertThrows } from "../assert_throws-BNXdRGWP.js";
@@ -6,9 +6,9 @@
6
6
  import { mockDocumentLoader, test } from "../dist-B5f6a8Tt.js";
7
7
  import { assertEquals } from "../assert_equals-DSbWqCm3.js";
8
8
  import { assert } from "../assert-MZs1qjMx.js";
9
- import "../deno-CIi8RNND.js";
10
- import { generateCryptoKeyPair } from "../key-C7JS89OH.js";
11
- import { attachSignature, createSignature, detachSignature, signJsonLd, verifyJsonLd, verifySignature } from "../ld-C8i1kViF.js";
9
+ import "../deno-D-Duks4b.js";
10
+ import { generateCryptoKeyPair } from "../key-DChkqRrm.js";
11
+ import { attachSignature, createSignature, detachSignature, signJsonLd, verifyJsonLd, verifySignature } from "../ld-CR9Xg8mN.js";
12
12
  import { assertFalse, assertRejects } from "../assert_rejects-Ce45JcFg.js";
13
13
  import { assertThrows } from "../assert_throws-BNXdRGWP.js";
14
14
  import { ed25519Multikey, ed25519PrivateKey, rsaPrivateKey2, rsaPrivateKey3, rsaPublicKey2, rsaPublicKey3 } from "../keys-ZbcByPg9.js";
package/dist/sig/mod.cjs CHANGED
@@ -2,8 +2,8 @@
2
2
  const { Temporal } = require("@js-temporal/polyfill");
3
3
  const { URLPattern } = require("urlpattern-polyfill");
4
4
 
5
- const require_http = require('../http-BjroyS-9.cjs');
6
- const require_proof = require('../proof-C8qvlfLD.cjs');
5
+ const require_http = require('../http-DGYGS8C8.cjs');
6
+ const require_proof = require('../proof-DnzISmKI.cjs');
7
7
  require('../sig-vX39WyWI.cjs');
8
8
 
9
9
  exports.attachSignature = require_proof.attachSignature;
@@ -1,4 +1,4 @@
1
- import { FetchKeyOptions, FetchKeyResult, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, SignRequestOptions, VerifyRequestOptions, exportJwk, fetchKey, generateCryptoKeyPair, importJwk, signRequest, verifyRequest } from "../http-CCEu-x1_.cjs";
2
- import { DoesActorOwnKeyOptions, GetKeyOwnerOptions, doesActorOwnKey, getKeyOwner } from "../owner-9yZ5Ibsb.cjs";
3
- import { CreateProofOptions, CreateSignatureOptions, SignJsonLdOptions, SignObjectOptions, VerifyJsonLdOptions, VerifyObjectOptions, VerifyProofOptions, VerifySignatureOptions, attachSignature, createProof, createSignature, detachSignature, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "../mod-COO7VMcm.cjs";
1
+ import { FetchKeyOptions, FetchKeyResult, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, SignRequestOptions, VerifyRequestOptions, exportJwk, fetchKey, generateCryptoKeyPair, importJwk, signRequest, verifyRequest } from "../http-Cz3MlXAZ.cjs";
2
+ import { DoesActorOwnKeyOptions, GetKeyOwnerOptions, doesActorOwnKey, getKeyOwner } from "../owner-1AbPBOOZ.cjs";
3
+ import { CreateProofOptions, CreateSignatureOptions, SignJsonLdOptions, SignObjectOptions, VerifyJsonLdOptions, VerifyObjectOptions, VerifyProofOptions, VerifySignatureOptions, attachSignature, createProof, createSignature, detachSignature, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "../mod-DPkRU3EK.cjs";
4
4
  export { CreateProofOptions, CreateSignatureOptions, DoesActorOwnKeyOptions, FetchKeyOptions, FetchKeyResult, GetKeyOwnerOptions, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, SignJsonLdOptions, SignObjectOptions, SignRequestOptions, VerifyJsonLdOptions, VerifyObjectOptions, VerifyProofOptions, VerifyRequestOptions, VerifySignatureOptions, attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, exportJwk, fetchKey, generateCryptoKeyPair, getKeyOwner, importJwk, signJsonLd, signObject, signRequest, verifyJsonLd, verifyObject, verifyProof, verifyRequest, verifySignature };
package/dist/sig/mod.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import { FetchKeyOptions, FetchKeyResult, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, SignRequestOptions, VerifyRequestOptions, exportJwk, fetchKey, generateCryptoKeyPair, importJwk, signRequest, verifyRequest } from "../http-CODSJcKx.js";
4
- import { DoesActorOwnKeyOptions, GetKeyOwnerOptions, doesActorOwnKey, getKeyOwner } from "../owner-DQYAbVmX.js";
5
- import { CreateProofOptions, CreateSignatureOptions, SignJsonLdOptions, SignObjectOptions, VerifyJsonLdOptions, VerifyObjectOptions, VerifyProofOptions, VerifySignatureOptions, attachSignature, createProof, createSignature, detachSignature, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "../mod-q2IR8UiH.js";
3
+ import { FetchKeyOptions, FetchKeyResult, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, SignRequestOptions, VerifyRequestOptions, exportJwk, fetchKey, generateCryptoKeyPair, importJwk, signRequest, verifyRequest } from "../http-DkHdFfrc.js";
4
+ import { DoesActorOwnKeyOptions, GetKeyOwnerOptions, doesActorOwnKey, getKeyOwner } from "../owner-gd0Q9FuU.js";
5
+ import { CreateProofOptions, CreateSignatureOptions, SignJsonLdOptions, SignObjectOptions, VerifyJsonLdOptions, VerifyObjectOptions, VerifyProofOptions, VerifySignatureOptions, attachSignature, createProof, createSignature, detachSignature, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "../mod-DUWcVv49.js";
6
6
  export { CreateProofOptions, CreateSignatureOptions, DoesActorOwnKeyOptions, FetchKeyOptions, FetchKeyResult, GetKeyOwnerOptions, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, SignJsonLdOptions, SignObjectOptions, SignRequestOptions, VerifyJsonLdOptions, VerifyObjectOptions, VerifyProofOptions, VerifyRequestOptions, VerifySignatureOptions, attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, exportJwk, fetchKey, generateCryptoKeyPair, getKeyOwner, importJwk, signJsonLd, signObject, signRequest, verifyJsonLd, verifyObject, verifyProof, verifyRequest, verifySignature };
package/dist/sig/mod.js CHANGED
@@ -2,8 +2,8 @@
2
2
  import { Temporal } from "@js-temporal/polyfill";
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
 
5
- import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk, signRequest, verifyRequest } from "../http-CCsNu78I.js";
6
- import { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, getKeyOwner, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "../proof-D61EYfPl.js";
5
+ import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk, signRequest, verifyRequest } from "../http-C3ipH_7H.js";
6
+ import { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, getKeyOwner, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "../proof-CNhYMIct.js";
7
7
  import "../sig-BNhspNOf.js";
8
8
 
9
9
  export { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, exportJwk, fetchKey, generateCryptoKeyPair, getKeyOwner, importJwk, signJsonLd, signObject, signRequest, verifyJsonLd, verifyObject, verifyProof, verifyRequest, verifySignature };