@book.dev/sdk 1.76.1 → 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/dist/backup.d.ts +1 -1
- package/dist/bookFolder.d.ts +38 -21
- package/dist/bookFolder.js +42 -18
- package/dist/bookFolder.js.map +1 -1
- package/dist/bookfile.d.ts +1 -1
- package/dist/client.d.ts +4 -4
- package/dist/client.js +4 -4
- package/dist/client.js.map +1 -1
- package/dist/database.d.ts +9 -3
- package/dist/database.js +30 -11
- package/dist/database.js.map +1 -1
- package/dist/forwarding/forwardingClient.d.ts +38 -0
- package/dist/forwarding/forwardingClient.js +57 -4
- package/dist/forwarding/forwardingClient.js.map +1 -1
- package/dist/forwarding/index.d.ts +2 -2
- package/dist/forwarding/index.js +2 -2
- package/dist/forwarding/index.js.map +1 -1
- package/dist/forwarding/rosterAssertion.d.ts +61 -12
- package/dist/forwarding/rosterAssertion.js +77 -26
- package/dist/forwarding/rosterAssertion.js.map +1 -1
- package/dist/import.d.ts +3 -3
- package/dist/import.js +3 -3
- package/dist/import.js.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/provenance.d.ts +38 -27
- package/dist/provenance.js.map +1 -1
- package/dist/routes.d.ts +9 -3
- package/dist/routes.js +10 -4
- package/dist/routes.js.map +1 -1
- package/dist/templates.d.ts +35 -8
- package/dist/templates.js +307 -17
- package/dist/templates.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
// Per-instance roster assertion (OB-199 — "bind instance ↔
|
|
1
|
+
// Per-instance roster assertion (OB-199 — "bind instance ↔ library").
|
|
2
2
|
//
|
|
3
|
-
// When a managed instance pulls its bound
|
|
4
|
-
// (`GET /api/
|
|
3
|
+
// When a managed instance pulls its bound library's roster from the account
|
|
4
|
+
// (`GET /api/libraries/:id/roster`), it must prove it is the SITE that owns the
|
|
5
5
|
// binding — not an end user. It does so by signing a short-lived assertion with
|
|
6
6
|
// the site's device private key (the same key that double-gates the forwarding
|
|
7
7
|
// tunnel attach). The account verifies the signature against the Site row's
|
|
8
|
-
// registered public key and that the site is bound to the
|
|
8
|
+
// registered public key and that the site is bound to the library.
|
|
9
9
|
//
|
|
10
10
|
// The signing half runs ONLY where the private key lives — the desktop's OS
|
|
11
11
|
// keychain — so the raw key never enters the (separate) data-server process. The
|
|
@@ -13,44 +13,85 @@
|
|
|
13
13
|
// account can adopt one canonical implementation and so the contract is testable
|
|
14
14
|
// end-to-end (sign → verify) without the account repo.
|
|
15
15
|
//
|
|
16
|
+
// LIB-5 — the wire field renamed from `workspaceId` → `libraryId`. Because the
|
|
17
|
+
// field name lives INSIDE the signed bytes, the rename is versioned: the signer
|
|
18
|
+
// emits `openbook.roster.v2` (carrying `libraryId`) while the verifier
|
|
19
|
+
// DUAL-ACCEPTS v1 (`workspaceId`) + v2 (`libraryId`), fail-closed. The version is
|
|
20
|
+
// authenticated (it is part of the signed payload AND the signed-message prefix),
|
|
21
|
+
// so an attacker can never flip v1↔v2 without breaking the signature, and the
|
|
22
|
+
// verifier never trusts an out-of-band version. See the LIB-5 design + runbook.
|
|
23
|
+
//
|
|
16
24
|
// Runtime-agnostic (Web Crypto via {@link signWithSiteKey}/{@link verifyWithSiteKey}).
|
|
17
25
|
import { b64uDecodeString, b64uEncodeString } from './encoding';
|
|
18
26
|
import { signWithSiteKey, verifyWithSiteKey } from './siteKey';
|
|
19
|
-
/** The assertion
|
|
27
|
+
/** The legacy assertion version tag (v1) — carries `workspaceId`. Still ACCEPTED. */
|
|
20
28
|
export const ROSTER_ASSERTION_VERSION = 'openbook.roster.v1';
|
|
29
|
+
/** The current assertion version tag (v2, LIB-5) — carries `libraryId`. What the signer emits. */
|
|
30
|
+
export const ROSTER_ASSERTION_V2 = 'openbook.roster.v2';
|
|
31
|
+
/**
|
|
32
|
+
* Every version tag the verifier accepts (dual-accept v1 + v2). Pinned BEFORE any
|
|
33
|
+
* crypto runs — an unknown / absent `v` is rejected without a signature check, so
|
|
34
|
+
* there is no downgrade oracle. Retiring v1 is a later, reversible step (drop it
|
|
35
|
+
* from this set) — never do it while any un-updatable desktop build still signs v1.
|
|
36
|
+
*/
|
|
37
|
+
export const ACCEPTED_ROSTER_VERSIONS = [ROSTER_ASSERTION_VERSION, ROSTER_ASSERTION_V2];
|
|
38
|
+
/**
|
|
39
|
+
* Which JSON key carries the audience (the bound library id) PER version. v1 signed
|
|
40
|
+
* `workspaceId`; v2 renames the KEY to `libraryId` (the id VALUE — a cuid — is
|
|
41
|
+
* UNCHANGED). The verifier selects this field strictly from the AUTHENTICATED `v`
|
|
42
|
+
* via THIS explicit map — never a binary ternary that defaults to v1 — so a v1 body
|
|
43
|
+
* can't be re-read as v2 (or vice-versa): each version reads only its own key, and
|
|
44
|
+
* a body carrying the wrong key resolves to `undefined` → reject.
|
|
45
|
+
*/
|
|
46
|
+
const AUDIENCE_KEY_BY_VERSION = {
|
|
47
|
+
[ROSTER_ASSERTION_VERSION]: 'workspaceId',
|
|
48
|
+
[ROSTER_ASSERTION_V2]: 'libraryId',
|
|
49
|
+
};
|
|
50
|
+
/** Narrow an arbitrary string to an accepted version tag (pinned before crypto). */
|
|
51
|
+
export function isAcceptedRosterVersion(v) {
|
|
52
|
+
return v === ROSTER_ASSERTION_VERSION || v === ROSTER_ASSERTION_V2;
|
|
53
|
+
}
|
|
21
54
|
/** Default freshness window for a roster assertion (±5 min — the account's window). */
|
|
22
55
|
export const ROSTER_ASSERTION_SKEW_MS = 5 * 60 * 1000;
|
|
23
56
|
/**
|
|
24
|
-
* The exact bytes signed/verified:
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
57
|
+
* The exact bytes signed/verified: `<version>.<base64url(payloadJson)>`. The version
|
|
58
|
+
* prefix is derived from the payload's OWN `v` tag (never hardcoded), so the signed
|
|
59
|
+
* message and the authenticated version can never disagree. The base64url payload
|
|
60
|
+
* carries no `.`, so it never collides with the version prefix's dots when the
|
|
61
|
+
* account reconstructs the message from the assertion's first half.
|
|
28
62
|
*/
|
|
29
|
-
function rosterAssertionMessage(payloadB64) {
|
|
30
|
-
return `${
|
|
63
|
+
function rosterAssertionMessage(version, payloadB64) {
|
|
64
|
+
return `${version}.${payloadB64}`;
|
|
31
65
|
}
|
|
32
66
|
/**
|
|
33
67
|
* Mint a fresh signed roster assertion bearer for `Authorization: Bearer <…>`.
|
|
34
|
-
*
|
|
35
|
-
*
|
|
68
|
+
* Emits `openbook.roster.v2` (`libraryId`). Returns
|
|
69
|
+
* `base64url(payloadJson) + '.' + base64url(ed25519Sig)`. Stamps `ts` at call time,
|
|
70
|
+
* so mint one PER fetch (the account's freshness window is ±5 min).
|
|
36
71
|
*/
|
|
37
72
|
export async function signRosterAssertion(input) {
|
|
38
73
|
const ts = input.now ? input.now() : Date.now();
|
|
39
74
|
const payload = {
|
|
40
|
-
v:
|
|
75
|
+
v: ROSTER_ASSERTION_V2,
|
|
41
76
|
pub: input.publicKey,
|
|
42
|
-
|
|
77
|
+
libraryId: input.libraryId,
|
|
43
78
|
ts,
|
|
44
79
|
};
|
|
45
80
|
const payloadB64 = b64uEncodeString(JSON.stringify(payload));
|
|
46
|
-
const signature = await signWithSiteKey(input.privateKey, rosterAssertionMessage(payloadB64));
|
|
81
|
+
const signature = await signWithSiteKey(input.privateKey, rosterAssertionMessage(ROSTER_ASSERTION_V2, payloadB64));
|
|
47
82
|
return `${payloadB64}.${signature}`;
|
|
48
83
|
}
|
|
49
84
|
/**
|
|
50
85
|
* Verify a roster assertion (the account side, mirrored here for one canonical
|
|
51
|
-
* impl + end-to-end tests).
|
|
52
|
-
* ANY failure — bad framing,
|
|
86
|
+
* impl + end-to-end tests). DUAL-ACCEPTS v1 + v2. Returns the version-normalized
|
|
87
|
+
* result on success, or `null` on ANY failure — bad framing, unknown/absent
|
|
88
|
+
* version, missing/mistyped field, wrong library/pub, a stale/future `ts`, or a bad
|
|
53
89
|
* signature. Never throws (so it can sit directly in an auth gate).
|
|
90
|
+
*
|
|
91
|
+
* Fail-closed order (all BEFORE trusting anything): frame → decode → pin the
|
|
92
|
+
* version from the authenticated body → select the audience field by the
|
|
93
|
+
* per-version map → require a non-empty audience that matches → freshness →
|
|
94
|
+
* Ed25519 verify over the prefix reconstructed from the authenticated version.
|
|
54
95
|
*/
|
|
55
96
|
export async function verifyRosterAssertion(input) {
|
|
56
97
|
try {
|
|
@@ -59,28 +100,38 @@ export async function verifyRosterAssertion(input) {
|
|
|
59
100
|
return null;
|
|
60
101
|
const payloadB64 = input.assertion.slice(0, dot);
|
|
61
102
|
const signature = input.assertion.slice(dot + 1);
|
|
62
|
-
if (signature.includes('.'))
|
|
63
|
-
return null; // exactly two base64url parts
|
|
103
|
+
if (!signature || signature.includes('.'))
|
|
104
|
+
return null; // exactly two non-empty base64url parts
|
|
64
105
|
const parsed = JSON.parse(b64uDecodeString(payloadB64));
|
|
65
106
|
if (typeof parsed !== 'object' || parsed === null)
|
|
66
107
|
return null;
|
|
67
108
|
const payload = parsed;
|
|
68
|
-
|
|
109
|
+
// (1) Pin the version from the AUTHENTICATED, decoded body BEFORE any crypto.
|
|
110
|
+
// Unknown / absent → reject with no signature check (no downgrade oracle).
|
|
111
|
+
const version = payload.v;
|
|
112
|
+
if (!isAcceptedRosterVersion(version))
|
|
69
113
|
return null;
|
|
114
|
+
// (2/3) Select the audience field by an EXPLICIT per-version map — never a
|
|
115
|
+
// binary ternary defaulting to v1. A v1 body carrying `libraryId` reads its
|
|
116
|
+
// (absent) `workspaceId` key → undefined → reject; a v2 body reads `libraryId`.
|
|
117
|
+
const aud = payload[AUDIENCE_KEY_BY_VERSION[version]];
|
|
70
118
|
if (typeof payload.pub !== 'string' || payload.pub !== input.publicKey)
|
|
71
119
|
return null;
|
|
72
|
-
if (typeof
|
|
73
|
-
return null;
|
|
120
|
+
if (typeof aud !== 'string' || !aud)
|
|
121
|
+
return null; // (4) non-empty audience required
|
|
122
|
+
if (aud !== input.libraryId)
|
|
123
|
+
return null; // audience bind — id VALUE unchanged
|
|
74
124
|
if (typeof payload.ts !== 'number' || !Number.isFinite(payload.ts))
|
|
75
125
|
return null;
|
|
76
126
|
const now = input.now ?? Date.now();
|
|
77
127
|
const skewMs = input.skewMs ?? ROSTER_ASSERTION_SKEW_MS;
|
|
78
128
|
if (Math.abs(now - payload.ts) > skewMs)
|
|
79
|
-
return null;
|
|
80
|
-
|
|
129
|
+
return null; // symmetric — rejects stale AND future
|
|
130
|
+
// Reconstruct the signed prefix from the AUTHENTICATED version, never a constant.
|
|
131
|
+
const ok = await verifyWithSiteKey(input.publicKey, rosterAssertionMessage(version, payloadB64), signature);
|
|
81
132
|
if (!ok)
|
|
82
133
|
return null;
|
|
83
|
-
return { v:
|
|
134
|
+
return { v: version, pub: payload.pub, libraryId: aud, ts: payload.ts };
|
|
84
135
|
}
|
|
85
136
|
catch {
|
|
86
137
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rosterAssertion.js","sourceRoot":"","sources":["../../src/forwarding/rosterAssertion.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"rosterAssertion.js","sourceRoot":"","sources":["../../src/forwarding/rosterAssertion.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,EAAE;AACF,4EAA4E;AAC5E,gFAAgF;AAChF,gFAAgF;AAChF,+EAA+E;AAC/E,4EAA4E;AAC5E,mEAAmE;AACnE,EAAE;AACF,4EAA4E;AAC5E,iFAAiF;AACjF,kFAAkF;AAClF,iFAAiF;AACjF,uDAAuD;AACvD,EAAE;AACF,+EAA+E;AAC/E,gFAAgF;AAChF,uEAAuE;AACvE,kFAAkF;AAClF,kFAAkF;AAClF,8EAA8E;AAC9E,gFAAgF;AAChF,EAAE;AACF,uFAAuF;AAEvF,OAAO,EAAC,gBAAgB,EAAE,gBAAgB,EAAC,MAAM,YAAY,CAAC;AAC9D,OAAO,EAAC,eAAe,EAAE,iBAAiB,EAAC,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AAC,GAAG,KAAK,KAAK,CAAC,SAAS;YAAE,OAAO,IAAI,CAAC;QACpF,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,CAAC,GAAG;YAAE,OAAO,IAAI,CAAC,CAAC,kCAAkC;QACpF,IAAI,GAAG,KAAK,KAAK,CAAC,SAAS;YAAE,OAAO,IAAI,CAAC,CAAC,qCAAqC;QAC/E,IAAI,OAAO,OAAO,CAAC,EAAE,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;YAAE,OAAO,IAAI,CAAC;QAEhF,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC;QACpC,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,IAAI,wBAAwB,CAAC;QACxD,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,OAAO,CAAC,EAAE,CAAC,GAAG,MAAM;YAAE,OAAO,IAAI,CAAC,CAAC,uCAAuC;QAE7F,kFAAkF;QAClF,MAAM,EAAE,GAAG,MAAM,iBAAiB,CAAC,KAAK,CAAC,SAAS,EAAE,sBAAsB,CAAC,OAAO,EAAE,UAAU,CAAC,EAAE,SAAS,CAAC,CAAC;QAC5G,IAAI,CAAC,EAAE;YAAE,OAAO,IAAI,CAAC;QACrB,OAAO,EAAC,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,EAAE,EAAE,OAAO,CAAC,EAAE,EAAC,CAAC;IACxE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
|
package/dist/import.d.ts
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*
|
|
15
15
|
* - **Strategy B — {@link writeViaBundle}** maps the whole IR into a backup
|
|
16
16
|
* bundle (`{pages, databases}` native records) and hands it to
|
|
17
|
-
* `
|
|
17
|
+
* `importLibrary(…, mode:'copy')`. That inherits — for free — the server's
|
|
18
18
|
* id-remap, `@`-mention link-rewrite, name de-dup, and idempotent-replay
|
|
19
19
|
* machinery (`remapBundle` / `importBundle`), plus the Restore dialog on the
|
|
20
20
|
* UI side. Best for a multi-page / database tree.
|
|
@@ -200,7 +200,7 @@ export type ImportStrategy = 'create' | 'bundle';
|
|
|
200
200
|
*/
|
|
201
201
|
export declare function chooseStrategy(doc: ImportedDoc): ImportStrategy;
|
|
202
202
|
/** The slice of {@link DataClient} the import writers use (a real client satisfies it). */
|
|
203
|
-
export type ImportWriteClient = Pick<DataClient, 'savePage' | 'setPageProperties' | 'createDatabase' | 'createRow' | '
|
|
203
|
+
export type ImportWriteClient = Pick<DataClient, 'savePage' | 'setPageProperties' | 'createDatabase' | 'createRow' | 'importLibrary'>;
|
|
204
204
|
/** Options shared by both writers. */
|
|
205
205
|
export interface ImportOptions {
|
|
206
206
|
/**
|
|
@@ -271,7 +271,7 @@ export declare function buildImportBundle(doc: ImportedDoc, opts?: BundleOptions
|
|
|
271
271
|
};
|
|
272
272
|
/**
|
|
273
273
|
* **Strategy B.** Build the copy-mode bundle ({@link buildImportBundle}) and
|
|
274
|
-
* hand it to `
|
|
274
|
+
* hand it to `importLibrary`, inheriting the server's id-remap, link-rewrite,
|
|
275
275
|
* name-dedup, and idempotent-replay handling. Surfaces the server's
|
|
276
276
|
* {@link ImportResult} (and its `idMap` as the new page ids).
|
|
277
277
|
*/
|
package/dist/import.js
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*
|
|
15
15
|
* - **Strategy B — {@link writeViaBundle}** maps the whole IR into a backup
|
|
16
16
|
* bundle (`{pages, databases}` native records) and hands it to
|
|
17
|
-
* `
|
|
17
|
+
* `importLibrary(…, mode:'copy')`. That inherits — for free — the server's
|
|
18
18
|
* id-remap, `@`-mention link-rewrite, name de-dup, and idempotent-replay
|
|
19
19
|
* machinery (`remapBundle` / `importBundle`), plus the Restore dialog on the
|
|
20
20
|
* UI side. Best for a multi-page / database tree.
|
|
@@ -300,14 +300,14 @@ export function buildImportBundle(doc, opts = {}) {
|
|
|
300
300
|
}
|
|
301
301
|
/**
|
|
302
302
|
* **Strategy B.** Build the copy-mode bundle ({@link buildImportBundle}) and
|
|
303
|
-
* hand it to `
|
|
303
|
+
* hand it to `importLibrary`, inheriting the server's id-remap, link-rewrite,
|
|
304
304
|
* name-dedup, and idempotent-replay handling. Surfaces the server's
|
|
305
305
|
* {@link ImportResult} (and its `idMap` as the new page ids).
|
|
306
306
|
*/
|
|
307
307
|
export async function writeViaBundle(client, doc, opts = {}) {
|
|
308
308
|
const { pages, databases } = buildImportBundle(doc, opts);
|
|
309
309
|
const req = { pages, databases, mode: 'copy' };
|
|
310
|
-
const importResult = await client.
|
|
310
|
+
const importResult = await client.importLibrary(req);
|
|
311
311
|
// Map the bundle pages that carry an image placeholder to their server-assigned
|
|
312
312
|
// ids (via the id-map) so the post-import rehydration pass revisits only those.
|
|
313
313
|
const placeholderPageIds = [];
|
package/dist/import.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import.js","sourceRoot":"","sources":["../src/import.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAKH,OAAO,EAAC,iBAAiB,EAAqC,MAAM,SAAS,CAAC;AAC9E,OAAO,EAAC,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAC,WAAW,EAAC,MAAM,SAAS,CAAC;AAgHpC,gFAAgF;AAEhF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,0BAA0B,CAAC;AACjE,MAAM,CAAC,MAAM,sBAAsB,GAAG,eAAe,CAAC;AAEtD;;;;;;;;GAQG;AACH,MAAM,UAAU,qBAAqB,CAAC,KAAoB;IACxD,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,KAAK,CAAC,KA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I,IAAI,CAAC,IAAI,CAAC,QAAmD,EAAE,MAAM,CAAC;QACtF,IAAI,CAAC,0BAA0B,CAAC,MAAM,CAAC;YAAE,SAAS;QAClD,MAAM,MAAM,GAAG,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC3C,IAAI,MAAM;YAAE,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC9C,CAAC;IACD,OAAO;QACL,QAAQ,EAAE,QAAQ;QAClB,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC;QAC1C,WAAW,EAAE,EAAE;QACf,MAAM,EAAE,EAAE;QACV,YAAY;QACZ,kBAAkB;KACnB,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,SAAS,CACvB,MAAyB,EACzB,GAAgB,EAChB,OAAsB,EAAE;IAExB,OAAO,cAAc,CAAC,GAAG,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;AACtH,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export { emptyPageSnapshot, PAGE_VISIBILITIES } from './types';
|
|
|
3
3
|
export { API, type ApiError, type CompactResult } from './routes';
|
|
4
4
|
export type { DataClient, PageSubscription, FetchLike, LiveSourceLike, HttpDataClientOptions, IdentityCredential } from './client';
|
|
5
5
|
export { HttpDataClient } from './client';
|
|
6
|
-
export { ForwardingApiError, ForwardingClient, TunnelClient, MemoryKeyStore, mintSiteKeypair, signWithSiteKey, verifyWithSiteKey, FORWARDED_HEADER, signRosterAssertion, verifyRosterAssertion, ROSTER_ASSERTION_VERSION, ROSTER_ASSERTION_SKEW_MS, type KeyStore, type SiteIdentity, type ForwardingClientOptions, type TunnelStatus, type RosterAssertionPayload, type SignRosterAssertionInput, type VerifyRosterAssertionInput, } from './forwarding';
|
|
6
|
+
export { ForwardingApiError, ForwardingClient, TunnelClient, MemoryKeyStore, SITE_VISIBILITIES, mintSiteKeypair, signWithSiteKey, verifyWithSiteKey, FORWARDED_HEADER, signRosterAssertion, verifyRosterAssertion, isAcceptedRosterVersion, ROSTER_ASSERTION_VERSION, ROSTER_ASSERTION_V2, ACCEPTED_ROSTER_VERSIONS, ROSTER_ASSERTION_SKEW_MS, type KeyStore, type SiteIdentity, type SiteVisibility, type ForwardingClientOptions, type TunnelStatus, type RosterAssertionVersion, type RosterAssertionPayload, type RosterAssertionV1Payload, type RosterAssertionV2Payload, type SignRosterAssertionInput, type VerifyRosterAssertionInput, type VerifiedRosterAssertion, } from './forwarding';
|
|
7
7
|
export { DATA_PALETTE, DATA_COLOR_TOKENS, DATA_COLOR_SCHEMES, DEFAULT_DATA_COLOR_SCHEME, SERIES_ORDER, DATA_STROKE, STATUS_TOKENS, dataStroke, isDataColorToken, seriesColor, statusColor, hexAlpha, type DataColorToken, type DataColorScheme, type DataColor, type ChipColors, } from './dataColors';
|
|
8
8
|
export type { DatabasePropertyType, NumberFormat, NumberDisplay, StatusGroup, RollupFunction, RollupConfig, RelationCardinality, DatabaseSelectOption, DatabaseProperty, DateRange, LocationValue, PropertyGroup, RowTemplate, DatabaseViewType, ChartAggregate, SummaryType, FilterOperator, FilterConjunction, DatabaseFilter, DatabaseFilterGroup, FilterNode, SortDirection, DatabaseSort, DatabaseView, DatabaseMetric, ColorRule, DatabaseSchema, AutoExpiryConfig, ResolvedAutoExpiry, StoredDatabase, DatabaseInput, DatabaseUpdate, DatabaseRow, RowInput, RowUpdate, RowGroup, ChartDatum, ChartSeries, ChartSegment, ChartGroup, ChartMatrix, DateSpan, GraphNode, GraphEdge, DependencyGraph, InverseUpdate, RowTreeNode, } from './database';
|
|
9
9
|
export { TITLE_PROPERTY_ID, SELECT_COLORS, NO_VALUE_GROUP, STATUS_GROUPS, RELATIVE_DATE_OPS, projectExports, rowValue, matchesFilter, rowMatchesCondition, applyView, viewFilterRoot, isFilterGroup, shortId, resolveAutoExpiry, defaultDatabaseSchema, defaultView, defaultStatusOptions, removeProperty, formatNumber, formatUniqueId, numberProgress, groupRows, groupRowsBy, groupRowsByParent, PARENT_GROUP_ID, NO_PARENT_GROUP, aggregateRows, aggregateMatrix, CHART_TOTAL_SERIES, summarizeColumn, dateStart, dateEnd, parseDay, rowDateSpan, rowLocation, asLocation, dependencyGraph, syncInverseUpdates, relationSides, buildRowTree, flattenRowTree, isImageUrl, firstImageUrl, coverImageUrl, } from './database';
|
|
@@ -12,22 +12,22 @@ export { OWNER_PROPERTY_ID, VERIFICATION_PROPERTY_ID, BACKLINKS_PROPERTY_ID, THE
|
|
|
12
12
|
export { getServerUrlOverride, setServerUrlOverride, getServerTokenOverride, setServerTokenOverride, getIdentityCredential, setIdentityToken, setGuestName, getForwardingAudience, setForwardingAudience, isMixedContentBlocked } from './connection';
|
|
13
13
|
export { AccountClient, AccountError, DEFAULT_ACCOUNT_URL, getAccountUrlOverride, setAccountUrlOverride, resolveAccountUrl, type AccountSettings, type IdentityTokenResult, } from './account';
|
|
14
14
|
export { guestPrincipal, localPrincipal, principalId, verifiedSubject, colorForIdentity, IDENTITY_COLORS, mintIdentityKeypair, signIdentity, decodeIdentity, verifyIdentity, verifyRevocations, signRevocations, principalFromClaims, unverifiedPrincipalFromClaims, LOCAL_OWNER_HEADER, type Principal, type PrincipalKind, type VerifiedVia, type IdentityHeader, type IdentityClaims, type Jwk, type Jwks, type RevocationEntry, type RevocationSet, type IdentityKeypair, type VerifyOptions, type VerifyResult, type VerifyFailure, } from './identity';
|
|
15
|
-
export { DEFAULT_INSTANCE_CONFIG, type GuestAccess, type TrustedIssuerConfig, type InstanceConfig, type InstanceInfo, type StoredEdit, type
|
|
15
|
+
export { DEFAULT_INSTANCE_CONFIG, type GuestAccess, type TrustedIssuerConfig, type InstanceConfig, type InstanceInfo, type StoredEdit, type LibraryBinding, type LibraryRoster, type LibraryRosterEntry, } from './provenance';
|
|
16
16
|
export { authorize, isEmailAuthoritative, type Role, type EffectiveVisibility, type AclEntry, type AccessPage, type AccessCtx, type Decision, } from './authorize';
|
|
17
17
|
export { snapshotText, paragraphBlocks, textSnapshot, appendTextToSnapshot, appendBlocksToSnapshot, type AppendBlock } from './content';
|
|
18
18
|
export { snapshotBlocks, contentHash, computeBlockMtimes, stampSnapshotMtimes, latestBlockMtime, type BlockDigest, } from './mtime';
|
|
19
19
|
export { computeBlockAuthors, stampSnapshotAuthors, stampSnapshotAuthorsPerBlock, latestSnapshotAuthor, type BlockAuthorResolver, } from './authors';
|
|
20
20
|
export { OPENBOOK_ISLAND_MARKER, OPENBOOK_ASSETS_MARKER, encodeIsland, islandScript, assetsIslandScript, readIsland, readIslandRaw, readAssetsIsland, type ExportAssetEntry, type ExportAssetsIsland, } from './island';
|
|
21
21
|
export { pageToBookHtml, bookHtmlToPage, readBookHtmlMeta, pageIslandScript, sanitizeLegacyInline, isSafeHref, slugify, bookRuntimeScripts, BOOK_RUNTIME_DIR, BOOK_RUNTIME_FILE, type BookHtmlOptions, type BookPageRecord, type PageIsland, } from './bookfile';
|
|
22
|
-
export {
|
|
22
|
+
export { libraryToBookFiles, parseBookFolder, libraryIslandScript, readLibraryIsland, SPACE_BUNDLE_FILE, LEGACY_SPACE_BUNDLE_FILE, type BookFolderFile, type LibrarySnapshot, type LibraryToBookFilesOptions, type LibraryIsland, } from './bookFolder';
|
|
23
23
|
export { canonicalDigest, generateRegistryKeys, signPlugin, verifyPlugin, validateManifest, OPENBOOK_REGISTRY, type PluginManifest, type PluginAgentTool, type PluginPackage, type PluginSignature, type StoredPlugin, } from './plugins';
|
|
24
24
|
export { buildSampleDocument, seedSampleDocument, SAMPLE_DOCUMENT_NAME } from './sampleDocument';
|
|
25
25
|
export type { CommentRun, AuthoredIdentity, SuggestionAuthorKind, SuggestionKind, SuggestionStatus, SuggestionTarget, StoredSuggestion, SuggestionInput, SuggestionUpdate, StoredComment, CommentInput, } from './suggestions';
|
|
26
|
-
export { PAGE_TEMPLATES, instantiateTemplate, type PageTemplate } from './templates';
|
|
26
|
+
export { PAGE_TEMPLATES, instantiateTemplate, type PageTemplate, type TemplateTag } from './templates';
|
|
27
27
|
export { imagePlaceholderBlock, imagePlaceholderCell, importedBlocksToSnapshot, chooseStrategy, writeViaCreateApis, buildImportBundle, writeViaBundle, importDoc, IMAGE_PLACEHOLDER_KIND, IMAGE_PLACEHOLDER_PROP, HTML_ARTIFACT_PENDING_PROP, htmlArtifactPendingBlock, type ImportInlineAttrs, type ImportTextRun, type ImportedBlock, type ImportedAsset, type ImportedRow, type ImportedDatabase, type ImportedPage, type ImportedDoc, type ImportStrategy, type ImportWriteClient, type ImportOptions, type BundleOptions, type ImportWriteResult, blocksHaveImagePlaceholder, } from './import';
|
|
28
28
|
export { markdownToBlocks, markdownToImportedDoc, type MarkdownImportOptions } from './markdownImport';
|
|
29
29
|
export { notionExportToImportedDoc, parseCsv } from './notionImport';
|
|
30
30
|
export { rehydrateImageUrls, rehydrateStoredImages, importedImageBlock, imagePlaceholderMeta, mimeFromRef, notionAssetResolver, urlAssetResolver, isHttpUrl, isDataUrlRef, IMAGE_BLOCK_TYPE, DEFAULT_MAX_ASSET_BYTES, type RehydrateUrlOptions, type RehydrateStoredClient, type RehydrateStoredOptions, type RehydrateStoredResult, type ImportAssetResolver, type AssetBytes, } from './importAssets';
|
|
31
|
-
export { BACKUP_VERSION, BACKUP_CADENCES, BACKUP_CADENCE_MS, DEFAULT_BACKUP_CONFIG, remapBundle, type
|
|
31
|
+
export { BACKUP_VERSION, BACKUP_CADENCES, BACKUP_CADENCE_MS, DEFAULT_BACKUP_CONFIG, remapBundle, type LibraryBackup, type ImportMode, type ImportRequest, type ImportResult, type BackupCadence, type BackupConfig, type BackupCadenceStatus, type BackupStatus, } from './backup';
|
|
32
32
|
export type { AgentChatEvent, AgentChatMessage, AgentChatOptions, AgentProposal, InterviewStep, AiProvider, AiConfig, AiProviderSettings, AiEffort, AiSkill, AiStatus, AiSearchResult, AiSearchResponse, AiTasksResponse, AiStreamEvent, AiModelPrice, AiPricingTable, AiPricingResponse, AiUsageRow, AiUsageTotals, AiUsageResponse, } from './ai';
|
|
33
33
|
export { providerSettings, isPaidProvider } from './ai';
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { emptyPageSnapshot, PAGE_VISIBILITIES } from './types';
|
|
2
2
|
export { API } from './routes';
|
|
3
3
|
export { HttpDataClient } from './client';
|
|
4
|
-
export { ForwardingApiError, ForwardingClient, TunnelClient, MemoryKeyStore, mintSiteKeypair, signWithSiteKey, verifyWithSiteKey, FORWARDED_HEADER, signRosterAssertion, verifyRosterAssertion, ROSTER_ASSERTION_VERSION, ROSTER_ASSERTION_SKEW_MS, } from './forwarding';
|
|
4
|
+
export { ForwardingApiError, ForwardingClient, TunnelClient, MemoryKeyStore, SITE_VISIBILITIES, mintSiteKeypair, signWithSiteKey, verifyWithSiteKey, FORWARDED_HEADER, signRosterAssertion, verifyRosterAssertion, isAcceptedRosterVersion, ROSTER_ASSERTION_VERSION, ROSTER_ASSERTION_V2, ACCEPTED_ROSTER_VERSIONS, ROSTER_ASSERTION_SKEW_MS, } from './forwarding';
|
|
5
5
|
export { DATA_PALETTE, DATA_COLOR_TOKENS, DATA_COLOR_SCHEMES, DEFAULT_DATA_COLOR_SCHEME, SERIES_ORDER, DATA_STROKE, STATUS_TOKENS, dataStroke, isDataColorToken, seriesColor, statusColor, hexAlpha, } from './dataColors';
|
|
6
6
|
export { TITLE_PROPERTY_ID, SELECT_COLORS, NO_VALUE_GROUP, STATUS_GROUPS, RELATIVE_DATE_OPS, projectExports, rowValue, matchesFilter, rowMatchesCondition, applyView, viewFilterRoot, isFilterGroup, shortId, resolveAutoExpiry, defaultDatabaseSchema, defaultView, defaultStatusOptions, removeProperty, formatNumber, formatUniqueId, numberProgress, groupRows, groupRowsBy, groupRowsByParent, PARENT_GROUP_ID, NO_PARENT_GROUP, aggregateRows, aggregateMatrix, CHART_TOTAL_SERIES, summarizeColumn, dateStart, dateEnd, parseDay, rowDateSpan, rowLocation, asLocation, dependencyGraph, syncInverseUpdates, relationSides, buildRowTree, flattenRowTree, isImageUrl, firstImageUrl, coverImageUrl, } from './database';
|
|
7
7
|
export { evaluateFormula, formulaReferences, FormulaError, } from './formula';
|
|
@@ -16,7 +16,7 @@ export { snapshotBlocks, contentHash, computeBlockMtimes, stampSnapshotMtimes, l
|
|
|
16
16
|
export { computeBlockAuthors, stampSnapshotAuthors, stampSnapshotAuthorsPerBlock, latestSnapshotAuthor, } from './authors';
|
|
17
17
|
export { OPENBOOK_ISLAND_MARKER, OPENBOOK_ASSETS_MARKER, encodeIsland, islandScript, assetsIslandScript, readIsland, readIslandRaw, readAssetsIsland, } from './island';
|
|
18
18
|
export { pageToBookHtml, bookHtmlToPage, readBookHtmlMeta, pageIslandScript, sanitizeLegacyInline, isSafeHref, slugify, bookRuntimeScripts, BOOK_RUNTIME_DIR, BOOK_RUNTIME_FILE, } from './bookfile';
|
|
19
|
-
export {
|
|
19
|
+
export { libraryToBookFiles, parseBookFolder, libraryIslandScript, readLibraryIsland, SPACE_BUNDLE_FILE, LEGACY_SPACE_BUNDLE_FILE, } from './bookFolder';
|
|
20
20
|
export { canonicalDigest, generateRegistryKeys, signPlugin, verifyPlugin, validateManifest, OPENBOOK_REGISTRY, } from './plugins';
|
|
21
21
|
export { buildSampleDocument, seedSampleDocument, SAMPLE_DOCUMENT_NAME } from './sampleDocument';
|
|
22
22
|
export { PAGE_TEMPLATES, instantiateTemplate } from './templates';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAC,iBAAiB,EAAE,iBAAiB,EAAC,MAAM,SAAS,CAAC;AAC7D,OAAO,EAAC,GAAG,EAAoC,MAAM,UAAU,CAAC;AAEhE,OAAO,EAAC,cAAc,EAAC,MAAM,UAAU,CAAC;AACxC,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,EACnB,qBAAqB,EACrB,wBAAwB,EACxB,wBAAwB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAC,iBAAiB,EAAE,iBAAiB,EAAC,MAAM,SAAS,CAAC;AAC7D,OAAO,EAAC,GAAG,EAAoC,MAAM,UAAU,CAAC;AAEhE,OAAO,EAAC,cAAc,EAAC,MAAM,UAAU,CAAC;AACxC,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,EACvB,wBAAwB,EACxB,mBAAmB,EACnB,wBAAwB,EACxB,wBAAwB,GAazB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,yBAAyB,EACzB,YAAY,EACZ,WAAW,EACX,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,QAAQ,GAKT,MAAM,cAAc,CAAC;AAkDtB,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,QAAQ,EACR,aAAa,EACb,mBAAmB,EACnB,SAAS,EACT,cAAc,EACd,aAAa,EACb,OAAO,EACP,iBAAiB,EACjB,qBAAqB,EACrB,WAAW,EACX,oBAAoB,EACpB,cAAc,EACd,YAAY,EACZ,cAAc,EACd,cAAc,EACd,SAAS,EACT,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,aAAa,EACb,eA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,EAAC,MAAM,gBAAgB,CAAC;AACnE,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,EACpB,WAAW,EACX,mBAAmB,EACnB,gBAAgB,EAChB,SAAS,EACT,YAAY,EACZ,gBAAgB,EAChB,uBAAuB,GAOxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,WAAW,GASZ,MAAM,UAAU,CAAC;AAwBlB,OAAO,EAAC,gBAAgB,EAAE,cAAc,EAAC,MAAM,MAAM,CAAC"}
|
package/dist/provenance.d.ts
CHANGED
|
@@ -68,39 +68,40 @@ export interface InstanceConfig {
|
|
|
68
68
|
*/
|
|
69
69
|
emailAuthority?: string;
|
|
70
70
|
/**
|
|
71
|
-
* When this instance is a MANAGED
|
|
72
|
-
* is bound to. Set, the periodic roster sync projects that
|
|
73
|
-
* (admins / viewers + the
|
|
71
|
+
* When this instance is a MANAGED library (OB-199), the account library it
|
|
72
|
+
* is bound to. Set, the periodic roster sync projects that library's roster
|
|
73
|
+
* (admins / viewers + the library owner) into the local `members` table so
|
|
74
74
|
* `members`-scope + admin/viewer roles resolve for direct (non-edge) access too.
|
|
75
75
|
* Unset ⇒ a standalone instance; the sync is inert. Additive — absence is the
|
|
76
76
|
* pre-OB-199 single-instance behaviour. Holds non-secret COORDINATES only; the
|
|
77
77
|
* credential the instance presents to read the roster is supplied out-of-band
|
|
78
|
-
* (never persisted in policy). See {@link
|
|
78
|
+
* (never persisted in policy). See {@link LibraryBinding}.
|
|
79
79
|
*/
|
|
80
|
-
|
|
80
|
+
libraryBinding?: LibraryBinding;
|
|
81
81
|
}
|
|
82
82
|
/**
|
|
83
|
-
* Binds a managed instance to an account
|
|
84
|
-
* coordinates only — the roster-read credential is
|
|
85
|
-
* stored here. Set by the owner (via the instance-policy
|
|
86
|
-
* the forwarding/claim flow.
|
|
83
|
+
* Binds a managed instance to an account library (OB-199; LIB-5 renamed from
|
|
84
|
+
* `WorkspaceBinding`). Non-secret coordinates only — the roster-read credential is
|
|
85
|
+
* injected at runtime, never stored here. Set by the owner (via the instance-policy
|
|
86
|
+
* route) or learned during the forwarding/claim flow.
|
|
87
87
|
*/
|
|
88
|
-
export interface
|
|
89
|
-
/** The account
|
|
90
|
-
|
|
88
|
+
export interface LibraryBinding {
|
|
89
|
+
/** The account library id this instance serves (renamed from `workspaceId`; SAME id value). */
|
|
90
|
+
libraryId: string;
|
|
91
91
|
/**
|
|
92
|
-
* Base URL of the account that owns the
|
|
92
|
+
* Base URL of the account that owns the library (where the roster lives).
|
|
93
93
|
* Defaults to the instance `emailAuthority` (account.book.pub) when omitted.
|
|
94
94
|
*/
|
|
95
95
|
accountBaseUrl?: string;
|
|
96
96
|
}
|
|
97
97
|
/**
|
|
98
|
-
* One entry of the account
|
|
99
|
-
* OB-199 sync. Identifies a member by a
|
|
100
|
-
* persona `email`, with the
|
|
101
|
-
* instance only reads this shape (it never writes the
|
|
98
|
+
* One entry of the account library roster (OB-197 contract; LIB-5 renamed from
|
|
99
|
+
* `WorkspaceRosterEntry`), as consumed by the OB-199 sync. Identifies a member by a
|
|
100
|
+
* bound `subject` (`iss#sub`) and/or a persona `email`, with the library role. The
|
|
101
|
+
* account is the producer; the instance only reads this shape (it never writes the
|
|
102
|
+
* account).
|
|
102
103
|
*/
|
|
103
|
-
export interface
|
|
104
|
+
export interface LibraryRosterEntry {
|
|
104
105
|
/** Bound `iss#sub` of the member, when the account exposes it. */
|
|
105
106
|
subject?: string;
|
|
106
107
|
/** Persona email (any case; lowercased on sync). */
|
|
@@ -108,17 +109,18 @@ export interface WorkspaceRosterEntry {
|
|
|
108
109
|
role: MemberRole;
|
|
109
110
|
}
|
|
110
111
|
/**
|
|
111
|
-
* The account
|
|
112
|
-
* (OB-197), as consumed by the OB-199 sync.
|
|
113
|
-
* owner's bound subject (`iss#sub`) — admitted as an
|
|
114
|
-
* from the instance's own site owner (OB-198 F2), so the
|
|
115
|
-
* locked out of a
|
|
112
|
+
* The account library roster returned by `GET /api/libraries/:id/roster`
|
|
113
|
+
* (OB-197; LIB-5 renamed from `WorkspaceRoster`), as consumed by the OB-199 sync.
|
|
114
|
+
* `ownerSubject` is the library owner's bound subject (`iss#sub`) — admitted as an
|
|
115
|
+
* admin even when it differs from the instance's own site owner (OB-198 F2), so the
|
|
116
|
+
* library owner is never locked out of a library they own.
|
|
116
117
|
*/
|
|
117
|
-
export interface
|
|
118
|
-
workspaceId
|
|
119
|
-
|
|
118
|
+
export interface LibraryRoster {
|
|
119
|
+
/** The account library id (renamed from `workspaceId`; SAME id value). */
|
|
120
|
+
libraryId: string;
|
|
121
|
+
/** Bound `iss#sub` of the library owner (admitted as admin). */
|
|
120
122
|
ownerSubject?: string;
|
|
121
|
-
members:
|
|
123
|
+
members: LibraryRosterEntry[];
|
|
122
124
|
}
|
|
123
125
|
export declare const DEFAULT_INSTANCE_CONFIG: InstanceConfig;
|
|
124
126
|
/**
|
|
@@ -139,6 +141,15 @@ export interface InstanceInfo {
|
|
|
139
141
|
* it only needs to ensure its own token is scoped, never to relax + re-assert.
|
|
140
142
|
* Optional: absent (e.g. a pre-OB-202 server / a test fixture) is treated as `false`. */
|
|
141
143
|
requireAudience?: boolean;
|
|
144
|
+
/**
|
|
145
|
+
* The audience scope a page's `visibility='inherit'` resolves to at the root once
|
|
146
|
+
* the instance is claimed (OB-182 §2.4) — the TRUE effective default behind the
|
|
147
|
+
* Share dialog's "Workspace default". Exposed so a claimed instance can show what
|
|
148
|
+
* inheriting really means (e.g. "members only") instead of the guest-gate summary,
|
|
149
|
+
* which only governs an *unclaimed* instance's rule-0 short-circuit. Never
|
|
150
|
+
* `inherit`. Optional: absent on a pre-SHR-6 server / a test fixture — the client
|
|
151
|
+
* falls back to the {@link guestAccess} summary. */
|
|
152
|
+
defaultVisibility?: Exclude<PageVisibility, 'inherit'> | null;
|
|
142
153
|
/** Who the server resolved you to be on this request. */
|
|
143
154
|
you: Principal;
|
|
144
155
|
/**
|
package/dist/provenance.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provenance.js","sourceRoot":"","sources":["../src/provenance.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAC,mBAAmB,EAAC,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"provenance.js","sourceRoot":"","sources":["../src/provenance.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAC,mBAAmB,EAAC,MAAM,WAAW,CAAC;AA6H9C,MAAM,CAAC,MAAM,uBAAuB,GAAmB;IACrD,WAAW,EAAE,OAAO;IACpB,+EAA+E;IAC/E,+EAA+E;IAC/E,gFAAgF;IAChF,4EAA4E;IAC5E,cAAc,EAAE;QACd;YACE,MAAM,EAAE,mBAAmB;YAC3B,OAAO,EAAE,GAAG,mBAAmB,oBAAoB;YACnD,2EAA2E;YAC3E,uDAAuD;YACvD,cAAc,EAAE,GAAG,mBAAmB,2BAA2B;SAClE;KACF;IACD,iFAAiF;IACjF,+EAA+E;IAC/E,iBAAiB,EAAE,SAAS;IAC5B,iFAAiF;IACjF,+EAA+E;IAC/E,cAAc,EAAE,mBAAmB;CACpC,CAAC"}
|
package/dist/routes.d.ts
CHANGED
|
@@ -18,9 +18,9 @@ export declare const API: {
|
|
|
18
18
|
/** Move/reorder a page in the sidebar tree (re-parent + reorder siblings): `PUT`. */
|
|
19
19
|
readonly pageMove: (id: string) => string;
|
|
20
20
|
/** Whole-space backup: `GET` returns every live page + database as one bundle. */
|
|
21
|
-
readonly
|
|
21
|
+
readonly exportLibrary: "/api/export";
|
|
22
22
|
/** Restore a backup: `POST` `{pages, databases, mode}` → import summary. */
|
|
23
|
-
readonly
|
|
23
|
+
readonly importLibrary: "/api/import";
|
|
24
24
|
/** The trash: `GET` (list trashed pages) / `DELETE` (empty the whole trash). */
|
|
25
25
|
readonly trash: "/api/trash";
|
|
26
26
|
/** A single trashed page: `DELETE` (permanently purge it and its subtree). */
|
|
@@ -175,10 +175,16 @@ export declare const API: {
|
|
|
175
175
|
readonly pageVisibility: (id: string) => string;
|
|
176
176
|
/**
|
|
177
177
|
* On-demand roster sync of a managed instance: `GET` reports the binding +
|
|
178
|
-
* last-sync status; `POST` pulls the bound
|
|
178
|
+
* last-sync status; `POST` pulls the bound library roster from the account and
|
|
179
179
|
* reconciles it into the local roster (managed rows only). Instance-writer
|
|
180
180
|
* (owner/admin/loopback) only. The same sync also runs periodically.
|
|
181
181
|
*/
|
|
182
|
+
readonly librarySync: "/api/library/sync";
|
|
183
|
+
/**
|
|
184
|
+
* Legacy alias of {@link librarySync} (LIB-5 renamed `/api/workspace/sync` →
|
|
185
|
+
* `/api/library/sync`). Kept live so a not-yet-updated caller still resolves;
|
|
186
|
+
* both paths hit the same handler. Retire only in the last, reversible phase.
|
|
187
|
+
*/
|
|
182
188
|
readonly workspaceSync: "/api/workspace/sync";
|
|
183
189
|
/** Scheduled-backup policy: `GET` returns {@link BackupStatus}; `PUT` updates
|
|
184
190
|
* the policy and returns the new status. */
|
package/dist/routes.js
CHANGED
|
@@ -18,9 +18,9 @@ export const API = {
|
|
|
18
18
|
/** Move/reorder a page in the sidebar tree (re-parent + reorder siblings): `PUT`. */
|
|
19
19
|
pageMove: (id) => `/api/pages/${encodeURIComponent(id)}/move`,
|
|
20
20
|
/** Whole-space backup: `GET` returns every live page + database as one bundle. */
|
|
21
|
-
|
|
21
|
+
exportLibrary: '/api/export',
|
|
22
22
|
/** Restore a backup: `POST` `{pages, databases, mode}` → import summary. */
|
|
23
|
-
|
|
23
|
+
importLibrary: '/api/import',
|
|
24
24
|
/** The trash: `GET` (list trashed pages) / `DELETE` (empty the whole trash). */
|
|
25
25
|
trash: '/api/trash',
|
|
26
26
|
/** A single trashed page: `DELETE` (permanently purge it and its subtree). */
|
|
@@ -179,13 +179,19 @@ export const API = {
|
|
|
179
179
|
* "you manage sharing of pages you can write" rule as the ACL).
|
|
180
180
|
*/
|
|
181
181
|
pageVisibility: (id) => `/api/pages/${encodeURIComponent(id)}/visibility`,
|
|
182
|
-
// ── Managed
|
|
182
|
+
// ── Managed library: instance ↔ library roster sync — OB-199 / LIB-5 ─────────
|
|
183
183
|
/**
|
|
184
184
|
* On-demand roster sync of a managed instance: `GET` reports the binding +
|
|
185
|
-
* last-sync status; `POST` pulls the bound
|
|
185
|
+
* last-sync status; `POST` pulls the bound library roster from the account and
|
|
186
186
|
* reconciles it into the local roster (managed rows only). Instance-writer
|
|
187
187
|
* (owner/admin/loopback) only. The same sync also runs periodically.
|
|
188
188
|
*/
|
|
189
|
+
librarySync: '/api/library/sync',
|
|
190
|
+
/**
|
|
191
|
+
* Legacy alias of {@link librarySync} (LIB-5 renamed `/api/workspace/sync` →
|
|
192
|
+
* `/api/library/sync`). Kept live so a not-yet-updated caller still resolves;
|
|
193
|
+
* both paths hit the same handler. Retire only in the last, reversible phase.
|
|
194
|
+
*/
|
|
189
195
|
workspaceSync: '/api/workspace/sync',
|
|
190
196
|
// ── Scheduled backups — OB-166 ───────────────────────────────────────────────
|
|
191
197
|
/** Scheduled-backup policy: `GET` returns {@link BackupStatus}; `PUT` updates
|
package/dist/routes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.js","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,GAAG,GAAG;IACjB,MAAM,EAAE,SAAS;IACjB,kDAAkD;IAClD,KAAK,EAAE,YAAY;IACnB,oFAAoF;IACpF,IAAI,EAAE,CAAC,EAAU,EAAU,EAAE,CAAC,cAAc,kBAAkB,CAAC,EAAE,CAAC,EAAE;IACpE,wFAAwF;IACxF,cAAc,EAAE,CAAC,EAAU,EAAU,EAAE,CAAC,cAAc,kBAAkB,CAAC,EAAE,CAAC,aAAa;IACzF,+DAA+D;IAC/D,aAAa,EAAE,CAAC,EAAU,EAAU,EAAE,CAAC,cAAc,kBAA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