@blogmcp/sdk 0.13.0 → 0.14.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/community/links.d.ts +6 -0
- package/dist/community/links.js +9 -1
- package/dist/community/outcome.d.ts +1 -1
- package/dist/community/outcome.js +60 -23
- package/dist/community/private/browser.d.ts +18 -0
- package/dist/community/private/browser.js +17 -0
- package/dist/community/private/client.d.ts +259 -0
- package/dist/community/private/client.js +98 -0
- package/dist/community/private/dm.d.ts +547 -0
- package/dist/community/private/dm.js +852 -0
- package/dist/community/private/dpop.d.ts +59 -0
- package/dist/community/private/dpop.js +46 -0
- package/dist/community/private/encoding.d.ts +17 -0
- package/dist/community/private/encoding.js +50 -0
- package/dist/community/private/host-state.d.ts +20 -0
- package/dist/community/private/host-state.js +15 -0
- package/dist/community/private/index.d.ts +51 -0
- package/dist/community/private/index.js +71 -0
- package/dist/community/private/keystore.d.ts +73 -0
- package/dist/community/private/keystore.js +91 -0
- package/dist/community/private/marker.d.ts +17 -0
- package/dist/community/private/marker.js +11 -0
- package/dist/community/private/private-routes.d.ts +6 -0
- package/dist/community/private/private-routes.js +72 -0
- package/dist/community/private/promise.d.ts +65 -0
- package/dist/community/private/promise.js +39 -0
- package/dist/community/private/realtime.d.ts +127 -0
- package/dist/community/private/realtime.js +199 -0
- package/dist/community/private/session.d.ts +175 -0
- package/dist/community/private/session.js +441 -0
- package/dist/community/private/transport.d.ts +47 -0
- package/dist/community/private/transport.js +65 -0
- package/dist/community/server/grant-handoff.d.ts +53 -0
- package/dist/community/server/grant-handoff.js +96 -0
- package/dist/community/server/grant.d.ts +100 -0
- package/dist/community/server/grant.js +165 -0
- package/dist/community/server/index.d.ts +4 -0
- package/dist/community/server/index.js +20 -16
- package/dist/community/shapes.d.ts +27 -1
- package/dist/community/shapes.js +27 -17
- package/package.json +7 -3
- package/src/community/links.ts +8 -0
- package/src/community/outcome.ts +37 -0
- package/src/community/private/browser.ts +31 -0
- package/src/community/private/client.ts +304 -0
- package/src/community/private/dm.ts +1687 -0
- package/src/community/private/dpop.ts +110 -0
- package/src/community/private/encoding.ts +71 -0
- package/src/community/private/host-state.ts +37 -0
- package/src/community/private/index.ts +169 -0
- package/src/community/private/keystore.ts +179 -0
- package/src/community/private/marker.ts +28 -0
- package/src/community/private/private-routes.ts +80 -0
- package/src/community/private/promise.ts +125 -0
- package/src/community/private/realtime.ts +431 -0
- package/src/community/private/session.ts +848 -0
- package/src/community/private/transport.ts +125 -0
- package/src/community/server/grant-handoff.ts +179 -0
- package/src/community/server/grant.ts +292 -0
- package/src/community/server/index.ts +6 -0
- package/src/community/shapes.ts +46 -1
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DPoP proofs (RFC 9449) as kb-api's verifier checks them (docs/internal/m4-contracts.md §5.7, `KB/auth/dpop.ts`):
|
|
3
|
+
* header `{ typ: 'dpop+jwt', alg: 'ES256', jwk }`, claims `{ jti, htm, htu, iat, nonce, ath? }`, signed with the
|
|
4
|
+
* device key through WebCrypto — whose ECDSA signature is already the IEEE P1363 `r ‖ s` that JWS ES256 wants
|
|
5
|
+
* (RFC 7518 §3.4), so no DER conversion.
|
|
6
|
+
*
|
|
7
|
+
* - `jti`: 16 random bytes, base64url (22 characters; kb-api takes 16–64 of `[A-Za-z0-9_-]` and spends each once).
|
|
8
|
+
* - `nonce`: kb-api's server nonce for this key, from the grant answer's `dpopNonce` first and then from the
|
|
9
|
+
* `DPoP-Nonce` header of every private answer (CORS exposes it). The cache is per kb-api origin; a refusal
|
|
10
|
+
* `DPOP_NONCE` (`use_dpop_nonce`) carries a fresh one and the caller retries once.
|
|
11
|
+
* - `iat`: the local clock corrected by the offset to kb-api's clock. The offset is kept from the `serverTime`
|
|
12
|
+
* (epoch ms) of the grant answer and of every private JSON answer, refusals included — never from `Date`, which is
|
|
13
|
+
* not a CORS-safelisted response header and reads as null cross-origin. On `DPOP_INVALID` whose `serverTime` is more
|
|
14
|
+
* than 60 s from the corrected clock the caller corrects the offset and retries once.
|
|
15
|
+
* - `ath`: `base64url(sha256(access token))` whenever a token is presented.
|
|
16
|
+
*/
|
|
17
|
+
import type { DevicePublicJwk } from './keystore.js';
|
|
18
|
+
/** How far the clock may be off before a `DPOP_INVALID` is read as the clock's fault (§5.7). */
|
|
19
|
+
export declare const DPOP_CLOCK_RETRY_MS = 60000;
|
|
20
|
+
export interface DpopProofInput {
|
|
21
|
+
privateKey: CryptoKey;
|
|
22
|
+
jwk: DevicePublicJwk;
|
|
23
|
+
htm: 'POST';
|
|
24
|
+
htu: string;
|
|
25
|
+
/** The server nonce for this key, or null when none is known yet (kb-api then answers `use_dpop_nonce`). */
|
|
26
|
+
nonce: string | null;
|
|
27
|
+
/** The access token the request presents, for `ath`. */
|
|
28
|
+
accessToken?: string | null;
|
|
29
|
+
/** `iat` in epoch seconds (the corrected clock). */
|
|
30
|
+
iat: number;
|
|
31
|
+
/** For the shared fixture only: a fixed `jti`. */
|
|
32
|
+
jti?: string;
|
|
33
|
+
}
|
|
34
|
+
/** `base64url(sha256(token))`, the `ath` claim. */
|
|
35
|
+
export declare function dpopAth(accessToken: string): Promise<string>;
|
|
36
|
+
/** A compact JWS: the proof for one request. */
|
|
37
|
+
export declare function signDpopProof(input: DpopProofInput): Promise<string>;
|
|
38
|
+
/**
|
|
39
|
+
* The per-origin nonce cache and the clock offset of one session (one per tab: neither holds a secret, and another
|
|
40
|
+
* tab's values arrive with its own answers).
|
|
41
|
+
*/
|
|
42
|
+
export interface DpopClock {
|
|
43
|
+
/** The nonce for this origin and key, or null. */
|
|
44
|
+
nonce(origin: string, jkt: string): string | null;
|
|
45
|
+
/** Remember a nonce kb-api handed out (a grant answer's `dpopNonce`, an answer's `DPoP-Nonce`). */
|
|
46
|
+
setNonce(origin: string, jkt: string, nonce: unknown): void;
|
|
47
|
+
/** Forget every nonce of a key (it was replaced). */
|
|
48
|
+
forgetKey(jkt: string): void;
|
|
49
|
+
/** `iat` in epoch seconds, corrected by the offset. */
|
|
50
|
+
iat(): number;
|
|
51
|
+
/** The offset in ms (kb-api's clock minus ours). */
|
|
52
|
+
offsetMs(): number;
|
|
53
|
+
/**
|
|
54
|
+
* Take a `serverTime` from an answer: the offset follows it. Answers whether the clock was off by more than
|
|
55
|
+
* DPOP_CLOCK_RETRY_MS before this answer (the condition of the one corrected retry).
|
|
56
|
+
*/
|
|
57
|
+
observe(serverTime: unknown): boolean;
|
|
58
|
+
}
|
|
59
|
+
export declare function createDpopClock(now?: () => number): DpopClock;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { subtle as i, assertPrivateBrowser as y } from "./browser.js";
|
|
2
|
+
import { randomBase64url as h, base64url as c, utf8 as f, sha256 as l } from "./encoding.js";
|
|
3
|
+
y();
|
|
4
|
+
const k = 6e4;
|
|
5
|
+
async function w(t) {
|
|
6
|
+
return c(await l(t));
|
|
7
|
+
}
|
|
8
|
+
async function u(t) {
|
|
9
|
+
const n = { typ: "dpop+jwt", alg: "ES256", jwk: { kty: t.jwk.kty, crv: t.jwk.crv, x: t.jwk.x, y: t.jwk.y } }, s = {
|
|
10
|
+
jti: t.jti ?? h(16),
|
|
11
|
+
htm: t.htm,
|
|
12
|
+
htu: t.htu,
|
|
13
|
+
iat: t.iat
|
|
14
|
+
};
|
|
15
|
+
t.nonce !== null && (s.nonce = t.nonce), t.accessToken && (s.ath = await w(t.accessToken));
|
|
16
|
+
const a = `${c(f(JSON.stringify(n)))}.${c(f(JSON.stringify(s)))}`, e = await i().sign({ name: "ECDSA", hash: "SHA-256" }, t.privateKey, f(a));
|
|
17
|
+
return `${a}.${c(new Uint8Array(e))}`;
|
|
18
|
+
}
|
|
19
|
+
const g = /^[A-Za-z0-9_-]{8,128}$/;
|
|
20
|
+
function $(t = Date.now) {
|
|
21
|
+
const n = /* @__PURE__ */ new Map();
|
|
22
|
+
let s = 0;
|
|
23
|
+
const a = (e, o) => `${e}|${o}`;
|
|
24
|
+
return {
|
|
25
|
+
nonce: (e, o) => n.get(a(e, o)) ?? null,
|
|
26
|
+
setNonce(e, o, r) {
|
|
27
|
+
typeof r == "string" && g.test(r) && n.set(a(e, o), r);
|
|
28
|
+
},
|
|
29
|
+
forgetKey(e) {
|
|
30
|
+
for (const o of [...n.keys()]) o.endsWith(`|${e}`) && n.delete(o);
|
|
31
|
+
},
|
|
32
|
+
iat: () => Math.floor((t() + s) / 1e3),
|
|
33
|
+
offsetMs: () => s,
|
|
34
|
+
observe(e) {
|
|
35
|
+
if (typeof e != "number" || !Number.isFinite(e) || e <= 0) return !1;
|
|
36
|
+
const o = e - t(), r = Math.abs(o - s) > k;
|
|
37
|
+
return s = o, r;
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
export {
|
|
42
|
+
k as DPOP_CLOCK_RETRY_MS,
|
|
43
|
+
$ as createDpopClock,
|
|
44
|
+
w as dpopAth,
|
|
45
|
+
u as signDpopProof
|
|
46
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The byte helpers the private entry needs: base64url (RFC 4648 §5, no padding — what JOSE and kb-api's tokens use),
|
|
3
|
+
* SHA-256 over WebCrypto, and random values from `crypto.getRandomValues`. No dependency, so the entry stays one of
|
|
4
|
+
* plain WebCrypto.
|
|
5
|
+
*/
|
|
6
|
+
/** base64url without padding. */
|
|
7
|
+
export declare function base64url(bytes: Uint8Array): string;
|
|
8
|
+
/** The bytes of a base64url string, or null for anything that is not one (padding, `+`, `/`, a stray character). */
|
|
9
|
+
export declare function fromBase64url(text: string): Uint8Array | null;
|
|
10
|
+
/** UTF-8 bytes of a string. */
|
|
11
|
+
export declare function utf8(text: string): Uint8Array<ArrayBuffer>;
|
|
12
|
+
/** SHA-256 of bytes or of a string's UTF-8. */
|
|
13
|
+
export declare function sha256(input: Uint8Array | string): Promise<Uint8Array>;
|
|
14
|
+
/** Lower-case hex of bytes. */
|
|
15
|
+
export declare function hex(bytes: Uint8Array): string;
|
|
16
|
+
/** `n` random bytes as base64url (a JWT `jti`, a hand-off `state`). */
|
|
17
|
+
export declare function randomBase64url(n: number): string;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { subtle as l } from "./browser.js";
|
|
2
|
+
const e = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
|
|
3
|
+
function u(n) {
|
|
4
|
+
let r = "", t = 0;
|
|
5
|
+
for (; t + 2 < n.length; t += 3) {
|
|
6
|
+
const o = n[t] << 16 | n[t + 1] << 8 | n[t + 2];
|
|
7
|
+
r += e[o >> 18 & 63] + e[o >> 12 & 63] + e[o >> 6 & 63] + e[o & 63];
|
|
8
|
+
}
|
|
9
|
+
const f = n.length - t;
|
|
10
|
+
if (f === 1) {
|
|
11
|
+
const o = n[t] << 16;
|
|
12
|
+
r += e[o >> 18 & 63] + e[o >> 12 & 63];
|
|
13
|
+
} else if (f === 2) {
|
|
14
|
+
const o = n[t] << 16 | n[t + 1] << 8;
|
|
15
|
+
r += e[o >> 18 & 63] + e[o >> 12 & 63] + e[o >> 6 & 63];
|
|
16
|
+
}
|
|
17
|
+
return r;
|
|
18
|
+
}
|
|
19
|
+
function s(n) {
|
|
20
|
+
if (typeof n != "string" || !/^[A-Za-z0-9_-]*$/.test(n) || n.length % 4 === 1) return null;
|
|
21
|
+
const r = new Uint8Array(Math.floor(n.length * 3 / 4));
|
|
22
|
+
let t = 0, f = 0, o = 0;
|
|
23
|
+
for (const i of n)
|
|
24
|
+
f = f << 6 | e.indexOf(i), t += 6, t >= 8 && (t -= 8, r[o++] = f >> t & 255);
|
|
25
|
+
return r;
|
|
26
|
+
}
|
|
27
|
+
function c(n) {
|
|
28
|
+
return new TextEncoder().encode(n);
|
|
29
|
+
}
|
|
30
|
+
async function g(n) {
|
|
31
|
+
const r = typeof n == "string" ? c(n) : new Uint8Array(n);
|
|
32
|
+
return new Uint8Array(await l().digest("SHA-256", r));
|
|
33
|
+
}
|
|
34
|
+
function h(n) {
|
|
35
|
+
let r = "";
|
|
36
|
+
for (const t of n) r += t.toString(16).padStart(2, "0");
|
|
37
|
+
return r;
|
|
38
|
+
}
|
|
39
|
+
function A(n) {
|
|
40
|
+
const r = new Uint8Array(n);
|
|
41
|
+
return globalThis.crypto.getRandomValues(r), u(r);
|
|
42
|
+
}
|
|
43
|
+
export {
|
|
44
|
+
u as base64url,
|
|
45
|
+
s as fromBase64url,
|
|
46
|
+
h as hex,
|
|
47
|
+
A as randomBase64url,
|
|
48
|
+
g as sha256,
|
|
49
|
+
c as utf8
|
|
50
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a host reads from its own `me/get` before it mounts anything private (docs/internal/m4-contracts.md §5.11):
|
|
3
|
+
* the module block gains `private: { state, rendering }` — additive, absent from a kb-api before PS4. The dock and the
|
|
4
|
+
* blogs mount the private view only on `live` (or `read_only`, for the safety minimum), and under `provider_page` they
|
|
5
|
+
* render only the link to the account host.
|
|
6
|
+
*
|
|
7
|
+
* The block's type is the public shapes' (`ModuleInfo.private`, `PrivateModuleBlock` in shapes.ts), which the shapes'
|
|
8
|
+
* drift spec compares with kb-api's `ModuleBlock` member for member; this module only reads it.
|
|
9
|
+
*/
|
|
10
|
+
import type { PrivateModuleBlock, PrivateSurfaceState } from '../shapes.js';
|
|
11
|
+
export type { PrivateModuleBlock };
|
|
12
|
+
export declare const PRIVATE_STATES: readonly PrivateSurfaceState[];
|
|
13
|
+
export type PrivateState = PrivateSurfaceState;
|
|
14
|
+
/**
|
|
15
|
+
* The private block of a `me/get` answer (`MyState`), or null when kb-api sends none or one this SDK does not know —
|
|
16
|
+
* read as `dark`: nothing private is mounted.
|
|
17
|
+
*/
|
|
18
|
+
export declare function privateBlockOf(me: unknown): PrivateModuleBlock | null;
|
|
19
|
+
/** What the host mounts for a private block: the private view, only the account host's link, or nothing. */
|
|
20
|
+
export declare function privateMountOf(block: PrivateModuleBlock | null): 'view' | 'link' | 'none';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const t = Object.freeze(["dark", "live", "read_only", "braked"]);
|
|
2
|
+
function l(e) {
|
|
3
|
+
const n = e?.module?.private;
|
|
4
|
+
if (!n || typeof n != "object" || !t.includes(n.state)) return null;
|
|
5
|
+
const r = n.rendering === "provider_page" ? "provider_page" : n.rendering === "tenant" ? "tenant" : null;
|
|
6
|
+
return r === null ? null : Object.freeze({ state: n.state, rendering: r });
|
|
7
|
+
}
|
|
8
|
+
function u(e) {
|
|
9
|
+
return e === null || e.state !== "live" && e.state !== "read_only" ? "none" : e.rendering === "provider_page" ? "link" : "view";
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
t as PRIVATE_STATES,
|
|
13
|
+
l as privateBlockOf,
|
|
14
|
+
u as privateMountOf
|
|
15
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@blogmcp/sdk/community/private` — the member's private session in the browser (docs/internal/m4-contracts.md §6.1):
|
|
3
|
+
* the device key in IndexedDB, DPoP proofs, kb-api's private surface reached directly with no credentials, the
|
|
4
|
+
* session's lifecycle across tabs, the private view's marker and the promise as data. The private elements
|
|
5
|
+
* (`@blogmcp/community/private`) are built on it; a host mounts those, not this entry, unless it renders its own UI.
|
|
6
|
+
*
|
|
7
|
+
* BROWSER-ONLY by contract: importing it where `window`, `indexedDB` or `crypto.subtle` is missing throws (the device
|
|
8
|
+
* key must never exist on a server). Its server half — the grant route a host serves — is
|
|
9
|
+
* `createPrivateGrantHandler` / `createPrivateGrantHandoff` in `@blogmcp/sdk/community/server`, and this entry never
|
|
10
|
+
* imports it. It imports no error tracker, analytics or RUM, and a host that adds one excludes the private view
|
|
11
|
+
* (`PRIVATE_ROOT_ATTR`, `PRIVATE_VIEW_EVENT`).
|
|
12
|
+
*
|
|
13
|
+
* ```ts
|
|
14
|
+
* // Client-only code of a host (a lazy chunk mounted when me/get's module.private.state is live):
|
|
15
|
+
* const client = createPrivateClient({
|
|
16
|
+
* kbOrigin: 'https://tenant.blogmcp.ai',
|
|
17
|
+
* grantPath: '/komunita/grant',
|
|
18
|
+
* member: async () => (await community.me.get()).value?.member?.memberId ?? null,
|
|
19
|
+
* })
|
|
20
|
+
* await client.session.start() // ends another member's stored session on a shared browser
|
|
21
|
+
* const s = await ensureSession(client)
|
|
22
|
+
* // …and in the host's sign-out flow:
|
|
23
|
+
* await privateSignOut(client)
|
|
24
|
+
* // The member's inbox, live (the elements' `realtime` property takes `createPrivateRealtime` itself):
|
|
25
|
+
* const realtime = createPrivateRealtime({ client })
|
|
26
|
+
* const off = realtime.subscribe((event) => console.log(event.k))
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export { PRIVATE_SERVER_IMPORT_MESSAGE, isPrivateBrowser } from './browser.js';
|
|
30
|
+
export { createPrivateClient, ensureSession, privateSignOut, forgetDevice, PRIVATE_CLIENT_OPS, PRIVATE_OPS_AHEAD } from './client.js';
|
|
31
|
+
export type { PrivateClient, PrivateClientConfig, PrivateClientOp, PrivateStateAnswer, PrivateDeviceState, PrivateDevice, PrivateReadHour, PrivateApprovalRequest, PrivateApprovalStart, PrivateLegalText, PrivateActivation, PrivateActivationState, PrivateActivationAccept, PrivateTextProof, PrivatePushSubscription, PrivateNotification, PrivateNotificationsQuery, PrivateNotificationsMarkRead, } from './client.js';
|
|
32
|
+
export { createPrivateRealtime, inboxChannelOfToken, privateRealtimeEventOf, privateRealtimeUrlOf, PRIVATE_RT_RENEW_MARGIN_MS, } from './realtime.js';
|
|
33
|
+
export type { PrivateRealtime, PrivateRealtimeOptions, PrivateRealtimeEvent, PrivateRealtimeListener, PrivateRealtimeMode, PrivateRealtimeEnd, PrivateRealtimeEndReason, PrivateRealtimeTokenAnswer, PrivateCentrifugeLike, PrivateCentrifugeModuleLike, } from './realtime.js';
|
|
34
|
+
export { createPrivateSession, PRIVATE_REFRESH_MARGIN_MS, PRIVATE_SESSION_STORAGE, privateLockName } from './session.js';
|
|
35
|
+
export type { PrivateSession, PrivateSessionConfig, PrivateSessionInfo, PrivateSessionOpened, PrivateOutcome, PrivateFailure, PrivateCode, PrivateClientCode, PrivateLocks, PrivateChannel, } from './session.js';
|
|
36
|
+
export { PRIVATE_DB_NAME, PRIVATE_DB_STORE, jwkThumbprint, privateRecordId } from './keystore.js';
|
|
37
|
+
export type { DevicePublicJwk, PrivateKeyRecord, PrivateRendering } from './keystore.js';
|
|
38
|
+
export { DPOP_CLOCK_RETRY_MS, signDpopProof, dpopAth, createDpopClock } from './dpop.js';
|
|
39
|
+
export type { DpopProofInput, DpopClock } from './dpop.js';
|
|
40
|
+
export { PRIVATE_BASE_PATH, PRIVATE_TIMEOUT_MS, kbOriginOf, privateBaseOf } from './transport.js';
|
|
41
|
+
export { PRIVATE_ROUTES } from './private-routes.js';
|
|
42
|
+
export type { PrivateRoute } from './private-routes.js';
|
|
43
|
+
export { PRIVATE_ROOT_ATTR, PRIVATE_VIEW_EVENT, markPrivateRoot } from './marker.js';
|
|
44
|
+
export type { PrivateViewEventDetail } from './marker.js';
|
|
45
|
+
export { privatePromise, PRIVATE_PROMISE_KEYS, PRIVATE_PROMISE_MESSAGES_CS } from './promise.js';
|
|
46
|
+
export type { PrivatePromise, PrivatePromiseInput, PrivatePromiseKey, PrivateReceives, PrivateSpace, PrivateIdentity, PrivatePromiseRendering } from './promise.js';
|
|
47
|
+
export { PRIVATE_STATES, privateBlockOf, privateMountOf } from './host-state.js';
|
|
48
|
+
export type { PrivateModuleBlock, PrivateState } from './host-state.js';
|
|
49
|
+
export type { PrivateSurfaceState } from '../shapes.js';
|
|
50
|
+
export { createPrivateDmClient, dmEventEffect, isBoundedDmFailure, isRetryableDmFailure, privateDmMessageOf, PRIVATE_DM_EVENT_KINDS, PRIVATE_DM_MESSAGE_STATES, PRIVATE_DM_OPS, PRIVATE_DM_OPS_AHEAD, PRIVATE_DM_PAGE_MAX, PRIVATE_DM_REREAD_PAGES, PRIVATE_DM_RETRY, PRIVATE_DM_RETRY_BOUNDED, PRIVATE_DM_RETRYABLE, PRIVATE_DM_TYPING_INTERVAL_MS, PRIVATE_DM_TYPING_SHOW_MS, } from './dm.js';
|
|
51
|
+
export type { PrivateDmAudience, PrivateDmBlock, PrivateDmBlockReportInput, PrivateDmCase, PrivateDmClient, PrivateDmClientCode, PrivateDmClientOptions, PrivateDmClientSource, PrivateDmConversation, PrivateDmCounterpart, PrivateDmDrafts, PrivateDmEditInput, PrivateDmEventEffect, PrivateDmExport, PrivateDmFailure, PrivateDmMessage, PrivateDmMessagesQuery, PrivateDmMessageState, PrivateDmOp, PrivateDmOpened, PrivateDmPage, PrivateDmReadResult, PrivateDmPendingSend, PrivateDmReportInput, PrivateDmReportLine, PrivateDmReportPreview, PrivateDmReportRecipients, PrivateDmReportTarget, PrivateDmRequest, PrivateDmSending, PrivateDmSendInput, PrivateDmSendOutcome, PrivateDmSlice, PrivateDmStatement, PrivateDmThread, PrivateDmThreadListener, PrivateDmThreadState, } from './dm.js';
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { assertPrivateBrowser as e } from "./browser.js";
|
|
2
|
+
import { PRIVATE_SERVER_IMPORT_MESSAGE as R, isPrivateBrowser as T } from "./browser.js";
|
|
3
|
+
import { PRIVATE_CLIENT_OPS as A, PRIVATE_OPS_AHEAD as P, createPrivateClient as o, ensureSession as I, forgetDevice as S, privateSignOut as i } from "./client.js";
|
|
4
|
+
import { PRIVATE_RT_RENEW_MARGIN_MS as V, createPrivateRealtime as p, inboxChannelOfToken as M, privateRealtimeEventOf as O, privateRealtimeUrlOf as D } from "./realtime.js";
|
|
5
|
+
import { PRIVATE_REFRESH_MARGIN_MS as f, PRIVATE_SESSION_STORAGE as v, createPrivateSession as n, privateLockName as s } from "./session.js";
|
|
6
|
+
import { PRIVATE_DB_NAME as x, PRIVATE_DB_STORE as l, jwkThumbprint as c, privateRecordId as B } from "./keystore.js";
|
|
7
|
+
import { DPOP_CLOCK_RETRY_MS as C, createDpopClock as k, dpopAth as u, signDpopProof as Y } from "./dpop.js";
|
|
8
|
+
import { PRIVATE_BASE_PATH as g, PRIVATE_TIMEOUT_MS as H, kbOriginOf as L, privateBaseOf as b } from "./transport.js";
|
|
9
|
+
import { PRIVATE_ROUTES as h } from "./private-routes.js";
|
|
10
|
+
import { PRIVATE_ROOT_ATTR as F, PRIVATE_VIEW_EVENT as K, markPrivateRoot as W } from "./marker.js";
|
|
11
|
+
import { PRIVATE_PROMISE_KEYS as y, PRIVATE_PROMISE_MESSAGES_CS as X, privatePromise as q } from "./promise.js";
|
|
12
|
+
import { PRIVATE_STATES as J, privateBlockOf as Q, privateMountOf as Z } from "./host-state.js";
|
|
13
|
+
import { PRIVATE_DM_EVENT_KINDS as ee, PRIVATE_DM_MESSAGE_STATES as Ee, PRIVATE_DM_OPS as _e, PRIVATE_DM_OPS_AHEAD as re, PRIVATE_DM_PAGE_MAX as Re, PRIVATE_DM_REREAD_PAGES as Te, PRIVATE_DM_RETRY as te, PRIVATE_DM_RETRYABLE as Ae, PRIVATE_DM_RETRY_BOUNDED as Pe, PRIVATE_DM_TYPING_INTERVAL_MS as oe, PRIVATE_DM_TYPING_SHOW_MS as Ie, createPrivateDmClient as Se, dmEventEffect as ie, isBoundedDmFailure as ae, isRetryableDmFailure as Ve, privateDmMessageOf as pe } from "./dm.js";
|
|
14
|
+
e();
|
|
15
|
+
export {
|
|
16
|
+
C as DPOP_CLOCK_RETRY_MS,
|
|
17
|
+
g as PRIVATE_BASE_PATH,
|
|
18
|
+
A as PRIVATE_CLIENT_OPS,
|
|
19
|
+
x as PRIVATE_DB_NAME,
|
|
20
|
+
l as PRIVATE_DB_STORE,
|
|
21
|
+
ee as PRIVATE_DM_EVENT_KINDS,
|
|
22
|
+
Ee as PRIVATE_DM_MESSAGE_STATES,
|
|
23
|
+
_e as PRIVATE_DM_OPS,
|
|
24
|
+
re as PRIVATE_DM_OPS_AHEAD,
|
|
25
|
+
Re as PRIVATE_DM_PAGE_MAX,
|
|
26
|
+
Te as PRIVATE_DM_REREAD_PAGES,
|
|
27
|
+
te as PRIVATE_DM_RETRY,
|
|
28
|
+
Ae as PRIVATE_DM_RETRYABLE,
|
|
29
|
+
Pe as PRIVATE_DM_RETRY_BOUNDED,
|
|
30
|
+
oe as PRIVATE_DM_TYPING_INTERVAL_MS,
|
|
31
|
+
Ie as PRIVATE_DM_TYPING_SHOW_MS,
|
|
32
|
+
P as PRIVATE_OPS_AHEAD,
|
|
33
|
+
y as PRIVATE_PROMISE_KEYS,
|
|
34
|
+
X as PRIVATE_PROMISE_MESSAGES_CS,
|
|
35
|
+
f as PRIVATE_REFRESH_MARGIN_MS,
|
|
36
|
+
F as PRIVATE_ROOT_ATTR,
|
|
37
|
+
h as PRIVATE_ROUTES,
|
|
38
|
+
V as PRIVATE_RT_RENEW_MARGIN_MS,
|
|
39
|
+
R as PRIVATE_SERVER_IMPORT_MESSAGE,
|
|
40
|
+
v as PRIVATE_SESSION_STORAGE,
|
|
41
|
+
J as PRIVATE_STATES,
|
|
42
|
+
H as PRIVATE_TIMEOUT_MS,
|
|
43
|
+
K as PRIVATE_VIEW_EVENT,
|
|
44
|
+
k as createDpopClock,
|
|
45
|
+
o as createPrivateClient,
|
|
46
|
+
Se as createPrivateDmClient,
|
|
47
|
+
p as createPrivateRealtime,
|
|
48
|
+
n as createPrivateSession,
|
|
49
|
+
ie as dmEventEffect,
|
|
50
|
+
u as dpopAth,
|
|
51
|
+
I as ensureSession,
|
|
52
|
+
S as forgetDevice,
|
|
53
|
+
M as inboxChannelOfToken,
|
|
54
|
+
ae as isBoundedDmFailure,
|
|
55
|
+
T as isPrivateBrowser,
|
|
56
|
+
Ve as isRetryableDmFailure,
|
|
57
|
+
c as jwkThumbprint,
|
|
58
|
+
L as kbOriginOf,
|
|
59
|
+
W as markPrivateRoot,
|
|
60
|
+
b as privateBaseOf,
|
|
61
|
+
Q as privateBlockOf,
|
|
62
|
+
pe as privateDmMessageOf,
|
|
63
|
+
s as privateLockName,
|
|
64
|
+
Z as privateMountOf,
|
|
65
|
+
q as privatePromise,
|
|
66
|
+
O as privateRealtimeEventOf,
|
|
67
|
+
D as privateRealtimeUrlOf,
|
|
68
|
+
B as privateRecordId,
|
|
69
|
+
i as privateSignOut,
|
|
70
|
+
Y as signDpopProof
|
|
71
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The device key (docs/internal/m4-contracts.md §6.1, §4.5, §5.9). One ECDSA P-256 key pair per member per browser,
|
|
3
|
+
* made by `crypto.subtle.generateKey(…, false, ['sign'])`: the private half is not extractable, and it is stored as
|
|
4
|
+
* the `CryptoKey` itself (a structured-clone value) in IndexedDB — database `blogmcp-private`, store `keys` — never
|
|
5
|
+
* exported, never serialised. The public half is exported as a JWK for the proof header and its RFC 7638 thumbprint
|
|
6
|
+
* (`jkt`), which is the device's identity on kb-api.
|
|
7
|
+
*
|
|
8
|
+
* A record's key is `sha256(<kb origin> ‖ "|" ‖ <member>)` in hex: two members on one browser have two keys, so each
|
|
9
|
+
* is one device of its own member, and the record names no member in clear. `<member>` is the member id the host's
|
|
10
|
+
* `me/get` gives under tenant rendering, and the hand-off's `memberRef` under `provider_page` (the account page never
|
|
11
|
+
* learns a member id).
|
|
12
|
+
*
|
|
13
|
+
* The record also holds, under tenant rendering, the session's refresh token (B-33: a refresh token bound to a
|
|
14
|
+
* non-extractable key is useless without that key — RFC 9449 §5 — and keeping it spares a grant on every page load)
|
|
15
|
+
* and the private base the grant named. Under `provider_page` the refresh token lives in this tab's `sessionStorage`
|
|
16
|
+
* only (session.ts), so every new load proves the site's current host session through the hand-off. The access token
|
|
17
|
+
* is never stored anywhere (session.ts keeps it in memory).
|
|
18
|
+
*/
|
|
19
|
+
export declare const PRIVATE_DB_NAME = "blogmcp-private";
|
|
20
|
+
export declare const PRIVATE_DB_STORE = "keys";
|
|
21
|
+
/** How the private view is rendered: on the tenant's site, or on blogmcp's account host (`/zpravy`). */
|
|
22
|
+
export type PrivateRendering = 'tenant' | 'provider_page';
|
|
23
|
+
/** The public JWK of a device key: exactly the members RFC 7638 hashes, so the proof header carries nothing else. */
|
|
24
|
+
export interface DevicePublicJwk {
|
|
25
|
+
readonly kty: 'EC';
|
|
26
|
+
readonly crv: 'P-256';
|
|
27
|
+
readonly x: string;
|
|
28
|
+
readonly y: string;
|
|
29
|
+
}
|
|
30
|
+
/** One device key and what belongs to it (see the module doc). */
|
|
31
|
+
export interface PrivateKeyRecord {
|
|
32
|
+
/** `sha256(kbOrigin ‖ "|" ‖ member)` in hex, or `unbound:<random>` for a `provider_page` key before its first hand-off. */
|
|
33
|
+
readonly id: string;
|
|
34
|
+
readonly kbOrigin: string;
|
|
35
|
+
readonly rendering: PrivateRendering;
|
|
36
|
+
readonly keyPair: CryptoKeyPair;
|
|
37
|
+
readonly publicJwk: DevicePublicJwk;
|
|
38
|
+
readonly jkt: string;
|
|
39
|
+
/** Tenant rendering only; `provider_page` keeps it in sessionStorage. Null without a session. */
|
|
40
|
+
readonly refreshToken: string | null;
|
|
41
|
+
/** The absolute private base the last grant answer named (transport.ts checks it again on every use). */
|
|
42
|
+
readonly privateBase: string | null;
|
|
43
|
+
readonly createdAt: number;
|
|
44
|
+
readonly usedAt: number;
|
|
45
|
+
}
|
|
46
|
+
/** The record id of a member's key on one kb-api origin. */
|
|
47
|
+
export declare function privateRecordId(kbOrigin: string, member: string): Promise<string>;
|
|
48
|
+
/** An id for a key made before the member is known (the first hand-off under `provider_page`). */
|
|
49
|
+
export declare function unboundRecordId(): string;
|
|
50
|
+
export declare const isUnboundRecordId: (id: string) => boolean;
|
|
51
|
+
/** RFC 7638: the SHA-256 of the required members in lexicographic order, no whitespace, base64url. */
|
|
52
|
+
export declare function jwkThumbprint(jwk: DevicePublicJwk): Promise<string>;
|
|
53
|
+
/** A new non-extractable P-256 signing key, its public JWK and its thumbprint. */
|
|
54
|
+
export declare function generateDeviceKey(): Promise<{
|
|
55
|
+
keyPair: CryptoKeyPair;
|
|
56
|
+
publicJwk: DevicePublicJwk;
|
|
57
|
+
jkt: string;
|
|
58
|
+
}>;
|
|
59
|
+
/** The store of device keys. Every call opens its own short transaction and re-reads (another tab may have written). */
|
|
60
|
+
export interface PrivateKeystore {
|
|
61
|
+
get(id: string): Promise<PrivateKeyRecord | null>;
|
|
62
|
+
put(record: PrivateKeyRecord): Promise<void>;
|
|
63
|
+
delete(id: string): Promise<void>;
|
|
64
|
+
/** Every record of this kb origin. */
|
|
65
|
+
list(): Promise<PrivateKeyRecord[]>;
|
|
66
|
+
/** A new key under `id` (replacing whatever was there: the old key is gone for good). */
|
|
67
|
+
create(id: string, rendering: PrivateRendering): Promise<PrivateKeyRecord>;
|
|
68
|
+
}
|
|
69
|
+
export declare function createPrivateKeystore(options: {
|
|
70
|
+
kbOrigin: string;
|
|
71
|
+
indexedDB?: () => IDBFactory;
|
|
72
|
+
now?: () => number;
|
|
73
|
+
}): PrivateKeystore;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { subtle as b, assertPrivateBrowser as k } from "./browser.js";
|
|
2
|
+
import { base64url as m, sha256 as f, utf8 as g, hex as x, randomBase64url as P } from "./encoding.js";
|
|
3
|
+
k();
|
|
4
|
+
const E = "blogmcp-private", u = "keys", D = 1;
|
|
5
|
+
async function O(e, r) {
|
|
6
|
+
return x(await f(`${e}|${r}`));
|
|
7
|
+
}
|
|
8
|
+
function S() {
|
|
9
|
+
return `unbound:${P(16)}`;
|
|
10
|
+
}
|
|
11
|
+
const T = (e) => e.startsWith("unbound:");
|
|
12
|
+
async function B(e) {
|
|
13
|
+
const r = `{"crv":"${e.crv}","kty":"${e.kty}","x":"${e.x}","y":"${e.y}"}`;
|
|
14
|
+
return m(await f(g(r)));
|
|
15
|
+
}
|
|
16
|
+
async function I() {
|
|
17
|
+
const e = await b().generateKey({ name: "ECDSA", namedCurve: "P-256" }, !1, ["sign"]), r = await b().exportKey("jwk", e.publicKey);
|
|
18
|
+
if (r.kty !== "EC" || r.crv !== "P-256" || typeof r.x != "string" || typeof r.y != "string")
|
|
19
|
+
throw new Error("[blogmcp-sdk] the browser made a key that is not a P-256 key");
|
|
20
|
+
const a = Object.freeze({ kty: "EC", crv: "P-256", x: r.x, y: r.y });
|
|
21
|
+
return { keyPair: e, publicJwk: a, jkt: await B(a) };
|
|
22
|
+
}
|
|
23
|
+
function h(e) {
|
|
24
|
+
return new Promise((r, a) => {
|
|
25
|
+
e.onsuccess = () => r(e.result), e.onerror = () => a(e.error ?? new Error("IndexedDB request failed"));
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
function v(e) {
|
|
29
|
+
return new Promise((r, a) => {
|
|
30
|
+
const o = e.open(E, D);
|
|
31
|
+
o.onupgradeneeded = () => {
|
|
32
|
+
const i = o.result;
|
|
33
|
+
i.objectStoreNames.contains(u) || i.createObjectStore(u, { keyPath: "id" });
|
|
34
|
+
}, o.onsuccess = () => r(o.result), o.onerror = () => a(o.error ?? new Error("IndexedDB open failed")), o.onblocked = () => a(new Error("IndexedDB open blocked"));
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function $(e) {
|
|
38
|
+
const r = e.indexedDB ?? (() => globalThis.indexedDB), a = e.now ?? Date.now, o = e.kbOrigin;
|
|
39
|
+
async function i(t, n) {
|
|
40
|
+
const s = await v(r());
|
|
41
|
+
try {
|
|
42
|
+
const c = s.transaction(u, t), d = new Promise((p, w) => {
|
|
43
|
+
c.oncomplete = () => p(), c.onerror = () => w(c.error ?? new Error("IndexedDB transaction failed")), c.onabort = () => w(c.error ?? new Error("IndexedDB transaction aborted"));
|
|
44
|
+
}), l = await h(n(c.objectStore(u)));
|
|
45
|
+
return await d, l;
|
|
46
|
+
} finally {
|
|
47
|
+
s.close();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
const y = (t) => !!t && typeof t == "object" && typeof t.id == "string" && t.kbOrigin === o;
|
|
51
|
+
return {
|
|
52
|
+
async get(t) {
|
|
53
|
+
const n = await i("readonly", (s) => s.get(t));
|
|
54
|
+
return y(n) ? n : null;
|
|
55
|
+
},
|
|
56
|
+
async put(t) {
|
|
57
|
+
await i("readwrite", (n) => n.put(t));
|
|
58
|
+
},
|
|
59
|
+
async delete(t) {
|
|
60
|
+
await i("readwrite", (n) => n.delete(t));
|
|
61
|
+
},
|
|
62
|
+
async list() {
|
|
63
|
+
return (await i("readonly", (n) => n.getAll())).filter(y);
|
|
64
|
+
},
|
|
65
|
+
async create(t, n) {
|
|
66
|
+
const s = await I(), c = a(), d = {
|
|
67
|
+
id: t,
|
|
68
|
+
kbOrigin: o,
|
|
69
|
+
rendering: n,
|
|
70
|
+
keyPair: s.keyPair,
|
|
71
|
+
publicJwk: s.publicJwk,
|
|
72
|
+
jkt: s.jkt,
|
|
73
|
+
refreshToken: null,
|
|
74
|
+
privateBase: null,
|
|
75
|
+
createdAt: c,
|
|
76
|
+
usedAt: c
|
|
77
|
+
};
|
|
78
|
+
return await i("readwrite", (l) => l.put(d)), d;
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
export {
|
|
83
|
+
E as PRIVATE_DB_NAME,
|
|
84
|
+
u as PRIVATE_DB_STORE,
|
|
85
|
+
$ as createPrivateKeystore,
|
|
86
|
+
I as generateDeviceKey,
|
|
87
|
+
T as isUnboundRecordId,
|
|
88
|
+
B as jwkThumbprint,
|
|
89
|
+
O as privateRecordId,
|
|
90
|
+
S as unboundRecordId
|
|
91
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The private view's marker (docs/internal/m4-contracts.md §6.1, §7.1). A host pauses its analytics and any RUM while
|
|
3
|
+
* private content is on screen: the private view's root carries `data-blogmcp-private`, and `document` receives
|
|
4
|
+
* `blogmcp:private-view` with `{ open: true }` when it mounts and `{ open: false }` when it goes. The storefront's Umami
|
|
5
|
+
* filter drops every event whose target is inside `[data-blogmcp-private]` (PH3).
|
|
6
|
+
*/
|
|
7
|
+
export declare const PRIVATE_ROOT_ATTR = "data-blogmcp-private";
|
|
8
|
+
export declare const PRIVATE_VIEW_EVENT = "blogmcp:private-view";
|
|
9
|
+
/** The event's detail. */
|
|
10
|
+
export interface PrivateViewEventDetail {
|
|
11
|
+
open: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Marks `el` as the private view's root (or unmarks it with `open: false`) and tells the page. Returns a function that
|
|
15
|
+
* undoes the mark, for a view's unmount.
|
|
16
|
+
*/
|
|
17
|
+
export declare function markPrivateRoot(el: Element, open?: boolean): () => void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const o = "data-blogmcp-private", i = "blogmcp:private-view";
|
|
2
|
+
function r(t, e = !0) {
|
|
3
|
+
return e ? t.setAttribute(o, "") : t.removeAttribute(o), (t.ownerDocument ?? globalThis.document)?.dispatchEvent(new CustomEvent(i, { detail: { open: e } })), () => {
|
|
4
|
+
e && r(t, !1);
|
|
5
|
+
};
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
o as PRIVATE_ROOT_ATTR,
|
|
9
|
+
i as PRIVATE_VIEW_EVENT,
|
|
10
|
+
r as markPrivateRoot
|
|
11
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
const e = Object.freeze([
|
|
2
|
+
Object.freeze({ method: "POST", path: "/community/v1/account/activation/dispute" }),
|
|
3
|
+
Object.freeze({ method: "POST", path: "/community/v1/account/activation/end" }),
|
|
4
|
+
Object.freeze({ method: "POST", path: "/community/v1/account/address/change/confirm" }),
|
|
5
|
+
Object.freeze({ method: "POST", path: "/community/v1/account/address/change/request" }),
|
|
6
|
+
Object.freeze({ method: "POST", path: "/community/v1/account/address/set" }),
|
|
7
|
+
Object.freeze({ method: "POST", path: "/community/v1/account/address/verify" }),
|
|
8
|
+
Object.freeze({ method: "POST", path: "/community/v1/account/device/approval/get" }),
|
|
9
|
+
Object.freeze({ method: "POST", path: "/community/v1/account/device/approve" }),
|
|
10
|
+
Object.freeze({ method: "POST", path: "/community/v1/account/device/list" }),
|
|
11
|
+
Object.freeze({ method: "POST", path: "/community/v1/account/device/sign-out" }),
|
|
12
|
+
Object.freeze({ method: "POST", path: "/community/v1/account/device/sign-out-all" }),
|
|
13
|
+
Object.freeze({ method: "POST", path: "/community/v1/account/export/confirm" }),
|
|
14
|
+
Object.freeze({ method: "POST", path: "/community/v1/account/export/download" }),
|
|
15
|
+
Object.freeze({ method: "POST", path: "/community/v1/account/reads/list" }),
|
|
16
|
+
Object.freeze({ method: "POST", path: "/community/v1/grant/issue" }),
|
|
17
|
+
Object.freeze({ method: "POST", path: "/community/v1/private/activation/accept" }),
|
|
18
|
+
Object.freeze({ method: "POST", path: "/community/v1/private/activation/end" }),
|
|
19
|
+
Object.freeze({ method: "POST", path: "/community/v1/private/activation/state" }),
|
|
20
|
+
Object.freeze({ method: "POST", path: "/community/v1/private/activation/withdraw" }),
|
|
21
|
+
Object.freeze({ method: "POST", path: "/community/v1/private/address/link" }),
|
|
22
|
+
Object.freeze({ method: "POST", path: "/community/v1/private/appeals/submit" }),
|
|
23
|
+
Object.freeze({ method: "POST", path: "/community/v1/private/approval/deny" }),
|
|
24
|
+
Object.freeze({ method: "POST", path: "/community/v1/private/approval/pending" }),
|
|
25
|
+
Object.freeze({ method: "POST", path: "/community/v1/private/approval/redeem" }),
|
|
26
|
+
Object.freeze({ method: "POST", path: "/community/v1/private/approval/show" }),
|
|
27
|
+
Object.freeze({ method: "POST", path: "/community/v1/private/approval/start" }),
|
|
28
|
+
Object.freeze({ method: "POST", path: "/community/v1/private/audience/check" }),
|
|
29
|
+
Object.freeze({ method: "POST", path: "/community/v1/private/blocks/add" }),
|
|
30
|
+
Object.freeze({ method: "POST", path: "/community/v1/private/blocks/list" }),
|
|
31
|
+
Object.freeze({ method: "POST", path: "/community/v1/private/blocks/remove" }),
|
|
32
|
+
Object.freeze({ method: "POST", path: "/community/v1/private/cases/get" }),
|
|
33
|
+
Object.freeze({ method: "POST", path: "/community/v1/private/cases/list" }),
|
|
34
|
+
Object.freeze({ method: "POST", path: "/community/v1/private/devices/forget" }),
|
|
35
|
+
Object.freeze({ method: "POST", path: "/community/v1/private/devices/list" }),
|
|
36
|
+
Object.freeze({ method: "POST", path: "/community/v1/private/devices/reads" }),
|
|
37
|
+
Object.freeze({ method: "POST", path: "/community/v1/private/devices/sign-out" }),
|
|
38
|
+
Object.freeze({ method: "POST", path: "/community/v1/private/devices/sign-out-all" }),
|
|
39
|
+
Object.freeze({ method: "POST", path: "/community/v1/private/dm/clear" }),
|
|
40
|
+
Object.freeze({ method: "POST", path: "/community/v1/private/dm/delete" }),
|
|
41
|
+
Object.freeze({ method: "POST", path: "/community/v1/private/dm/edit" }),
|
|
42
|
+
Object.freeze({ method: "POST", path: "/community/v1/private/dm/hide" }),
|
|
43
|
+
Object.freeze({ method: "POST", path: "/community/v1/private/dm/list" }),
|
|
44
|
+
Object.freeze({ method: "POST", path: "/community/v1/private/dm/messages" }),
|
|
45
|
+
Object.freeze({ method: "POST", path: "/community/v1/private/dm/open" }),
|
|
46
|
+
Object.freeze({ method: "POST", path: "/community/v1/private/dm/read" }),
|
|
47
|
+
Object.freeze({ method: "POST", path: "/community/v1/private/dm/send" }),
|
|
48
|
+
Object.freeze({ method: "POST", path: "/community/v1/private/dm/typing" }),
|
|
49
|
+
Object.freeze({ method: "POST", path: "/community/v1/private/export/download" }),
|
|
50
|
+
Object.freeze({ method: "POST", path: "/community/v1/private/notifications/list" }),
|
|
51
|
+
Object.freeze({ method: "POST", path: "/community/v1/private/notifications/mark-read" }),
|
|
52
|
+
Object.freeze({ method: "POST", path: "/community/v1/private/notifications/unread-count" }),
|
|
53
|
+
Object.freeze({ method: "POST", path: "/community/v1/private/push/subscribe" }),
|
|
54
|
+
Object.freeze({ method: "POST", path: "/community/v1/private/push/unsubscribe" }),
|
|
55
|
+
Object.freeze({ method: "POST", path: "/community/v1/private/realtime/token" }),
|
|
56
|
+
Object.freeze({ method: "POST", path: "/community/v1/private/reports/preview" }),
|
|
57
|
+
Object.freeze({ method: "POST", path: "/community/v1/private/reports/submit" }),
|
|
58
|
+
Object.freeze({ method: "POST", path: "/community/v1/private/requests/accept" }),
|
|
59
|
+
Object.freeze({ method: "POST", path: "/community/v1/private/requests/block-report" }),
|
|
60
|
+
Object.freeze({ method: "POST", path: "/community/v1/private/requests/delete" }),
|
|
61
|
+
Object.freeze({ method: "POST", path: "/community/v1/private/requests/list" }),
|
|
62
|
+
Object.freeze({ method: "POST", path: "/community/v1/private/session" }),
|
|
63
|
+
Object.freeze({ method: "POST", path: "/community/v1/private/session/end" }),
|
|
64
|
+
Object.freeze({ method: "POST", path: "/community/v1/private/session/refresh" }),
|
|
65
|
+
Object.freeze({ method: "POST", path: "/community/v1/private/settings/get" }),
|
|
66
|
+
Object.freeze({ method: "POST", path: "/community/v1/private/settings/set" }),
|
|
67
|
+
Object.freeze({ method: "POST", path: "/community/v1/private/state" }),
|
|
68
|
+
Object.freeze({ method: "POST", path: "/community/v1/private/statements/get" })
|
|
69
|
+
]);
|
|
70
|
+
export {
|
|
71
|
+
e as PRIVATE_ROUTES
|
|
72
|
+
};
|