@the_library/public 1.0.0 → 2.0.0
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 +201 -28
- package/assets/branding/pond-enterprise-logo.svg +1 -1
- package/dist/Book-K86JRm42.d.ts +600 -0
- package/dist/bookSearchService-BmFHrvsv.d.ts +300 -0
- package/dist/branding/index.js +1 -66
- package/dist/branding/index.js.map +1 -1
- package/dist/chunk-3XUKOVEF.js +2 -0
- package/dist/chunk-3XUKOVEF.js.map +1 -0
- package/dist/chunk-46FQHZNM.js +2 -0
- package/dist/chunk-46FQHZNM.js.map +1 -0
- package/dist/chunk-7G3BMGV2.js +2 -0
- package/dist/chunk-7G3BMGV2.js.map +1 -0
- package/dist/chunk-D4DXGA2W.js +2 -0
- package/dist/chunk-D4DXGA2W.js.map +1 -0
- package/dist/chunk-EMA2QJTW.js +2 -0
- package/dist/chunk-EMA2QJTW.js.map +1 -0
- package/dist/chunk-FN52YV7L.js +2 -0
- package/dist/chunk-FN52YV7L.js.map +1 -0
- package/dist/chunk-GWQNULP4.js +2 -0
- package/dist/chunk-GWQNULP4.js.map +1 -0
- package/dist/chunk-OELHBR4F.js +2 -0
- package/dist/chunk-OELHBR4F.js.map +1 -0
- package/dist/chunk-PV3X54EU.js +2 -0
- package/dist/chunk-PV3X54EU.js.map +1 -0
- package/dist/chunk-SD3INWZF.js +2 -0
- package/dist/chunk-SD3INWZF.js.map +1 -0
- package/dist/downloader/dl2-sw.js +1 -198
- package/dist/downloader/dl2-sw.js.map +1 -1
- package/dist/downloader/file-worker-v2.js +1 -257
- package/dist/downloader/file-worker-v2.js.map +1 -1
- package/dist/downloader/index.d.ts +18 -2
- package/dist/downloader/index.js +1 -537
- package/dist/downloader/index.js.map +1 -1
- package/dist/downloader/mu-worker-v2.js +1 -196
- package/dist/downloader/mu-worker-v2.js.map +1 -1
- package/dist/downloader/react.d.ts +1 -1
- package/dist/downloader/react.js +1 -31
- package/dist/downloader/react.js.map +1 -1
- package/dist/downloader/solid.d.ts +1 -1
- package/dist/downloader/solid.js +1 -18
- package/dist/downloader/solid.js.map +1 -1
- package/dist/downloader/sw.js +1 -118
- package/dist/downloader/sw.js.map +1 -1
- package/dist/downloader/vue.d.ts +1 -1
- package/dist/downloader/vue.js +1 -18
- package/dist/downloader/vue.js.map +1 -1
- package/dist/enriched-index-T0sDG7JR.d.ts +209 -0
- package/dist/global/public.global.js +68 -0
- package/dist/global/public.manifest.json +484 -0
- package/dist/level-state-DXqglpAX.d.ts +27 -0
- package/dist/models/astro.d.ts +4 -3
- package/dist/models/astro.js +1 -43
- package/dist/models/astro.js.map +1 -1
- package/dist/models/index.d.ts +449 -22
- package/dist/models/index.js +1 -339
- package/dist/models/index.js.map +1 -1
- package/dist/models/models.d.ts +196 -441
- package/dist/models/models.js +1 -45
- package/dist/models/patch-worker.js +1 -542
- package/dist/models/patch-worker.js.map +1 -1
- package/dist/models/react.d.ts +6 -5
- package/dist/models/react.js +1 -72
- package/dist/models/react.js.map +1 -1
- package/dist/models/solid.d.ts +16 -6
- package/dist/models/solid.js +1 -94
- package/dist/models/solid.js.map +1 -1
- package/dist/models/vue.d.ts +90 -7
- package/dist/models/vue.js +1 -97
- package/dist/models/vue.js.map +1 -1
- package/dist/orm-MJTHCG9E.d.ts +1003 -0
- package/dist/{session-vqOnyxga.d.ts → session-JudUKAV7.d.ts} +76 -74
- package/dist/{state-BTsp-E4v.d.ts → state-CkYavOSt.d.ts} +16 -0
- package/dist/{types-Dn0EFMO_.d.ts → types-B-IX3HBn.d.ts} +94 -21
- package/dist/{types-Xb8Ta9tZ.d.ts → types-Blyx2A7F.d.ts} +10 -36
- package/dist/web3/auth.d.ts +89 -0
- package/dist/web3/auth.js +13 -0
- package/dist/web3/auth.js.map +1 -0
- package/dist/web3/index.d.ts +1913 -126
- package/dist/web3/index.js +1 -1019
- package/dist/web3/index.js.map +1 -1
- package/dist/web3/network.d.ts +6 -0
- package/dist/web3/network.js +2 -0
- package/dist/web3/network.js.map +1 -0
- package/dist/web3/registry.d.ts +34 -9
- package/dist/web3/registry.js +1 -22
- package/dist/web3/vue.d.ts +31 -14
- package/dist/web3/vue.js +1 -390
- package/dist/web3/vue.js.map +1 -1
- package/package.json +23 -2
- package/dist/chunk-2HFOWE5R.js +0 -296
- package/dist/chunk-2HFOWE5R.js.map +0 -1
- package/dist/chunk-3L6LH2XK.js +0 -465
- package/dist/chunk-3L6LH2XK.js.map +0 -1
- package/dist/chunk-4CWVFPBN.js +0 -28
- package/dist/chunk-4CWVFPBN.js.map +0 -1
- package/dist/chunk-AGHPATVL.js +0 -65
- package/dist/chunk-AGHPATVL.js.map +0 -1
- package/dist/chunk-JDUYLUDJ.js +0 -4835
- package/dist/chunk-JDUYLUDJ.js.map +0 -1
- package/dist/chunk-OEZK7IX7.js +0 -77
- package/dist/chunk-OEZK7IX7.js.map +0 -1
- package/dist/chunk-PUYDAUCI.js +0 -2873
- package/dist/chunk-PUYDAUCI.js.map +0 -1
- package/dist/chunk-WHWMTS7D.js +0 -99
- package/dist/chunk-WHWMTS7D.js.map +0 -1
- package/dist/chunk-Y7RS6RTM.js +0 -342
- package/dist/chunk-Y7RS6RTM.js.map +0 -1
- package/dist/chunk-ZEZGI2TP.js +0 -197
- package/dist/chunk-ZEZGI2TP.js.map +0 -1
- package/dist/core-dao-core-logo-VDT2I5IW.svg +0 -33
- package/dist/level-state-J3pj64Tr.d.ts +0 -15
- package/dist/models/models_v2.global.js +0 -1
- package/dist/orm-BvkX0aBT.d.ts +0 -507
package/dist/orm-BvkX0aBT.d.ts
DELETED
|
@@ -1,507 +0,0 @@
|
|
|
1
|
-
declare enum PatchOperation {
|
|
2
|
-
EditPropertyString = 1,
|
|
3
|
-
EditPropertyNumber = 2,
|
|
4
|
-
EditInstanceFieldString = 3,
|
|
5
|
-
EditInstanceFieldNumber = 4,
|
|
6
|
-
EditRelation = 5,
|
|
7
|
-
SetAlias = 6,
|
|
8
|
-
CreateRecord = 7,
|
|
9
|
-
AddInstance = 8
|
|
10
|
-
}
|
|
11
|
-
declare enum PatchAction {
|
|
12
|
-
Remove = 0,
|
|
13
|
-
Add = 1
|
|
14
|
-
}
|
|
15
|
-
interface BasePatch {
|
|
16
|
-
operation: PatchOperation;
|
|
17
|
-
objectType: number;
|
|
18
|
-
objectId: number;
|
|
19
|
-
langId: number;
|
|
20
|
-
}
|
|
21
|
-
interface EditPropertyNumberObj extends BasePatch {
|
|
22
|
-
operation: PatchOperation.EditPropertyNumber;
|
|
23
|
-
propertyId: number;
|
|
24
|
-
value: number;
|
|
25
|
-
}
|
|
26
|
-
interface EditPropertyStringObj extends BasePatch {
|
|
27
|
-
operation: PatchOperation.EditPropertyString;
|
|
28
|
-
propertyId: number;
|
|
29
|
-
value: string;
|
|
30
|
-
}
|
|
31
|
-
interface EditInstanceFieldNumberObj extends BasePatch {
|
|
32
|
-
operation: PatchOperation.EditInstanceFieldNumber;
|
|
33
|
-
instanceIndex: number;
|
|
34
|
-
propertyId: number;
|
|
35
|
-
value: number;
|
|
36
|
-
}
|
|
37
|
-
interface EditInstanceFieldStringObj extends BasePatch {
|
|
38
|
-
operation: PatchOperation.EditInstanceFieldString;
|
|
39
|
-
instanceIndex: number;
|
|
40
|
-
propertyId: number;
|
|
41
|
-
value: string;
|
|
42
|
-
}
|
|
43
|
-
interface EditRelationObj extends BasePatch {
|
|
44
|
-
operation: PatchOperation.EditRelation;
|
|
45
|
-
relationId: number;
|
|
46
|
-
action: PatchAction;
|
|
47
|
-
targetId: number;
|
|
48
|
-
}
|
|
49
|
-
interface SetAliasObj {
|
|
50
|
-
operation: PatchOperation.SetAlias;
|
|
51
|
-
objectType: number;
|
|
52
|
-
fromUid: number;
|
|
53
|
-
toUid: number;
|
|
54
|
-
}
|
|
55
|
-
interface CreateRecordObj {
|
|
56
|
-
operation: PatchOperation.CreateRecord;
|
|
57
|
-
objectType: number;
|
|
58
|
-
objectId: number;
|
|
59
|
-
langId: 0;
|
|
60
|
-
}
|
|
61
|
-
interface AddInstanceObj extends BasePatch {
|
|
62
|
-
operation: PatchOperation.AddInstance;
|
|
63
|
-
objectType: number;
|
|
64
|
-
objectId: number;
|
|
65
|
-
langId: number;
|
|
66
|
-
instanceIndex: number;
|
|
67
|
-
}
|
|
68
|
-
type AnyPatch = EditPropertyNumberObj | EditPropertyStringObj | EditInstanceFieldNumberObj | EditInstanceFieldStringObj | EditRelationObj | SetAliasObj | CreateRecordObj | AddInstanceObj;
|
|
69
|
-
interface EnumLayout {
|
|
70
|
-
bits: number;
|
|
71
|
-
values: string[];
|
|
72
|
-
}
|
|
73
|
-
interface PropLayout {
|
|
74
|
-
name: string;
|
|
75
|
-
type: 'string' | 'number' | 'boolean' | 'enum';
|
|
76
|
-
bits: number;
|
|
77
|
-
enum?: string;
|
|
78
|
-
}
|
|
79
|
-
interface VersionEntry {
|
|
80
|
-
hash: string;
|
|
81
|
-
enums: Record<string, EnumLayout>;
|
|
82
|
-
props: Record<number, PropLayout>;
|
|
83
|
-
instanceFields: Record<number, number[]>;
|
|
84
|
-
}
|
|
85
|
-
interface VersionsFile {
|
|
86
|
-
current: number;
|
|
87
|
-
versions: Record<number, VersionEntry>;
|
|
88
|
-
}
|
|
89
|
-
interface VersionLayout {
|
|
90
|
-
hash: string;
|
|
91
|
-
enums: Record<string, EnumLayout>;
|
|
92
|
-
props: Record<number, PropLayout>;
|
|
93
|
-
instanceFields: Record<number, number[]>;
|
|
94
|
-
}
|
|
95
|
-
interface EvmPayload {
|
|
96
|
-
version: number;
|
|
97
|
-
patches: bigint[];
|
|
98
|
-
textIndex: number[];
|
|
99
|
-
textData: string[];
|
|
100
|
-
}
|
|
101
|
-
declare const LANG_ID_ENCODE: Record<string, number>;
|
|
102
|
-
declare const LANG_ID_DECODE: Record<number, string>;
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Merges all version delta entries up to and including `version`.
|
|
106
|
-
*
|
|
107
|
-
* WARNING: COUPLING CONTRACT
|
|
108
|
-
* \`resolveLayout\` relies on \`computeVersionDelta\` emitting the FULL \`instanceFields\`
|
|
109
|
-
* array for any model that changed. It blindly overwrites the merged layout with the
|
|
110
|
-
* delta entry's array (\`merged.instanceFields[ot] = [...fields]\`). If future
|
|
111
|
-
* optimizations shrink \`versions.json\` by emitting only newly added fields, this
|
|
112
|
-
* function will silently corrupt the field layout by deleting historical fields.
|
|
113
|
-
*/
|
|
114
|
-
declare function resolveLayout(version: number, versionsFile: VersionsFile): VersionLayout;
|
|
115
|
-
declare function packPatch(patch: AnyPatch, layout: VersionLayout): bigint;
|
|
116
|
-
declare function unpackPatch(packed: bigint, layout: VersionLayout): AnyPatch;
|
|
117
|
-
declare function patchToEvm(patches: AnyPatch[], layout: VersionLayout, version: number): EvmPayload;
|
|
118
|
-
declare function evmToPatch(payload: EvmPayload, versionsFile: VersionsFile): AnyPatch[];
|
|
119
|
-
|
|
120
|
-
declare enum LifecycleStatus {
|
|
121
|
-
Provisional = 0,
|
|
122
|
-
Submitted = 1,
|
|
123
|
-
CommunityPending = 2,
|
|
124
|
-
Canonical = 3
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* Local-only, non-EVM operations (analytics, local state).
|
|
129
|
-
* EVM-bound mutations use `PatchOperation` from `@the_library/db_schemas`
|
|
130
|
-
* (re-exported in `binary.ts`) — do not add EVM operation variants here.
|
|
131
|
-
*/
|
|
132
|
-
declare enum ActionTypes {
|
|
133
|
-
Visit = 0,
|
|
134
|
-
VisitPart = 1,
|
|
135
|
-
Download = 2,
|
|
136
|
-
Rate = 3,
|
|
137
|
-
RatePart = 4,
|
|
138
|
-
Share = 5,
|
|
139
|
-
SharePart = 6
|
|
140
|
-
}
|
|
141
|
-
declare enum WorkerCommands {
|
|
142
|
-
Init = "init",// Initial load: fetch sidecars + local patches
|
|
143
|
-
SavePatches = "savePatches",
|
|
144
|
-
GetRecord = "getRecord",// LRU on-demand re-hydration (SPEC §2.5)
|
|
145
|
-
LoadLanguage = "loadLanguage"
|
|
146
|
-
}
|
|
147
|
-
declare enum Rating {
|
|
148
|
-
None = 0,
|
|
149
|
-
New = 1,
|
|
150
|
-
Keep = 2,
|
|
151
|
-
Trash = 3,
|
|
152
|
-
Shared = 4
|
|
153
|
-
}
|
|
154
|
-
declare enum WorkerEvent {
|
|
155
|
-
WorkerReady = "workerready",
|
|
156
|
-
WorkerLoadingError = "workerLoadingError",
|
|
157
|
-
DownloadStarted = "downloadStarted",
|
|
158
|
-
DownloadFinished = "downloadFinished",
|
|
159
|
-
DownloadError = "downloadError",
|
|
160
|
-
LevelUpdated = "levelUpdated"
|
|
161
|
-
}
|
|
162
|
-
declare enum DownloadState {
|
|
163
|
-
Unknown = 0,
|
|
164
|
-
Pending = 1,
|
|
165
|
-
InProgress = 2,
|
|
166
|
-
Done = 3,
|
|
167
|
-
Error = 4
|
|
168
|
-
}
|
|
169
|
-
/** Sidecar type byte in the DPM1 wire header (SPEC §4.1). */
|
|
170
|
-
declare enum SidecarType {
|
|
171
|
-
Slim = 0,
|
|
172
|
-
Extended = 1,
|
|
173
|
-
Provenance = 2
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
type Lang = string;
|
|
177
|
-
type uid = number;
|
|
178
|
-
interface RecordIdentityCluster {
|
|
179
|
-
sfcuid: string;
|
|
180
|
-
native: string;
|
|
181
|
-
aliases: string[];
|
|
182
|
-
wireId: number;
|
|
183
|
-
}
|
|
184
|
-
/**
|
|
185
|
-
* Key used in per-language value maps when a value is language-agnostic
|
|
186
|
-
* (patches with langId 0).
|
|
187
|
-
*/
|
|
188
|
-
declare const LANG_AGNOSTIC: Lang;
|
|
189
|
-
/**
|
|
190
|
-
* One embedded instance (e.g. a PDF variant of a Book). Keys are the
|
|
191
|
-
* instanceField names from the schema; `isDefault` is appended by the
|
|
192
|
-
* sidecar writer and is not an instanceField.
|
|
193
|
-
*/
|
|
194
|
-
type InstanceData = Record<string, string | number | boolean | null>;
|
|
195
|
-
/**
|
|
196
|
-
* V2 in-memory ORM tuple. All value maps are per-language (perLang defaults
|
|
197
|
-
* to true in the V2 schema); language-agnostic values use LANG_AGNOSTIC ("").
|
|
198
|
-
*/
|
|
199
|
-
type CommonOrmJson = [
|
|
200
|
-
uid,
|
|
201
|
-
Map<number, Set<number>>,
|
|
202
|
-
Map<number, Set<number>>,
|
|
203
|
-
Map<number, Map<Lang, number>>,
|
|
204
|
-
Map<number, Map<Lang, boolean>>,
|
|
205
|
-
Map<number, Map<Lang, string>>,
|
|
206
|
-
Map<Lang, InstanceData[]>
|
|
207
|
-
];
|
|
208
|
-
/** JSON-compatible serialization of CommonOrmJson (worker <-> main thread). */
|
|
209
|
-
type SerializedCommonOrmJson = [
|
|
210
|
-
uid,
|
|
211
|
-
Array<[number, Array<number>]>,
|
|
212
|
-
Array<[number, Array<number>]>,
|
|
213
|
-
Array<[number, Array<[Lang, number]>]>,
|
|
214
|
-
Array<[number, Array<[Lang, boolean]>]>,
|
|
215
|
-
Array<[number, Array<[Lang, string]>]>,
|
|
216
|
-
Array<[Lang, InstanceData[]]>
|
|
217
|
-
];
|
|
218
|
-
type PropertyType = 'string' | 'number' | 'boolean' | 'enum';
|
|
219
|
-
interface BaseLocalOp {
|
|
220
|
-
ts: number;
|
|
221
|
-
action: ActionTypes;
|
|
222
|
-
objectType: number;
|
|
223
|
-
objectId: number;
|
|
224
|
-
}
|
|
225
|
-
interface RateOp extends BaseLocalOp {
|
|
226
|
-
rate: Rating;
|
|
227
|
-
}
|
|
228
|
-
interface PartOp extends BaseLocalOp {
|
|
229
|
-
part: number;
|
|
230
|
-
}
|
|
231
|
-
interface RatePartOp extends PartOp {
|
|
232
|
-
rate: Rating;
|
|
233
|
-
}
|
|
234
|
-
interface ShareOp extends BaseLocalOp {
|
|
235
|
-
socialMediaId: number;
|
|
236
|
-
}
|
|
237
|
-
interface SharePartOp extends PartOp {
|
|
238
|
-
socialMediaId: number;
|
|
239
|
-
}
|
|
240
|
-
type LocalOp = RateOp | RatePartOp | PartOp | ShareOp | SharePartOp | BaseLocalOp;
|
|
241
|
-
/**
|
|
242
|
-
* Anything the patcher queue can hold: EVM-bound V2 patches (`AnyPatch`,
|
|
243
|
-
* discriminated by `operation`) or local analytics ops (discriminated by `action`).
|
|
244
|
-
*/
|
|
245
|
-
type QueueItem = AnyPatch | LocalOp;
|
|
246
|
-
declare const isEvmPatch: (item: QueueItem) => item is AnyPatch;
|
|
247
|
-
type SidecarUrls = {
|
|
248
|
-
objectType: number;
|
|
249
|
-
lang: Lang;
|
|
250
|
-
slimUrl?: string;
|
|
251
|
-
extendedUrl?: string;
|
|
252
|
-
provUrl?: string;
|
|
253
|
-
};
|
|
254
|
-
type InitPayload = {
|
|
255
|
-
cmd: WorkerCommands.Init;
|
|
256
|
-
payload: {
|
|
257
|
-
/** Flattened sidecar URLs for all selected languages. */
|
|
258
|
-
sidecars: Array<SidecarUrls>;
|
|
259
|
-
selectedLangs: Lang[];
|
|
260
|
-
};
|
|
261
|
-
};
|
|
262
|
-
type SavePatchesPayload = {
|
|
263
|
-
cmd: WorkerCommands.SavePatches;
|
|
264
|
-
payload: {
|
|
265
|
-
username: string;
|
|
266
|
-
patches: Array<QueueItem>;
|
|
267
|
-
};
|
|
268
|
-
};
|
|
269
|
-
type GetRecordPayload = {
|
|
270
|
-
cmd: WorkerCommands.GetRecord;
|
|
271
|
-
payload: {
|
|
272
|
-
objectType: number;
|
|
273
|
-
id: uid;
|
|
274
|
-
};
|
|
275
|
-
};
|
|
276
|
-
type LoadLanguagePayload = {
|
|
277
|
-
cmd: WorkerCommands.LoadLanguage;
|
|
278
|
-
payload: {
|
|
279
|
-
lang: Lang;
|
|
280
|
-
sidecars: Array<SidecarUrls>;
|
|
281
|
-
};
|
|
282
|
-
};
|
|
283
|
-
type WorkerPayload = InitPayload | SavePatchesPayload | GetRecordPayload | LoadLanguagePayload;
|
|
284
|
-
interface IThread {
|
|
285
|
-
sendRequest(payload: WorkerPayload, transferables?: Array<any>): Promise<any>;
|
|
286
|
-
}
|
|
287
|
-
type StatSummary = {
|
|
288
|
-
visits: Array<number>;
|
|
289
|
-
rating: Rating;
|
|
290
|
-
socialMediaId: Array<number>;
|
|
291
|
-
downloads: Array<number>;
|
|
292
|
-
parts: {
|
|
293
|
-
[partId: string]: {
|
|
294
|
-
rating: Rating;
|
|
295
|
-
socialMediaId: Array<number>;
|
|
296
|
-
visits: Array<number>;
|
|
297
|
-
};
|
|
298
|
-
};
|
|
299
|
-
};
|
|
300
|
-
interface BookData {
|
|
301
|
-
fileId: string;
|
|
302
|
-
parsed: boolean;
|
|
303
|
-
author: string;
|
|
304
|
-
title: string;
|
|
305
|
-
dimensions: Array<{
|
|
306
|
-
width: number;
|
|
307
|
-
height: number;
|
|
308
|
-
} | null>;
|
|
309
|
-
}
|
|
310
|
-
interface FileRecord {
|
|
311
|
-
id: string;
|
|
312
|
-
creationTime: number;
|
|
313
|
-
sizeKb: number;
|
|
314
|
-
content: Uint8Array;
|
|
315
|
-
local: boolean;
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
declare const PopulateStatsStore: (operations: Array<LocalOp>) => void;
|
|
319
|
-
declare const DownloadsByType: (objectType: number) => Array<number>;
|
|
320
|
-
declare const VisitsByType: (objectType: number) => Array<number>;
|
|
321
|
-
declare const FavoritesByTypes: (objectType: number) => Array<{
|
|
322
|
-
id: uid;
|
|
323
|
-
nbVisits: number;
|
|
324
|
-
rating: Rating;
|
|
325
|
-
}>;
|
|
326
|
-
declare class Stats {
|
|
327
|
-
private objectId;
|
|
328
|
-
protected objectType: number;
|
|
329
|
-
constructor(objectId: number, objectType: number);
|
|
330
|
-
favoriteParts(): Array<{
|
|
331
|
-
partId: number;
|
|
332
|
-
nbVisits: number;
|
|
333
|
-
rating: Rating;
|
|
334
|
-
}>;
|
|
335
|
-
check(): void;
|
|
336
|
-
visit(): void;
|
|
337
|
-
download(): void;
|
|
338
|
-
get rating(): Rating;
|
|
339
|
-
set rating(rating: Rating);
|
|
340
|
-
share(socialMediaId: number): void;
|
|
341
|
-
ratePart(partId: number, rating: Rating): void;
|
|
342
|
-
visitPart(partId: number): void;
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
interface UidFactory {
|
|
346
|
-
next(): Promise<{
|
|
347
|
-
wireId: number;
|
|
348
|
-
localId: number;
|
|
349
|
-
}>;
|
|
350
|
-
isUserCreated(wireId: number): boolean;
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
/**
|
|
354
|
-
* V2 model definition — the shape of the enriched JSON files in
|
|
355
|
-
* `@the_library/db_schemas/generated-src/*.json` (frozen numeric IDs).
|
|
356
|
-
*/
|
|
357
|
-
interface SchemaProp {
|
|
358
|
-
name: string;
|
|
359
|
-
type: PropertyType;
|
|
360
|
-
source: 'slim' | 'extended';
|
|
361
|
-
propId: number;
|
|
362
|
-
enum?: string;
|
|
363
|
-
bits?: number;
|
|
364
|
-
nullable?: boolean;
|
|
365
|
-
}
|
|
366
|
-
interface SchemaInstanceField {
|
|
367
|
-
name: string;
|
|
368
|
-
type: PropertyType;
|
|
369
|
-
propId: number;
|
|
370
|
-
enum?: string;
|
|
371
|
-
bits?: number;
|
|
372
|
-
nullable?: boolean;
|
|
373
|
-
identityComponent?: boolean;
|
|
374
|
-
source?: 'slim' | 'extended';
|
|
375
|
-
}
|
|
376
|
-
interface SchemaRelation {
|
|
377
|
-
name: string;
|
|
378
|
-
targetType: string;
|
|
379
|
-
direction: 'has' | 'in';
|
|
380
|
-
inverted: string;
|
|
381
|
-
relationId: number;
|
|
382
|
-
}
|
|
383
|
-
/**
|
|
384
|
-
* Cols field name for a `has`-relation tail. The `authors` relation keeps its
|
|
385
|
-
* historical `authorIds` name for back-compat; every other relation uses its
|
|
386
|
-
* schema name directly (e.g. Tag.tags, Tag.books). Single source of truth for
|
|
387
|
-
* both the codegen (schemaGenerator.ts, which emits `${relationColName(rel)}`
|
|
388
|
-
* as the ExtendedCols field name) and the runtime reader (orm.ts's
|
|
389
|
-
* mergeExtended, which must look up that same field name on the incoming cols
|
|
390
|
-
* object) — they must never drift apart.
|
|
391
|
-
*/
|
|
392
|
-
declare const relationColName: (rel: SchemaRelation) => string;
|
|
393
|
-
interface ModelDefinition {
|
|
394
|
-
name: string;
|
|
395
|
-
typePrefix: string;
|
|
396
|
-
objectId: number;
|
|
397
|
-
multipleInstances: boolean;
|
|
398
|
-
uidStrategy?: string | string[];
|
|
399
|
-
instanceUidStrategy?: string | string[];
|
|
400
|
-
standardPks?: Record<string, string>;
|
|
401
|
-
props: SchemaProp[];
|
|
402
|
-
instanceFields: SchemaInstanceField[];
|
|
403
|
-
relations: SchemaRelation[];
|
|
404
|
-
}
|
|
405
|
-
declare class SchemaRegistry {
|
|
406
|
-
private static instance;
|
|
407
|
-
private schemas;
|
|
408
|
-
private byName;
|
|
409
|
-
private constructor();
|
|
410
|
-
static getInstance(): SchemaRegistry;
|
|
411
|
-
register(schema: ModelDefinition): void;
|
|
412
|
-
get(id: number): ModelDefinition;
|
|
413
|
-
/** Lookup by model name (relation targetType resolution). */
|
|
414
|
-
getByName(name: string): ModelDefinition | undefined;
|
|
415
|
-
clear(): void;
|
|
416
|
-
}
|
|
417
|
-
declare const Registry: SchemaRegistry;
|
|
418
|
-
|
|
419
|
-
declare class Orm extends Stats {
|
|
420
|
-
readonly _id: uid;
|
|
421
|
-
protected _boolValues: Map<number, Map<string, boolean>>;
|
|
422
|
-
protected _stringValues: Map<number, Map<string, string>>;
|
|
423
|
-
protected _numberValues: Map<number, Map<string, number>>;
|
|
424
|
-
protected _has: Map<number, Set<number>>;
|
|
425
|
-
protected _in: Map<number, Set<number>>;
|
|
426
|
-
/** lang -> instance array (BookInstanceData structs, not ORM objects). */
|
|
427
|
-
protected _instances: Map<string, InstanceData[]>;
|
|
428
|
-
/** lang -> propId -> provenance code (2-bit: unset/AI/human/consensus). */
|
|
429
|
-
protected _provenance: Map<string, Map<number, number>>;
|
|
430
|
-
schema: ModelDefinition;
|
|
431
|
-
static createNewRequest(id: uid): CommonOrmJson;
|
|
432
|
-
static createNewRecord<T extends Orm>(this: {
|
|
433
|
-
new (json: any, creatorUsername?: string): T;
|
|
434
|
-
type: number;
|
|
435
|
-
}, uidFactory: UidFactory, creatorUsername: string): Promise<T>;
|
|
436
|
-
protected _creatorUsername?: string;
|
|
437
|
-
get creatorUsername(): string;
|
|
438
|
-
constructor(objectType: number, json: CommonOrmJson | SerializedCommonOrmJson, creatorUsername?: string);
|
|
439
|
-
toJSON(): SerializedCommonOrmJson;
|
|
440
|
-
get id(): number;
|
|
441
|
-
protected langOf(langId: number): Lang;
|
|
442
|
-
protected langIdOf(lang?: Lang): number;
|
|
443
|
-
get title(): string;
|
|
444
|
-
set title(value: string);
|
|
445
|
-
getTitle(lang: Lang): string;
|
|
446
|
-
setTitle(value: string, lang: Lang): void;
|
|
447
|
-
get description(): string;
|
|
448
|
-
set description(value: string);
|
|
449
|
-
getDescription(lang: Lang): string;
|
|
450
|
-
setDescription(value: string, lang: Lang): void;
|
|
451
|
-
get originalLang(): string;
|
|
452
|
-
set originalLang(value: string);
|
|
453
|
-
getOriginalLang(lang: Lang): string;
|
|
454
|
-
setOriginalLang(value: string, lang: Lang): void;
|
|
455
|
-
get ageGradeBand(): number;
|
|
456
|
-
set ageGradeBand(value: number);
|
|
457
|
-
get previewTxId(): string;
|
|
458
|
-
set previewTxId(value: string);
|
|
459
|
-
get safe(): boolean;
|
|
460
|
-
set safe(value: boolean);
|
|
461
|
-
get deleted(): boolean;
|
|
462
|
-
set deleted(value: boolean);
|
|
463
|
-
get lifecycleStatus(): LifecycleStatus;
|
|
464
|
-
set lifecycleStatus(value: LifecycleStatus);
|
|
465
|
-
protected dispatchString(propertyId: number, value: string, lang?: Lang): void;
|
|
466
|
-
protected dispatchNumber(propertyId: number, value: number, lang?: Lang): void;
|
|
467
|
-
protected dispatchRelation(relationId: number, action: PatchAction, targetId: number): void;
|
|
468
|
-
/**
|
|
469
|
-
* Raw in-memory relation mutation: no patch is emitted. Used by the
|
|
470
|
-
* generic inverse propagation in patch() and by generated in-side
|
|
471
|
-
* relation helpers. Idempotent (Set semantics).
|
|
472
|
-
*/
|
|
473
|
-
protected applyRelationRaw(direction: 'has' | 'in', relationId: number, action: PatchAction, targetId: number): void;
|
|
474
|
-
/**
|
|
475
|
-
* Bulk-restores the inverse (`in`) edges implied by this record's forward
|
|
476
|
-
* (`has`) relations onto their target records. The sidecar serializes only
|
|
477
|
-
* the `has` direction (§3.7.1); `mergeExtended` fills `_has`, but the inverse
|
|
478
|
-
* side (`Person.authorOf`, `Tag.inTags`, …) stays empty until this runs.
|
|
479
|
-
*
|
|
480
|
-
* No patch emitted, no reactivity fired (bulk boot path). Idempotent (Set
|
|
481
|
-
* add). Targets must already be materialized — call after a full
|
|
482
|
-
* `hydrateAll` pass (see `rebuildInverseRelations`).
|
|
483
|
-
*/
|
|
484
|
-
restoreInverses(): void;
|
|
485
|
-
/**
|
|
486
|
-
* Applies a V2 patch to the in-memory state. Triggers reactivity.
|
|
487
|
-
*/
|
|
488
|
-
patch(patch: AnyPatch, _isMine?: boolean): void;
|
|
489
|
-
protected applyInstancePatch(p: EditInstanceFieldStringObj | EditInstanceFieldNumberObj): void;
|
|
490
|
-
protected getPropType(propId: number): 'string' | 'number' | 'boolean';
|
|
491
|
-
getProp(propId: number, lang?: Lang): any;
|
|
492
|
-
/** Direct state write — no patch emitted (used by merge methods). */
|
|
493
|
-
protected setRaw(propId: number, value: any, lang?: Lang): void;
|
|
494
|
-
getInstancesData(lang?: Lang): InstanceData[];
|
|
495
|
-
getDefaultInstanceData(lang?: Lang): InstanceData | undefined;
|
|
496
|
-
/** Direct state write — no patch emitted (used by mergeExtended/mergeSlim). */
|
|
497
|
-
setInstancesRaw(lang: Lang, instances: InstanceData[]): void;
|
|
498
|
-
growInstances(lang: Lang, toIndex: number): void;
|
|
499
|
-
addInstance(lang?: Lang): number;
|
|
500
|
-
getProvenance(propId: number, lang?: Lang): number;
|
|
501
|
-
setProvenanceRaw(lang: Lang, propId: number, value: number): void;
|
|
502
|
-
mergeSlim(cols: any, index: number, lang?: Lang): void;
|
|
503
|
-
mergeExtended(cols: any, index: number, lang?: Lang): void;
|
|
504
|
-
mergeProv(cols: any, index: number, lang?: Lang): void;
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
export { LANG_ID_DECODE as $, type AnyPatch as A, type BookData as B, type CommonOrmJson as C, DownloadState as D, type EvmPayload as E, type FileRecord as F, type GetRecordPayload as G, SchemaRegistry as H, type InstanceData as I, Registry as J, PatchOperation as K, type Lang as L, type ModelDefinition as M, PatchAction as N, Orm as O, type PropertyType as P, type QueueItem as Q, type RecordIdentityCluster as R, SidecarType as S, packPatch as T, unpackPatch as U, type VersionsFile as V, WorkerCommands as W, resolveLayout as X, patchToEvm as Y, evmToPatch as Z, LANG_ID_ENCODE as _, type SidecarUrls as a, type BasePatch as a0, type EditPropertyStringObj as a1, type EditPropertyNumberObj as a2, type EditInstanceFieldStringObj as a3, type EditInstanceFieldNumberObj as a4, type EditRelationObj as a5, type SetAliasObj as a6, type CreateRecordObj as a7, type AddInstanceObj as a8, type VersionEntry as a9, type EnumLayout as aa, type PropLayout as ab, PopulateStatsStore as ac, DownloadsByType as ad, VisitsByType as ae, FavoritesByTypes as af, Stats as ag, type SerializedCommonOrmJson as b, type VersionLayout as c, type IThread as d, ActionTypes as e, Rating as f, WorkerEvent as g, LANG_AGNOSTIC as h, type BaseLocalOp as i, type RateOp as j, type PartOp as k, type RatePartOp as l, type ShareOp as m, type SharePartOp as n, type LocalOp as o, isEvmPatch as p, type InitPayload as q, type SavePatchesPayload as r, type LoadLanguagePayload as s, type WorkerPayload as t, type uid as u, type StatSummary as v, type SchemaProp as w, type SchemaInstanceField as x, type SchemaRelation as y, relationColName as z };
|