@drfed/graphql 0.0.0-stage → 0.1.0-dev.561
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/LICENSE +661 -0
- package/README.md +254 -2
- package/dist/account.d.mts +6 -0
- package/dist/account.d.mts.map +1 -0
- package/dist/account.mjs +168 -0
- package/dist/account.mjs.map +1 -0
- package/dist/activity-delivery/entry.d.mts +6 -0
- package/dist/activity-delivery/entry.d.mts.map +1 -0
- package/dist/activity-delivery/entry.mjs +291 -0
- package/dist/activity-delivery/entry.mjs.map +1 -0
- package/dist/actor-BJvviz6Q.mjs +600 -0
- package/dist/actor-BJvviz6Q.mjs.map +1 -0
- package/dist/actor.d.mts +7 -0
- package/dist/actor.d.mts.map +1 -0
- package/dist/actor.mjs +2 -0
- package/dist/builder-BLioFAdv.mjs +152 -0
- package/dist/builder-BLioFAdv.mjs.map +1 -0
- package/dist/builder-CSxRffRp.d.mts +134 -0
- package/dist/builder-CSxRffRp.d.mts.map +1 -0
- package/dist/builder.d.mts +2 -0
- package/dist/builder.mjs +2 -0
- package/dist/classification.d.mts +62 -0
- package/dist/classification.d.mts.map +1 -0
- package/dist/classification.mjs +65 -0
- package/dist/classification.mjs.map +1 -0
- package/dist/index.d.mts +55 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +86 -0
- package/dist/index.mjs.map +1 -0
- package/dist/instance.d.mts +32 -0
- package/dist/instance.d.mts.map +1 -0
- package/dist/instance.mjs +176 -0
- package/dist/instance.mjs.map +1 -0
- package/dist/object.d.mts +6 -0
- package/dist/object.d.mts.map +1 -0
- package/dist/object.mjs +321 -0
- package/dist/object.mjs.map +1 -0
- package/dist/readable-CSN0MPlO.mjs +140 -0
- package/dist/readable-CSN0MPlO.mjs.map +1 -0
- package/dist/schema-ZeV-COPn.mjs +275 -0
- package/dist/schema-ZeV-COPn.mjs.map +1 -0
- package/dist/schema.d.mts +11 -0
- package/dist/schema.d.mts.map +1 -0
- package/dist/schema.mjs +2 -0
- package/package.json +154 -3
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
import { n as builder } from "../builder-BLioFAdv.mjs";
|
|
2
|
+
import { a as readableResource, o as viewableInstance } from "../readable-CSN0MPlO.mjs";
|
|
3
|
+
import { activityDeliveryDirectionEnum } from "@drfed/models/schema";
|
|
4
|
+
import { drizzleConnectionHelpers } from "@pothos/plugin-drizzle";
|
|
5
|
+
//#region src/activity-delivery/entry.ts
|
|
6
|
+
const ActivityDeliveryDirection = builder.enumType("ActivityDeliveryDirection", {
|
|
7
|
+
description: "Whether DrFed received the delivery or made it.",
|
|
8
|
+
values: activityDeliveryDirectionEnum.enumValues
|
|
9
|
+
});
|
|
10
|
+
const ActivityDeliveryStatus = builder.enumType("ActivityDeliveryStatus", {
|
|
11
|
+
description: "What became of a delivery. Inbound values follow the response DrFed gave, a request whose handling threw counting as refused; outbound values follow the delivery attempt.",
|
|
12
|
+
values: {
|
|
13
|
+
received: { description: "Inbound: answered 2xx and the inbox listener ran." },
|
|
14
|
+
acknowledged: { description: "Inbound: answered 2xx without running the inbox listener, e.g. a duplicate of an already processed activity or an unsupported type." },
|
|
15
|
+
unverified: { description: "Inbound: refused, and no signature or proof was verified." },
|
|
16
|
+
rejected: { description: "Inbound: refused although a signature or proof was verified." },
|
|
17
|
+
queued: { description: "Outbound: started, and no attempt has ended yet." },
|
|
18
|
+
sent: { description: "Outbound: the remote inbox accepted the delivery." },
|
|
19
|
+
failed: { description: "Outbound: the latest attempt failed. With a message queue, it may still be retried." },
|
|
20
|
+
permanently_failed: { description: "Outbound: given up without further retries, because the remote inbox answered with a permanent failure status, or because the circuit breaker for its host held the delivery too long." },
|
|
21
|
+
abandoned: { description: "Outbound: the retry policy ran out after the latest attempt failed." }
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
const VerificationMechanism = builder.enumType("ActivityDeliveryVerificationMechanism", {
|
|
25
|
+
description: "How an inbound activity was authenticated. Not to be confused with FEP-8b32's `verificationMethod`, which is a key.",
|
|
26
|
+
values: {
|
|
27
|
+
http_signature: { description: "The HTTP request signature." },
|
|
28
|
+
ld_signature: { description: "Linked Data Signatures (`signature`)." },
|
|
29
|
+
object_integrity_proof: { description: "FEP-8b32 Object Integrity Proofs (`proof`)." }
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
const VerificationResult = builder.enumType("ActivityDeliveryVerificationResult", {
|
|
33
|
+
description: "What Fedify reported of verifying an inbound activity, as it verified it. Whether the activity was accepted is `ActivityDelivery.status`.",
|
|
34
|
+
values: {
|
|
35
|
+
verified: { description: "A signature or proof was verified." },
|
|
36
|
+
invalid_signature: { description: "A signature or proof was present and did not verify." },
|
|
37
|
+
key_fetch_error: { description: "Fedify reported a failure fetching the key a signature or proof names." },
|
|
38
|
+
no_signature: { description: "Nothing to verify was found." },
|
|
39
|
+
unattempted: { description: "Fedify stopped before checking a signature or proof, e.g. a body that is not JSON or an unknown inbox." },
|
|
40
|
+
unobserved: { description: "Recording the observation failed; the mechanism is unknown." }
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
const ActivityDeliveryFilter = builder.inputType("ActivityDeliveryFilter", { fields: (t) => ({
|
|
44
|
+
direction: t.field({ type: ActivityDeliveryDirection }),
|
|
45
|
+
status: t.field({ type: ActivityDeliveryStatus }),
|
|
46
|
+
type: t.string()
|
|
47
|
+
}) });
|
|
48
|
+
function decodeUtf8(body) {
|
|
49
|
+
if (body == null) return null;
|
|
50
|
+
try {
|
|
51
|
+
return new TextDecoder("utf-8", { fatal: true }).decode(body);
|
|
52
|
+
} catch {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
const access = (localId) => localId == null ? false : { $any: {
|
|
57
|
+
admin: true,
|
|
58
|
+
localInstanceMember: localId
|
|
59
|
+
} };
|
|
60
|
+
builder.drizzleObject("activityDeliveryAttempts", {
|
|
61
|
+
name: "ActivityDeliveryAttempt",
|
|
62
|
+
description: "One ended attempt of an outbound delivery.",
|
|
63
|
+
fields: (t) => ({
|
|
64
|
+
uuid: t.expose("id", { type: "UUID" }),
|
|
65
|
+
succeeded: t.exposeBoolean("succeeded"),
|
|
66
|
+
statusCode: t.exposeInt("statusCode", {
|
|
67
|
+
nullable: true,
|
|
68
|
+
description: "The status the remote inbox answered the attempt with. Null when no response came, as for a network error."
|
|
69
|
+
}),
|
|
70
|
+
responseBody: t.exposeString("responseBody", {
|
|
71
|
+
nullable: true,
|
|
72
|
+
description: "What the remote inbox answered a failed attempt, with U+FFFD for each U+0000, which PostgreSQL cannot store."
|
|
73
|
+
}),
|
|
74
|
+
error: t.exposeString("error", {
|
|
75
|
+
nullable: true,
|
|
76
|
+
description: "Why the attempt failed, including the causes of a network error. Null for a success."
|
|
77
|
+
}),
|
|
78
|
+
created: t.expose("created", {
|
|
79
|
+
type: "DateTime",
|
|
80
|
+
description: "When the attempt ended."
|
|
81
|
+
})
|
|
82
|
+
})
|
|
83
|
+
});
|
|
84
|
+
const ActivityDelivery = builder.drizzleNode("activityDeliveries", {
|
|
85
|
+
name: "ActivityDelivery",
|
|
86
|
+
select: { with: { instance: { columns: { localId: true } } } },
|
|
87
|
+
authScopes: (delivery) => access(delivery.instance.localId),
|
|
88
|
+
runScopesOnType: true,
|
|
89
|
+
id: { column: (delivery) => delivery.id },
|
|
90
|
+
fields: (t) => ({
|
|
91
|
+
uuid: t.expose("id", { type: "UUID" }),
|
|
92
|
+
instance: t.relation("instance"),
|
|
93
|
+
actor: t.relation("actor", {
|
|
94
|
+
nullable: true,
|
|
95
|
+
description: "The owner of the inbox the request arrived at, or the sending actor. Null for the shared inbox, and for a deleted actor."
|
|
96
|
+
}),
|
|
97
|
+
direction: t.expose("direction", { type: ActivityDeliveryDirection }),
|
|
98
|
+
status: t.expose("status", {
|
|
99
|
+
type: ActivityDeliveryStatus,
|
|
100
|
+
description: "The outcome of the delivery. Inbound, it follows the response DrFed gave, not `verificationResult`."
|
|
101
|
+
}),
|
|
102
|
+
verificationMechanism: t.expose("verificationMechanism", {
|
|
103
|
+
type: VerificationMechanism,
|
|
104
|
+
nullable: true,
|
|
105
|
+
description: "Inbound: the mechanism that verified the activity, or the last one Fedify tried. Null when Fedify tried none, when recording failed, and for outbound deliveries."
|
|
106
|
+
}),
|
|
107
|
+
verificationResult: t.expose("verificationResult", {
|
|
108
|
+
type: VerificationResult,
|
|
109
|
+
nullable: true,
|
|
110
|
+
description: "Inbound: what verifying found. Null for outbound deliveries."
|
|
111
|
+
}),
|
|
112
|
+
type: t.exposeString("type", {
|
|
113
|
+
nullable: true,
|
|
114
|
+
description: "The one type the activity resolved to; see `types`."
|
|
115
|
+
}),
|
|
116
|
+
types: t.exposeStringList("types", { description: "Every type the activity declares." }),
|
|
117
|
+
activityIri: t.expose("activityIri", {
|
|
118
|
+
type: "URL",
|
|
119
|
+
nullable: true
|
|
120
|
+
}),
|
|
121
|
+
activity: t.relation("activity", {
|
|
122
|
+
nullable: true,
|
|
123
|
+
query: (_, ctx) => ({ where: { RAW: (table) => readableResource(ctx, table.id) } }),
|
|
124
|
+
description: "The stored activity `activityIri` names, for an inbound delivery that was verified and accepted, or a delivery DrFed sent. Null when the activity has no ID, did not meet the rules for storing it, the delivery was not verified, or the viewer may not read the activity."
|
|
125
|
+
}),
|
|
126
|
+
objectType: t.exposeString("objectType", { nullable: true }),
|
|
127
|
+
objectIri: t.expose("objectIri", {
|
|
128
|
+
type: "URL",
|
|
129
|
+
nullable: true
|
|
130
|
+
}),
|
|
131
|
+
signedKeyIri: t.expose("signedKeyIri", {
|
|
132
|
+
type: "URL",
|
|
133
|
+
nullable: true,
|
|
134
|
+
description: "The `keyId` the HTTP signature declares. It may differ from the IRI of `verificationKey` when another mechanism verified the activity."
|
|
135
|
+
}),
|
|
136
|
+
verificationKey: t.relation("verificationKey", {
|
|
137
|
+
nullable: true,
|
|
138
|
+
description: "The public key version `verificationMechanism` actually used, even when it failed. Its presence does not imply success; consult `verificationResult`."
|
|
139
|
+
}),
|
|
140
|
+
remoteActorIri: t.expose("remoteActorIri", {
|
|
141
|
+
type: "URL",
|
|
142
|
+
nullable: true
|
|
143
|
+
}),
|
|
144
|
+
remoteHost: t.exposeString("remoteHost", { nullable: true }),
|
|
145
|
+
inboxUrl: t.expose("inboxUrl", {
|
|
146
|
+
type: "URL",
|
|
147
|
+
description: "The canonical IRI of the inbox, however the request spelled it; see `requestUrl`."
|
|
148
|
+
}),
|
|
149
|
+
requestUrl: t.expose("requestUrl", {
|
|
150
|
+
type: "URL",
|
|
151
|
+
nullable: true,
|
|
152
|
+
description: "Inbound: the URL the request actually arrived at."
|
|
153
|
+
}),
|
|
154
|
+
requestHeaders: t.expose("headers", {
|
|
155
|
+
type: "JSON",
|
|
156
|
+
nullable: true,
|
|
157
|
+
description: "Inbound: the request headers as `[name, value]` pairs with lowercase names; their original order and case are not kept. `cookie` is left out, and `authorization` is whole only for the `Signature` scheme."
|
|
158
|
+
}),
|
|
159
|
+
rawBody: t.string({
|
|
160
|
+
nullable: true,
|
|
161
|
+
description: "Inbound: the request body as received, when it is valid UTF-8; otherwise read `rawBodyBase64`.",
|
|
162
|
+
select: { columns: { body: true } },
|
|
163
|
+
resolve: (delivery) => decodeUtf8(delivery.body)
|
|
164
|
+
}),
|
|
165
|
+
rawBodyBase64: t.string({
|
|
166
|
+
nullable: true,
|
|
167
|
+
description: "Inbound: the octets of the request body, in Base64.",
|
|
168
|
+
select: { columns: { body: true } },
|
|
169
|
+
resolve: (delivery) => delivery.body?.toString("base64") ?? null
|
|
170
|
+
}),
|
|
171
|
+
statusCode: t.exposeInt("statusCode", {
|
|
172
|
+
nullable: true,
|
|
173
|
+
description: "Inbound: what DrFed answered; null when handling the request threw. Outbound: what the remote inbox answered the latest attempt; null when no response came."
|
|
174
|
+
}),
|
|
175
|
+
responseBody: t.exposeString("responseBody", {
|
|
176
|
+
nullable: true,
|
|
177
|
+
description: "Inbound: what DrFed answered; null when handling the request threw. Outbound: what the remote inbox answered the latest failed attempt, with U+FFFD for each U+0000, which PostgreSQL cannot store."
|
|
178
|
+
}),
|
|
179
|
+
error: t.exposeString("error", {
|
|
180
|
+
nullable: true,
|
|
181
|
+
description: "Why a refused or failed delivery ended that way, which for an inbound request whose handling threw is the exception. Null for accepted ones unless verification observation failed."
|
|
182
|
+
}),
|
|
183
|
+
attempts: t.relatedConnection("attempts", {
|
|
184
|
+
query: { orderBy: {
|
|
185
|
+
created: "asc",
|
|
186
|
+
id: "asc"
|
|
187
|
+
} },
|
|
188
|
+
description: "Outbound: each attempt that ended, oldest first, including the retries of a queued delivery. Empty for inbound deliveries."
|
|
189
|
+
}),
|
|
190
|
+
payload: t.expose("payload", {
|
|
191
|
+
type: "JSON",
|
|
192
|
+
nullable: true,
|
|
193
|
+
description: "Inbound: `rawBody` parsed as JSON, which loses key order, whitespace and duplicate keys; null when it does not parse, when it holds U+0000 or an unpaired surrogate, which PostgreSQL cannot store, and for a literal JSON null. Outbound: the compact JSON-LD before signing, without `bto` and `bcc`, so it lacks the `proof` and `signature` the remote server received. May contain unverified remote input and private recipients."
|
|
194
|
+
}),
|
|
195
|
+
recipientIris: t.expose("recipientIris", {
|
|
196
|
+
type: ["URL"],
|
|
197
|
+
description: "Outbound: every recipient sharing the inbox, including those named by `bto` and `bcc`."
|
|
198
|
+
}),
|
|
199
|
+
created: t.expose("created", {
|
|
200
|
+
type: "DateTime",
|
|
201
|
+
description: "Inbound: when the request arrived, before it was verified and handled. Outbound: when DrFed started the delivery. Deliveries are ordered by it."
|
|
202
|
+
}),
|
|
203
|
+
completed: t.expose("completed", {
|
|
204
|
+
type: "DateTime",
|
|
205
|
+
nullable: true,
|
|
206
|
+
description: "Inbound: when DrFed answered the request. Outbound: when `status` last changed. Null while an outbound delivery is `queued`."
|
|
207
|
+
})
|
|
208
|
+
})
|
|
209
|
+
});
|
|
210
|
+
const deliveryWhere = (filter) => ({
|
|
211
|
+
...filter?.direction == null ? {} : { direction: filter.direction },
|
|
212
|
+
...filter?.status == null ? {} : { status: filter.status },
|
|
213
|
+
...filter?.type == null ? {} : { type: filter.type }
|
|
214
|
+
});
|
|
215
|
+
const deliveriesConnection = drizzleConnectionHelpers(builder, "activityDeliveries", { query: ({ filter }) => ({
|
|
216
|
+
where: deliveryWhere(filter),
|
|
217
|
+
orderBy: {
|
|
218
|
+
created: "desc",
|
|
219
|
+
id: "desc"
|
|
220
|
+
}
|
|
221
|
+
}) });
|
|
222
|
+
const actorDeliveriesConnection = drizzleConnectionHelpers(builder, "activityDeliveryActors", {
|
|
223
|
+
query: ({ filter }) => ({
|
|
224
|
+
where: { delivery: deliveryWhere(filter) },
|
|
225
|
+
orderBy: {
|
|
226
|
+
created: "desc",
|
|
227
|
+
deliveryId: "desc"
|
|
228
|
+
}
|
|
229
|
+
}),
|
|
230
|
+
select: (nestedSelection) => ({ with: {
|
|
231
|
+
delivery: nestedSelection(),
|
|
232
|
+
collections: { orderBy: { collectionIri: "asc" } }
|
|
233
|
+
} }),
|
|
234
|
+
resolveNode: (link) => link.delivery
|
|
235
|
+
});
|
|
236
|
+
builder.drizzleObjectField("instances", "activityDeliveries", (t) => t.connection({
|
|
237
|
+
type: ActivityDelivery,
|
|
238
|
+
args: { filter: t.arg({ type: ActivityDeliveryFilter }) },
|
|
239
|
+
description: "Delivery observations, newest first. Restricted to local instance members and administrators.",
|
|
240
|
+
select: (args, ctx, nestedSelection) => ({
|
|
241
|
+
columns: { localId: true },
|
|
242
|
+
with: { activityDeliveries: deliveriesConnection.getQuery(args, ctx, nestedSelection) }
|
|
243
|
+
}),
|
|
244
|
+
resolve: (instance, args, ctx) => deliveriesConnection.resolve(instance.activityDeliveries, args, ctx, instance),
|
|
245
|
+
authScopes: (instance) => access(instance.localId)
|
|
246
|
+
}));
|
|
247
|
+
const activityDeliveriesConnection = drizzleConnectionHelpers(builder, "activityDeliveries", { query: ({ filter }, ctx) => ({
|
|
248
|
+
where: {
|
|
249
|
+
...deliveryWhere(filter),
|
|
250
|
+
RAW: (table) => viewableInstance(ctx, table.instanceId)
|
|
251
|
+
},
|
|
252
|
+
orderBy: {
|
|
253
|
+
created: "desc",
|
|
254
|
+
id: "desc"
|
|
255
|
+
}
|
|
256
|
+
}) });
|
|
257
|
+
builder.drizzleObjectField("activities", "deliveries", (t) => t.connection({
|
|
258
|
+
type: ActivityDelivery,
|
|
259
|
+
args: { filter: t.arg({ type: ActivityDeliveryFilter }) },
|
|
260
|
+
description: "Deliveries of this activity, newest first: those it arrived in, verified and accepted, and those DrFed sent it in. Only those of the local instances the viewer is a member of, or of every one for an administrator.",
|
|
261
|
+
select: (args, ctx, nestedSelection) => ({ with: { deliveries: activityDeliveriesConnection.getQuery(args, ctx, nestedSelection) } }),
|
|
262
|
+
resolve: (activity, args, ctx) => activityDeliveriesConnection.resolve(activity.deliveries, args, ctx, activity)
|
|
263
|
+
}));
|
|
264
|
+
builder.drizzleObjectField("actors", "activityDeliveries", (t) => t.connection({
|
|
265
|
+
type: ActivityDelivery,
|
|
266
|
+
args: { filter: t.arg({ type: ActivityDeliveryFilter }) },
|
|
267
|
+
description: "Deliveries that concern this local actor, newest first: those that arrived at its inbox, those it sent, and those addressed to it through any inbox, directly or as a member of an addressed collection. Collection membership counts only as far as DrFed has stored it. Each edge tells how the delivery concerns the actor. Restricted to instance members and administrators.",
|
|
268
|
+
select: (args, ctx, nestedSelection) => ({
|
|
269
|
+
columns: { localId: true },
|
|
270
|
+
with: {
|
|
271
|
+
instance: { columns: { localId: true } },
|
|
272
|
+
activityDeliveryLinks: actorDeliveriesConnection.getQuery(args, ctx, nestedSelection)
|
|
273
|
+
}
|
|
274
|
+
}),
|
|
275
|
+
resolve: (actor, args, ctx) => actorDeliveriesConnection.resolve(actor.activityDeliveryLinks, args, ctx, actor),
|
|
276
|
+
authScopes: (actor) => actor.localId == null ? false : access(actor.instance.localId)
|
|
277
|
+
}, {}, { fields: (edge) => ({
|
|
278
|
+
inboxOwner: edge.exposeBoolean("inboxOwner", { description: "Whether the delivery arrived at this actor's inbox." }),
|
|
279
|
+
sender: edge.exposeBoolean("sender", { description: "Whether this actor sent the delivery." }),
|
|
280
|
+
addressed: edge.exposeBoolean("addressed", { description: "Whether the activity addressed this actor, directly or through a collection." }),
|
|
281
|
+
addressedDirectly: edge.exposeBoolean("addressedDirectly", { description: "Whether the activity addressed this actor by its IRI." }),
|
|
282
|
+
viaCollections: edge.field({
|
|
283
|
+
type: ["URL"],
|
|
284
|
+
description: "The addressed collections this actor was a member of when the delivery arrived, as far as DrFed had stored them, in IRI order. Empty when no collection addressed it.",
|
|
285
|
+
resolve: (link) => link.collections.map(({ collectionIri }) => collectionIri)
|
|
286
|
+
})
|
|
287
|
+
}) }));
|
|
288
|
+
//#endregion
|
|
289
|
+
export { ActivityDelivery };
|
|
290
|
+
|
|
291
|
+
//# sourceMappingURL=entry.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entry.mjs","names":[],"sources":["../../src/activity-delivery/entry.ts"],"sourcesContent":["// DrFed: A web-based platform for developing and debugging ActivityPub apps\n// Copyright (C) 2026 DrFed team\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see <https://www.gnu.org/licenses/>.\n\nimport {\n activityDeliveryDirectionEnum,\n activityDeliveryStatusEnum,\n activityDeliveryVerificationMechanismEnum,\n activityDeliveryVerificationResultEnum,\n} from \"@drfed/models/schema\";\nimport type { Uuid } from \"@drfed/models/uuid\";\nimport { drizzleConnectionHelpers } from \"@pothos/plugin-drizzle\";\n\nimport builder, { type DrFedObjectRef } from \"../builder.ts\";\nimport { readableResource, viewableInstance } from \"../readable.ts\";\n\nconst ActivityDeliveryDirection = builder.enumType(\n \"ActivityDeliveryDirection\",\n {\n description: \"Whether DrFed received the delivery or made it.\",\n values: activityDeliveryDirectionEnum.enumValues,\n },\n);\nconst ActivityDeliveryStatus = builder.enumType(\"ActivityDeliveryStatus\", {\n description:\n \"What became of a delivery. Inbound values follow the response DrFed \" +\n \"gave, a request whose handling threw counting as refused; outbound \" +\n \"values follow the delivery attempt.\",\n values: {\n received: {\n description: \"Inbound: answered 2xx and the inbox listener ran.\",\n },\n acknowledged: {\n description:\n \"Inbound: answered 2xx without running the inbox listener, e.g. a \" +\n \"duplicate of an already processed activity or an unsupported type.\",\n },\n unverified: {\n description: \"Inbound: refused, and no signature or proof was verified.\",\n },\n rejected: {\n description:\n \"Inbound: refused although a signature or proof was verified.\",\n },\n queued: {\n description: \"Outbound: started, and no attempt has ended yet.\",\n },\n sent: { description: \"Outbound: the remote inbox accepted the delivery.\" },\n failed: {\n description:\n \"Outbound: the latest attempt failed. With a message queue, it may \" +\n \"still be retried.\",\n },\n permanently_failed: {\n description:\n \"Outbound: given up without further retries, because the remote \" +\n \"inbox answered with a permanent failure status, or because the \" +\n \"circuit breaker for its host held the delivery too long.\",\n },\n abandoned: {\n description:\n \"Outbound: the retry policy ran out after the latest attempt failed.\",\n },\n } satisfies Record<\n (typeof activityDeliveryStatusEnum.enumValues)[number],\n object\n >,\n});\nconst VerificationMechanism = builder.enumType(\n \"ActivityDeliveryVerificationMechanism\",\n {\n description:\n \"How an inbound activity was authenticated. Not to be confused with \" +\n \"FEP-8b32's `verificationMethod`, which is a key.\",\n values: {\n http_signature: { description: \"The HTTP request signature.\" },\n ld_signature: { description: \"Linked Data Signatures (`signature`).\" },\n object_integrity_proof: {\n description: \"FEP-8b32 Object Integrity Proofs (`proof`).\",\n },\n } satisfies Record<\n (typeof activityDeliveryVerificationMechanismEnum.enumValues)[number],\n object\n >,\n },\n);\nconst VerificationResult = builder.enumType(\n \"ActivityDeliveryVerificationResult\",\n {\n description:\n \"What Fedify reported of verifying an inbound activity, as it \" +\n \"verified it. Whether the activity was accepted is \" +\n \"`ActivityDelivery.status`.\",\n values: {\n verified: { description: \"A signature or proof was verified.\" },\n invalid_signature: {\n description: \"A signature or proof was present and did not verify.\",\n },\n key_fetch_error: {\n description:\n \"Fedify reported a failure fetching the key a signature or proof names.\",\n },\n no_signature: { description: \"Nothing to verify was found.\" },\n unattempted: {\n description:\n \"Fedify stopped before checking a signature or proof, e.g. a body that is \" +\n \"not JSON or an unknown inbox.\",\n },\n unobserved: {\n description:\n \"Recording the observation failed; the mechanism is unknown.\",\n },\n } satisfies Record<\n (typeof activityDeliveryVerificationResultEnum.enumValues)[number],\n object\n >,\n },\n);\nconst ActivityDeliveryFilter = builder.inputType(\"ActivityDeliveryFilter\", {\n fields: (t) => ({\n direction: t.field({ type: ActivityDeliveryDirection }),\n status: t.field({ type: ActivityDeliveryStatus }),\n type: t.string(),\n }),\n});\nfunction decodeUtf8(body: Uint8Array | null): string | null {\n if (body == null) return null;\n try {\n return new TextDecoder(\"utf-8\", { fatal: true }).decode(body);\n } catch {\n return null;\n }\n}\nconst access = (localId: Uuid | null) =>\n localId == null\n ? false\n : { $any: { admin: true as const, localInstanceMember: localId } };\n\nbuilder.drizzleObject(\"activityDeliveryAttempts\", {\n name: \"ActivityDeliveryAttempt\",\n description: \"One ended attempt of an outbound delivery.\",\n fields: (t) => ({\n uuid: t.expose(\"id\", { type: \"UUID\" }),\n succeeded: t.exposeBoolean(\"succeeded\"),\n statusCode: t.exposeInt(\"statusCode\", {\n nullable: true,\n description:\n \"The status the remote inbox answered the attempt with. Null \" +\n \"when no response came, as for a network error.\",\n }),\n responseBody: t.exposeString(\"responseBody\", {\n nullable: true,\n description:\n \"What the remote inbox answered a failed attempt, with U+FFFD for \" +\n \"each U+0000, which PostgreSQL cannot store.\",\n }),\n error: t.exposeString(\"error\", {\n nullable: true,\n description:\n \"Why the attempt failed, including the causes of a network error. \" +\n \"Null for a success.\",\n }),\n created: t.expose(\"created\", {\n type: \"DateTime\",\n description: \"When the attempt ended.\",\n }),\n }),\n});\n\nconst ActivityDeliveryRef = builder.drizzleNode(\"activityDeliveries\", {\n name: \"ActivityDelivery\",\n select: { with: { instance: { columns: { localId: true } } } },\n authScopes: (delivery) => access(delivery.instance.localId),\n runScopesOnType: true,\n id: { column: (delivery) => delivery.id },\n fields: (t) => ({\n uuid: t.expose(\"id\", { type: \"UUID\" }),\n instance: t.relation(\"instance\"),\n actor: t.relation(\"actor\", {\n nullable: true,\n description:\n \"The owner of the inbox the request arrived at, or the sending \" +\n \"actor. Null for the shared inbox, and for a deleted actor.\",\n }),\n direction: t.expose(\"direction\", { type: ActivityDeliveryDirection }),\n status: t.expose(\"status\", {\n type: ActivityDeliveryStatus,\n description:\n \"The outcome of the delivery. Inbound, it follows the response \" +\n \"DrFed gave, not `verificationResult`.\",\n }),\n verificationMechanism: t.expose(\"verificationMechanism\", {\n type: VerificationMechanism,\n nullable: true,\n description:\n \"Inbound: the mechanism that verified the activity, or the last \" +\n \"one Fedify tried. Null when Fedify tried none, when recording \" +\n \"failed, and for outbound deliveries.\",\n }),\n verificationResult: t.expose(\"verificationResult\", {\n type: VerificationResult,\n nullable: true,\n description:\n \"Inbound: what verifying found. Null for outbound deliveries.\",\n }),\n type: t.exposeString(\"type\", {\n nullable: true,\n description: \"The one type the activity resolved to; see `types`.\",\n }),\n types: t.exposeStringList(\"types\", {\n description: \"Every type the activity declares.\",\n }),\n activityIri: t.expose(\"activityIri\", { type: \"URL\", nullable: true }),\n activity: t.relation(\"activity\", {\n nullable: true,\n // The link names the activity whatever the delivery carried, so it\n // opens no more than a node lookup would.\n query: (_, ctx) => ({\n where: { RAW: (table) => readableResource(ctx, table.id) },\n }),\n description:\n \"The stored activity `activityIri` names, for an inbound delivery \" +\n \"that was verified and accepted, or a delivery DrFed sent. Null \" +\n \"when the activity has no ID, did not meet the rules for storing \" +\n \"it, the delivery was not verified, or the viewer may not read the \" +\n \"activity.\",\n }),\n objectType: t.exposeString(\"objectType\", { nullable: true }),\n objectIri: t.expose(\"objectIri\", { type: \"URL\", nullable: true }),\n signedKeyIri: t.expose(\"signedKeyIri\", {\n type: \"URL\",\n nullable: true,\n description:\n \"The `keyId` the HTTP signature declares. It may differ from the \" +\n \"IRI of `verificationKey` when another mechanism verified the \" +\n \"activity.\",\n }),\n verificationKey: t.relation(\"verificationKey\", {\n nullable: true,\n description:\n \"The public key version `verificationMechanism` actually used, even \" +\n \"when it failed. Its presence does not imply success; consult \" +\n \"`verificationResult`.\",\n }),\n remoteActorIri: t.expose(\"remoteActorIri\", { type: \"URL\", nullable: true }),\n remoteHost: t.exposeString(\"remoteHost\", { nullable: true }),\n inboxUrl: t.expose(\"inboxUrl\", {\n type: \"URL\",\n description:\n \"The canonical IRI of the inbox, however the request spelled it; \" +\n \"see `requestUrl`.\",\n }),\n requestUrl: t.expose(\"requestUrl\", {\n type: \"URL\",\n nullable: true,\n description: \"Inbound: the URL the request actually arrived at.\",\n }),\n requestHeaders: t.expose(\"headers\", {\n type: \"JSON\",\n nullable: true,\n description:\n \"Inbound: the request headers as `[name, value]` pairs with \" +\n \"lowercase names; their original order and case are not kept. \" +\n \"`cookie` is left out, and `authorization` is whole only for the \" +\n \"`Signature` scheme.\",\n }),\n rawBody: t.string({\n nullable: true,\n description:\n \"Inbound: the request body as received, when it is valid UTF-8; \" +\n \"otherwise read `rawBodyBase64`.\",\n select: { columns: { body: true } },\n resolve: (delivery) => decodeUtf8(delivery.body),\n }),\n rawBodyBase64: t.string({\n nullable: true,\n description: \"Inbound: the octets of the request body, in Base64.\",\n select: { columns: { body: true } },\n resolve: (delivery) => delivery.body?.toString(\"base64\") ?? null,\n }),\n statusCode: t.exposeInt(\"statusCode\", {\n nullable: true,\n description:\n \"Inbound: what DrFed answered; null when handling the request \" +\n \"threw. Outbound: what the remote inbox answered the latest \" +\n \"attempt; null when no response came.\",\n }),\n responseBody: t.exposeString(\"responseBody\", {\n nullable: true,\n description:\n \"Inbound: what DrFed answered; null when handling the request \" +\n \"threw. Outbound: what the remote inbox answered the latest failed \" +\n \"attempt, with U+FFFD for each U+0000, which PostgreSQL cannot store.\",\n }),\n error: t.exposeString(\"error\", {\n nullable: true,\n description:\n \"Why a refused or failed delivery ended that way, which for an \" +\n \"inbound request whose handling threw is the exception. Null for \" +\n \"accepted ones unless verification observation failed.\",\n }),\n attempts: t.relatedConnection(\"attempts\", {\n query: { orderBy: { created: \"asc\", id: \"asc\" } },\n description:\n \"Outbound: each attempt that ended, oldest first, including the \" +\n \"retries of a queued delivery. Empty for inbound deliveries.\",\n }),\n payload: t.expose(\"payload\", {\n type: \"JSON\",\n nullable: true,\n description:\n \"Inbound: `rawBody` parsed as JSON, which loses key order, \" +\n \"whitespace and duplicate keys; null when it does not parse, when \" +\n \"it holds U+0000 or an unpaired surrogate, which PostgreSQL cannot \" +\n \"store, and for a literal JSON null. Outbound: the compact JSON-LD \" +\n \"before signing, without `bto` and `bcc`, so it lacks the `proof` \" +\n \"and `signature` the remote server received. May contain \" +\n \"unverified remote input and private recipients.\",\n }),\n recipientIris: t.expose(\"recipientIris\", {\n type: [\"URL\"],\n description:\n \"Outbound: every recipient sharing the inbox, including those \" +\n \"named by `bto` and `bcc`.\",\n }),\n created: t.expose(\"created\", {\n type: \"DateTime\",\n description:\n \"Inbound: when the request arrived, before it was verified and \" +\n \"handled. Outbound: when DrFed started the delivery. Deliveries \" +\n \"are ordered by it.\",\n }),\n completed: t.expose(\"completed\", {\n type: \"DateTime\",\n nullable: true,\n description:\n \"Inbound: when DrFed answered the request. Outbound: when \" +\n \"`status` last changed. Null while an outbound delivery is \" +\n \"`queued`.\",\n }),\n }),\n});\nexport const ActivityDelivery: DrFedObjectRef = ActivityDeliveryRef;\n\ntype DeliveryFilter =\n | typeof ActivityDeliveryFilter.$inferInput\n | null\n | undefined;\nconst deliveryWhere = (filter: DeliveryFilter) => ({\n ...(filter?.direction == null ? {} : { direction: filter.direction }),\n ...(filter?.status == null ? {} : { status: filter.status }),\n ...(filter?.type == null ? {} : { type: filter.type }),\n});\nconst deliveriesConnection = drizzleConnectionHelpers(\n builder,\n \"activityDeliveries\",\n {\n query: ({ filter }: { filter?: DeliveryFilter }) => ({\n where: deliveryWhere(filter),\n orderBy: { created: \"desc\", id: \"desc\" },\n }),\n },\n);\n// Paged over an actor's links, which copy the created of their deliveries, so\n// that each edge tells how the delivery concerns the actor.\nconst actorDeliveriesConnection = drizzleConnectionHelpers(\n builder,\n \"activityDeliveryActors\",\n {\n query: ({ filter }: { filter?: DeliveryFilter }) => ({\n where: { delivery: deliveryWhere(filter) },\n orderBy: { created: \"desc\", deliveryId: \"desc\" },\n }),\n select: (nestedSelection) => ({\n with: {\n delivery: nestedSelection(),\n // Every column, since Pothos cannot add a composite primary key to\n // a narrower selection.\n collections: { orderBy: { collectionIri: \"asc\" } },\n },\n }),\n resolveNode: (link) => link.delivery,\n },\n);\nbuilder.drizzleObjectField(\"instances\", \"activityDeliveries\", (t) =>\n t.connection({\n type: ActivityDelivery,\n args: { filter: t.arg({ type: ActivityDeliveryFilter }) },\n description:\n \"Delivery observations, newest first. \" +\n \"Restricted to local instance members and administrators.\",\n select: (args, ctx, nestedSelection) =>\n ({\n columns: { localId: true },\n with: {\n activityDeliveries: deliveriesConnection.getQuery(\n args,\n ctx,\n nestedSelection,\n ),\n },\n }) as const,\n resolve: (instance, args, ctx) =>\n deliveriesConnection.resolve(\n instance.activityDeliveries,\n args,\n ctx,\n instance,\n ),\n authScopes: (instance) => access(instance.localId),\n }),\n);\n// Rows are filtered before paging: an activity's deliveries span instances,\n// and the node's own check would fail the whole connection, while cursors\n// and page info would tell of rows it hides.\nconst activityDeliveriesConnection = drizzleConnectionHelpers(\n builder,\n \"activityDeliveries\",\n {\n query: ({ filter }: { filter?: DeliveryFilter }, ctx) => ({\n where: {\n ...deliveryWhere(filter),\n RAW: (table) => viewableInstance(ctx, table.instanceId),\n },\n orderBy: { created: \"desc\", id: \"desc\" },\n }),\n },\n);\nbuilder.drizzleObjectField(\"activities\", \"deliveries\", (t) =>\n t.connection({\n type: ActivityDelivery,\n args: { filter: t.arg({ type: ActivityDeliveryFilter }) },\n description:\n \"Deliveries of this activity, newest first: those it arrived in, \" +\n \"verified and accepted, and those DrFed sent it in. Only those of \" +\n \"the local instances the viewer is a member of, or of every one for \" +\n \"an administrator.\",\n select: (args, ctx, nestedSelection) => ({\n with: {\n deliveries: activityDeliveriesConnection.getQuery(\n args,\n ctx,\n nestedSelection,\n ),\n },\n }),\n resolve: (activity, args, ctx) =>\n activityDeliveriesConnection.resolve(\n activity.deliveries,\n args,\n ctx,\n activity,\n ),\n }),\n);\nbuilder.drizzleObjectField(\"actors\", \"activityDeliveries\", (t) =>\n t.connection(\n {\n type: ActivityDelivery,\n args: { filter: t.arg({ type: ActivityDeliveryFilter }) },\n description:\n \"Deliveries that concern this local actor, newest first: those \" +\n \"that arrived at its inbox, those it sent, and those addressed to \" +\n \"it through any inbox, directly or as a member of an addressed \" +\n \"collection. Collection membership counts only as far as DrFed \" +\n \"has stored it. Each edge tells how the delivery concerns the \" +\n \"actor. Restricted to instance members and administrators.\",\n select: (args, ctx, nestedSelection) =>\n ({\n columns: { localId: true },\n with: {\n instance: { columns: { localId: true } },\n activityDeliveryLinks: actorDeliveriesConnection.getQuery(\n args,\n ctx,\n nestedSelection,\n ),\n },\n }) as const,\n resolve: (actor, args, ctx) =>\n actorDeliveriesConnection.resolve(\n actor.activityDeliveryLinks,\n args,\n ctx,\n actor,\n ),\n authScopes: (actor) =>\n actor.localId == null ? false : access(actor.instance.localId),\n },\n {},\n {\n fields: (edge) => ({\n inboxOwner: edge.exposeBoolean(\"inboxOwner\", {\n description: \"Whether the delivery arrived at this actor's inbox.\",\n }),\n sender: edge.exposeBoolean(\"sender\", {\n description: \"Whether this actor sent the delivery.\",\n }),\n addressed: edge.exposeBoolean(\"addressed\", {\n description:\n \"Whether the activity addressed this actor, directly or \" +\n \"through a collection.\",\n }),\n addressedDirectly: edge.exposeBoolean(\"addressedDirectly\", {\n description: \"Whether the activity addressed this actor by its IRI.\",\n }),\n viaCollections: edge.field({\n type: [\"URL\"],\n description:\n \"The addressed collections this actor was a member of when the \" +\n \"delivery arrived, as far as DrFed had stored them, in IRI \" +\n \"order. Empty when no collection addressed it.\",\n resolve: (link) =>\n link.collections.map(({ collectionIri }) => collectionIri),\n }),\n }),\n },\n ),\n);\n"],"mappings":";;;;;AA4BA,MAAM,4BAA4B,QAAQ,SACxC,6BACA;CACE,aAAa;CACb,QAAQ,8BAA8B;AACxC,CACF;AACA,MAAM,yBAAyB,QAAQ,SAAS,0BAA0B;CACxE,aACE;CAGF,QAAQ;EACN,UAAU,EACR,aAAa,oDACf;EACA,cAAc,EACZ,aACE,sIAEJ;EACA,YAAY,EACV,aAAa,4DACf;EACA,UAAU,EACR,aACE,+DACJ;EACA,QAAQ,EACN,aAAa,mDACf;EACA,MAAM,EAAE,aAAa,oDAAoD;EACzE,QAAQ,EACN,aACE,uFAEJ;EACA,oBAAoB,EAClB,aACE,yLAGJ;EACA,WAAW,EACT,aACE,sEACJ;CACF;AAIF,CAAC;AACD,MAAM,wBAAwB,QAAQ,SACpC,yCACA;CACE,aACE;CAEF,QAAQ;EACN,gBAAgB,EAAE,aAAa,8BAA8B;EAC7D,cAAc,EAAE,aAAa,wCAAwC;EACrE,wBAAwB,EACtB,aAAa,8CACf;CACF;AAIF,CACF;AACA,MAAM,qBAAqB,QAAQ,SACjC,sCACA;CACE,aACE;CAGF,QAAQ;EACN,UAAU,EAAE,aAAa,qCAAqC;EAC9D,mBAAmB,EACjB,aAAa,uDACf;EACA,iBAAiB,EACf,aACE,yEACJ;EACA,cAAc,EAAE,aAAa,+BAA+B;EAC5D,aAAa,EACX,aACE,yGAEJ;EACA,YAAY,EACV,aACE,8DACJ;CACF;AAIF,CACF;AACA,MAAM,yBAAyB,QAAQ,UAAU,0BAA0B,EACzE,SAAS,OAAO;CACd,WAAW,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;CACtD,QAAQ,EAAE,MAAM,EAAE,M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