@fedify/fedify 2.1.0-dev.403 → 2.1.0-dev.406

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-CuPNOHve.js → builder-Ceg4JUD6.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-DK6kn7CL.js → deno-Bh21mp4s.js} +1 -1
  10. package/dist/{docloader-BdXqU3vd.js → docloader-B7fpGJry.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-BOqeWHl7.cjs → http-BSRs7RTl.cjs} +1 -1
  23. package/dist/{http-wjIWw7-A.js → http-CaADVgbC.js} +2 -2
  24. package/dist/http-Cz3MlXAZ.d.cts +244 -0
  25. package/dist/{http-DNQvZ8Zy.js → http-DWfg569c.js} +1 -1
  26. package/dist/http-DkHdFfrc.d.ts +246 -0
  27. package/dist/{inbox-t_CJsqtd.js → inbox-CShBXNsf.js} +1 -1
  28. package/dist/{key-Dg-Vsv-T.js → key-ChkqyM82.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-xD2Wcz7w.js → kv-cache-CT2vvbEO.js} +1 -1
  32. package/dist/{kv-cache-C4Zk5YEK.cjs → kv-cache-DsUK-UP5.cjs} +1 -1
  33. package/dist/{ld-D1jwNhWH.js → ld-67OFE4t0.js} +2 -2
  34. package/dist/{middleware-B3Z0H6M9.js → middleware-BlIdJC8u.js} +4 -4
  35. package/dist/{middleware-dccmUjJS.js → middleware-C5TQnF1z.js} +11 -11
  36. package/dist/{middleware-BkLZfMGP.js → middleware-DNHuC0hF.js} +4 -4
  37. package/dist/{middleware-DGskGzrk.cjs → middleware-Dcu_5VnY.cjs} +4 -4
  38. package/dist/{middleware-HK2bX-AT.js → middleware-GlA3q9EF.js} +10 -10
  39. package/dist/middleware-jXp8HjPA.cjs +12 -0
  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-bWYw-QTG.js → owner-DqSLIMcb.js} +1 -1
  59. package/dist/owner-gd0Q9FuU.d.ts +68 -0
  60. package/dist/{proof-DNvyDay_.cjs → proof-BlZvXuOl.cjs} +1 -1
  61. package/dist/{proof-DoktWuY2.js → proof-CO10OtuW.js} +1 -1
  62. package/dist/{proof-CB89TdYZ.js → proof-DbbuUNG4.js} +2 -2
  63. package/dist/{send-Dfds_HYn.js → send-Cn3AMQkR.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-CqEcHhpB.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,82 +0,0 @@
1
- import { Temporal } from "@js-temporal/polyfill";
2
- import { URLPattern } from "urlpattern-polyfill";
3
- import { ActivityTransformer, Context } from "./context-C-GVKcJR.js";
4
- import { Activity } from "@fedify/vocab";
5
-
6
- //#region src/compat/transformers.d.ts
7
-
8
- /**
9
- * An activity transformer that assigns a new random ID to an activity if it
10
- * does not already have one. This is useful for ensuring that activities
11
- * have an ID before they are sent to other servers.
12
- *
13
- * The generated ID is an origin URI with a fragment which contains an activity
14
- * type name with a random UUID:
15
- *
16
- * ```
17
- * https://example.com/#Follow/12345678-1234-5678-1234-567812345678
18
- * ```
19
- *
20
- * @template TContextData The type of the context data.
21
- * @param activity The activity to assign an ID to.
22
- * @param context The context of the activity.
23
- * @return The activity with an ID assigned.
24
- * @since 1.4.0
25
- */
26
- declare function autoIdAssigner<TContextData>(activity: Activity, context: Context<TContextData>): Activity;
27
- /**
28
- * An activity transformer that dehydrates the actor property of an activity
29
- * so that it only contains the actor's URI. For example, suppose we have an
30
- * activity like this:
31
- *
32
- * ```typescript
33
- * import { Follow, Person } from "@fedify/vocab";
34
- * const input = new Follow({
35
- * id: new URL("http://example.com/activities/1"),
36
- * actor: new Person({
37
- * id: new URL("http://example.com/actors/1"),
38
- * name: "Alice",
39
- * preferredUsername: "alice",
40
- * }),
41
- * object: new Person({
42
- * id: new URL("http://example.com/actors/2"),
43
- * name: "Bob",
44
- * preferredUsername: "bob",
45
- * }),
46
- * });
47
- * ```
48
- *
49
- * The result of applying this transformer would be:
50
- *
51
- * ```typescript
52
- * import { Follow, Person } from "@fedify/vocab";
53
- * const output = new Follow({
54
- * id: new URL("http://example.com/activities/1"),
55
- * actor: new URL("http://example.com/actors/1"),
56
- * object: new Person({
57
- * id: new URL("http://example.com/actors/2"),
58
- * name: "Bob",
59
- * preferredUsername: "bob",
60
- * }),
61
- * });
62
- * ```
63
- *
64
- * As some ActivityPub implementations like Threads fail to deal with inlined
65
- * actor objects, this transformer can be used to work around this issue.
66
- * @template TContextData The type of the context data.
67
- * @param activity The activity to dehydrate the actor property of.
68
- * @param context The context of the activity.
69
- * @returns The dehydrated activity.
70
- * @since 1.4.0
71
- */
72
- declare function actorDehydrator<TContextData>(activity: Activity, _context: Context<TContextData>): Activity;
73
- /**
74
- * Gets the default activity transformers that are applied to all outgoing
75
- * activities.
76
- * @template TContextData The type of the context data.
77
- * @returns The default activity transformers.
78
- * @since 1.4.0
79
- */
80
- declare function getDefaultActivityTransformers<TContextData>(): readonly ActivityTransformer<TContextData>[];
81
- //#endregion
82
- export { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers };
@@ -1,89 +0,0 @@
1
- import { HttpMessageSignaturesSpecDeterminer } from "./http-CCEu-x1_.cjs";
2
- import { KvKey, KvStore } from "./kv-g9jFc34-.cjs";
3
- import { DocumentLoader, DocumentLoaderFactoryOptions } from "@fedify/vocab-runtime";
4
- import { TracerProvider } from "@opentelemetry/api";
5
-
6
- //#region src/utils/docloader.d.ts
7
- /**
8
- * Options for {@link getAuthenticatedDocumentLoader}.
9
- * @see {@link getAuthenticatedDocumentLoader}
10
- * @since 1.3.0
11
- */
12
- interface GetAuthenticatedDocumentLoaderOptions extends DocumentLoaderFactoryOptions {
13
- /**
14
- * An optional spec determiner for HTTP Message Signatures.
15
- * It determines the spec to use for signing requests.
16
- * It is used for double-knocking
17
- * (see <https://swicg.github.io/activitypub-http-signature/#how-to-upgrade-supported-versions>).
18
- * @since 1.6.0
19
- */
20
- specDeterminer?: HttpMessageSignaturesSpecDeterminer;
21
- /**
22
- * The OpenTelemetry tracer provider. If omitted, the global tracer provider
23
- * is used.
24
- * @since 1.6.0
25
- */
26
- tracerProvider?: TracerProvider;
27
- }
28
- /**
29
- * Gets an authenticated {@link DocumentLoader} for the given identity.
30
- * Note that an authenticated document loader intentionally does not cache
31
- * the fetched documents.
32
- * @param identity The identity to get the document loader for.
33
- * The actor's key pair.
34
- * @param options The options for the document loader.
35
- * @returns The authenticated document loader.
36
- * @throws {TypeError} If the key is invalid or unsupported.
37
- * @since 0.4.0
38
- */
39
- declare function getAuthenticatedDocumentLoader(identity: {
40
- keyId: URL;
41
- privateKey: CryptoKey;
42
- }, {
43
- allowPrivateAddress,
44
- userAgent,
45
- specDeterminer,
46
- tracerProvider
47
- }?: GetAuthenticatedDocumentLoaderOptions): DocumentLoader;
48
- //#endregion
49
- //#region src/utils/kv-cache.d.ts
50
- /**
51
- * The parameters for {@link kvCache} function.
52
- */
53
- interface KvCacheParameters {
54
- /**
55
- * The document loader to decorate with a cache.
56
- */
57
- readonly loader: DocumentLoader;
58
- /**
59
- * The key–value store to use for backing the cache.
60
- */
61
- readonly kv: KvStore;
62
- /**
63
- * The key prefix to use for namespacing the cache.
64
- * `["_fedify", "remoteDocument"]` by default.
65
- */
66
- readonly prefix?: KvKey;
67
- /**
68
- * The per-URL cache rules in the array of `[urlPattern, duration]` pairs
69
- * where `urlPattern` is either a string, a {@link URL}, or
70
- * a {@link URLPattern} and `duration` is a {@link Temporal.DurationLike}.
71
- * The `duration` is allowed to be at most 30 days.
72
- *
73
- * By default, 5 minutes for all URLs.
74
- */
75
- readonly rules?: readonly [string | URL | URLPattern, Temporal.Duration | Temporal.DurationLike][];
76
- }
77
- /**
78
- * Decorates a {@link DocumentLoader} with a cache backed by a {@link KvStore}.
79
- * @param parameters The parameters for the cache.
80
- * @returns The decorated document loader which is cache-enabled.
81
- */
82
- declare function kvCache({
83
- loader,
84
- kv,
85
- prefix,
86
- rules
87
- }: KvCacheParameters): DocumentLoader;
88
- //#endregion
89
- export { getAuthenticatedDocumentLoader, kvCache };
@@ -1,268 +0,0 @@
1
- import { Temporal } from "@js-temporal/polyfill";
2
- import { URLPattern } from "urlpattern-polyfill";
3
- import { KeyCache } from "./http-CODSJcKx.js";
4
- import { CryptographicKey, DataIntegrityProof, Multikey, Object as Object$1 } from "@fedify/vocab";
5
- import { TracerProvider } from "@opentelemetry/api";
6
- import { DocumentLoader } from "@fedify/vocab-runtime";
7
-
8
- //#region src/sig/ld.d.ts
9
- /**
10
- * A signature of a JSON-LD document.
11
- * @since 1.0.0
12
- */
13
- interface Signature {
14
- "@context"?: "https://w3id.org/identity/v1";
15
- type: "RsaSignature2017";
16
- id?: string;
17
- creator: string;
18
- created: string;
19
- signatureValue: string;
20
- }
21
- /**
22
- * Attaches a LD signature to the given JSON-LD document.
23
- * @param jsonLd The JSON-LD document to attach the signature to. It is not
24
- * modified.
25
- * @param signature The signature to attach.
26
- * @returns The JSON-LD document with the attached signature.
27
- * @throws {TypeError} If the input document is not a valid JSON-LD document.
28
- * @since 1.0.0
29
- */
30
- declare function attachSignature(jsonLd: unknown, signature: Signature): {
31
- signature: Signature;
32
- };
33
- /**
34
- * Options for creating Linked Data Signatures.
35
- * @since 1.0.0
36
- */
37
- interface CreateSignatureOptions {
38
- /**
39
- * The context loader for loading remote JSON-LD contexts.
40
- */
41
- contextLoader?: DocumentLoader;
42
- /**
43
- * The time when the signature was created. If not specified, the current
44
- * time will be used.
45
- */
46
- created?: Temporal.Instant;
47
- }
48
- /**
49
- * Creates a LD signature for the given JSON-LD document.
50
- * @param jsonLd The JSON-LD document to sign.
51
- * @param privateKey The private key to sign the document.
52
- * @param keyId The ID of the public key that corresponds to the private key.
53
- * @param options Additional options for creating the signature.
54
- * See also {@link CreateSignatureOptions}.
55
- * @return The created signature.
56
- * @throws {TypeError} If the private key is invalid or unsupported.
57
- * @since 1.0.0
58
- */
59
- declare function createSignature(jsonLd: unknown, privateKey: CryptoKey, keyId: URL, {
60
- contextLoader,
61
- created
62
- }?: CreateSignatureOptions): Promise<Signature>;
63
- /**
64
- * Options for signing JSON-LD documents.
65
- * @since 1.0.0
66
- */
67
- interface SignJsonLdOptions extends CreateSignatureOptions {
68
- /**
69
- * The OpenTelemetry tracer provider for tracing the signing process.
70
- * If omitted, the global tracer provider is used.
71
- * @since 1.3.0
72
- */
73
- tracerProvider?: TracerProvider;
74
- }
75
- /**
76
- * Signs the given JSON-LD document with the private key and returns the signed
77
- * JSON-LD document.
78
- * @param jsonLd The JSON-LD document to sign.
79
- * @param privateKey The private key to sign the document.
80
- * @param keyId The key ID to use in the signature. It will be used by the
81
- * verifier to fetch the corresponding public key.
82
- * @param options Additional options for signing the document.
83
- * See also {@link SignJsonLdOptions}.
84
- * @returns The signed JSON-LD document.
85
- * @throws {TypeError} If the private key is invalid or unsupported.
86
- * @since 1.0.0
87
- */
88
- declare function signJsonLd(jsonLd: unknown, privateKey: CryptoKey, keyId: URL, options: SignJsonLdOptions): Promise<{
89
- signature: Signature;
90
- }>;
91
- /**
92
- * Detaches Linked Data Signatures from the given JSON-LD document.
93
- * @param jsonLd The JSON-LD document to modify.
94
- * @returns The modified JSON-LD document. If the input document does not
95
- * contain a signature, the original document is returned.
96
- * @since 1.0.0
97
- */
98
- declare function detachSignature(jsonLd: unknown): unknown;
99
- /**
100
- * Options for verifying Linked Data Signatures.
101
- * @since 1.0.0
102
- */
103
- interface VerifySignatureOptions {
104
- /**
105
- * The document loader to use for fetching the public key.
106
- */
107
- documentLoader?: DocumentLoader;
108
- /**
109
- * The context loader to use for JSON-LD context retrieval.
110
- */
111
- contextLoader?: DocumentLoader;
112
- /**
113
- * The key cache to use for caching public keys.
114
- */
115
- keyCache?: KeyCache;
116
- /**
117
- * The OpenTelemetry tracer provider for tracing the verification process.
118
- * If omitted, the global tracer provider is used.
119
- * @since 1.3.0
120
- */
121
- tracerProvider?: TracerProvider;
122
- }
123
- /**
124
- * Verifies Linked Data Signatures of the given JSON-LD document.
125
- * @param jsonLd The JSON-LD document to verify.
126
- * @param options Options for verifying the signature.
127
- * @returns The public key that signed the document or `null` if the signature
128
- * is invalid or the key is not found.
129
- * @since 1.0.0
130
- */
131
- declare function verifySignature(jsonLd: unknown, options?: VerifySignatureOptions): Promise<CryptographicKey | null>;
132
- /**
133
- * Options for verifying JSON-LD documents.
134
- */
135
- interface VerifyJsonLdOptions extends VerifySignatureOptions {}
136
- /**
137
- * Verify the authenticity of the given JSON-LD document using Linked Data
138
- * Signatures. If the document is signed, this function verifies the signature
139
- * and checks if the document is attributed to the owner of the public key.
140
- * If the document is not signed, this function returns `false`.
141
- * @param jsonLd The JSON-LD document to verify.
142
- * @param options Options for verifying the document.
143
- * @returns `true` if the document is authentic; `false` otherwise.
144
- */
145
- declare function verifyJsonLd(jsonLd: unknown, options?: VerifyJsonLdOptions): Promise<boolean>;
146
- //#endregion
147
- //#region src/sig/proof.d.ts
148
- /**
149
- * Options for {@link createProof}.
150
- * @since 0.10.0
151
- */
152
- interface CreateProofOptions {
153
- /**
154
- * The context loader for loading remote JSON-LD contexts.
155
- */
156
- contextLoader?: DocumentLoader;
157
- /**
158
- * The JSON-LD context to use for serializing the object to sign.
159
- */
160
- context?: string | Record<string, string> | (string | Record<string, string>)[];
161
- /**
162
- * The time when the proof was created. If not specified, the current time
163
- * will be used.
164
- */
165
- created?: Temporal.Instant;
166
- }
167
- /**
168
- * Creates a proof for the given object.
169
- * @param object The object to create a proof for.
170
- * @param privateKey The private key to sign the proof with.
171
- * @param keyId The key ID to use in the proof. It will be used by the verifier.
172
- * @param options Additional options. See also {@link CreateProofOptions}.
173
- * @returns The created proof.
174
- * @throws {TypeError} If the private key is invalid or unsupported.
175
- * @since 0.10.0
176
- */
177
- declare function createProof(object: Object$1, privateKey: CryptoKey, keyId: URL, {
178
- contextLoader,
179
- context,
180
- created
181
- }?: CreateProofOptions): Promise<DataIntegrityProof>;
182
- /**
183
- * Options for {@link signObject}.
184
- * @since 0.10.0
185
- */
186
- interface SignObjectOptions extends CreateProofOptions {
187
- /**
188
- * The document loader for loading remote JSON-LD documents.
189
- */
190
- documentLoader?: DocumentLoader;
191
- /**
192
- * The OpenTelemetry tracer provider. If omitted, the global tracer provider
193
- * is used.
194
- * @since 1.3.0
195
- */
196
- tracerProvider?: TracerProvider;
197
- }
198
- /**
199
- * Signs the given object with the private key and returns the signed object.
200
- * @param object The object to create a proof for.
201
- * @param privateKey The private key to sign the proof with.
202
- * @param keyId The key ID to use in the proof. It will be used by the verifier.
203
- * @param options Additional options. See also {@link SignObjectOptions}.
204
- * @returns The signed object.
205
- * @throws {TypeError} If the private key is invalid or unsupported.
206
- * @since 0.10.0
207
- */
208
- declare function signObject<T extends Object$1>(object: T, privateKey: CryptoKey, keyId: URL, options?: SignObjectOptions): Promise<T>;
209
- /**
210
- * Options for {@link verifyProof}.
211
- * @since 0.10.0
212
- */
213
- interface VerifyProofOptions {
214
- /**
215
- * The context loader for loading remote JSON-LD contexts.
216
- */
217
- contextLoader?: DocumentLoader;
218
- /**
219
- * The document loader for loading remote JSON-LD documents.
220
- */
221
- documentLoader?: DocumentLoader;
222
- /**
223
- * The key cache to use for caching public keys.
224
- * @since 0.12.0
225
- */
226
- keyCache?: KeyCache;
227
- /**
228
- * The OpenTelemetry tracer provider. If omitted, the global tracer provider
229
- * is used.
230
- * @since 1.3.0
231
- */
232
- tracerProvider?: TracerProvider;
233
- }
234
- /**
235
- * Verifies the given proof for the object.
236
- * @param jsonLd The JSON-LD object to verify the proof for. If it contains
237
- * any proofs, they will be ignored.
238
- * @param proof The proof to verify.
239
- * @param options Additional options. See also {@link VerifyProofOptions}.
240
- * @returns The public key that was used to sign the proof, or `null` if the
241
- * proof is invalid.
242
- * @since 0.10.0
243
- */
244
- declare function verifyProof(jsonLd: unknown, proof: DataIntegrityProof, options?: VerifyProofOptions): Promise<Multikey | null>;
245
- /**
246
- * Options for {@link verifyObject}.
247
- * @since 0.10.0
248
- */
249
- interface VerifyObjectOptions extends VerifyProofOptions {}
250
- /**
251
- * Verifies the given object. It will verify all the proofs in the object,
252
- * and succeed only if all the proofs are valid and all attributions and
253
- * actors are authenticated by the proofs.
254
- * @template T The type of the object to verify.
255
- * @param cls The class of the object to verify. It must be a subclass of
256
- * the {@link Object}.
257
- * @param jsonLd The JSON-LD object to verify. It's assumed that the object
258
- * is a compacted JSON-LD representation of a `T` with `@context`.
259
- * @param options Additional options. See also {@link VerifyObjectOptions}.
260
- * @returns The object if it's verified, or `null` if it's not.
261
- * @throws {TypeError} If the object is invalid or unsupported.
262
- * @since 0.10.0
263
- */
264
- declare function verifyObject<T extends Object$1>(cls: (new (...args: any[]) => T) & {
265
- fromJsonLd(jsonLd: unknown, options: VerifyObjectOptions): Promise<T>;
266
- }, jsonLd: unknown, options?: VerifyObjectOptions): Promise<T | null>;
267
- //#endregion
268
- export { CreateProofOptions, CreateSignatureOptions, SignJsonLdOptions, SignObjectOptions, VerifyJsonLdOptions, VerifyObjectOptions, VerifyProofOptions, VerifySignatureOptions, attachSignature, createProof, createSignature, detachSignature, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature };
@@ -1,66 +0,0 @@
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 };
@@ -1,68 +0,0 @@
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 };