@drfed/models 0.2.0-dev.717 → 0.2.0-dev.718
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/activity-delivery.d.mts +1 -1
- package/dist/{db-CcbUSnp2.d.mts → db-Al_MT-L_.d.mts} +132 -3
- package/dist/{db-CcbUSnp2.d.mts.map → db-Al_MT-L_.d.mts.map} +1 -1
- package/dist/db.d.mts +1 -1
- package/dist/document.mjs +1 -1
- package/dist/expansion-p4BoMDVd.d.mts +90 -0
- package/dist/expansion-p4BoMDVd.d.mts.map +1 -0
- package/dist/expansion.d.mts +2 -0
- package/dist/expansion.mjs +131 -0
- package/dist/expansion.mjs.map +1 -0
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +2 -2
- package/dist/instance.d.mts +1 -1
- package/dist/key.d.mts +1 -1
- package/dist/login.d.mts +1 -1
- package/dist/migrations-manifest.json +4 -0
- package/dist/relations.d.mts +1 -1
- package/dist/{resource-revision-rDmHhNCj.d.mts → resource-revision-BbXciRsu.d.mts} +117 -4
- package/dist/resource-revision-BbXciRsu.d.mts.map +1 -0
- package/dist/{resource-revision-bTQyJ7aw.mjs → resource-revision-DGsz8fnS.mjs} +338 -42
- package/dist/resource-revision-DGsz8fnS.mjs.map +1 -0
- package/dist/resource-revision.d.mts +2 -2
- package/dist/resource-revision.mjs +1 -1
- package/dist/resource.d.mts +1 -1
- package/dist/schema.d.mts +2 -2
- package/dist/schema.mjs +55 -1
- package/dist/schema.mjs.map +1 -1
- package/drizzle/20261125051505_revision_expansions/migration.sql +31 -0
- package/drizzle/20261125051505_revision_expansions/snapshot.json +4806 -0
- package/package.json +12 -7
- package/dist/resource-revision-bTQyJ7aw.mjs.map +0 -1
- package/dist/resource-revision-rDmHhNCj.d.mts.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { M as NewActivityDelivery, N as NewActivityDeliveryActor, o as ActivityDelivery, r as Transaction, t as Database } from "./db-
|
|
1
|
+
import { M as NewActivityDelivery, N as NewActivityDeliveryActor, o as ActivityDelivery, r as Transaction, t as Database } from "./db-Al_MT-L_.mjs";
|
|
2
2
|
import { t as Uuid } from "./uuid-CKMzlIND.mjs";
|
|
3
3
|
//#region src/activity-delivery.d.ts
|
|
4
4
|
/** The marks of what a delivery carried are the model's to decide. */
|
|
@@ -32,7 +32,7 @@ declare function observeKeyVersion(db: Database, entry: {
|
|
|
32
32
|
readonly observed?: Temporal.Instant;
|
|
33
33
|
}): Promise<KeyVersion>;
|
|
34
34
|
declare namespace schema_d_exports {
|
|
35
|
-
export { Account, ActivityDelivery, ActivityDeliveryActor, ActivityDeliveryActorCollection, ActivityDeliveryAttempt, ActivityDeliveryDirection, ActivityDeliveryStatus, ActivityDeliveryVerificationMechanism, ActivityDeliveryVerificationResult, ActivityPubObject, Actor, ActorType, Addressing, AddressingProperty, Collection, CollectionRole, Instance, InstanceMember, Key, KeyVersion, LOGIN_CHALLENGE_CODE_LENGTH, LocalActor, LocalActorKey, LocalActorKeyType, LocalInstance, LoginChallenge, NewAccount, NewActivityDelivery, NewActivityDeliveryActor, NewActivityPubObject, NewActor, NewInstance, NewInstanceMember, NewLocalActor, NewLocalActorKey, NewLocalInstance, NewLoginChallenge, NewResourceRevision, NewSession, ObjectType, Resource, ResourceHead, ResourceRevision, RevisionAddressing, RevisionEmbedding, RevisionReceipt, RevisionRelation, Session, StoredActivity, accounts, activities, activityDeliveries, activityDeliveryActorCollections, activityDeliveryActors, activityDeliveryAttempts, activityDeliveryDirectionEnum, activityDeliveryStatusEnum, activityDeliveryVerificationMechanismEnum, activityDeliveryVerificationResultEnum, activityTypeEnum, actorCollectionReferences, actorTypeEnum, actors, addressing, addressingPropertyEnum, collectionItems, collectionRoleEnum, collectionTypeEnum, collections, instanceMembers, instances, keyVersions, keys, localActorKeyTypeEnum, localActorKeys, localActors, localInstances, loginChallenges, objectTypeEnum, objects, resourceHeads, resourceKindEnum, resourceRevisionCaptureEnum, resourceRevisionKindEnum, resourceRevisionProjectionEnum, resourceRevisions, resources, revisionAddressing, revisionEmbeddingRelationEnum, revisionEmbeddings, revisionReceiptRoleEnum, revisionReceipts, revisionRelationRepresentationEnum, revisionRelations, sessions };
|
|
35
|
+
export { Account, ActivityDelivery, ActivityDeliveryActor, ActivityDeliveryActorCollection, ActivityDeliveryAttempt, ActivityDeliveryDirection, ActivityDeliveryStatus, ActivityDeliveryVerificationMechanism, ActivityDeliveryVerificationResult, ActivityPubObject, Actor, ActorType, Addressing, AddressingProperty, Collection, CollectionRole, Instance, InstanceMember, Key, KeyVersion, LOGIN_CHALLENGE_CODE_LENGTH, LocalActor, LocalActorKey, LocalActorKeyType, LocalInstance, LoginChallenge, NewAccount, NewActivityDelivery, NewActivityDeliveryActor, NewActivityPubObject, NewActor, NewInstance, NewInstanceMember, NewLocalActor, NewLocalActorKey, NewLocalInstance, NewLoginChallenge, NewResourceRevision, NewRevisionExpansion, NewSession, ObjectType, Resource, ResourceHead, ResourceRevision, RevisionAddressing, RevisionEmbedding, RevisionExpansion, RevisionReceipt, RevisionRelation, Session, StoredActivity, accounts, activities, activityDeliveries, activityDeliveryActorCollections, activityDeliveryActors, activityDeliveryAttempts, activityDeliveryDirectionEnum, activityDeliveryStatusEnum, activityDeliveryVerificationMechanismEnum, activityDeliveryVerificationResultEnum, activityTypeEnum, actorCollectionReferences, actorTypeEnum, actors, addressing, addressingPropertyEnum, collectionItems, collectionRoleEnum, collectionTypeEnum, collections, instanceMembers, instances, keyVersions, keys, localActorKeyTypeEnum, localActorKeys, localActors, localInstances, loginChallenges, objectTypeEnum, objects, resourceHeads, resourceKindEnum, resourceRevisionCaptureEnum, resourceRevisionKindEnum, resourceRevisionProjectionEnum, resourceRevisions, resources, revisionAddressing, revisionEmbeddingRelationEnum, revisionEmbeddings, revisionExpansionOutcomeEnum, revisionExpansions, revisionReceiptRoleEnum, revisionReceipts, revisionRelationRepresentationEnum, revisionRelations, sessions };
|
|
36
36
|
}
|
|
37
37
|
/**
|
|
38
38
|
* The database table to represent accounts.
|
|
@@ -3437,6 +3437,133 @@ declare const revisionEmbeddings: import("drizzle-orm/pg-core").PgTableWithColum
|
|
|
3437
3437
|
};
|
|
3438
3438
|
dialect: 'pg';
|
|
3439
3439
|
}>;
|
|
3440
|
+
declare const revisionExpansionOutcomeEnum: import("drizzle-orm/pg-core").PgEnum<["expanded", "failed", "no_document"]>;
|
|
3441
|
+
/**
|
|
3442
|
+
* The JSON-LD expanded form of a revision's document, written with the
|
|
3443
|
+
* revision. Unlike the other revision projections, rows are derived data: an
|
|
3444
|
+
* incorrect expansion is a bug, fixed by recomputing the rows of the affected
|
|
3445
|
+
* revisions, so the table has no immutability guard. A revision without a row
|
|
3446
|
+
* has not been expanded yet. An object embedded in a received activity is
|
|
3447
|
+
* expanded from that activity's document, recorded as `sourceRevisionId`.
|
|
3448
|
+
*
|
|
3449
|
+
* Unlike revision documents, expanded documents are `jsonb` so that they can
|
|
3450
|
+
* be indexed and queried with containment. Being derived, they are stored
|
|
3451
|
+
* normalized: U+0000 and unpaired surrogates in strings and keys become
|
|
3452
|
+
* U+FFFD, and negative zero becomes zero. The stored document holds the exact
|
|
3453
|
+
* values.
|
|
3454
|
+
*/
|
|
3455
|
+
declare const revisionExpansions: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
3456
|
+
name: "revision_expansions";
|
|
3457
|
+
schema: undefined;
|
|
3458
|
+
columns: {
|
|
3459
|
+
revisionId: import("drizzle-orm/pg-core").PgBuildColumn<"revision_expansions", import("drizzle-orm/pg-core").SetIsPrimaryKey<import("drizzle-orm/pg-core").Set$Type<import("drizzle-orm/pg-core").PgUUIDBuilder, `${string}-${string}-${string}-${string}-${string}`>>, {
|
|
3460
|
+
name: string;
|
|
3461
|
+
tableName: "revision_expansions";
|
|
3462
|
+
dataType: "string uuid";
|
|
3463
|
+
data: `${string}-${string}-${string}-${string}-${string}`;
|
|
3464
|
+
driverParam: string;
|
|
3465
|
+
notNull: true;
|
|
3466
|
+
hasDefault: false;
|
|
3467
|
+
isPrimaryKey: false;
|
|
3468
|
+
isAutoincrement: false;
|
|
3469
|
+
hasRuntimeDefault: false;
|
|
3470
|
+
enumValues: undefined;
|
|
3471
|
+
identity: undefined;
|
|
3472
|
+
generated: undefined;
|
|
3473
|
+
}>;
|
|
3474
|
+
outcome: import("drizzle-orm/pg-core").PgBuildColumn<"revision_expansions", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgEnumColumnBuilder<["expanded", "failed", "no_document"]>>, {
|
|
3475
|
+
name: string;
|
|
3476
|
+
tableName: "revision_expansions";
|
|
3477
|
+
dataType: "string enum";
|
|
3478
|
+
data: "expanded" | "failed" | "no_document";
|
|
3479
|
+
driverParam: string;
|
|
3480
|
+
notNull: true;
|
|
3481
|
+
hasDefault: false;
|
|
3482
|
+
isPrimaryKey: false;
|
|
3483
|
+
isAutoincrement: false;
|
|
3484
|
+
hasRuntimeDefault: false;
|
|
3485
|
+
enumValues: ["expanded", "failed", "no_document"];
|
|
3486
|
+
identity: undefined;
|
|
3487
|
+
generated: undefined;
|
|
3488
|
+
}>;
|
|
3489
|
+
document: import("drizzle-orm/pg-core").PgBuildColumn<"revision_expansions", import("drizzle-orm/pg-core").Set$Type<import("drizzle-orm/pg-core").PgJsonbBuilder, readonly unknown[]>, {
|
|
3490
|
+
name: string;
|
|
3491
|
+
tableName: "revision_expansions";
|
|
3492
|
+
dataType: "object json";
|
|
3493
|
+
data: readonly unknown[];
|
|
3494
|
+
driverParam: unknown;
|
|
3495
|
+
notNull: false;
|
|
3496
|
+
hasDefault: false;
|
|
3497
|
+
isPrimaryKey: false;
|
|
3498
|
+
isAutoincrement: false;
|
|
3499
|
+
hasRuntimeDefault: false;
|
|
3500
|
+
enumValues: undefined;
|
|
3501
|
+
identity: undefined;
|
|
3502
|
+
generated: undefined;
|
|
3503
|
+
}>;
|
|
3504
|
+
droppedTerms: import("drizzle-orm/pg-core").PgBuildColumn<"revision_expansions", import("drizzle-orm/pg-core").SetDimensions<import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>, 1>, {
|
|
3505
|
+
name: string;
|
|
3506
|
+
tableName: "revision_expansions";
|
|
3507
|
+
dataType: "string";
|
|
3508
|
+
data: string[];
|
|
3509
|
+
driverParam: string | string[];
|
|
3510
|
+
notNull: false;
|
|
3511
|
+
hasDefault: false;
|
|
3512
|
+
isPrimaryKey: false;
|
|
3513
|
+
isAutoincrement: false;
|
|
3514
|
+
hasRuntimeDefault: false;
|
|
3515
|
+
enumValues: undefined;
|
|
3516
|
+
identity: undefined;
|
|
3517
|
+
generated: undefined;
|
|
3518
|
+
}>;
|
|
3519
|
+
undefinedTerms: import("drizzle-orm/pg-core").PgBuildColumn<"revision_expansions", import("drizzle-orm/pg-core").SetDimensions<import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>, 1>, {
|
|
3520
|
+
name: string;
|
|
3521
|
+
tableName: "revision_expansions";
|
|
3522
|
+
dataType: "string";
|
|
3523
|
+
data: string[];
|
|
3524
|
+
driverParam: string | string[];
|
|
3525
|
+
notNull: false;
|
|
3526
|
+
hasDefault: false;
|
|
3527
|
+
isPrimaryKey: false;
|
|
3528
|
+
isAutoincrement: false;
|
|
3529
|
+
hasRuntimeDefault: false;
|
|
3530
|
+
enumValues: undefined;
|
|
3531
|
+
identity: undefined;
|
|
3532
|
+
generated: undefined;
|
|
3533
|
+
}>;
|
|
3534
|
+
failure: import("drizzle-orm/pg-core").PgBuildColumn<"revision_expansions", import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>, {
|
|
3535
|
+
name: string;
|
|
3536
|
+
tableName: "revision_expansions";
|
|
3537
|
+
dataType: "string";
|
|
3538
|
+
data: string;
|
|
3539
|
+
driverParam: string;
|
|
3540
|
+
notNull: false;
|
|
3541
|
+
hasDefault: false;
|
|
3542
|
+
isPrimaryKey: false;
|
|
3543
|
+
isAutoincrement: false;
|
|
3544
|
+
hasRuntimeDefault: false;
|
|
3545
|
+
enumValues: undefined;
|
|
3546
|
+
identity: undefined;
|
|
3547
|
+
generated: undefined;
|
|
3548
|
+
}>;
|
|
3549
|
+
sourceRevisionId: import("drizzle-orm/pg-core").PgBuildColumn<"revision_expansions", import("drizzle-orm/pg-core").Set$Type<import("drizzle-orm/pg-core").PgUUIDBuilder, `${string}-${string}-${string}-${string}-${string}`>, {
|
|
3550
|
+
name: string;
|
|
3551
|
+
tableName: "revision_expansions";
|
|
3552
|
+
dataType: "string uuid";
|
|
3553
|
+
data: `${string}-${string}-${string}-${string}-${string}`;
|
|
3554
|
+
driverParam: string;
|
|
3555
|
+
notNull: false;
|
|
3556
|
+
hasDefault: false;
|
|
3557
|
+
isPrimaryKey: false;
|
|
3558
|
+
isAutoincrement: false;
|
|
3559
|
+
hasRuntimeDefault: false;
|
|
3560
|
+
enumValues: undefined;
|
|
3561
|
+
identity: undefined;
|
|
3562
|
+
generated: undefined;
|
|
3563
|
+
}>;
|
|
3564
|
+
};
|
|
3565
|
+
dialect: 'pg';
|
|
3566
|
+
}>;
|
|
3440
3567
|
declare const revisionReceiptRoleEnum: import("drizzle-orm/pg-core").PgEnum<["activity", "object"]>;
|
|
3441
3568
|
/** Mutable index of delivery evidence, not part of immutable document history. */
|
|
3442
3569
|
declare const revisionReceipts: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
@@ -3498,6 +3625,8 @@ type RevisionAddressing = typeof revisionAddressing.$inferSelect;
|
|
|
3498
3625
|
type RevisionRelation = typeof revisionRelations.$inferSelect;
|
|
3499
3626
|
type RevisionReceipt = typeof revisionReceipts.$inferSelect;
|
|
3500
3627
|
type RevisionEmbedding = typeof revisionEmbeddings.$inferSelect;
|
|
3628
|
+
type RevisionExpansion = typeof revisionExpansions.$inferSelect;
|
|
3629
|
+
type NewRevisionExpansion = typeof revisionExpansions.$inferInsert;
|
|
3501
3630
|
//#endregion
|
|
3502
3631
|
//#region src/relations.d.ts
|
|
3503
3632
|
declare const relations: import("drizzle-orm").ExtractTablesWithRelations<{
|
|
@@ -3647,5 +3776,5 @@ type Transaction = PgAsyncTransaction<PgQueryResultHKT, typeof schema_d_exports,
|
|
|
3647
3776
|
*/
|
|
3648
3777
|
type RelationsFilter$1<T extends keyof typeof relations> = RelationsFilter<(typeof relations)[T], typeof relations>;
|
|
3649
3778
|
//#endregion
|
|
3650
|
-
export {
|
|
3651
|
-
//# sourceMappingURL=db-
|
|
3779
|
+
export { RevisionRelation as $, observeKeyVersion as $t, LoginChallenge as A, loginChallenges as At, NewLocalInstance as B, revisionAddressing as Bt, Key as C, instances as Ct, LocalActorKey as D, localActorKeys as Dt, LocalActor as E, localActorKeyTypeEnum as Et, NewActor as F, resourceRevisionCaptureEnum as Ft, ObjectType as G, revisionReceiptRoleEnum as Gt, NewResourceRevision as H, revisionEmbeddings as Ht, NewInstance as I, resourceRevisionKindEnum as It, ResourceRevision as J, revisionRelations as Jt, Resource as K, revisionReceipts as Kt, NewInstanceMember as L, resourceRevisionProjectionEnum as Lt, NewActivityDelivery as M, objects as Mt, NewActivityDeliveryActor as N, resourceHeads as Nt, LocalActorKeyType as O, localActors as Ot, NewActivityPubObject as P, resourceKindEnum as Pt, RevisionReceipt as Q, jwkThumbprint as Qt, NewLocalActor as R, resourceRevisions as Rt, InstanceMember as S, instanceMembers as St, LOGIN_CHALLENGE_CODE_LENGTH as T, keys as Tt, NewRevisionExpansion as U, revisionExpansionOutcomeEnum as Ut, NewLoginChallenge as V, revisionEmbeddingRelationEnum as Vt, NewSession as W, revisionExpansions as Wt, RevisionEmbedding as X, sessions as Xt, RevisionAddressing as Y, schema_d_exports as Yt, RevisionExpansion as Z, PublicJwk as Zt, Addressing as _, addressingPropertyEnum as _t, Account as a, activityDeliveryActorCollections as at, CollectionRole as b, collectionTypeEnum as bt, ActivityDeliveryActorCollection as c, activityDeliveryDirectionEnum as ct, ActivityDeliveryStatus as d, activityDeliveryVerificationResultEnum as dt, thumbprintInput as en, Session as et, ActivityDeliveryVerificationMechanism as f, activityTypeEnum as ft, ActorType as g, addressing as gt, Actor as h, actors as ht, relations as i, activityDeliveries as it, NewAccount as j, objectTypeEnum as jt, LocalInstance as k, localInstances as kt, ActivityDeliveryAttempt as l, activityDeliveryStatusEnum as lt, ActivityPubObject as m, actorTypeEnum as mt, RelationsFilter$1 as n, accounts as nt, ActivityDelivery as o, activityDeliveryActors as ot, ActivityDeliveryVerificationResult as p, actorCollectionReferences as pt, ResourceHead as q, revisionRelationRepresentationEnum as qt, Transaction as r, activities as rt, ActivityDeliveryActor as s, activityDeliveryAttempts as st, Database as t, toPublicJwk as tn, StoredActivity as tt, ActivityDeliveryDirection as u, activityDeliveryVerificationMechanismEnum as ut, AddressingProperty as v, collectionItems as vt, KeyVersion as w, keyVersions as wt, Instance as x, collections as xt, Collection as y, collectionRoleEnum as yt, NewLocalActorKey as z, resources as zt };
|
|
3780
|
+
//# sourceMappingURL=db-Al_MT-L_.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"db-
|
|
1
|
+
{"version":3,"file":"db-Al_MT-L_.d.mts","names":["schema","schema","RelationsFilter","RelationsFilterImpl"],"sources":["../src/key.ts","../src/schema.ts","../src/relations.ts","../src/db.ts"],"mappings":";;;;;KAuBY,YAAY,QACtB,QAAQ,WAAW,6BACnB;EACI;EAAc;;;;;;iBAiBJ,YAAY,KAAK,YAAY;;;;;iBAY7B,gBAAgB,KAAK;;;;;iBAyBf,cAAc,KAAK,YAAY;;;;;iBAe/B,kBACpB,IAAI,UACJ;WACW;WACA,WAAW;WACX,WAAW,SAAS;IAE9B,QAAQ;;;;;;;cCvCE,wCAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAAR,SAAA;;;;;;YAAA,SAAA;;;;;;;;;;;;;;KAoBD,iBAAiB,SAAS;KAC1B,oBAAoB,SAAS;;;;cAK5B,yCAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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-Al_MT-L_.mjs";
|
|
2
2
|
export { Database, RelationsFilter, Transaction };
|
package/dist/document.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MIMEType } from "node:util";
|
|
2
|
-
import { Accept, Activity, Add, Announce, Application, Arrive, Article, Block, Collection, CollectionPage, Create, Delete, Dislike, Flag, Follow, Group, Ignore, IntransitiveActivity, Invite, Join, Leave, Like, Link, Listen, Mention, Move, Note, Object as Object$1, Offer, OrderedCollection, OrderedCollectionPage, Organization, Person, Question, Read, Reject, Remove, Service, TentativeAccept, TentativeReject, Travel, Undo, Update, View, getEntityTypeById } from "@fedify/vocab";
|
|
3
2
|
import { preloadedContexts } from "@fedify/vocab-runtime";
|
|
3
|
+
import { Accept, Activity, Add, Announce, Application, Arrive, Article, Block, Collection, CollectionPage, Create, Delete, Dislike, Flag, Follow, Group, Ignore, IntransitiveActivity, Invite, Join, Leave, Like, Link, Listen, Mention, Move, Note, Object as Object$1, Offer, OrderedCollection, OrderedCollectionPage, Organization, Person, Question, Read, Reject, Remove, Service, TentativeAccept, TentativeReject, Travel, Undo, Update, View, getEntityTypeById } from "@fedify/vocab";
|
|
4
4
|
//#region src/document.ts
|
|
5
5
|
/** Stable classifications; human-readable diagnostic messages may change. */
|
|
6
6
|
const DIAGNOSTIC_REASONS = {
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
//#region src/expansion.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* How the JSON-LD expansion of a revision's document turned out.
|
|
4
|
+
*
|
|
5
|
+
* - `expanded`: the document was expanded. `droppedTerms` lists the terms
|
|
6
|
+
* the expansion discarded because no context defined them;
|
|
7
|
+
* `undefinedTerms` lists the terms a vocabulary such as ActivityStreams,
|
|
8
|
+
* whose context maps undefined terms with `"@vocab": "_:"`, kept as
|
|
9
|
+
* blank node identifiers instead.
|
|
10
|
+
* - `failed`: the document could not be expanded, for example because a
|
|
11
|
+
* context could not be loaded.
|
|
12
|
+
* - `no_document`: the revision has no document to expand.
|
|
13
|
+
*/
|
|
14
|
+
type DocumentExpansion = {
|
|
15
|
+
readonly outcome: "expanded";
|
|
16
|
+
readonly document: readonly unknown[];
|
|
17
|
+
readonly droppedTerms: readonly string[];
|
|
18
|
+
readonly undefinedTerms: readonly string[];
|
|
19
|
+
} | {
|
|
20
|
+
readonly outcome: "failed";
|
|
21
|
+
readonly failure: string;
|
|
22
|
+
} | {
|
|
23
|
+
readonly outcome: "no_document";
|
|
24
|
+
};
|
|
25
|
+
/** Options for {@link expandDocument}. */
|
|
26
|
+
interface ExpandDocumentOptions {
|
|
27
|
+
/**
|
|
28
|
+
* Remote contexts gathered beforehand, by URL, besides the contexts
|
|
29
|
+
* preloaded by `@fedify/vocab-runtime`. Expansion never accesses the
|
|
30
|
+
* network, so it may run inside a transaction; a context found in neither
|
|
31
|
+
* fails the expansion.
|
|
32
|
+
*/
|
|
33
|
+
readonly contexts?: ReadonlyMap<string, GatheredContext>;
|
|
34
|
+
/**
|
|
35
|
+
* Called for each occurrence of a dropped term, before duplicates are
|
|
36
|
+
* removed from `droppedTerms`.
|
|
37
|
+
*/
|
|
38
|
+
readonly onDroppedTerm?: (term: string) => void;
|
|
39
|
+
}
|
|
40
|
+
/** A remote context gathered before an expansion, keyed by requested URL. */
|
|
41
|
+
interface GatheredContext {
|
|
42
|
+
/** The URL the context was finally loaded from, after redirects. */
|
|
43
|
+
readonly documentUrl: string;
|
|
44
|
+
/**
|
|
45
|
+
* The context a response linked to, such as with an HTTP `Link` header,
|
|
46
|
+
* which the processor applies with the loaded one.
|
|
47
|
+
*/
|
|
48
|
+
readonly contextUrl?: string | null;
|
|
49
|
+
readonly document: unknown;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Options the JSON-LD processor is given, as Fedify gives them when it reads
|
|
53
|
+
* a document, so that a node with only an `@id` is kept.
|
|
54
|
+
*/
|
|
55
|
+
declare const EXPAND_OPTIONS: {
|
|
56
|
+
readonly keepFreeFloatingNodes: true;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Why a stored value cannot be expanded, if it cannot: the processor reads a
|
|
60
|
+
* string as the URL of a document to load, which a stored value is not.
|
|
61
|
+
* @param document The stored value.
|
|
62
|
+
* @returns The failure reason, or undefined for an object or array.
|
|
63
|
+
*/
|
|
64
|
+
declare function unexpandableValue(document: unknown): string | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* Expands a document with the JSON-LD processor Fedify uses, reading
|
|
67
|
+
* contexts only from those preloaded and those given. Expansion failures are
|
|
68
|
+
* returned as a `failed` outcome rather than thrown.
|
|
69
|
+
* @param document The document as stored.
|
|
70
|
+
* @param options Options, including gathered contexts.
|
|
71
|
+
* @returns The outcome of the expansion.
|
|
72
|
+
*/
|
|
73
|
+
declare function expandDocument(document: unknown, options?: ExpandDocumentOptions): Promise<DocumentExpansion>;
|
|
74
|
+
/**
|
|
75
|
+
* Describes why an expansion failed, followed by its causes, since the
|
|
76
|
+
* JSON-LD processor wraps the error a context loader threw.
|
|
77
|
+
* @param error The thrown error.
|
|
78
|
+
* @returns The reason recorded for a `failed` outcome.
|
|
79
|
+
*/
|
|
80
|
+
declare function expansionFailure(error: unknown): string;
|
|
81
|
+
/**
|
|
82
|
+
* Lists the terms an expanded document keeps as blank node identifiers, in
|
|
83
|
+
* property names and `@type` values, without their `_:` prefix.
|
|
84
|
+
* @param expanded An expanded document.
|
|
85
|
+
* @returns The terms, sorted and without duplicates.
|
|
86
|
+
*/
|
|
87
|
+
declare function undefinedTermsOf(expanded: readonly unknown[]): string[];
|
|
88
|
+
//#endregion
|
|
89
|
+
export { expandDocument as a, unexpandableValue as c, GatheredContext as i, EXPAND_OPTIONS as n, expansionFailure as o, ExpandDocumentOptions as r, undefinedTermsOf as s, DocumentExpansion as t };
|
|
90
|
+
//# sourceMappingURL=expansion-p4BoMDVd.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expansion-p4BoMDVd.d.mts","names":[],"sources":["../src/expansion.ts"],"mappings":";;;;;;;;;;;;;KAkCY;WAEG;WACA;WACA;WACA;;WAEA;WAA4B;;WAC5B;;;UAGE;;;;;;;WAON,WAAW,oBAAoB;;;;;WAK/B,iBAAiB;;;UAIX;;WAEN;;;;;WAKA;WACA;;;;;;cA4BE;WAAmB;;;;;;;;iBAQhB,kBAAkB;;;;;;;;;iBAuBZ,eACpB,mBACA,UAAS,wBACR,QAAQ;;;;;;;iBAkEK,iBAAiB;;;;;;;iBAwBjB,iBAAiB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as expandDocument, c as unexpandableValue, i as GatheredContext, n as EXPAND_OPTIONS, o as expansionFailure, r as ExpandDocumentOptions, s as undefinedTermsOf, t as DocumentExpansion } from "./expansion-p4BoMDVd.mjs";
|
|
2
|
+
export { DocumentExpansion, EXPAND_OPTIONS, ExpandDocumentOptions, GatheredContext, expandDocument, expansionFailure, undefinedTermsOf, unexpandableValue };
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { preloadedContexts } from "@fedify/vocab-runtime";
|
|
2
|
+
import jsonld from "@fedify/vocab-runtime/jsonld";
|
|
3
|
+
//#region src/expansion.ts
|
|
4
|
+
function contextReader(contexts = /* @__PURE__ */ new Map()) {
|
|
5
|
+
return (url) => {
|
|
6
|
+
const gathered = Object.hasOwn(preloadedContexts, url) ? {
|
|
7
|
+
documentUrl: url,
|
|
8
|
+
document: preloadedContexts[url]
|
|
9
|
+
} : contexts.get(url);
|
|
10
|
+
if (gathered === void 0) return Promise.reject(/* @__PURE__ */ new Error(`The context ${JSON.stringify(url)} was not gathered.`));
|
|
11
|
+
const remote = {
|
|
12
|
+
contextUrl: gathered.contextUrl ?? null,
|
|
13
|
+
documentUrl: gathered.documentUrl,
|
|
14
|
+
document: gathered.document
|
|
15
|
+
};
|
|
16
|
+
return Promise.resolve(remote);
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Options the JSON-LD processor is given, as Fedify gives them when it reads
|
|
21
|
+
* a document, so that a node with only an `@id` is kept.
|
|
22
|
+
*/
|
|
23
|
+
const EXPAND_OPTIONS = { keepFreeFloatingNodes: true };
|
|
24
|
+
/**
|
|
25
|
+
* Why a stored value cannot be expanded, if it cannot: the processor reads a
|
|
26
|
+
* string as the URL of a document to load, which a stored value is not.
|
|
27
|
+
* @param document The stored value.
|
|
28
|
+
* @returns The failure reason, or undefined for an object or array.
|
|
29
|
+
*/
|
|
30
|
+
function unexpandableValue(document) {
|
|
31
|
+
if (document !== null && typeof document === "object") return void 0;
|
|
32
|
+
return `A JSON-LD document must be an object or array, not ${document === null ? "null" : typeof document}.`;
|
|
33
|
+
}
|
|
34
|
+
const DROPPED_TERM_EVENTS = /* @__PURE__ */ new Set(["invalid property", "invalid reverse property"]);
|
|
35
|
+
/**
|
|
36
|
+
* Expands a document with the JSON-LD processor Fedify uses, reading
|
|
37
|
+
* contexts only from those preloaded and those given. Expansion failures are
|
|
38
|
+
* returned as a `failed` outcome rather than thrown.
|
|
39
|
+
* @param document The document as stored.
|
|
40
|
+
* @param options Options, including gathered contexts.
|
|
41
|
+
* @returns The outcome of the expansion.
|
|
42
|
+
*/
|
|
43
|
+
async function expandDocument(document, options = {}) {
|
|
44
|
+
const unexpandable = unexpandableValue(document);
|
|
45
|
+
if (unexpandable !== void 0) return {
|
|
46
|
+
outcome: "failed",
|
|
47
|
+
failure: unexpandable
|
|
48
|
+
};
|
|
49
|
+
const dropped = [];
|
|
50
|
+
let expanded;
|
|
51
|
+
try {
|
|
52
|
+
expanded = await jsonld.expand(document, {
|
|
53
|
+
...EXPAND_OPTIONS,
|
|
54
|
+
documentLoader: contextReader(options.contexts),
|
|
55
|
+
eventHandler: ({ event }) => {
|
|
56
|
+
const property = event.details?.property;
|
|
57
|
+
if (DROPPED_TERM_EVENTS.has(event.code) && typeof property === "string") {
|
|
58
|
+
dropped.push(property);
|
|
59
|
+
options.onDroppedTerm?.(property);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
} catch (error) {
|
|
64
|
+
return {
|
|
65
|
+
outcome: "failed",
|
|
66
|
+
failure: expansionFailure(error)
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
const nodes = Array.isArray(expanded) ? expanded : [expanded];
|
|
70
|
+
return {
|
|
71
|
+
outcome: "expanded",
|
|
72
|
+
document: nodes,
|
|
73
|
+
droppedTerms: distinct(dropped),
|
|
74
|
+
undefinedTerms: undefinedTermsOf(nodes)
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
function describeError(error) {
|
|
78
|
+
if (error instanceof Error) return error.message === "" ? error.name : `${error.name}: ${error.message}`;
|
|
79
|
+
return String(error);
|
|
80
|
+
}
|
|
81
|
+
function causeOf(error) {
|
|
82
|
+
if (error === null || typeof error !== "object") return void 0;
|
|
83
|
+
const { details, cause } = error;
|
|
84
|
+
return details?.cause ?? cause;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Describes why an expansion failed, followed by its causes, since the
|
|
88
|
+
* JSON-LD processor wraps the error a context loader threw.
|
|
89
|
+
* @param error The thrown error.
|
|
90
|
+
* @returns The reason recorded for a `failed` outcome.
|
|
91
|
+
*/
|
|
92
|
+
function expansionFailure(error) {
|
|
93
|
+
const reasons = [describeError(error)];
|
|
94
|
+
const seen = /* @__PURE__ */ new Set([error]);
|
|
95
|
+
for (let cause = causeOf(error); cause !== void 0 && cause !== null && !seen.has(cause); cause = causeOf(cause)) {
|
|
96
|
+
seen.add(cause);
|
|
97
|
+
reasons.push(describeError(cause));
|
|
98
|
+
}
|
|
99
|
+
return reasons.join(" Caused by ");
|
|
100
|
+
}
|
|
101
|
+
function distinct(values) {
|
|
102
|
+
return [...new Set(values)].sort();
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Lists the terms an expanded document keeps as blank node identifiers, in
|
|
106
|
+
* property names and `@type` values, without their `_:` prefix.
|
|
107
|
+
* @param expanded An expanded document.
|
|
108
|
+
* @returns The terms, sorted and without duplicates.
|
|
109
|
+
*/
|
|
110
|
+
function undefinedTermsOf(expanded) {
|
|
111
|
+
const terms = [];
|
|
112
|
+
const visit = (value) => {
|
|
113
|
+
if (Array.isArray(value)) {
|
|
114
|
+
for (const entry of value) visit(entry);
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
if (value === null || typeof value !== "object") return;
|
|
118
|
+
for (const [key, entry] of Object.entries(value)) {
|
|
119
|
+
if (key.startsWith("_:")) terms.push(key.slice(2));
|
|
120
|
+
if (key === "@type") {
|
|
121
|
+
for (const type of Array.isArray(entry) ? entry : [entry]) if (typeof type === "string" && type.startsWith("_:")) terms.push(type.slice(2));
|
|
122
|
+
} else if (key !== "@value") visit(entry);
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
visit(expanded);
|
|
126
|
+
return distinct(terms);
|
|
127
|
+
}
|
|
128
|
+
//#endregion
|
|
129
|
+
export { EXPAND_OPTIONS, expandDocument, expansionFailure, undefinedTermsOf, unexpandableValue };
|
|
130
|
+
|
|
131
|
+
//# sourceMappingURL=expansion.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expansion.mjs","names":[],"sources":["../src/expansion.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/>.\nimport {\n type DocumentLoader,\n type RemoteDocument,\n preloadedContexts,\n} from \"@fedify/vocab-runtime\";\nimport jsonld from \"@fedify/vocab-runtime/jsonld\";\n\n/**\n * How the JSON-LD expansion of a revision's document turned out.\n *\n * - `expanded`: the document was expanded. `droppedTerms` lists the terms\n * the expansion discarded because no context defined them;\n * `undefinedTerms` lists the terms a vocabulary such as ActivityStreams,\n * whose context maps undefined terms with `\"@vocab\": \"_:\"`, kept as\n * blank node identifiers instead.\n * - `failed`: the document could not be expanded, for example because a\n * context could not be loaded.\n * - `no_document`: the revision has no document to expand.\n */\nexport type DocumentExpansion =\n | {\n readonly outcome: \"expanded\";\n readonly document: readonly unknown[];\n readonly droppedTerms: readonly string[];\n readonly undefinedTerms: readonly string[];\n }\n | { readonly outcome: \"failed\"; readonly failure: string }\n | { readonly outcome: \"no_document\" };\n\n/** Options for {@link expandDocument}. */\nexport interface ExpandDocumentOptions {\n /**\n * Remote contexts gathered beforehand, by URL, besides the contexts\n * preloaded by `@fedify/vocab-runtime`. Expansion never accesses the\n * network, so it may run inside a transaction; a context found in neither\n * fails the expansion.\n */\n readonly contexts?: ReadonlyMap<string, GatheredContext>;\n /**\n * Called for each occurrence of a dropped term, before duplicates are\n * removed from `droppedTerms`.\n */\n readonly onDroppedTerm?: (term: string) => void;\n}\n\n/** A remote context gathered before an expansion, keyed by requested URL. */\nexport interface GatheredContext {\n /** The URL the context was finally loaded from, after redirects. */\n readonly documentUrl: string;\n /**\n * The context a response linked to, such as with an HTTP `Link` header,\n * which the processor applies with the loaded one.\n */\n readonly contextUrl?: string | null;\n readonly document: unknown;\n}\n\nfunction contextReader(\n contexts: ReadonlyMap<string, GatheredContext> = new Map(),\n): DocumentLoader {\n return (url) => {\n const gathered = Object.hasOwn(preloadedContexts, url)\n ? { documentUrl: url, document: preloadedContexts[url] }\n : contexts.get(url);\n if (gathered === undefined) {\n return Promise.reject(\n new Error(`The context ${JSON.stringify(url)} was not gathered.`),\n );\n }\n const remote: RemoteDocument = {\n contextUrl: gathered.contextUrl ?? null,\n documentUrl: gathered.documentUrl,\n document: gathered.document,\n };\n return Promise.resolve(remote);\n };\n}\n\n/**\n * Options the JSON-LD processor is given, as Fedify gives them when it reads\n * a document, so that a node with only an `@id` is kept.\n */\nexport const EXPAND_OPTIONS = { keepFreeFloatingNodes: true } as const;\n\n/**\n * Why a stored value cannot be expanded, if it cannot: the processor reads a\n * string as the URL of a document to load, which a stored value is not.\n * @param document The stored value.\n * @returns The failure reason, or undefined for an object or array.\n */\nexport function unexpandableValue(document: unknown): string | undefined {\n if (document !== null && typeof document === \"object\") return undefined;\n return `A JSON-LD document must be an object or array, not ${\n document === null ? \"null\" : typeof document\n }.`;\n}\n\nconst DROPPED_TERM_EVENTS: ReadonlySet<string> = new Set([\n \"invalid property\",\n \"invalid reverse property\",\n]);\n\ntype ExpandInput = Parameters<typeof jsonld.expand>[0];\ntype ExpandOptions = NonNullable<Parameters<typeof jsonld.expand>[1]>;\n\n/**\n * Expands a document with the JSON-LD processor Fedify uses, reading\n * contexts only from those preloaded and those given. Expansion failures are\n * returned as a `failed` outcome rather than thrown.\n * @param document The document as stored.\n * @param options Options, including gathered contexts.\n * @returns The outcome of the expansion.\n */\nexport async function expandDocument(\n document: unknown,\n options: ExpandDocumentOptions = {},\n): Promise<DocumentExpansion> {\n const unexpandable = unexpandableValue(document);\n if (unexpandable !== undefined) {\n return { outcome: \"failed\", failure: unexpandable };\n }\n const dropped: string[] = [];\n let expanded: unknown;\n try {\n expanded = await jsonld.expand(\n document as ExpandInput,\n {\n ...EXPAND_OPTIONS,\n documentLoader: contextReader(options.contexts),\n eventHandler: ({ event }: { event: JsonLdEvent }) => {\n const property = event.details?.property;\n if (\n DROPPED_TERM_EVENTS.has(event.code) &&\n typeof property === \"string\"\n ) {\n dropped.push(property);\n options.onDroppedTerm?.(property);\n }\n },\n } as ExpandOptions,\n );\n } catch (error) {\n return { outcome: \"failed\", failure: expansionFailure(error) };\n }\n const nodes = Array.isArray(expanded) ? (expanded as unknown[]) : [expanded];\n return {\n outcome: \"expanded\",\n document: nodes,\n droppedTerms: distinct(dropped),\n undefinedTerms: undefinedTermsOf(nodes),\n };\n}\n\ninterface JsonLdEvent {\n readonly code: string;\n readonly details?: { readonly property?: unknown };\n}\n\nfunction describeError(error: unknown): string {\n if (error instanceof Error) {\n return error.message === \"\"\n ? error.name\n : `${error.name}: ${error.message}`;\n }\n return String(error);\n}\n\nfunction causeOf(error: unknown): unknown {\n if (error === null || typeof error !== \"object\") return undefined;\n const { details, cause } = error as {\n readonly details?: { readonly cause?: unknown };\n readonly cause?: unknown;\n };\n return details?.cause ?? cause;\n}\n\n/**\n * Describes why an expansion failed, followed by its causes, since the\n * JSON-LD processor wraps the error a context loader threw.\n * @param error The thrown error.\n * @returns The reason recorded for a `failed` outcome.\n */\nexport function expansionFailure(error: unknown): string {\n const reasons = [describeError(error)];\n const seen = new Set<unknown>([error]);\n for (\n let cause = causeOf(error);\n cause !== undefined && cause !== null && !seen.has(cause);\n cause = causeOf(cause)\n ) {\n seen.add(cause);\n reasons.push(describeError(cause));\n }\n return reasons.join(\" Caused by \");\n}\n\nfunction distinct(values: readonly string[]): string[] {\n return [...new Set(values)].sort();\n}\n\n/**\n * Lists the terms an expanded document keeps as blank node identifiers, in\n * property names and `@type` values, without their `_:` prefix.\n * @param expanded An expanded document.\n * @returns The terms, sorted and without duplicates.\n */\nexport function undefinedTermsOf(expanded: readonly unknown[]): string[] {\n const terms: string[] = [];\n const visit = (value: unknown): void => {\n if (Array.isArray(value)) {\n for (const entry of value) visit(entry);\n return;\n }\n if (value === null || typeof value !== \"object\") return;\n for (const [key, entry] of Object.entries(value)) {\n if (key.startsWith(\"_:\")) terms.push(key.slice(2));\n if (key === \"@type\") {\n for (const type of Array.isArray(entry) ? entry : [entry]) {\n if (typeof type === \"string\" && type.startsWith(\"_:\")) {\n terms.push(type.slice(2));\n }\n }\n } else if (key !== \"@value\") {\n visit(entry);\n }\n }\n };\n visit(expanded);\n return distinct(terms);\n}\n"],"mappings":";;;AAwEA,SAAS,cACP,2BAAiD,IAAI,IAAI,GACzC;CAChB,QAAQ,QAAQ;EACd,MA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QAAQ,KAAK,IAAI,QAAQ,CAAC,KAAK,GACtD,IAAI,OAAO,SAAS,YAAY,KAAK,WAAW,IAAI,GAClD,MAAM,KAAK,KAAK,MAAM,CAAC,CAAC;GAAA,OAGvB,IAAI,QAAQ,UACjB,MAAM,KAAK;EAEf;CACF;CACA,MAAM,QAAQ;CACd,OAAO,SAAS,KAAK;AACvB"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $t as observeKeyVersion, Qt as jwkThumbprint, Yt as schema_d_exports, Zt as PublicJwk, en as thumbprintInput, i as relations, n as RelationsFilter, r as Transaction, t as Database, tn as toPublicJwk } from "./db-Al_MT-L_.mjs";
|
|
2
2
|
import { AddressedActor, InboundDeliveryEntry, OutboundDeliveryEntry, OutboundSettlement, inboundActorRows, linkInboundActivity, receiveInbound, recordFetchedObject, recordInbound, recordOutbound, settleOutbound } from "./activity-delivery.mjs";
|
|
3
3
|
import { normalizeEmail } from "./email.mjs";
|
|
4
4
|
import { MigrateCredentials, MigrateOptions, PGliteMigrateCredentials, PostgresMigrateCredentials, migrate } from "./migrate.mjs";
|
|
@@ -11,5 +11,5 @@ import { InspectMigrationStateOptions, MigrationHistoryFormat, MigrationQueryCli
|
|
|
11
11
|
import { a as preparePostgresDatabase, i as migrationLockKey, n as PostgresPreparationCredentials, o as MigrationPreparationCode, r as PreparePostgresOptions, s as MigrationPreparationError, t as MigrationClientFactory } from "./migration-session-B4xHeU_a.mjs";
|
|
12
12
|
import { PersistentPgliteStore, PgliteStoreCode, PgliteStoreError, openPersistentPglite } from "./pglite-store.mjs";
|
|
13
13
|
import { PreparePgliteOptions, preparePgliteDatabase } from "./pglite-preparation.mjs";
|
|
14
|
-
import { _ as
|
|
15
|
-
export { AddressedActor, AddressingInput, AddressingOccurrence, AppendResourceRevisionInput, Database, InboundDeliveryEntry, InspectMigrationStateOptions, JsonObject, JsonValue, LegacyResourceRevisionError, LoginChallengeConsumptionError, LoginChallengeError, LoginChallengeNotFoundError, MigrateCredentials, MigrateOptions, MigrationClientFactory, MigrationHistoryFormat, MigrationIdentity, MigrationManifest, MigrationManifestPaths, type MigrationPreparationCode, MigrationPreparationError, MigrationQueryClient, MigrationState, MigrationStatus, OutboundDeliveryEntry, OutboundSettlement, PGliteMigrateCredentials, PUBLIC_IRI, PUBLIC_RESOURCE_ID, PersistentPgliteStore, PgliteStoreCode, PgliteStoreError, PostgresMigrateCredentials, PostgresPreparationCredentials, PreparePgliteOptions, PreparePostgresOptions, PublicJwk, RelationsFilter, ResourceKindConflictError, ResourceRevisionStateError, RevisionConflictError, RevisionEmbeddingInput, RevisionRelationInput, StoredResourceRevision, Transaction, TypedObjectColumns, TypedResourceRevisionInput, addActorCollectionItem, appendResourceRevision, assertMigrationManifestPrefix, captureLegacyResourceRevision, checkAddressingOccurrences, classifyMigrationHistory, consumeLoginChallenge, ensureRemoteInstance, ensureResource, findLoginChallenge, generateLoginChallengeCode, inboundActorRows, inspectMigrationState, jwkThumbprint, linkInboundActivity, listResourceRevisions, loadCurrentResourceRevision, loadResourceRevision, lockActorCollection, lockResources, migrate, migrationLockKey, migrationTimestamp, normalizeEmail, observeKeyVersion, openPersistentPglite, parseMigrationManifest, preparePgliteDatabase, preparePostgresDatabase, promoteResource, receiveInbound, recordFetchedObject, recordInbound, recordOutbound, relations, replaceAddressing, schema_d_exports as schema, settleOutbound, storableText, storeAddressing, storeAddressingOccurrences, thumbprintInput, toPublicJwk, verifyMigrationManifest, writeTypedResourceRevision };
|
|
14
|
+
import { C as listFailedRevisions, E as retryRevisionExpansion, S as findCarryingActivityRevision, T as recordRevisionExpansion, _ as ResourceRevisionStateError, a as RevisionRelationInput, b as RevisionExpansionInput, c as TypedResourceRevisionInput, d as loadCurrentResourceRevision, f as loadResourceRevision, g as captureLegacyResourceRevision, h as CaptureLegacyResourceRevisionOptions, i as RevisionEmbeddingInput, l as appendResourceRevision, m as writeTypedResourceRevision, n as JsonObject, o as StoredResourceRevision, p as loadRevisionExpansion, r as JsonValue, s as TypedObjectColumns, t as AppendResourceRevisionInput, u as listResourceRevisions, v as LegacyResourceRevisionError, w as listUnexpandedRevisions, x as UnexpandedRevision, y as RevisionConflictError } from "./resource-revision-BbXciRsu.mjs";
|
|
15
|
+
export { AddressedActor, AddressingInput, AddressingOccurrence, AppendResourceRevisionInput, type CaptureLegacyResourceRevisionOptions, Database, InboundDeliveryEntry, InspectMigrationStateOptions, JsonObject, JsonValue, LegacyResourceRevisionError, LoginChallengeConsumptionError, LoginChallengeError, LoginChallengeNotFoundError, MigrateCredentials, MigrateOptions, MigrationClientFactory, MigrationHistoryFormat, MigrationIdentity, MigrationManifest, MigrationManifestPaths, type MigrationPreparationCode, MigrationPreparationError, MigrationQueryClient, MigrationState, MigrationStatus, OutboundDeliveryEntry, OutboundSettlement, PGliteMigrateCredentials, PUBLIC_IRI, PUBLIC_RESOURCE_ID, PersistentPgliteStore, PgliteStoreCode, PgliteStoreError, PostgresMigrateCredentials, PostgresPreparationCredentials, PreparePgliteOptions, PreparePostgresOptions, PublicJwk, RelationsFilter, ResourceKindConflictError, ResourceRevisionStateError, RevisionConflictError, RevisionEmbeddingInput, type RevisionExpansionInput, RevisionRelationInput, StoredResourceRevision, Transaction, TypedObjectColumns, TypedResourceRevisionInput, type UnexpandedRevision, addActorCollectionItem, appendResourceRevision, assertMigrationManifestPrefix, captureLegacyResourceRevision, checkAddressingOccurrences, classifyMigrationHistory, consumeLoginChallenge, ensureRemoteInstance, ensureResource, findCarryingActivityRevision, findLoginChallenge, generateLoginChallengeCode, inboundActorRows, inspectMigrationState, jwkThumbprint, linkInboundActivity, listFailedRevisions, listResourceRevisions, listUnexpandedRevisions, loadCurrentResourceRevision, loadResourceRevision, loadRevisionExpansion, lockActorCollection, lockResources, migrate, migrationLockKey, migrationTimestamp, normalizeEmail, observeKeyVersion, openPersistentPglite, parseMigrationManifest, preparePgliteDatabase, preparePostgresDatabase, promoteResource, receiveInbound, recordFetchedObject, recordInbound, recordOutbound, recordRevisionExpansion, relations, replaceAddressing, retryRevisionExpansion, schema_d_exports as schema, settleOutbound, storableText, storeAddressing, storeAddressingOccurrences, thumbprintInput, toPublicJwk, verifyMigrationManifest, writeTypedResourceRevision };
|
package/dist/index.mjs
CHANGED
|
@@ -15,5 +15,5 @@ import { n as MigrationPreparationError } from "./migration-snapshot-OM5jQN1-.mj
|
|
|
15
15
|
import { migrationLockKey, preparePostgresDatabase } from "./migration-session.mjs";
|
|
16
16
|
import { PgliteStoreError, openPersistentPglite } from "./pglite-store.mjs";
|
|
17
17
|
import { preparePgliteDatabase } from "./pglite-preparation.mjs";
|
|
18
|
-
import { a as
|
|
19
|
-
export { LegacyResourceRevisionError, LoginChallengeConsumptionError, LoginChallengeError, LoginChallengeNotFoundError, MigrationPreparationError, PUBLIC_IRI, PUBLIC_RESOURCE_ID, PgliteStoreError, ResourceKindConflictError, ResourceRevisionStateError, RevisionConflictError, addActorCollectionItem, appendResourceRevision, assertMigrationManifestPrefix, captureLegacyResourceRevision, checkAddressingOccurrences, classifyMigrationHistory, consumeLoginChallenge, ensureRemoteInstance, ensureResource, findLoginChallenge, generateLoginChallengeCode, inboundActorRows, inspectMigrationState, jwkThumbprint, linkInboundActivity, listResourceRevisions, loadCurrentResourceRevision, loadResourceRevision, lockActorCollection, lockResources, migrate, migrationLockKey, migrationTimestamp, normalizeEmail, observeKeyVersion, openPersistentPglite, parseMigrationManifest, preparePgliteDatabase, preparePostgresDatabase, promoteResource, receiveInbound, recordFetchedObject, recordInbound, recordOutbound, relations, replaceAddressing, schema_exports as schema, settleOutbound, storableText, storeAddressing, storeAddressingOccurrences, thumbprintInput, toPublicJwk, verifyMigrationManifest, writeTypedResourceRevision };
|
|
18
|
+
import { a as loadRevisionExpansion, c as findCarryingActivityRevision, d as recordRevisionExpansion, f as retryRevisionExpansion, h as LegacyResourceRevisionError, i as loadResourceRevision, l as listFailedRevisions, m as ResourceRevisionStateError, n as listResourceRevisions, o as writeTypedResourceRevision, p as RevisionConflictError, r as loadCurrentResourceRevision, s as captureLegacyResourceRevision, t as appendResourceRevision, u as listUnexpandedRevisions } from "./resource-revision-DGsz8fnS.mjs";
|
|
19
|
+
export { LegacyResourceRevisionError, LoginChallengeConsumptionError, LoginChallengeError, LoginChallengeNotFoundError, MigrationPreparationError, PUBLIC_IRI, PUBLIC_RESOURCE_ID, PgliteStoreError, ResourceKindConflictError, ResourceRevisionStateError, RevisionConflictError, addActorCollectionItem, appendResourceRevision, assertMigrationManifestPrefix, captureLegacyResourceRevision, checkAddressingOccurrences, classifyMigrationHistory, consumeLoginChallenge, ensureRemoteInstance, ensureResource, findCarryingActivityRevision, findLoginChallenge, generateLoginChallengeCode, inboundActorRows, inspectMigrationState, jwkThumbprint, linkInboundActivity, listFailedRevisions, listResourceRevisions, listUnexpandedRevisions, loadCurrentResourceRevision, loadResourceRevision, loadRevisionExpansion, lockActorCollection, lockResources, migrate, migrationLockKey, migrationTimestamp, normalizeEmail, observeKeyVersion, openPersistentPglite, parseMigrationManifest, preparePgliteDatabase, preparePostgresDatabase, promoteResource, receiveInbound, recordFetchedObject, recordInbound, recordOutbound, recordRevisionExpansion, relations, replaceAddressing, retryRevisionExpansion, schema_exports as schema, settleOutbound, storableText, storeAddressing, storeAddressingOccurrences, thumbprintInput, toPublicJwk, verifyMigrationManifest, writeTypedResourceRevision };
|
package/dist/instance.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as Transaction, t as Database, x as Instance } from "./db-
|
|
1
|
+
import { r as Transaction, t as Database, x as Instance } from "./db-Al_MT-L_.mjs";
|
|
2
2
|
//#region src/instance.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* Returns the remote instance of a host, registering it if it is new. The
|
package/dist/key.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $t as observeKeyVersion, Qt as jwkThumbprint, Zt as PublicJwk, en as thumbprintInput, tn as toPublicJwk } from "./db-Al_MT-L_.mjs";
|
|
2
2
|
export { PublicJwk, jwkThumbprint, observeKeyVersion, thumbprintInput, toPublicJwk };
|
package/dist/login.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as LoginChallenge, r as Transaction, t as Database } from "./db-
|
|
1
|
+
import { A as LoginChallenge, r as Transaction, t as Database } from "./db-Al_MT-L_.mjs";
|
|
2
2
|
import { t as Uuid } from "./uuid-CKMzlIND.mjs";
|
|
3
3
|
import { SQL } from "drizzle-orm/sql";
|
|
4
4
|
//#region src/login.d.ts
|
|
@@ -124,6 +124,10 @@
|
|
|
124
124
|
{
|
|
125
125
|
"name": "20261113080537_guard_revision_embeddings",
|
|
126
126
|
"sha256": "565918b747d0a6d092cdb1d68cf709a729b705c17489b2e333aca294c692b8f5"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"name": "20261125051505_revision_expansions",
|
|
130
|
+
"sha256": "15d30fdb8b3d0db2d5ee3a37d93ddeb17350a48d433948d09522538d6ee369b8"
|
|
127
131
|
}
|
|
128
132
|
]
|
|
129
133
|
}
|
package/dist/relations.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as relations } from "./db-
|
|
1
|
+
import { i as relations } from "./db-Al_MT-L_.mjs";
|
|
2
2
|
export { relations as default, relations };
|