@drfed/models 0.2.0-dev.639 → 0.2.0-dev.682
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/README.md +340 -188
- package/dist/activity-delivery.d.mts +1 -1
- package/dist/activity-delivery.d.mts.map +1 -1
- package/dist/activity-delivery.mjs +34 -9
- package/dist/activity-delivery.mjs.map +1 -1
- package/dist/{db-DtcLuISw.d.mts → db-BBw4F4HU.d.mts} +478 -6
- package/dist/{db-DtcLuISw.d.mts.map → db-BBw4F4HU.d.mts.map} +1 -1
- package/dist/db.d.mts +1 -1
- package/dist/document.d.mts +200 -0
- package/dist/document.d.mts.map +1 -0
- package/dist/document.mjs +1264 -0
- package/dist/document.mjs.map +1 -0
- package/dist/index.d.mts +3 -2
- package/dist/index.mjs +2 -1
- 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 +12 -0
- package/dist/relations.d.mts +1 -1
- package/dist/relations.mjs +65 -0
- package/dist/relations.mjs.map +1 -1
- package/dist/resource-revision-BuG5kUlA.d.mts +103 -0
- package/dist/resource-revision-BuG5kUlA.d.mts.map +1 -0
- package/dist/resource-revision-DWg6et77.mjs +313 -0
- package/dist/resource-revision-DWg6et77.mjs.map +1 -0
- package/dist/resource-revision.d.mts +2 -0
- package/dist/resource-revision.mjs +3 -0
- package/dist/resource.d.mts +1 -1
- package/dist/schema.d.mts +2 -2
- package/dist/schema.mjs +104 -5
- package/dist/schema.mjs.map +1 -1
- package/drizzle/20261026181201_resource_revision_storage/migration.sql +72 -0
- package/drizzle/20261026181201_resource_revision_storage/snapshot.json +4501 -0
- package/drizzle/20261026181206_guard_resource_revisions/migration.sql +175 -0
- package/drizzle/20261026181206_guard_resource_revisions/snapshot.json +4501 -0
- package/drizzle/20261026192411_capture_legacy_resource_revisions/migration.sql +249 -0
- package/drizzle/20261026192411_capture_legacy_resource_revisions/snapshot.json +4501 -0
- package/package.json +19 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"db-
|
|
1
|
+
{"version":3,"file":"db-BBw4F4HU.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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAAT,SAAA;;;;;;YAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAoBD,kBAAkB,UAAU;KAC5B,qBAAqB,UAAU;cAE9B,8CAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAAd,SAAA;;;;;;YAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAuBD,uBAAuB,eAAe;KACtC,0BAA0B,eAAe;;;;;;cAOxC,+CAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA0BhB,wBAAwB,gBAAgB;KACxC,2BAA2B,gBAAgB;;cAG1C;;;;;cAMA,+CAAe;;;;;;;;;;;;;;;;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WAAW,gBACrB,yBACOC,yBACA;;;;KAMG,cAAc,mBACxB,yBACOA,yBACA;;;;KAMGC,kBAAgB,uBAAuB,aACjDC,wBAA4B,WAAW,WAAW"}
|
package/dist/db.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as RelationsFilter, r as Transaction, t as Database } from "./db-
|
|
1
|
+
import { n as RelationsFilter, r as Transaction, t as Database } from "./db-BBw4F4HU.mjs";
|
|
2
2
|
export { Database, RelationsFilter, Transaction };
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
//#region src/document.d.ts
|
|
2
|
+
/** The source property names and zero-based indexes leading to a finding. */
|
|
3
|
+
type FieldPath = readonly (string | number)[];
|
|
4
|
+
type DiagnosticCategory = "vocabulary" | "authority" | "support" | "compatibility";
|
|
5
|
+
type DiagnosticSeverity = "error" | "warning";
|
|
6
|
+
/** Stable classifications; human-readable diagnostic messages may change. */
|
|
7
|
+
declare const diagnosticReasons: {
|
|
8
|
+
readonly invalid_document_root: {
|
|
9
|
+
readonly category: "vocabulary";
|
|
10
|
+
readonly severity: "error";
|
|
11
|
+
};
|
|
12
|
+
readonly non_json_value: {
|
|
13
|
+
readonly category: "vocabulary";
|
|
14
|
+
readonly severity: "error";
|
|
15
|
+
};
|
|
16
|
+
readonly invalid_value_shape: {
|
|
17
|
+
readonly category: "vocabulary";
|
|
18
|
+
readonly severity: "error";
|
|
19
|
+
};
|
|
20
|
+
readonly invalid_iri: {
|
|
21
|
+
readonly category: "vocabulary";
|
|
22
|
+
readonly severity: "error";
|
|
23
|
+
};
|
|
24
|
+
readonly invalid_datetime: {
|
|
25
|
+
readonly category: "vocabulary";
|
|
26
|
+
readonly severity: "error";
|
|
27
|
+
};
|
|
28
|
+
readonly invalid_multiplicity: {
|
|
29
|
+
readonly category: "vocabulary";
|
|
30
|
+
readonly severity: "error";
|
|
31
|
+
};
|
|
32
|
+
readonly property_not_applicable: {
|
|
33
|
+
readonly category: "vocabulary";
|
|
34
|
+
readonly severity: "error";
|
|
35
|
+
};
|
|
36
|
+
readonly invalid_context: {
|
|
37
|
+
readonly category: "vocabulary";
|
|
38
|
+
readonly severity: "error";
|
|
39
|
+
};
|
|
40
|
+
readonly unauthorized_local_identity: {
|
|
41
|
+
readonly category: "authority";
|
|
42
|
+
readonly severity: "error";
|
|
43
|
+
};
|
|
44
|
+
readonly server_owned_field_conflict: {
|
|
45
|
+
readonly category: "authority";
|
|
46
|
+
readonly severity: "error";
|
|
47
|
+
};
|
|
48
|
+
readonly context_unavailable_offline: {
|
|
49
|
+
readonly category: "support";
|
|
50
|
+
readonly severity: "error";
|
|
51
|
+
};
|
|
52
|
+
readonly unsupported_context_form: {
|
|
53
|
+
readonly category: "support";
|
|
54
|
+
readonly severity: "error";
|
|
55
|
+
};
|
|
56
|
+
readonly unsupported_type: {
|
|
57
|
+
readonly category: "support";
|
|
58
|
+
readonly severity: "error";
|
|
59
|
+
};
|
|
60
|
+
readonly unsupported_property: {
|
|
61
|
+
readonly category: "support";
|
|
62
|
+
readonly severity: "error";
|
|
63
|
+
};
|
|
64
|
+
readonly unsupported_value_form: {
|
|
65
|
+
readonly category: "support";
|
|
66
|
+
readonly severity: "error";
|
|
67
|
+
};
|
|
68
|
+
readonly processing_limit_exceeded: {
|
|
69
|
+
readonly category: "support";
|
|
70
|
+
readonly severity: "error";
|
|
71
|
+
};
|
|
72
|
+
readonly diagnostic_limit_reached: {
|
|
73
|
+
readonly category: "support";
|
|
74
|
+
readonly severity: "error";
|
|
75
|
+
};
|
|
76
|
+
readonly implicit_activitystreams_context: {
|
|
77
|
+
readonly category: "compatibility";
|
|
78
|
+
readonly severity: "warning";
|
|
79
|
+
};
|
|
80
|
+
readonly extension_property_unchecked: {
|
|
81
|
+
readonly category: "compatibility";
|
|
82
|
+
readonly severity: "warning";
|
|
83
|
+
};
|
|
84
|
+
readonly empty_property_list: {
|
|
85
|
+
readonly category: "compatibility";
|
|
86
|
+
readonly severity: "warning";
|
|
87
|
+
};
|
|
88
|
+
readonly absent_identifier: {
|
|
89
|
+
readonly category: "compatibility";
|
|
90
|
+
readonly severity: "warning";
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
type DiagnosticReason = keyof typeof diagnosticReasons;
|
|
94
|
+
interface Diagnostic {
|
|
95
|
+
readonly reason: DiagnosticReason;
|
|
96
|
+
readonly category: DiagnosticCategory;
|
|
97
|
+
readonly severity: DiagnosticSeverity;
|
|
98
|
+
readonly path: FieldPath;
|
|
99
|
+
readonly message: string;
|
|
100
|
+
}
|
|
101
|
+
type JsonValue = null | boolean | number | string | readonly JsonValue[] | {
|
|
102
|
+
readonly [key: string]: JsonValue;
|
|
103
|
+
};
|
|
104
|
+
/** A proposed transformation; validation never applies it to the input. */
|
|
105
|
+
type NormalizationChange = {
|
|
106
|
+
readonly operation: "add";
|
|
107
|
+
readonly reason: string;
|
|
108
|
+
readonly path: FieldPath;
|
|
109
|
+
readonly after: JsonValue;
|
|
110
|
+
readonly message: string;
|
|
111
|
+
} | {
|
|
112
|
+
readonly operation: "replace";
|
|
113
|
+
readonly reason: string;
|
|
114
|
+
readonly path: FieldPath;
|
|
115
|
+
readonly before: JsonValue;
|
|
116
|
+
readonly after: JsonValue;
|
|
117
|
+
readonly message: string;
|
|
118
|
+
} | {
|
|
119
|
+
readonly operation: "remove";
|
|
120
|
+
readonly reason: string;
|
|
121
|
+
readonly path: FieldPath;
|
|
122
|
+
readonly before: JsonValue;
|
|
123
|
+
readonly message: string;
|
|
124
|
+
};
|
|
125
|
+
interface DocumentValidationResult {
|
|
126
|
+
/** Whether checks finished, including a definite invalid-input conclusion. */
|
|
127
|
+
readonly complete: boolean;
|
|
128
|
+
readonly diagnostics: readonly Diagnostic[];
|
|
129
|
+
readonly normalizedDocument?: {
|
|
130
|
+
readonly [key: string]: JsonValue;
|
|
131
|
+
};
|
|
132
|
+
readonly changes: readonly NormalizationChange[];
|
|
133
|
+
}
|
|
134
|
+
/** A permission outcome established by server code, not by document content. */
|
|
135
|
+
interface DocumentAuthority {
|
|
136
|
+
readonly allowed: boolean;
|
|
137
|
+
/** Original document location; use [] for an operation-level denial. */
|
|
138
|
+
readonly path: FieldPath;
|
|
139
|
+
}
|
|
140
|
+
/** An authoritative creation value allocated by the caller, never the editor. */
|
|
141
|
+
interface ServerOwnedField {
|
|
142
|
+
/** Source path to id, actor, attributedTo, published, or updated. */
|
|
143
|
+
readonly path: FieldPath;
|
|
144
|
+
readonly value: string;
|
|
145
|
+
}
|
|
146
|
+
/** Trusted server inputs; these options must not be accepted from a client. */
|
|
147
|
+
interface DocumentPreparationOptions {
|
|
148
|
+
/** At least one explicit outcome is required; omission never means allowed. */
|
|
149
|
+
readonly authority: readonly [DocumentAuthority, ...DocumentAuthority[]];
|
|
150
|
+
readonly serverOwnedFields: readonly ServerOwnedField[];
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Checks the implemented Activity Vocabulary types, including nested
|
|
154
|
+
* activity objects, without network access or writes. Embedded objects inherit
|
|
155
|
+
* the parent's context. Collections add member, count, and navigation checks.
|
|
156
|
+
* Question uses shared intransitive rules; poll-specific
|
|
157
|
+
* fields remain unsupported pending #155.
|
|
158
|
+
*
|
|
159
|
+
* Supports allowlisted bundled contexts and simple inline aliases/prefixes,
|
|
160
|
+
* single types, id, string content,
|
|
161
|
+
* attribution/location and activity actor, object, target, origin, result,
|
|
162
|
+
* and instrument values. These can be IRI references or supported
|
|
163
|
+
* embedded types, singly or in flat lists. Empty supported property arrays
|
|
164
|
+
* receive omission previews. Intransitive activities
|
|
165
|
+
* reject a non-null object property. Other forms produce
|
|
166
|
+
* support diagnostics and `complete: false`. This is not a permission check,
|
|
167
|
+
* a Fedify parsability check, or full ActivityStreams validation.
|
|
168
|
+
* The input must be plain JSON data, not a Proxy.
|
|
169
|
+
* Context interpretation is bounded and synchronous. Unknown
|
|
170
|
+
* custom properties are preserved as opaque JSON with warnings. Complex
|
|
171
|
+
* contexts remain unsupported; input is never expanded.
|
|
172
|
+
* Null list entries mean absence. Functional properties accept at most one
|
|
173
|
+
* non-null value, preserving array-index paths. Common text/language maps,
|
|
174
|
+
* timestamps, actor preferredUsername, and addressing are checked.
|
|
175
|
+
* @returns Findings at original-input paths, with an explicit omission preview
|
|
176
|
+
* for empty supported property arrays and absent identifiers only when validation
|
|
177
|
+
* completes without errors.
|
|
178
|
+
*/
|
|
179
|
+
declare function validateDocument(document: unknown): DocumentValidationResult;
|
|
180
|
+
/**
|
|
181
|
+
* Prepares a creation preview against trusted server values and permission
|
|
182
|
+
* outcomes. Does not determine authorization, allocate values, or persist.
|
|
183
|
+
*
|
|
184
|
+
* Integration boundary: https://github.com/fedify-dev/drfed/issues/152
|
|
185
|
+
* The write operation constructs options from trusted server state, not client
|
|
186
|
+
* JSON. It must check every local write, including nested creations, and recheck
|
|
187
|
+
* permissions at commit. This preview is not an authorization token. The caller
|
|
188
|
+
* also owns keeping committed IDs/timestamps consistent with the shown preview.
|
|
189
|
+
* Merely referencing or embedding an actor/resource does not request a write.
|
|
190
|
+
*
|
|
191
|
+
* Paths identify original source locations; owned-field aliases are resolved
|
|
192
|
+
* within the supported context profile. Matching singleton values are retained;
|
|
193
|
+
* absent/null values receive explicit additions/replacements. Conflicts block
|
|
194
|
+
* the preview. Throws TypeError for invalid trusted options/target paths.
|
|
195
|
+
* @returns Original-input diagnostics and any explicit creation preview changes.
|
|
196
|
+
*/
|
|
197
|
+
declare function prepareDocument(document: unknown, options: DocumentPreparationOptions): DocumentValidationResult;
|
|
198
|
+
//#endregion
|
|
199
|
+
export { Diagnostic, DiagnosticCategory, DiagnosticReason, DiagnosticSeverity, DocumentAuthority, DocumentPreparationOptions, DocumentValidationResult, FieldPath, JsonValue, NormalizationChange, ServerOwnedField, diagnosticReasons, prepareDocument, validateDocument };
|
|
200
|
+
//# sourceMappingURL=document.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document.d.mts","names":[],"sources":["../src/document.ts"],"mappings":";;KAqEY;KAEA;KAMA;;cAGC;;aACc;aAAwB;;;aAC/B;aAAwB;;;aACnB;aAAwB;;;aAChC;aAAwB;;;aACnB;aAAwB;;;aACpB;aAAwB;;;aACrB;aAAwB;;;aAChC;aAAwB;;;aACZ;aAAuB;;;aACvB;aAAuB;;;aACvB;aAAqB;;;aACxB;aAAqB;;;aAC7B;aAAqB;;;aACjB;aAAqB;;;aACnB;aAAqB;;;aAClB;aAAqB;;;aACtB;aAAqB;;;aAE/C;aACA;;;aAGA;aACA;;;aAEqB;aAA2B;;;aAC7B;aAA2B;;;KAStC,gCAAgC;UAE3B;WACN,QAAQ;WACR,UAAU;WACV,UAAU;WACV,MAAM;WACN;;KAGC,wDAKC;YACG,cAAc;;;KAGlB;WAEG;WACA;WACA,MAAM;WACN,OAAO;WACP;;WAGA;WACA;WACA,MAAM;WACN,QAAQ;WACR,OAAO;WACP;;WAGA;WACA;WACA,MAAM;WACN,QAAQ;WACR;;UAGE;;WAEN;WACA,sBAAsB;WACtB;cAAiC,cAAc;;WAC/C,kBAAkB;;;UAIZ;WACN;;WAEA,MAAM;;;UAIA;;WAEN,MAAM;WACN;;;UAIM;;WAEN,qBAAqB,sBAAsB;WAC3C,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA8yDvB,iBAAiB,oBAAoB;;;;;;;;;;;;;;;;;;iBA0QrC,gBACd,mBACA,SAAS,6BACR"}
|