smoodly 0.0.51 → 0.0.53
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 +14 -13
- package/dist/admin/auth.d.ts +3 -11
- package/dist/admin/auth.js +1 -30
- package/dist/admin/client-ops.d.ts +5 -4
- package/dist/admin/client-ops.js +15 -12
- package/dist/admin/delivery-mode.d.ts +1 -1
- package/dist/admin/delivery-mode.js +2 -2
- package/dist/admin/drift.d.ts +0 -2
- package/dist/admin/drift.js +1 -1
- package/dist/admin/editor/EditorView.d.ts +0 -3
- package/dist/admin/editor/EditorView.js +11 -16
- package/dist/admin/editor/FloatingToolbar.d.ts +0 -1
- package/dist/admin/editor/FloatingToolbar.js +1 -1
- package/dist/admin/editor/SeoSettings.d.ts +0 -2
- package/dist/admin/editor/SeoSettings.js +2 -2
- package/dist/admin/editor/canvas-address.d.ts +8 -0
- package/dist/admin/editor/canvas-address.js +18 -2
- package/dist/admin/editor/canvas-diagnosis.d.ts +2 -0
- package/dist/admin/editor/canvas-diagnosis.js +3 -0
- package/dist/admin/editor/inline-dom.d.ts +0 -4
- package/dist/admin/editor/inline-dom.js +1 -1
- package/dist/admin/editor/preview-grant.d.ts +6 -0
- package/dist/admin/editor/preview-grant.js +25 -0
- package/dist/admin/editor/useCanvasDiagnosis.js +2 -2
- package/dist/admin/files.generated.js +1 -1
- package/dist/admin/fixed-nodes.d.ts +0 -6
- package/dist/admin/fixed-nodes.js +1 -81
- package/dist/admin/forms/CropEditor.d.ts +4 -2
- package/dist/admin/forms/CropEditor.js +58 -5
- package/dist/admin/forms/ImagePreview.d.ts +3 -1
- package/dist/admin/forms/ImagePreview.js +9 -3
- package/dist/admin/forms/MediaGrid.js +2 -1
- package/dist/admin/forms/MediaPicker.js +9 -6
- package/dist/admin/forms/MediaWidget.js +11 -9
- package/dist/admin/forms/assets-context.d.ts +7 -3
- package/dist/admin/forms/assets-context.js +5 -3
- package/dist/admin/forms/crop-editor.d.ts +24 -2
- package/dist/admin/forms/crop-editor.js +36 -2
- package/dist/admin/forms/date-picker.d.ts +0 -1
- package/dist/admin/forms/date-picker.js +1 -1
- package/dist/admin/forms/tabs.d.ts +0 -1
- package/dist/admin/forms/tabs.js +1 -1
- package/dist/admin/forms/upload.d.ts +18 -11
- package/dist/admin/forms/upload.js +62 -24
- package/dist/admin/global-items.d.ts +0 -3
- package/dist/admin/global-items.js +0 -54
- package/dist/admin/handler.d.ts +22 -28
- package/dist/admin/handler.js +146 -47
- package/dist/admin/health.d.ts +0 -4
- package/dist/admin/index.d.ts +6 -9
- package/dist/admin/index.js +3 -6
- package/dist/admin/ops.d.ts +40 -32
- package/dist/admin/page-data.d.ts +14 -6
- package/dist/admin/page-data.js +1 -1
- package/dist/admin/session-flow.d.ts +65 -0
- package/dist/admin/session-flow.js +121 -0
- package/dist/admin/shell/AdminApp.d.ts +8 -3
- package/dist/admin/shell/AdminApp.js +37 -58
- package/dist/admin/shell/ContentHealthPage.js +1 -3
- package/dist/admin/shell/GlobalFields.d.ts +0 -3
- package/dist/admin/shell/GlobalFields.js +1 -1
- package/dist/admin/shell/IconRail.js +10 -8
- package/dist/admin/shell/MediaScreen.js +9 -6
- package/dist/admin/shell/MembersPage.d.ts +1 -2
- package/dist/admin/shell/MembersPage.js +19 -90
- package/dist/admin/shell/SettingsView.d.ts +1 -2
- package/dist/admin/shell/SettingsView.js +2 -2
- package/dist/admin/shell/SignedOutView.d.ts +5 -0
- package/dist/admin/shell/SignedOutView.js +9 -0
- package/dist/admin/shell/console-links.d.ts +5 -0
- package/dist/admin/shell/console-links.js +11 -0
- package/dist/admin/shell/members-list.d.ts +1 -14
- package/dist/admin/shell/members-list.js +2 -23
- package/dist/admin/shell/pages-tree.d.ts +0 -2
- package/dist/admin/shell/pages-tree.js +1 -1
- package/dist/admin/shell/presence-socket.d.ts +10 -0
- package/dist/admin/shell/presence-socket.js +191 -0
- package/dist/admin/shell/presence.d.ts +6 -18
- package/dist/admin/shell/presence.js +4 -11
- package/dist/admin/shell/session.d.ts +19 -12
- package/dist/admin/shell/session.js +114 -47
- package/dist/admin/ui/LocaleSwitcher.d.ts +0 -4
- package/dist/admin/ui/LocaleSwitcher.js +2 -2
- package/dist/admin/ui/primitives.d.ts +4 -14
- package/dist/admin/ui/primitives.js +7 -9
- package/dist/admin/ui/theme.js +13 -2
- package/dist/admin/validate.js +10 -1
- package/dist/api-client.d.ts +26 -0
- package/dist/api-client.js +107 -0
- package/dist/assemble.d.ts +4 -41
- package/dist/assemble.js +5 -303
- package/dist/asset-store.d.ts +28 -30
- package/dist/asset-store.js +26 -121
- package/dist/astro/cache.d.ts +1 -1
- package/dist/astro/components/Head.astro +4 -1
- package/dist/astro/components/Image.astro +12 -17
- package/dist/astro/components/Video.astro +5 -2
- package/dist/astro/head.d.ts +3 -0
- package/dist/astro/head.js +24 -0
- package/dist/astro/index.js +61 -27
- package/dist/astro/locale-paths.d.ts +5 -2
- package/dist/astro/locale-paths.js +10 -2
- package/dist/astro/routes/admin.js +9 -7
- package/dist/astro/runtime.d.ts +3 -2
- package/dist/astro/runtime.js +5 -4
- package/dist/astro/server.d.ts +7 -11
- package/dist/astro/server.js +22 -28
- package/dist/astro/shell.d.ts +3 -3
- package/dist/astro/shell.js +1 -1
- package/dist/astro/static-media-node.d.ts +4 -0
- package/dist/astro/static-media-node.js +25 -0
- package/dist/astro/static-media.d.ts +17 -0
- package/dist/astro/static-media.js +55 -0
- package/dist/astro/static.d.ts +5 -10
- package/dist/astro/static.js +13 -29
- package/dist/canvas-marker.d.ts +14 -0
- package/dist/canvas-marker.js +36 -0
- package/dist/cli/api.d.ts +14 -0
- package/dist/cli/api.js +48 -0
- package/dist/cli/app-env.d.ts +2 -0
- package/dist/cli/app-env.js +20 -0
- package/dist/cli/export.d.ts +16 -2
- package/dist/cli/export.js +52 -35
- package/dist/cli/import.d.ts +7 -11
- package/dist/cli/import.js +50 -54
- package/dist/cli/load-config.d.ts +0 -1
- package/dist/cli/load-config.js +1 -1
- package/dist/cli/main.d.ts +4 -12
- package/dist/cli/main.js +26 -72
- package/dist/cli/push.d.ts +6 -0
- package/dist/cli/push.js +31 -0
- package/dist/collections.d.ts +0 -1
- package/dist/collections.js +1 -1
- package/dist/config.d.ts +20 -5
- package/dist/config.js +18 -1
- package/dist/content/content-api.d.ts +23 -23
- package/dist/content/content-api.js +48 -56
- package/dist/content/mime.d.ts +1 -0
- package/dist/content/mime.js +6 -0
- package/dist/css.js +1 -1
- package/dist/deploy-store.d.ts +19 -0
- package/dist/entry-store.d.ts +8 -94
- package/dist/entry-store.js +9 -557
- package/dist/env.d.ts +27 -20
- package/dist/env.js +38 -50
- package/dist/fields.d.ts +11 -3
- package/dist/fields.js +33 -2
- package/dist/global-id.d.ts +2 -0
- package/dist/global-id.js +4 -2
- package/dist/image/SmoodlyImage.d.ts +9 -5
- package/dist/image/SmoodlyImage.js +29 -15
- package/dist/image/SmoodlyVideo.d.ts +1 -1
- package/dist/image/SmoodlyVideo.js +3 -2
- package/dist/image/index.d.ts +2 -3
- package/dist/image/index.js +0 -2
- package/dist/image/markup.d.ts +53 -0
- package/dist/image/markup.js +111 -0
- package/dist/index.d.ts +13 -23
- package/dist/index.js +7 -20
- package/dist/media-cut.d.ts +44 -0
- package/dist/media-cut.js +70 -0
- package/dist/media.d.ts +58 -4
- package/dist/media.js +126 -16
- package/dist/member-store.d.ts +2 -50
- package/dist/member-store.js +0 -56
- package/dist/next/admin-route.d.ts +1 -1
- package/dist/next/admin-route.js +5 -3
- package/dist/next/meta.js +2 -3
- package/dist/next/page-renderer.d.ts +2 -2
- package/dist/next/page-renderer.js +22 -11
- package/dist/next/queries.d.ts +2 -2
- package/dist/path-index.d.ts +0 -24
- package/dist/path-index.js +0 -98
- package/dist/paths.d.ts +1 -1
- package/dist/paths.js +1 -1
- package/dist/push.d.ts +30 -0
- package/dist/push.js +52 -0
- package/dist/read-counter.d.ts +2 -0
- package/dist/read-counter.js +6 -0
- package/dist/reads.d.ts +7 -7
- package/dist/reads.js +3 -0
- package/dist/registry-json.d.ts +11 -0
- package/dist/registry-json.js +81 -0
- package/dist/render.d.ts +0 -1
- package/dist/render.js +1 -1
- package/dist/resolve.d.ts +12 -6
- package/dist/resolve.js +11 -8
- package/dist/revalidate.d.ts +8 -1
- package/dist/revalidate.js +8 -1
- package/dist/richtext/index.d.ts +1 -1
- package/dist/section-wrapper.d.ts +1 -1
- package/dist/section-wrapper.js +0 -9
- package/dist/signed-message.d.ts +26 -0
- package/dist/signed-message.js +103 -0
- package/dist/site.d.ts +59 -18
- package/dist/site.js +21 -252
- package/dist/space-transfer.d.ts +6 -3
- package/dist/space-transfer.js +18 -6
- package/dist/store.d.ts +2 -80
- package/dist/store.js +3 -489
- package/dist/toolset.d.ts +2 -1
- package/dist/toolset.js +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +4 -15
- package/dist/admin/auth-config.d.ts +0 -6
- package/dist/admin/browser/fetch-op.d.ts +0 -10
- package/dist/admin/browser/fetch-op.js +0 -44
- package/dist/admin/browser/main.d.ts +0 -1
- package/dist/admin/browser/main.js +0 -23
- package/dist/admin/ops-impl.d.ts +0 -51
- package/dist/admin/ops-impl.js +0 -1403
- package/dist/admin/shell/InviteModal.d.ts +0 -6
- package/dist/admin/shell/InviteModal.js +0 -28
- package/dist/admin/shell/LoginView.d.ts +0 -5
- package/dist/admin/shell/LoginView.js +0 -80
- package/dist/admin/shell/SchemaNotice.d.ts +0 -4
- package/dist/admin/shell/SchemaNotice.js +0 -4
- package/dist/admin/shell/SetPasswordView.d.ts +0 -7
- package/dist/admin/shell/SetPasswordView.js +0 -41
- package/dist/admin/shell/presence-realtime.d.ts +0 -3
- package/dist/admin/shell/presence-realtime.js +0 -32
- package/dist/admin/supabase-auth.d.ts +0 -7
- package/dist/admin/supabase-auth.js +0 -30
- package/dist/astro/deploy-deps.d.ts +0 -10
- package/dist/astro/deploy-deps.js +0 -8
- package/dist/astro/image.d.ts +0 -27
- package/dist/astro/image.js +0 -29
- package/dist/bind.d.ts +0 -19
- package/dist/bind.js +0 -34
- package/dist/cli/add-admin.d.ts +0 -11
- package/dist/cli/add-admin.js +0 -25
- package/dist/cli/load-collections.d.ts +0 -2
- package/dist/cli/load-collections.js +0 -27
- package/dist/cli/migrate.d.ts +0 -43
- package/dist/cli/migrate.js +0 -138
- package/dist/cli/rebuild.d.ts +0 -23
- package/dist/cli/rebuild.js +0 -22
- package/dist/cli/space-io.d.ts +0 -41
- package/dist/cli/space-io.js +0 -84
- package/dist/client.d.ts +0 -11
- package/dist/client.js +0 -54
- package/dist/current-space.d.ts +0 -4
- package/dist/current-space.js +0 -9
- package/dist/document-stamp.d.ts +0 -7
- package/dist/document-stamp.js +0 -48
- package/dist/image/loaders.d.ts +0 -15
- package/dist/image/loaders.js +0 -5
- package/dist/image/next-config.d.ts +0 -18
- package/dist/image/next-config.js +0 -32
- package/dist/image/remote-pattern.d.ts +0 -1
- package/dist/image/remote-pattern.js +0 -5
- package/dist/migrations.d.ts +0 -37
- package/dist/migrations.js +0 -73
- package/dist/project.d.ts +0 -88
- package/dist/project.js +0 -231
- package/dist/published.d.ts +0 -142
- package/dist/published.js +0 -164
- package/dist/ref-index.d.ts +0 -19
- package/dist/ref-index.js +0 -0
- package/dist/schema-read.d.ts +0 -23
- package/dist/schema-read.js +0 -50
- package/dist/schema-version.d.ts +0 -19
- package/dist/schema-version.js +0 -34
- package/dist/sql-space.d.ts +0 -44
- package/dist/sql-space.js +0 -289
- package/dist/sql.d.ts +0 -15
- package/dist/sql.js +0 -556
- package/dist/supabase-asset-store.d.ts +0 -21
- package/dist/supabase-asset-store.js +0 -170
- package/dist/supabase-entry-store.d.ts +0 -92
- package/dist/supabase-entry-store.js +0 -824
- package/dist/supabase-member-store.d.ts +0 -21
- package/dist/supabase-member-store.js +0 -96
- package/dist/supabase-path-index.d.ts +0 -30
- package/dist/supabase-path-index.js +0 -138
- package/dist/supabase-published-store.d.ts +0 -56
- package/dist/supabase-published-store.js +0 -314
- package/dist/supabase-store.d.ts +0 -103
- package/dist/supabase-store.js +0 -678
- package/migrations/20260926120000_smoodly_v1.sql +0 -535
- package/migrations/20260926130000_smoodly_v2.sql +0 -26
- package/migrations/20260926140000_smoodly_v3.sql +0 -38
- package/migrations/20260926150000_smoodly_v4.sql +0 -41
- package/migrations/20260929120000_smoodly_v5.sql +0 -56
- package/migrations/20260929135523_smoodly_v6.sql +0 -200
- package/migrations/20260930040956_smoodly_v7.sql +0 -84
- package/migrations/20261007120000_smoodly_v8.sql +0 -154
- package/migrations/20261007200000_smoodly_v9.sql +0 -30
- package/migrations/20261008120000_smoodly_v10.sql +0 -47
- package/migrations/20261009120000_smoodly_v11.sql +0 -49
- /package/dist/{admin/auth-config.js → deploy-store.js} +0 -0
package/dist/migrations.js
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
// packages/smoodly/src/migrations.ts
|
|
2
|
-
// What `npx smoodly migrate` decides, as pure functions over file lists
|
|
3
|
-
// (spec 2026-09-26 §2–§3): which package files the app lacks, which
|
|
4
|
-
// collections need a fresh view block, and the one views file to write.
|
|
5
|
-
// Node-only (crypto): exposed at `smoodly/migrations`, never from the
|
|
6
|
-
// root index, which the client bundle reaches through the config.
|
|
7
|
-
import { createHash } from "node:crypto";
|
|
8
|
-
export const MARKER_PREFIX = "-- smoodly:collection ";
|
|
9
|
-
const MARKER_RE = /^-- smoodly:collection (\S+) sha256:([0-9a-f]+)\s*$/gm;
|
|
10
|
-
const OWN_FILE_RE = /^(\d{14})_smoodly_(v\d+|views)\.sql$/;
|
|
11
|
-
/** The first 16 hex chars of sha256 over the exact emitted SQL. */
|
|
12
|
-
export const collectionHash = (sql) => createHash("sha256").update(sql).digest("hex").slice(0, 16);
|
|
13
|
-
export const collectionMarker = (c) => `${MARKER_PREFIX}${c.name} sha256:${collectionHash(c.sql)}`;
|
|
14
|
-
/** name → hash, the LAST marker per collection across the files in name order. */
|
|
15
|
-
export function parseMarkers(files) {
|
|
16
|
-
const out = new Map();
|
|
17
|
-
for (const file of [...files].sort((a, b) => a.name.localeCompare(b.name))) {
|
|
18
|
-
for (const m of file.text.matchAll(MARKER_RE))
|
|
19
|
-
out.set(m[1], m[2]);
|
|
20
|
-
}
|
|
21
|
-
return out;
|
|
22
|
-
}
|
|
23
|
-
/** UTC yyyyMMddHHmmss — the Supabase CLI's file-name prefix. */
|
|
24
|
-
export const stamp = (at) => at.toISOString().replace(/\D/g, "").slice(0, 14);
|
|
25
|
-
const stampDate = (s) => new Date(Date.UTC(+s.slice(0, 4), +s.slice(4, 6) - 1, +s.slice(6, 8), +s.slice(8, 10), +s.slice(10, 12), +s.slice(12, 14)));
|
|
26
|
-
/** A views file must sort after every core file it may depend on and
|
|
27
|
-
* after any earlier views file it supersedes: the later of `now` and the
|
|
28
|
-
* newest own stamp plus a minute. */
|
|
29
|
-
export function viewsStamp(names, now) {
|
|
30
|
-
let at = now;
|
|
31
|
-
for (const name of names) {
|
|
32
|
-
const m = OWN_FILE_RE.exec(name);
|
|
33
|
-
if (!m)
|
|
34
|
-
continue;
|
|
35
|
-
const after = new Date(stampDate(m[1]).getTime() + 60000);
|
|
36
|
-
if (after > at)
|
|
37
|
-
at = after;
|
|
38
|
-
}
|
|
39
|
-
return at;
|
|
40
|
-
}
|
|
41
|
-
/** One file with a block per new or changed collection; null when none changed. */
|
|
42
|
-
export function viewsFile(collections, existing, at) {
|
|
43
|
-
const changed = collections.filter((c) => existing.get(c.name) !== collectionHash(c.sql));
|
|
44
|
-
if (changed.length === 0)
|
|
45
|
-
return null;
|
|
46
|
-
const text = "-- Smoodly: read views for this app's collections, written by `npx smoodly migrate`\n" +
|
|
47
|
-
`-- (${at.toISOString()}). One block per collection; the marker's hash is the block's SQL, compared on the next run.\n` +
|
|
48
|
-
"-- Never edit a written file: change the collection and run migrate again.\n\n" +
|
|
49
|
-
changed.map((c) => `${collectionMarker(c)}\n${c.sql.trim()}`).join("\n\n") +
|
|
50
|
-
"\n";
|
|
51
|
-
return { name: `${stamp(at)}_smoodly_views.sql`, text };
|
|
52
|
-
}
|
|
53
|
-
/** Package files the app lacks (copy) and same-named files whose text differs (modified — never overwritten). */
|
|
54
|
-
export function pendingCoreFiles(packageFiles, appFiles) {
|
|
55
|
-
const app = new Map(appFiles.map((f) => [f.name, f.text]));
|
|
56
|
-
const copy = [];
|
|
57
|
-
const modified = [];
|
|
58
|
-
for (const file of [...packageFiles].sort((a, b) => a.name.localeCompare(b.name))) {
|
|
59
|
-
const have = app.get(file.name);
|
|
60
|
-
if (have === undefined)
|
|
61
|
-
copy.push(file);
|
|
62
|
-
else if (have !== file.text)
|
|
63
|
-
modified.push(file.name);
|
|
64
|
-
}
|
|
65
|
-
return { copy, modified };
|
|
66
|
-
}
|
|
67
|
-
export function planMigrate(input, now) {
|
|
68
|
-
const core = pendingCoreFiles(input.packageFiles, input.appFiles);
|
|
69
|
-
const names = [...input.packageFiles, ...input.appFiles].map((f) => f.name);
|
|
70
|
-
const views = viewsFile(input.collections, parseMarkers(input.appFiles), viewsStamp(names, now));
|
|
71
|
-
return { ...core, views };
|
|
72
|
-
}
|
|
73
|
-
export const planIsEmpty = (plan) => plan.copy.length === 0 && plan.modified.length === 0 && plan.views === null;
|
package/dist/project.d.ts
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import type { Assembler } from "./assemble.ts";
|
|
2
|
-
import type { CollectionSchema } from "./collections.ts";
|
|
3
|
-
import type { EntryStore } from "./entry-store.ts";
|
|
4
|
-
import type { GlobalSchema } from "./global.ts";
|
|
5
|
-
import type { LocaleSet } from "./paths.ts";
|
|
6
|
-
import type { PublishedKey, PublishedStore } from "./published.ts";
|
|
7
|
-
import { type SectionLike } from "./refs.ts";
|
|
8
|
-
import type { SiteEntry, SitePage } from "./site.ts";
|
|
9
|
-
import type { PageStore } from "./store.ts";
|
|
10
|
-
/** The documents one projection writes before the rest are left to heal on read (§2). */
|
|
11
|
-
export declare const PROJECTION_CAP = 100;
|
|
12
|
-
/** `cap` overrides the projector's own for one call: a rebuild passes Infinity, a test a small number. `write`
|
|
13
|
-
* false (DESIGN §3, the document stamp): the rows are built but nothing is written, removed or marked — a reader
|
|
14
|
-
* whose stamp the space did not record. Default true. */
|
|
15
|
-
export type ProjectOptions = {
|
|
16
|
-
cap?: number;
|
|
17
|
-
write?: boolean;
|
|
18
|
-
/** `false` (a behind rebuild on a read, spec 2026-10-09 static mode §5): an existing row keeps its publishedAt, so
|
|
19
|
-
* the rebuild is not counted as a publish the static site has not got. Default true: a publish, `npx smoodly rebuild`. */
|
|
20
|
-
stamp?: boolean;
|
|
21
|
-
};
|
|
22
|
-
export type Projector = {
|
|
23
|
-
/** Writes the delivery rows of these pages in every supported locale (a row per visible locale, removed where not visible). Returns the keys it could not fit under the cap, already marked stale. */
|
|
24
|
-
pages(ids: string[], options?: ProjectOptions): Promise<PublishedKey[]>;
|
|
25
|
-
/** The same for entries and globals, by id (the collection is found through the registry). */
|
|
26
|
-
entries(ids: string[], options?: ProjectOptions): Promise<PublishedKey[]>;
|
|
27
|
-
/** One page document, one locale, written now: what heal-on-read calls. `seen`: the caller read a row for it,
|
|
28
|
-
* so a target no longer visible has a row to remove; without one nothing is written. The write is best effort:
|
|
29
|
-
* a failed put or remove is logged and the assembled document is served all the same. */
|
|
30
|
-
healPage(id: string, locale: string, options?: HealOptions): Promise<SitePage | null>;
|
|
31
|
-
healEntry(id: string, locale: string, options?: HealOptions): Promise<SiteEntry | null>;
|
|
32
|
-
healGlobal<V>(item: GlobalSchema<V>, locale: string, options?: HealOptions): Promise<V | null>;
|
|
33
|
-
/** Flags rows to rebuild on their next read: what an op does with the targets of a projection that threw. */
|
|
34
|
-
markStale(keys: PublishedKey[]): Promise<void>;
|
|
35
|
-
/** Records this projector's stamp as the space's current one (DESIGN §3): what a rebuild ends with. */
|
|
36
|
-
record(): Promise<void>;
|
|
37
|
-
/** The delivery tables against this stamp: how many rows are behind it, and which stamp the space recorded. */
|
|
38
|
-
delivery(): Promise<DeliveryStatus>;
|
|
39
|
-
};
|
|
40
|
-
/** What Content health and `migrate --check` show of the delivery tables (DESIGN §3, the document stamp). */
|
|
41
|
-
export type DeliveryStatus = {
|
|
42
|
-
total: number;
|
|
43
|
-
behind: number;
|
|
44
|
-
recorded: string | null;
|
|
45
|
-
stamp: string;
|
|
46
|
-
};
|
|
47
|
-
/** `write` false: serve the assembled document, write and remove nothing (a reader at another stamp than the recorded one). */
|
|
48
|
-
export type HealOptions = {
|
|
49
|
-
seen?: boolean;
|
|
50
|
-
write?: boolean;
|
|
51
|
-
};
|
|
52
|
-
export type ProjectorDeps = {
|
|
53
|
-
assembler: Assembler;
|
|
54
|
-
stores: () => {
|
|
55
|
-
pages: PageStore;
|
|
56
|
-
entries: EntryStore;
|
|
57
|
-
published: PublishedStore;
|
|
58
|
-
};
|
|
59
|
-
collections: CollectionSchema<any>[];
|
|
60
|
-
globals: GlobalSchema[];
|
|
61
|
-
/** The ref walk behind a page row's tags. */
|
|
62
|
-
sections: SectionLike[];
|
|
63
|
-
elements?: SectionLike[];
|
|
64
|
-
locales: LocaleSet;
|
|
65
|
-
/** The stamp a row is current against: the site's document stamp (§4; DESIGN §3). */
|
|
66
|
-
model: string;
|
|
67
|
-
cap?: number;
|
|
68
|
-
};
|
|
69
|
-
export declare function createProjector(deps: ProjectorDeps): Projector;
|
|
70
|
-
export type ProjectAllDeps = {
|
|
71
|
-
stores: {
|
|
72
|
-
pages: PageStore;
|
|
73
|
-
entries: EntryStore;
|
|
74
|
-
};
|
|
75
|
-
projector: Projector;
|
|
76
|
-
/** Every registered collection's and global's name: the entries are listed per name. */
|
|
77
|
-
names: string[];
|
|
78
|
-
/** Ids per batch; each batch is written whole, past the projector's cap. */
|
|
79
|
-
cap?: number;
|
|
80
|
-
};
|
|
81
|
-
/** The rebuild (spec 2026-10-07 delivery model §2): every page and entry of the space projected, in batches of
|
|
82
|
-
* `cap` ids, none left stale, and the stamp recorded as the space's current one. Import ends with it, and `smoodly rebuild` is it. The counts are the pages and the
|
|
83
|
-
* entries (globals included) published in some locale; `stale` is what a batch could not write, 0 by design. */
|
|
84
|
-
export declare function projectAll(deps: ProjectAllDeps): Promise<{
|
|
85
|
-
pages: number;
|
|
86
|
-
entries: number;
|
|
87
|
-
stale: number;
|
|
88
|
-
}>;
|
package/dist/project.js
DELETED
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
import { ASSET_COLLECTION } from "./media.js";
|
|
2
|
-
import { collectEntryRefs, collectTreeRefs } from "./refs.js";
|
|
3
|
-
import { collectionTag, entryTag, globalTag, pageTag } from "./revalidate.js";
|
|
4
|
-
/** The documents one projection writes before the rest are left to heal on read (§2). */
|
|
5
|
-
export const PROJECTION_CAP = 100;
|
|
6
|
-
/** The entry ids a document depends on (media is not an entry). */
|
|
7
|
-
const entryTags = (edges) => edges.filter((e) => e.targetCollection !== ASSET_COLLECTION).map((e) => entryTag(e.targetId));
|
|
8
|
-
const unique = (tags) => [...new Set(tags)];
|
|
9
|
-
/** A heal's write is derived and the visitor's read must not fail on it (spec §2 Failure): logged, not thrown. */
|
|
10
|
-
async function bestEffort(what, write) {
|
|
11
|
-
try {
|
|
12
|
-
await write();
|
|
13
|
-
}
|
|
14
|
-
catch (e) {
|
|
15
|
-
console.error(`smoodly: ${what} in the delivery tables failed; the next read rebuilds it.`, e);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
export function createProjector(deps) {
|
|
19
|
-
const { assembler, collections, globals, locales, model } = deps;
|
|
20
|
-
const cap = deps.cap ?? PROJECTION_CAP;
|
|
21
|
-
const isGlobal = (schema) => schema.kind === "global";
|
|
22
|
-
/** The page's row in the locale, or null where the public does not see it (absent, or an unpublished page). */
|
|
23
|
-
async function pageRow(a, record, all, locale) {
|
|
24
|
-
const row = record.locales[locale];
|
|
25
|
-
if (!row || (record.template !== null && row.status !== "published"))
|
|
26
|
-
return null;
|
|
27
|
-
const light = await a.treeRow(record, all, locale);
|
|
28
|
-
// A folder is a row without a document. A page the tree hides (path null) keeps one at its live address, which
|
|
29
|
-
// the address lookup never reaches but a locate can (a record at a code address): the read takes it by id then.
|
|
30
|
-
const path = light.hasPage ? light.path ?? (await deps.stores().pages.pathsOf(record.id))[locale] ?? null : null;
|
|
31
|
-
const document = path !== null ? await a.page(record.id, locale, path, { draft: false }) : null;
|
|
32
|
-
const raw = document ? await deps.stores().pages.getPublishedTree(record.id, locale) : null;
|
|
33
|
-
const refs = raw ? entryTags(collectTreeRefs(raw, deps.sections, deps.elements)) : [];
|
|
34
|
-
return {
|
|
35
|
-
...light, document,
|
|
36
|
-
tags: unique([pageTag(record.id), ...refs]),
|
|
37
|
-
model, stale: false, publishedAt: Date.now(),
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
/** The schema an entry id belongs to, and its record: one `get` per registered collection until found. */
|
|
41
|
-
async function findEntry(id) {
|
|
42
|
-
const { entries } = deps.stores();
|
|
43
|
-
for (const schema of [...collections, ...globals]) {
|
|
44
|
-
const record = await entries.get(schema.name, id);
|
|
45
|
-
if (record)
|
|
46
|
-
return { schema, record };
|
|
47
|
-
}
|
|
48
|
-
return null;
|
|
49
|
-
}
|
|
50
|
-
/** The entry's or global's row in the locale, or null where it is not published. A collection
|
|
51
|
-
* without a `path` gets a document too (its list items), with `path` null. */
|
|
52
|
-
async function entryRow(a, schema, record, locale) {
|
|
53
|
-
const row = record.locales[locale];
|
|
54
|
-
if (!row || row.status !== "published")
|
|
55
|
-
return null;
|
|
56
|
-
const { entries } = deps.stores();
|
|
57
|
-
const fields = (await entries.getMany(schema.name, [record.id], locale, { status: "published" }))[record.id];
|
|
58
|
-
if (!fields)
|
|
59
|
-
return null;
|
|
60
|
-
let document;
|
|
61
|
-
let path = null;
|
|
62
|
-
if (isGlobal(schema)) {
|
|
63
|
-
document = await a.global(schema, locale, { draft: false });
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
path = schema.path !== undefined ? (await entries.pathsOf(schema.name, record.id))[locale] ?? null : null;
|
|
67
|
-
if (path !== null) {
|
|
68
|
-
document = await a.entry(record.id, locale, path, { draft: false });
|
|
69
|
-
}
|
|
70
|
-
else {
|
|
71
|
-
// The list item is all an address-less entry serves: the same projection getEntries makes.
|
|
72
|
-
const [read] = await a.entries(schema.name, { locale, ids: [record.id] });
|
|
73
|
-
document = read && {
|
|
74
|
-
kind: "entry", locale, collection: schema.name, entry: { ...read.record, fields: read.item.fields },
|
|
75
|
-
path: null, locales: read.item.locales, ...(read.item.seo ? { seo: read.item.seo } : {}),
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
if (document == null)
|
|
80
|
-
return null;
|
|
81
|
-
return {
|
|
82
|
-
id: record.id, locale, collection: schema.name, parentId: record.parentId, sort: record.sort, slug: row.slug, path,
|
|
83
|
-
createdAt: record.createdAt, updatedAt: row.updatedAt, fields, document,
|
|
84
|
-
tags: unique([
|
|
85
|
-
entryTag(record.id), collectionTag(schema.name), ...(isGlobal(schema) ? [globalTag(schema.name)] : []),
|
|
86
|
-
...entryTags(collectEntryRefs(fields, schema, deps.elements)),
|
|
87
|
-
]),
|
|
88
|
-
model, stale: false, publishedAt: Date.now(),
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
/** Builds rows for each (id, locale) until the cap; the rest are marked stale and returned. */
|
|
92
|
-
async function project(cap, kind, targets, idOf, build, put, write) {
|
|
93
|
-
const { published } = deps.stores();
|
|
94
|
-
const rows = [];
|
|
95
|
-
const gone = [];
|
|
96
|
-
const over = [];
|
|
97
|
-
for (const t of targets) {
|
|
98
|
-
for (const locale of locales.supported) {
|
|
99
|
-
if (rows.length >= cap) {
|
|
100
|
-
over.push({ kind, id: idOf(t), locale });
|
|
101
|
-
continue;
|
|
102
|
-
}
|
|
103
|
-
const row = await build(t, locale);
|
|
104
|
-
if (row)
|
|
105
|
-
rows.push(row);
|
|
106
|
-
else
|
|
107
|
-
gone.push({ kind, id: idOf(t), locale });
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
if (!write)
|
|
111
|
-
return over;
|
|
112
|
-
if (rows.length > 0)
|
|
113
|
-
await put(rows);
|
|
114
|
-
if (gone.length > 0)
|
|
115
|
-
await published.remove(gone);
|
|
116
|
-
if (over.length > 0)
|
|
117
|
-
await published.markStale(over);
|
|
118
|
-
return over;
|
|
119
|
-
}
|
|
120
|
-
return {
|
|
121
|
-
async pages(ids, options) {
|
|
122
|
-
const write = options?.write !== false;
|
|
123
|
-
const all = await deps.stores().pages.listPages();
|
|
124
|
-
const a = assembler.batch({ pages: all });
|
|
125
|
-
const byId = new Map(all.map((p) => [p.id, p]));
|
|
126
|
-
// A page no longer in the tree has no row in any locale.
|
|
127
|
-
const missing = ids.filter((id) => !byId.has(id));
|
|
128
|
-
if (write && missing.length > 0)
|
|
129
|
-
await deps.stores().published.remove(missing.map((id) => ({ kind: "page", id })));
|
|
130
|
-
const keep = options?.stamp === false;
|
|
131
|
-
return project(options?.cap ?? cap, "page", ids.filter((id) => byId.has(id)).map((id) => byId.get(id)), (p) => p.id, (p, locale) => pageRow(a, p, all, locale), (rows) => deps.stores().published.putPages(rows, { keep }), write);
|
|
132
|
-
},
|
|
133
|
-
async entries(ids, options) {
|
|
134
|
-
const a = assembler.batch();
|
|
135
|
-
const found = [];
|
|
136
|
-
const missing = [];
|
|
137
|
-
for (const id of ids) {
|
|
138
|
-
const hit = await findEntry(id);
|
|
139
|
-
if (hit)
|
|
140
|
-
found.push(hit);
|
|
141
|
-
else
|
|
142
|
-
missing.push({ kind: "entry", id });
|
|
143
|
-
}
|
|
144
|
-
const write = options?.write !== false;
|
|
145
|
-
if (write && missing.length > 0)
|
|
146
|
-
await deps.stores().published.remove(missing);
|
|
147
|
-
const keep = options?.stamp === false;
|
|
148
|
-
return project(options?.cap ?? cap, "entry", found, (h) => h.record.id, (h, locale) => entryRow(a, h.schema, h.record, locale), (rows) => deps.stores().published.putEntries(rows, { keep }), write);
|
|
149
|
-
},
|
|
150
|
-
async healPage(id, locale, options) {
|
|
151
|
-
const { pages, published } = deps.stores();
|
|
152
|
-
// One record first: a page the public does not see in the locale costs no table read.
|
|
153
|
-
const record = await pages.getPage(id);
|
|
154
|
-
const row = record?.locales[locale];
|
|
155
|
-
const visible = row !== undefined && (record.template === null || row.status === "published");
|
|
156
|
-
const all = visible ? await pages.listPages() : [];
|
|
157
|
-
const projected = visible ? await pageRow(assembler.batch({ pages: all }), record, all, locale) : null;
|
|
158
|
-
const write = options?.write !== false;
|
|
159
|
-
if (!projected) {
|
|
160
|
-
if (write && options?.seen !== false)
|
|
161
|
-
await bestEffort(`removing page ${id} (${locale})`, () => published.remove([{ kind: "page", id, locale }]));
|
|
162
|
-
return null;
|
|
163
|
-
}
|
|
164
|
-
// A heal keeps the row's publishedAt: it rebuilds what a publish wrote, it is not one (spec 2026-10-09 static mode §5).
|
|
165
|
-
if (write)
|
|
166
|
-
await bestEffort(`writing page ${id} (${locale})`, () => published.putPages([projected], { keep: true }));
|
|
167
|
-
return projected.document;
|
|
168
|
-
},
|
|
169
|
-
async healEntry(id, locale, options) {
|
|
170
|
-
const { published } = deps.stores();
|
|
171
|
-
const hit = await findEntry(id);
|
|
172
|
-
const row = hit ? await entryRow(assembler.batch(), hit.schema, hit.record, locale) : null;
|
|
173
|
-
const write = options?.write !== false;
|
|
174
|
-
if (!row) {
|
|
175
|
-
if (write && options?.seen !== false)
|
|
176
|
-
await bestEffort(`removing entry ${id} (${locale})`, () => published.remove([{ kind: "entry", id, locale }]));
|
|
177
|
-
return null;
|
|
178
|
-
}
|
|
179
|
-
if (write)
|
|
180
|
-
await bestEffort(`writing entry ${id} (${locale})`, () => published.putEntries([row], { keep: true }));
|
|
181
|
-
return row.document;
|
|
182
|
-
},
|
|
183
|
-
async healGlobal(item, locale, options) {
|
|
184
|
-
const { entries, published } = deps.stores();
|
|
185
|
-
const [record] = await entries.list(item.name);
|
|
186
|
-
if (!record)
|
|
187
|
-
return null;
|
|
188
|
-
const row = await entryRow(assembler.batch(), item, record, locale);
|
|
189
|
-
const write = options?.write !== false;
|
|
190
|
-
if (!row) {
|
|
191
|
-
if (write && options?.seen !== false)
|
|
192
|
-
await bestEffort(`removing global ${item.name} (${locale})`, () => published.remove([{ kind: "entry", id: record.id, locale }]));
|
|
193
|
-
return null;
|
|
194
|
-
}
|
|
195
|
-
if (write)
|
|
196
|
-
await bestEffort(`writing global ${item.name} (${locale})`, () => published.putEntries([row], { keep: true }));
|
|
197
|
-
return row.document;
|
|
198
|
-
},
|
|
199
|
-
markStale: (keys) => deps.stores().published.markStale(keys),
|
|
200
|
-
record: () => deps.stores().published.recordModel(model),
|
|
201
|
-
async delivery() {
|
|
202
|
-
const { published } = deps.stores();
|
|
203
|
-
const [counts, recorded] = await Promise.all([published.countBehind(model), published.recordedModel()]);
|
|
204
|
-
return { ...counts, recorded, stamp: model };
|
|
205
|
-
},
|
|
206
|
-
};
|
|
207
|
-
}
|
|
208
|
-
/** The rebuild (spec 2026-10-07 delivery model §2): every page and entry of the space projected, in batches of
|
|
209
|
-
* `cap` ids, none left stale, and the stamp recorded as the space's current one. Import ends with it, and `smoodly rebuild` is it. The counts are the pages and the
|
|
210
|
-
* entries (globals included) published in some locale; `stale` is what a batch could not write, 0 by design. */
|
|
211
|
-
export async function projectAll(deps) {
|
|
212
|
-
const size = deps.cap ?? PROJECTION_CAP;
|
|
213
|
-
const whole = { cap: Infinity };
|
|
214
|
-
const published = (r) => Object.values(r.locales).some((l) => l?.status === "published");
|
|
215
|
-
let stale = 0;
|
|
216
|
-
const pages = await deps.stores.pages.listPages();
|
|
217
|
-
for (let i = 0; i < pages.length; i += size) {
|
|
218
|
-
stale += (await deps.projector.pages(pages.slice(i, i + size).map((p) => p.id), whole)).length;
|
|
219
|
-
}
|
|
220
|
-
const entries = (await Promise.all(deps.names.map((name) => deps.stores.entries.list(name)))).flat();
|
|
221
|
-
for (let i = 0; i < entries.length; i += size) {
|
|
222
|
-
stale += (await deps.projector.entries(entries.slice(i, i + size).map((e) => e.id), whole)).length;
|
|
223
|
-
}
|
|
224
|
-
// Every row now carries this stamp: it is the space's current one, and this deployment the writer of record (DESIGN §3).
|
|
225
|
-
await deps.projector.record();
|
|
226
|
-
return {
|
|
227
|
-
pages: pages.filter((p) => p.template !== null && published(p)).length,
|
|
228
|
-
entries: entries.filter(published).length,
|
|
229
|
-
stale,
|
|
230
|
-
};
|
|
231
|
-
}
|
package/dist/published.d.ts
DELETED
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
import type { EntryOrder } from "./collections.ts";
|
|
2
|
-
import { type Where } from "./entry-store.ts";
|
|
3
|
-
import type { SiteEntry, SitePage } from "./site.ts";
|
|
4
|
-
/** A page's delivery row: a published page, or a folder present in the locale (document null, hasPage false). */
|
|
5
|
-
export type PublishedPageRow = {
|
|
6
|
-
id: string;
|
|
7
|
-
locale: string;
|
|
8
|
-
parentId: string | null;
|
|
9
|
-
sort: number | null;
|
|
10
|
-
/** The served address; null when the tree hides the node (no path, or a code address wins). */
|
|
11
|
-
path: string | null;
|
|
12
|
-
title: string;
|
|
13
|
-
hasPage: boolean;
|
|
14
|
-
/** The page fields with defaults, raw (no asset resolution): what a tree item and a link show. */
|
|
15
|
-
linkFields: Record<string, unknown>;
|
|
16
|
-
document: SitePage | null;
|
|
17
|
-
tags: string[];
|
|
18
|
-
/** The document stamp that built the row (document-stamp.ts); the column name predates the name. */
|
|
19
|
-
model: string;
|
|
20
|
-
stale: boolean;
|
|
21
|
-
publishedAt: number;
|
|
22
|
-
};
|
|
23
|
-
/** An entry's or a global's delivery row. A global's `document` is the value `getGlobal` returns; its collection is the item's name. */
|
|
24
|
-
export type PublishedEntryRow = {
|
|
25
|
-
id: string;
|
|
26
|
-
locale: string;
|
|
27
|
-
collection: string;
|
|
28
|
-
parentId: string | null;
|
|
29
|
-
sort: number | null;
|
|
30
|
-
slug: string | null;
|
|
31
|
-
path: string | null;
|
|
32
|
-
createdAt: number;
|
|
33
|
-
updatedAt: number;
|
|
34
|
-
/** The published snapshot, raw, slug included: what `where` and `order` read. */
|
|
35
|
-
fields: Record<string, unknown>;
|
|
36
|
-
document: SiteEntry | unknown;
|
|
37
|
-
tags: string[];
|
|
38
|
-
/** The document stamp that built the row (document-stamp.ts); the column name predates the name. */
|
|
39
|
-
model: string;
|
|
40
|
-
stale: boolean;
|
|
41
|
-
publishedAt: number;
|
|
42
|
-
};
|
|
43
|
-
/** `globals`: present when the lookup asked for global items by name — the locale's rows of those collections,
|
|
44
|
-
* as `entries` returns them (document, model, stale; the raw fields may be empty), so a page is one call. */
|
|
45
|
-
export type PublishedRoute = ({
|
|
46
|
-
kind: "page";
|
|
47
|
-
row: PublishedPageRow;
|
|
48
|
-
} | {
|
|
49
|
-
kind: "entry";
|
|
50
|
-
row: PublishedEntryRow;
|
|
51
|
-
}) & {
|
|
52
|
-
globals?: PublishedEntryRow[];
|
|
53
|
-
};
|
|
54
|
-
/** `model` and `stale` ride along so a tree read can rebuild what is behind before answering (spec 2026-10-07 §4). */
|
|
55
|
-
export type PublishedTreeRow = Pick<PublishedPageRow, "id" | "parentId" | "sort" | "path" | "title" | "hasPage" | "linkFields" | "model" | "stale">;
|
|
56
|
-
export type PublishedQuery = {
|
|
57
|
-
locale: string;
|
|
58
|
-
where?: Where;
|
|
59
|
-
order?: EntryOrder;
|
|
60
|
-
limit?: number;
|
|
61
|
-
parent?: string | null;
|
|
62
|
-
ids?: string[];
|
|
63
|
-
};
|
|
64
|
-
export type PublishedKey = {
|
|
65
|
-
kind: "page" | "entry";
|
|
66
|
-
id: string;
|
|
67
|
-
locale?: string;
|
|
68
|
-
};
|
|
69
|
-
export type PutOptions = {
|
|
70
|
-
keep?: boolean;
|
|
71
|
-
};
|
|
72
|
-
export interface PublishedStore {
|
|
73
|
-
/** Upsert by (id, locale). */
|
|
74
|
-
/** `keep` (a heal, a behind rebuild on read): an existing row keeps its publishedAt, a new row is dated now; without it
|
|
75
|
-
* every row is dated now (a publish, `npx smoodly rebuild`). The static build's count reads publishedAt (spec 2026-10-09 §5). */
|
|
76
|
-
putPages(rows: PublishedPageRow[], options?: PutOptions): Promise<void>;
|
|
77
|
-
putEntries(rows: PublishedEntryRow[], options?: PutOptions): Promise<void>;
|
|
78
|
-
/** Every locale of the id when `locale` is absent. */
|
|
79
|
-
remove(keys: PublishedKey[]): Promise<void>;
|
|
80
|
-
/** The one-call lookup: a reachable page or entry at the address, else null. With `globals` (collection names of
|
|
81
|
-
* global items), the locale's rows of those collections come along on the route (schema v9), still one call. */
|
|
82
|
-
byAddress(locale: string, path: string, globals?: readonly string[]): Promise<PublishedRoute | null>;
|
|
83
|
-
page(id: string, locale: string): Promise<PublishedPageRow | null>;
|
|
84
|
-
entry(id: string, locale: string): Promise<PublishedEntryRow | null>;
|
|
85
|
-
/** Filtered, ordered and limited over `fields`, in the store (SQL or the memory matcher). */
|
|
86
|
-
entries(collection: string, q: PublishedQuery): Promise<PublishedEntryRow[]>;
|
|
87
|
-
/** The light columns of every row in the locale, with the model and stale flag, in tree order (sort asc nulls last, published, id). */
|
|
88
|
-
tree(locale: string): Promise<PublishedTreeRow[]>;
|
|
89
|
-
markStale(keys: PublishedKey[]): Promise<void>;
|
|
90
|
-
/** The document stamp this space recorded as current (DESIGN §3): what `rebuild` last wrote, or the first
|
|
91
|
-
* writer's; null until then. Only a reader at this stamp rewrites rows. */
|
|
92
|
-
recordedModel(): Promise<string | null>;
|
|
93
|
-
/** Record `model` as the space's current stamp (upsert by space). */
|
|
94
|
-
recordModel(model: string): Promise<void>;
|
|
95
|
-
/** Rows of both tables, and how many of them carry a stamp other than `model`: what `migrate --check` and Content health show. */
|
|
96
|
-
countBehind(model: string): Promise<{
|
|
97
|
-
behind: number;
|
|
98
|
-
total: number;
|
|
99
|
-
}>;
|
|
100
|
-
/** The latest published_at over the space's pages and entries (ms); null when nothing is published. The static build's watermark (spec 2026-10-09 static mode §5). */
|
|
101
|
-
newestPublishedAt(): Promise<number | null>;
|
|
102
|
-
/** Rows published strictly after `since` (ms), pages plus entries: the Deploy tile's "changes waiting". */
|
|
103
|
-
countPublishedAfter(since: number): Promise<number>;
|
|
104
|
-
/** The space's last Deploy press (schema v11, space_deploys); null until the first press. */
|
|
105
|
-
deployRequest(): Promise<{
|
|
106
|
-
at: number;
|
|
107
|
-
by: string | null;
|
|
108
|
-
} | null>;
|
|
109
|
-
requestDeploy(by: string | null, at?: number): Promise<void>;
|
|
110
|
-
/** When a row last went (an unpublish, a delete): a change the count of newer rows cannot see (same row, `removed_at`). */
|
|
111
|
-
lastRemovalAt(): Promise<number | null>;
|
|
112
|
-
}
|
|
113
|
-
export declare class MemoryPublishedStore implements PublishedStore {
|
|
114
|
-
private pages;
|
|
115
|
-
private entryRows;
|
|
116
|
-
private recorded;
|
|
117
|
-
recordedModel(): Promise<string | null>;
|
|
118
|
-
recordModel(model: string): Promise<void>;
|
|
119
|
-
private deploy;
|
|
120
|
-
newestPublishedAt(): Promise<number | null>;
|
|
121
|
-
countPublishedAfter(since: number): Promise<number>;
|
|
122
|
-
deployRequest(): Promise<{
|
|
123
|
-
at: number;
|
|
124
|
-
by: string | null;
|
|
125
|
-
} | null>;
|
|
126
|
-
requestDeploy(by: string | null, at?: number): Promise<void>;
|
|
127
|
-
countBehind(model: string): Promise<{
|
|
128
|
-
behind: number;
|
|
129
|
-
total: number;
|
|
130
|
-
}>;
|
|
131
|
-
putPages(rows: PublishedPageRow[], options?: PutOptions): Promise<void>;
|
|
132
|
-
putEntries(rows: PublishedEntryRow[], options?: PutOptions): Promise<void>;
|
|
133
|
-
private removedAt;
|
|
134
|
-
remove(keys: PublishedKey[]): Promise<void>;
|
|
135
|
-
lastRemovalAt(): Promise<number | null>;
|
|
136
|
-
byAddress(locale: string, path: string, globals?: readonly string[]): Promise<PublishedRoute | null>;
|
|
137
|
-
page(id: string, locale: string): Promise<PublishedPageRow | null>;
|
|
138
|
-
entry(id: string, locale: string): Promise<PublishedEntryRow | null>;
|
|
139
|
-
entries(collection: string, q: PublishedQuery): Promise<PublishedEntryRow[]>;
|
|
140
|
-
tree(locale: string): Promise<PublishedTreeRow[]>;
|
|
141
|
-
markStale(keys: PublishedKey[]): Promise<void>;
|
|
142
|
-
}
|