@opendatalabs/personal-server-ts-core 1.32.0 → 1.33.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/dist/additions/first-added.d.ts +203 -0
- package/dist/additions/first-added.d.ts.map +1 -0
- package/dist/additions/first-added.js +647 -0
- package/dist/additions/first-added.js.map +1 -0
- package/dist/additions/index.d.ts +6 -0
- package/dist/additions/index.d.ts.map +1 -0
- package/dist/additions/index.js +6 -0
- package/dist/additions/index.js.map +1 -0
- package/dist/additions/ledger-store.d.ts +69 -0
- package/dist/additions/ledger-store.d.ts.map +1 -0
- package/dist/additions/ledger-store.js +343 -0
- package/dist/additions/ledger-store.js.map +1 -0
- package/dist/additions/record-rules.d.ts +54 -0
- package/dist/additions/record-rules.d.ts.map +1 -0
- package/dist/additions/record-rules.js +191 -0
- package/dist/additions/record-rules.js.map +1 -0
- package/dist/additions/scope-lock.d.ts +14 -0
- package/dist/additions/scope-lock.d.ts.map +1 -0
- package/dist/additions/scope-lock.js +32 -0
- package/dist/additions/scope-lock.js.map +1 -0
- package/dist/additions/summary.d.ts +48 -0
- package/dist/additions/summary.d.ts.map +1 -0
- package/dist/additions/summary.js +101 -0
- package/dist/additions/summary.js.map +1 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +26 -0
- package/dist/api/index.js.map +1 -1
- package/dist/contracts/data.d.ts +19 -1
- package/dist/contracts/data.d.ts.map +1 -1
- package/dist/contracts/data.js +95 -23
- package/dist/contracts/data.js.map +1 -1
- package/dist/ports/index.d.ts +11 -0
- package/dist/ports/index.d.ts.map +1 -1
- package/dist/ports/index.js.map +1 -1
- package/dist/sync/workers/download.d.ts.map +1 -1
- package/dist/sync/workers/download.js +19 -0
- package/dist/sync/workers/download.js.map +1 -1
- package/dist/test-utils/memory-storage.d.ts.map +1 -1
- package/dist/test-utils/memory-storage.js +47 -9
- package/dist/test-utils/memory-storage.js.map +1 -1
- package/package.json +5 -1
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
/** A single-record scope (a profile): counted, never tracked. */
|
|
2
|
+
const singleton = () => ({
|
|
3
|
+
collection: "profile",
|
|
4
|
+
idFields: [],
|
|
5
|
+
rowIdFields: [],
|
|
6
|
+
singleton: true,
|
|
7
|
+
});
|
|
8
|
+
/** A collection counted toward the total but never tracked for additions. */
|
|
9
|
+
const untracked = (collection, aliases) => ({
|
|
10
|
+
collection,
|
|
11
|
+
...(aliases ? { aliases } : {}),
|
|
12
|
+
idFields: [],
|
|
13
|
+
rowIdFields: [],
|
|
14
|
+
});
|
|
15
|
+
/** Same id field in both forms. */
|
|
16
|
+
const sameId = (collection, fields, aliases) => ({
|
|
17
|
+
collection,
|
|
18
|
+
...(aliases ? { aliases } : {}),
|
|
19
|
+
idFields: fields,
|
|
20
|
+
rowIdFields: fields,
|
|
21
|
+
});
|
|
22
|
+
/**
|
|
23
|
+
* Scope -> its record collections. The server's `total` must agree with what
|
|
24
|
+
* the owner app counts, so a scope the app counts is never given an empty
|
|
25
|
+
* list; where identity is not provably stable it is counted but not tracked.
|
|
26
|
+
* An empty list means the owner app also counts 0 for the scope.
|
|
27
|
+
*
|
|
28
|
+
* Both stored forms of a scope must produce the same keys, so each rule names
|
|
29
|
+
* the id field per form. Where the projection binding keeps no field that is
|
|
30
|
+
* equal in both forms (linkedin.experience, linkedin.education: the legacy
|
|
31
|
+
* body drops the row id), the collection is untracked in both forms and only
|
|
32
|
+
* counts toward the total.
|
|
33
|
+
*
|
|
34
|
+
* Changing a rule's `collection` or id fields re-keys that scope's ledger, so
|
|
35
|
+
* its records would be dated as new until its sidecar is rebuilt.
|
|
36
|
+
*/
|
|
37
|
+
export const MEMORY_RECORD_RULES = {
|
|
38
|
+
// --- Empty: the owner app counts 0 records for these. -------------------
|
|
39
|
+
"chatgpt.memories": [],
|
|
40
|
+
"chatgpt.messages": [],
|
|
41
|
+
"github.profile": [],
|
|
42
|
+
"instagram.profile": [],
|
|
43
|
+
// --- Tracked: an id that is equal in both stored forms. -----------------
|
|
44
|
+
"chatgpt.conversations": [sameId("conversations", ["id"])],
|
|
45
|
+
// Claude's conversations and projects keep the row id in both forms.
|
|
46
|
+
"claude.conversations": [sameId("conversations", ["id"])],
|
|
47
|
+
"claude.projects": [sameId("projects", ["id"])],
|
|
48
|
+
// The binding projects the row's `html_url` into the legacy `url`.
|
|
49
|
+
"github.repositories": [
|
|
50
|
+
{
|
|
51
|
+
collection: "repositories",
|
|
52
|
+
idFields: ["url"],
|
|
53
|
+
rowIdFields: ["html_url"],
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
"github.starred": [
|
|
57
|
+
{ collection: "starred", idFields: ["url"], rowIdFields: ["html_url"] },
|
|
58
|
+
],
|
|
59
|
+
"github.events": [sameId("events", ["id"])],
|
|
60
|
+
// The PDPP streams behind this legacy scope are stored as their own scopes
|
|
61
|
+
// (`github.issues`, `github.pull_requests`, `github.user`), never as one
|
|
62
|
+
// `github.history` rows scope, so these rules serve the legacy body only.
|
|
63
|
+
"github.history": [
|
|
64
|
+
sameId("issues", ["id"]),
|
|
65
|
+
sameId("pullRequests", ["id"], ["pull_requests"]),
|
|
66
|
+
],
|
|
67
|
+
"github.issues": [sameId("issues", ["id"])],
|
|
68
|
+
"github.pull_requests": [sameId("pullRequests", ["id"], ["pull_requests"])],
|
|
69
|
+
// The PDPP `contributions` stream's records become the legacy `days` array.
|
|
70
|
+
"github.contributions": [sameId("days", ["date"], ["contributions"])],
|
|
71
|
+
// The binding projects the row `id` into the legacy `recordName`.
|
|
72
|
+
"icloud_notes.notes": [
|
|
73
|
+
{ collection: "notes", idFields: ["recordName"], rowIdFields: ["id"] },
|
|
74
|
+
],
|
|
75
|
+
"icloud_notes.folders": [
|
|
76
|
+
{ collection: "folders", idFields: ["recordName"], rowIdFields: ["id"] },
|
|
77
|
+
],
|
|
78
|
+
// The legacy post has no id; `taken_at` is copied unchanged.
|
|
79
|
+
"instagram.posts": [sameId("posts", ["taken_at"])],
|
|
80
|
+
// The PDPP `following` stream's records become the legacy `accounts` array;
|
|
81
|
+
// the binding projects the row `id` into the legacy `pk`.
|
|
82
|
+
"instagram.following": [
|
|
83
|
+
{
|
|
84
|
+
collection: "accounts",
|
|
85
|
+
aliases: ["following"],
|
|
86
|
+
idFields: ["pk"],
|
|
87
|
+
rowIdFields: ["id"],
|
|
88
|
+
},
|
|
89
|
+
],
|
|
90
|
+
// The PDPP `ads` stream carries all kinds; `streamFilter` keeps each
|
|
91
|
+
// collection to the rows the projection assigns to it. The owner app counts
|
|
92
|
+
// the category rows too, so they are counted (untracked) here.
|
|
93
|
+
"instagram.ads": [
|
|
94
|
+
{
|
|
95
|
+
...sameId("ad_topics", ["name"], ["ads"]),
|
|
96
|
+
streamFilter: { field: "kind", equals: "ad_topic" },
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
...sameId("advertisers", ["name"], ["ads"]),
|
|
100
|
+
streamFilter: { field: "kind", equals: "advertiser" },
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
...untracked("categories", ["ads"]),
|
|
104
|
+
streamFilter: { field: "kind", equals: "ad_category" },
|
|
105
|
+
},
|
|
106
|
+
],
|
|
107
|
+
"discord.servers": [sameId("servers", ["id"])],
|
|
108
|
+
"discord.messages": [sameId("messages", ["id"])],
|
|
109
|
+
"discord.connections": [sameId("connections", ["id"])],
|
|
110
|
+
// These store a PDPP `{ records }` body, whose rows are the collection. The
|
|
111
|
+
// dataset-named alias keeps a keyed body (`{ posts: [...] }`) on the same
|
|
112
|
+
// `records:` keys.
|
|
113
|
+
"x.posts": [sameId("records", ["id"], ["posts"])],
|
|
114
|
+
"x.likes": [sameId("records", ["id"], ["likes"])],
|
|
115
|
+
"x.bookmarks": [sameId("records", ["id"], ["bookmarks"])],
|
|
116
|
+
// The binding projects the row `uri` unchanged.
|
|
117
|
+
"spotify.playlists": [
|
|
118
|
+
sameId("playlists", ["uri"], ["public_playlists", "items"]),
|
|
119
|
+
],
|
|
120
|
+
"spotify.savedTracks": [
|
|
121
|
+
sameId("savedTracks", ["uri"], ["tracks", "items", "saved_tracks"]),
|
|
122
|
+
],
|
|
123
|
+
// The PDPP stream is `saved_tracks`, so the rows are stored under this
|
|
124
|
+
// scope; its keys equal the legacy `spotify.savedTracks` keys.
|
|
125
|
+
"spotify.saved_tracks": [
|
|
126
|
+
sameId("savedTracks", ["uri"], ["saved_tracks", "tracks", "items"]),
|
|
127
|
+
],
|
|
128
|
+
// The legacy body keeps the order number as `orderId`.
|
|
129
|
+
"amazon.orders": [
|
|
130
|
+
{ collection: "orders", idFields: ["orderId"], rowIdFields: ["id"] },
|
|
131
|
+
],
|
|
132
|
+
"shop.orders": [sameId("orders", ["id"])],
|
|
133
|
+
"oura.activity": [sameId("days", ["id"], ["activity"])],
|
|
134
|
+
"oura.readiness": [sameId("days", ["id"], ["readiness"])],
|
|
135
|
+
"youtube.playlists": [sameId("playlists", ["url"])],
|
|
136
|
+
// --- Counted, never tracked: the owner app counts them, but no field is --
|
|
137
|
+
// --- provably equal in both stored forms. They report a total and no -----
|
|
138
|
+
// --- additions, and a null trackedSince. ---------------------------------
|
|
139
|
+
// The legacy body drops the row id.
|
|
140
|
+
"linkedin.experience": [untracked("items", ["experience", "experiences"])],
|
|
141
|
+
"linkedin.education": [untracked("items", ["education"])],
|
|
142
|
+
"linkedin.connections": [untracked("connections")],
|
|
143
|
+
"linkedin.skills": [untracked("skills")],
|
|
144
|
+
"linkedin.languages": [untracked("languages")],
|
|
145
|
+
// One `sleep` stream feeds two legacy arrays, so both are counted.
|
|
146
|
+
"oura.sleep": [
|
|
147
|
+
untracked("sleepPeriods", ["sleep"]),
|
|
148
|
+
untracked("dailyScores"),
|
|
149
|
+
],
|
|
150
|
+
// No binding fixture proves an id equal in both forms.
|
|
151
|
+
"heb.orders": [untracked("orders")],
|
|
152
|
+
"wholefoods.orders": [untracked("orders")],
|
|
153
|
+
"heb.nutrition": [untracked("nutrition")],
|
|
154
|
+
"wholefoods.nutrition": [untracked("nutrition")],
|
|
155
|
+
"youtube.subscriptions": [untracked("subscriptions")],
|
|
156
|
+
"youtube.likes": [untracked("likedVideos", ["likes"])],
|
|
157
|
+
"youtube.watchLater": [untracked("watchLater")],
|
|
158
|
+
"youtube.watch_later": [untracked("watchLater", ["watch_later"])],
|
|
159
|
+
"youtube.history": [untracked("history")],
|
|
160
|
+
"youtube.watch_history": [untracked("history", ["watch_history"])],
|
|
161
|
+
"youtube.playlistItems": [untracked("playlists", ["playlistItems"])],
|
|
162
|
+
"youtube.playlist_items": [untracked("playlists", ["playlist_items"])],
|
|
163
|
+
// Single-record scopes.
|
|
164
|
+
"linkedin.profile": [singleton()],
|
|
165
|
+
"spotify.profile": [singleton()],
|
|
166
|
+
"youtube.profile": [singleton()],
|
|
167
|
+
"heb.profile": [singleton()],
|
|
168
|
+
"wholefoods.profile": [singleton()],
|
|
169
|
+
// Streams that only join into another scope's legacy body, which the owner
|
|
170
|
+
// app counts when they are stored as their own scopes.
|
|
171
|
+
"amazon.order_items": [untracked("order_items")],
|
|
172
|
+
"heb.order_items": [untracked("order_items")],
|
|
173
|
+
"wholefoods.order_items": [untracked("order_items")],
|
|
174
|
+
"claude.messages": [untracked("messages")],
|
|
175
|
+
"claude.account_profile": [untracked("account_profile")],
|
|
176
|
+
"claude.project_documents": [untracked("project_documents")],
|
|
177
|
+
"github.user": [untracked("user")],
|
|
178
|
+
"github.user_stats": [untracked("user_stats")],
|
|
179
|
+
"github.pinned_repositories": [untracked("pinned_repositories")],
|
|
180
|
+
"github.organizations": [untracked("organizations")],
|
|
181
|
+
"instagram.post_likes": [untracked("post_likes")],
|
|
182
|
+
"spotify.playlist_items": [untracked("playlist_items")],
|
|
183
|
+
};
|
|
184
|
+
/** The rules for a scope, or null when the scope has no entry (generic default applies). */
|
|
185
|
+
export function memoryRecordRulesFor(scope) {
|
|
186
|
+
if (!Object.prototype.hasOwnProperty.call(MEMORY_RECORD_RULES, scope)) {
|
|
187
|
+
return null;
|
|
188
|
+
}
|
|
189
|
+
return MEMORY_RECORD_RULES[scope] ?? null;
|
|
190
|
+
}
|
|
191
|
+
//# sourceMappingURL=record-rules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record-rules.js","sourceRoot":"","sources":["../../src/additions/record-rules.ts"],"names":[],"mappings":"AAiCA,iEAAiE;AACjE,MAAM,SAAS,GAAG,GAAqB,EAAE,CAAC,CAAC;IACzC,UAAU,EAAE,SAAS;IACrB,QAAQ,EAAE,EAAE;IACZ,WAAW,EAAE,EAAE;IACf,SAAS,EAAE,IAAI;CAChB,CAAC,CAAC;AAEH,6EAA6E;AAC7E,MAAM,SAAS,GAAG,CAChB,UAAkB,EAClB,OAA2B,EACT,EAAE,CAAC,CAAC;IACtB,UAAU;IACV,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAC/B,QAAQ,EAAE,EAAE;IACZ,WAAW,EAAE,EAAE;CAChB,CAAC,CAAC;AAEH,mCAAmC;AACnC,MAAM,MAAM,GAAG,CACb,UAAkB,EAClB,MAAyB,EACzB,OAA2B,EACT,EAAE,CAAC,CAAC;IACtB,UAAU;IACV,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAC/B,QAAQ,EAAE,MAAM;IAChB,WAAW,EAAE,MAAM;CACpB,CAAC,CAAC;AAEH;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAE5B;IACF,2EAA2E;IAC3E,kBAAkB,EAAE,EAAE;IACtB,kBAAkB,EAAE,EAAE;IACtB,gBAAgB,EAAE,EAAE;IACpB,mBAAmB,EAAE,EAAE;IAEvB,2EAA2E;IAC3E,uBAAuB,EAAE,CAAC,MAAM,CAAC,eAAe,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAC1D,qEAAqE;IACrE,sBAAsB,EAAE,CAAC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;IACd,CAAC;IACD,OAAO,mBAAmB,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC;AAC5C,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A per-scope mutex for everything that reads-modifies-writes or deletes a
|
|
3
|
+
* scope's first-seen sidecar (ledger updates, rebuilds, scope and version
|
|
4
|
+
* deletion). It serializes callers inside one process only.
|
|
5
|
+
*
|
|
6
|
+
* It is NOT re-entrant: a `fn` that (directly or through a storage call) asks
|
|
7
|
+
* for the same scope's lock waits for itself forever, and so does every later
|
|
8
|
+
* caller. Never hold it across a call into a storage delete method
|
|
9
|
+
* (`deleteScope`, `deleteVersion`, `deleteByFileId`, `dropUnsyncedEntry`):
|
|
10
|
+
* those take the lock themselves.
|
|
11
|
+
*/
|
|
12
|
+
/** Run `fn` after every earlier call for `scope` has settled; later calls wait for it. */
|
|
13
|
+
export declare function withScopeLock<T>(scope: string, fn: () => Promise<T>): Promise<T>;
|
|
14
|
+
//# sourceMappingURL=scope-lock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scope-lock.d.ts","sourceRoot":"","sources":["../../src/additions/scope-lock.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,0FAA0F;AAC1F,wBAAsB,aAAa,CAAC,CAAC,EACnC,KAAK,EAAE,MAAM,EACb,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GACnB,OAAO,CAAC,CAAC,CAAC,CAeZ"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A per-scope mutex for everything that reads-modifies-writes or deletes a
|
|
3
|
+
* scope's first-seen sidecar (ledger updates, rebuilds, scope and version
|
|
4
|
+
* deletion). It serializes callers inside one process only.
|
|
5
|
+
*
|
|
6
|
+
* It is NOT re-entrant: a `fn` that (directly or through a storage call) asks
|
|
7
|
+
* for the same scope's lock waits for itself forever, and so does every later
|
|
8
|
+
* caller. Never hold it across a call into a storage delete method
|
|
9
|
+
* (`deleteScope`, `deleteVersion`, `deleteByFileId`, `dropUnsyncedEntry`):
|
|
10
|
+
* those take the lock themselves.
|
|
11
|
+
*/
|
|
12
|
+
const tails = new Map();
|
|
13
|
+
/** Run `fn` after every earlier call for `scope` has settled; later calls wait for it. */
|
|
14
|
+
export async function withScopeLock(scope, fn) {
|
|
15
|
+
const previous = tails.get(scope) ?? Promise.resolve();
|
|
16
|
+
let release;
|
|
17
|
+
const mine = new Promise((resolve) => {
|
|
18
|
+
release = resolve;
|
|
19
|
+
});
|
|
20
|
+
const tail = previous.then(() => mine);
|
|
21
|
+
tails.set(scope, tail);
|
|
22
|
+
await previous;
|
|
23
|
+
try {
|
|
24
|
+
return await fn();
|
|
25
|
+
}
|
|
26
|
+
finally {
|
|
27
|
+
release();
|
|
28
|
+
if (tails.get(scope) === tail)
|
|
29
|
+
tails.delete(scope);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=scope-lock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scope-lock.js","sourceRoot":"","sources":["../../src/additions/scope-lock.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,KAAK,GAAG,IAAI,GAAG,EAAyB,CAAC;AAE/C,0FAA0F;AAC1F,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,KAAa,EACb,EAAoB;IAEpB,MAAM,QAAQ,GAAG,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;IACvD,IAAI,OAAoB,CAAC;IACzB,MAAM,IAAI,GAAG,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;QACzC,OAAO,GAAG,OAAO,CAAC;IACpB,CAAC,CAAC,CAAC;IACH,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;IACvC,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACvB,MAAM,QAAQ,CAAC;IACf,IAAI,CAAC;QACH,OAAO,MAAM,EAAE,EAAE,CAAC;IACpB,CAAC;YAAS,CAAC;QACT,OAAO,EAAE,CAAC;QACV,IAAI,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,IAAI;YAAE,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACrD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Additions summary: how many records each scope's newest version holds and
|
|
3
|
+
* how many of those records were first seen on each of the last N local
|
|
4
|
+
* calendar days. Pure: it reads only the ledgers it is handed, never a store,
|
|
5
|
+
* and never mutates them. A day's count is meaningful for a scope only for
|
|
6
|
+
* days after that scope's `trackedSince`.
|
|
7
|
+
*/
|
|
8
|
+
import { type ScopeFirstSeenLedger } from "./first-added.js";
|
|
9
|
+
export interface AdditionsSummaryInput {
|
|
10
|
+
/**
|
|
11
|
+
* One first-seen ledger per visible scope. Consumed one at a time, so a
|
|
12
|
+
* lazy source keeps only one ledger in memory.
|
|
13
|
+
*/
|
|
14
|
+
ledgers: Iterable<ScopeFirstSeenLedger> | AsyncIterable<ScopeFirstSeenLedger>;
|
|
15
|
+
/** IANA timezone, e.g. "America/Toronto". */
|
|
16
|
+
timezone: string;
|
|
17
|
+
/** Number of local calendar days to report, ending with the day containing `now`. 1..31. */
|
|
18
|
+
days: number;
|
|
19
|
+
now: Date;
|
|
20
|
+
}
|
|
21
|
+
export interface AdditionsSummary {
|
|
22
|
+
timezone: string;
|
|
23
|
+
/** Records in each scope's newest version (tracked or not), summed. */
|
|
24
|
+
total: number;
|
|
25
|
+
/** Oldest first, exactly `days` entries, the last one is the local day containing `now`. */
|
|
26
|
+
days: {
|
|
27
|
+
date: string;
|
|
28
|
+
added: number;
|
|
29
|
+
}[];
|
|
30
|
+
/** Earliest scope baseline, or null when no scope has a trackable version yet. */
|
|
31
|
+
trackedSince: string | null;
|
|
32
|
+
scopes: {
|
|
33
|
+
scope: string;
|
|
34
|
+
total: number;
|
|
35
|
+
/**
|
|
36
|
+
* The scope's baseline: records first seen then predate tracking. Null
|
|
37
|
+
* when no version of the scope is trackable yet (binary only, over the
|
|
38
|
+
* record cap, or no record has an id): the scope is total-only.
|
|
39
|
+
*/
|
|
40
|
+
trackedSince: string | null;
|
|
41
|
+
}[];
|
|
42
|
+
}
|
|
43
|
+
export declare class InvalidTimezoneError extends Error {
|
|
44
|
+
}
|
|
45
|
+
/** Throws InvalidTimezoneError unless `timezone` is a known IANA zone. */
|
|
46
|
+
export declare function validateTimezone(timezone: string): void;
|
|
47
|
+
export declare function summarizeAdditions(input: AdditionsSummaryInput): Promise<AdditionsSummary>;
|
|
48
|
+
//# sourceMappingURL=summary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"summary.d.ts","sourceRoot":"","sources":["../../src/additions/summary.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,kBAAkB,CAAC;AAE1B,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,OAAO,EAAE,QAAQ,CAAC,oBAAoB,CAAC,GAAG,aAAa,CAAC,oBAAoB,CAAC,CAAC;IAC9E,6CAA6C;IAC7C,QAAQ,EAAE,MAAM,CAAC;IACjB,4FAA4F;IAC5F,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,IAAI,CAAC;CACX;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,uEAAuE;IACvE,KAAK,EAAE,MAAM,CAAC;IACd,4FAA4F;IAC5F,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACxC,kFAAkF;IAClF,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,MAAM,EAAE;QACN,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd;;;;WAIG;QACH,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;KAC7B,EAAE,CAAC;CACL;AAED,qBAAa,oBAAqB,SAAQ,KAAK;CAAG;AA2DlD,0EAA0E;AAC1E,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAEvD;AAED,wBAAsB,kBAAkB,CACtC,KAAK,EAAE,qBAAqB,GAC3B,OAAO,CAAC,gBAAgB,CAAC,CAsC3B"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Additions summary: how many records each scope's newest version holds and
|
|
3
|
+
* how many of those records were first seen on each of the last N local
|
|
4
|
+
* calendar days. Pure: it reads only the ledgers it is handed, never a store,
|
|
5
|
+
* and never mutates them. A day's count is meaningful for a scope only for
|
|
6
|
+
* days after that scope's `trackedSince`.
|
|
7
|
+
*/
|
|
8
|
+
import { listAddedTimestamps, } from "./first-added.js";
|
|
9
|
+
export class InvalidTimezoneError extends Error {
|
|
10
|
+
}
|
|
11
|
+
function createFormatter(timezone) {
|
|
12
|
+
try {
|
|
13
|
+
return new Intl.DateTimeFormat("en-CA", {
|
|
14
|
+
timeZone: timezone,
|
|
15
|
+
year: "numeric",
|
|
16
|
+
month: "2-digit",
|
|
17
|
+
day: "2-digit",
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
throw new InvalidTimezoneError(`Unknown timezone: ${timezone}`);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The local "YYYY-MM-DD" of an instant, built from `formatToParts` rather
|
|
26
|
+
* than the joined en-CA string so the ordering is guaranteed.
|
|
27
|
+
*/
|
|
28
|
+
function localDate(formatter, instant) {
|
|
29
|
+
let year = "";
|
|
30
|
+
let month = "";
|
|
31
|
+
let day = "";
|
|
32
|
+
for (const part of formatter.formatToParts(instant)) {
|
|
33
|
+
if (part.type === "year")
|
|
34
|
+
year = part.value;
|
|
35
|
+
else if (part.type === "month")
|
|
36
|
+
month = part.value;
|
|
37
|
+
else if (part.type === "day")
|
|
38
|
+
day = part.value;
|
|
39
|
+
}
|
|
40
|
+
return `${year}-${month}-${day}`;
|
|
41
|
+
}
|
|
42
|
+
function pad2(value) {
|
|
43
|
+
return String(value).padStart(2, "0");
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* `days` local dates, oldest first, ending with the local day of `now`.
|
|
47
|
+
* Previous dates use calendar arithmetic on the Y-M-D parts (via UTC), so a
|
|
48
|
+
* daylight-saving change cannot skip or repeat a day.
|
|
49
|
+
*/
|
|
50
|
+
function buildDayRows(formatter, now, days) {
|
|
51
|
+
const [year, month, day] = localDate(formatter, now).split("-").map(Number);
|
|
52
|
+
const rows = [];
|
|
53
|
+
for (let offset = days - 1; offset >= 0; offset -= 1) {
|
|
54
|
+
const date = new Date(Date.UTC(year, month - 1, day - offset));
|
|
55
|
+
rows.push({
|
|
56
|
+
date: `${date.getUTCFullYear()}-${pad2(date.getUTCMonth() + 1)}-${pad2(date.getUTCDate())}`,
|
|
57
|
+
added: 0,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
return rows;
|
|
61
|
+
}
|
|
62
|
+
/** Throws InvalidTimezoneError unless `timezone` is a known IANA zone. */
|
|
63
|
+
export function validateTimezone(timezone) {
|
|
64
|
+
createFormatter(timezone);
|
|
65
|
+
}
|
|
66
|
+
export async function summarizeAdditions(input) {
|
|
67
|
+
const { timezone, days, now } = input;
|
|
68
|
+
const formatter = createFormatter(timezone);
|
|
69
|
+
const dayRows = buildDayRows(formatter, now, days);
|
|
70
|
+
const dayIndex = new Map(dayRows.map((row, index) => [row.date, index]));
|
|
71
|
+
const scopes = [];
|
|
72
|
+
let total = 0;
|
|
73
|
+
let trackedSince = null;
|
|
74
|
+
let trackedSinceAt = Infinity;
|
|
75
|
+
for await (const ledger of input.ledgers) {
|
|
76
|
+
for (const firstSeen of listAddedTimestamps(ledger)) {
|
|
77
|
+
const date = localDate(formatter, new Date(Date.parse(firstSeen)));
|
|
78
|
+
const index = dayIndex.get(date);
|
|
79
|
+
if (index !== undefined)
|
|
80
|
+
dayRows[index].added += 1;
|
|
81
|
+
}
|
|
82
|
+
total += ledger.latest.total;
|
|
83
|
+
// A skipped scope keeps no per-record keys: it is total-only.
|
|
84
|
+
const scopeTrackedSince = ledger.skipped ? null : ledger.baseline;
|
|
85
|
+
if (scopeTrackedSince !== null) {
|
|
86
|
+
const baselineAt = Date.parse(scopeTrackedSince);
|
|
87
|
+
if (baselineAt < trackedSinceAt) {
|
|
88
|
+
trackedSinceAt = baselineAt;
|
|
89
|
+
trackedSince = scopeTrackedSince;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
scopes.push({
|
|
93
|
+
scope: ledger.scope,
|
|
94
|
+
total: ledger.latest.total,
|
|
95
|
+
trackedSince: scopeTrackedSince,
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
scopes.sort((a, b) => a.scope.localeCompare(b.scope));
|
|
99
|
+
return { timezone, total, days: dayRows, trackedSince, scopes };
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=summary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"summary.js","sourceRoot":"","sources":["../../src/additions/summary.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,mBAAmB,GAEpB,MAAM,kBAAkB,CAAC;AAmC1B,MAAM,OAAO,oBAAqB,SAAQ,KAAK;CAAG;AAElD,SAAS,eAAe,CAAC,QAAgB;IACvC,IAAI,CAAC;QACH,OAAO,IAAI,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE;YACtC,QAAQ,EAAE,QAAQ;YAClB,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,SAAS;YAChB,GAAG,EAAE,SAAS;SACf,CAAC,CAA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,CAAC,CAenB;AAED,wBAAsB,+BAA+B,CACnD,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,yBAAyB,EAC/B,OAAO,GAAE,gCAAqC,GAC7C,OAAO,CAAC,QAAQ,CAAC,CAmCnB;AAED,wBAAsB,iCAAiC,CACrD,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,2BAA2B,EACjC,OAAO,GAAE,gCAAqC,GAC7C,OAAO,CAAC,QAAQ,CAAC,CAyEnB;AAED,wBAAsB,iCAAiC,CACrD,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,2BAA2B,GAChC,OAAO,CAAC,QAAQ,CAAC,CA8BnB;AAED,wBAAsB,qCAAqC,CACzD,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,+BAA+B,GACpC,OAAO,CAAC,QAAQ,CAAC,CA6BnB;AAED,YAAY,EAAE,mBAAmB,EAAE,CAAC"}
|
package/dist/api/index.js
CHANGED
|
@@ -4,6 +4,8 @@ import { isEntryCoveredByTombstone, } from "../sync/scope-deletions.js";
|
|
|
4
4
|
import { supersedeLegacyVersions, } from "../storage/legacy-projection.js";
|
|
5
5
|
import { deleteScope as deleteScopeLocally, } from "../sync/workers/delete.js";
|
|
6
6
|
import { ingestDataContract, ingestBinaryDataContract, listAccessLogsContract, listDataScopesContract, listDataVersionsContract, parseDataScopeContract, parseJsonObjectBody, readDataContract, syncFileContract, triggerSyncContract, getSyncStatusContract, configReadErrorContract, configWriteErrorContract, createGrantContract, listGrantsContract, oauthTokenContract, revokeGrantContract, validateServerConfigContract, verifyGrantContract, decodeBinaryEnvelope, isBinaryEnvelope, parseMetadataHeader, stringifyMetadataHeader, IngestPersistedError, } from "../contracts/index.js";
|
|
7
|
+
// Imported directly: the contracts barrel does not re-export this addition.
|
|
8
|
+
import { summarizeDataAdditionsContract } from "../contracts/data.js";
|
|
7
9
|
import { WRITER_ATTRIBUTION_KEY, } from "../write/attribution.js";
|
|
8
10
|
import { extractLineageField, LINEAGE_KEY, prepareLineage, } from "../lineage/lineage.js";
|
|
9
11
|
import { binaryFilename, binaryMimeType, isJsonContentType, } from "../contracts/binary.js";
|
|
@@ -581,6 +583,30 @@ export async function handlePersonalServerDataRequest(request, deps, options = {
|
|
|
581
583
|
});
|
|
582
584
|
return jsonResponse(result.response);
|
|
583
585
|
}
|
|
586
|
+
// "additions" has no dot, so it can never be a real scope name (scopes are
|
|
587
|
+
// "source.dataset"); handle it before the single-segment scope path.
|
|
588
|
+
if (pathname === "/additions") {
|
|
589
|
+
if (request.method !== "GET")
|
|
590
|
+
return methodNotAllowed();
|
|
591
|
+
// The counts span every scope, so only the owner may read them.
|
|
592
|
+
await deps.auth.authorizeOwner(request);
|
|
593
|
+
const daysRaw = url.searchParams.get("days");
|
|
594
|
+
const result = await summarizeDataAdditionsContract({
|
|
595
|
+
storage: deps.storage,
|
|
596
|
+
isVisible: discoveryVisibility(deps),
|
|
597
|
+
timezone: url.searchParams.get("tz") ?? "UTC",
|
|
598
|
+
// Digits only: Number() would also accept "", "1e1", "0x7" and " 7".
|
|
599
|
+
days: daysRaw === null
|
|
600
|
+
? 7
|
|
601
|
+
: /^\d{1,3}$/.test(daysRaw)
|
|
602
|
+
? Number(daysRaw)
|
|
603
|
+
: Number.NaN,
|
|
604
|
+
now: (deps.now ?? (() => new Date()))(),
|
|
605
|
+
});
|
|
606
|
+
if ("ok" in result)
|
|
607
|
+
return contractErrorResponse(result);
|
|
608
|
+
return jsonResponse(result);
|
|
609
|
+
}
|
|
584
610
|
const parts = pathname.split("/").filter(Boolean);
|
|
585
611
|
if (parts.length === 2 && parts[1] === "versions") {
|
|
586
612
|
if (request.method !== "GET")
|