@codemem/server 0.49.1 → 0.50.0-beta.1

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.
Files changed (45) hide show
  1. package/dist/application/coordinator-maintenance.d.ts.map +1 -1
  2. package/dist/application/sync-health.d.ts +2 -0
  3. package/dist/application/sync-health.d.ts.map +1 -1
  4. package/dist/index.d.ts +8 -2
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +5901 -4056
  7. package/dist/index.js.map +1 -1
  8. package/dist/routes/device-block-action.d.ts +51 -0
  9. package/dist/routes/device-block-action.d.ts.map +1 -0
  10. package/dist/routes/device-block-enrolled.d.ts +58 -0
  11. package/dist/routes/device-block-enrolled.d.ts.map +1 -0
  12. package/dist/routes/device-block-removed.d.ts +57 -0
  13. package/dist/routes/device-block-removed.d.ts.map +1 -0
  14. package/dist/routes/device-rejoin-events.d.ts +47 -0
  15. package/dist/routes/device-rejoin-events.d.ts.map +1 -0
  16. package/dist/routes/device-rejoin-evidence.d.ts +6 -0
  17. package/dist/routes/device-rejoin-evidence.d.ts.map +1 -0
  18. package/dist/routes/device-removal-commit.d.ts +38 -0
  19. package/dist/routes/device-removal-commit.d.ts.map +1 -0
  20. package/dist/routes/device-removal-local.d.ts +41 -0
  21. package/dist/routes/device-removal-local.d.ts.map +1 -0
  22. package/dist/routes/device-removal-lookup.d.ts +37 -0
  23. package/dist/routes/device-removal-lookup.d.ts.map +1 -0
  24. package/dist/routes/device-removal-progress.d.ts +14 -0
  25. package/dist/routes/device-removal-progress.d.ts.map +1 -0
  26. package/dist/routes/device-removal-review.d.ts +126 -0
  27. package/dist/routes/device-removal-review.d.ts.map +1 -0
  28. package/dist/routes/device-rename.d.ts +16 -8
  29. package/dist/routes/device-rename.d.ts.map +1 -1
  30. package/dist/routes/device-retire.d.ts +206 -0
  31. package/dist/routes/device-retire.d.ts.map +1 -0
  32. package/dist/routes/project-withdrawal.d.ts +4 -0
  33. package/dist/routes/project-withdrawal.d.ts.map +1 -0
  34. package/dist/routes/sync.d.ts +68 -5
  35. package/dist/routes/sync.d.ts.map +1 -1
  36. package/dist/routes/team-create.d.ts +5 -0
  37. package/dist/routes/team-create.d.ts.map +1 -0
  38. package/dist/routes/team-setup-view.d.ts +3 -0
  39. package/dist/routes/team-setup-view.d.ts.map +1 -1
  40. package/dist/routes/team-setup.d.ts.map +1 -1
  41. package/package.json +2 -2
  42. package/static/app.js +65 -63
  43. package/static/app.js.br +0 -0
  44. package/static/app.js.gz +0 -0
  45. package/static/index.html +23 -3
@@ -0,0 +1,51 @@
1
+ import type { CoordinatorDeviceRevocationCommit, commitViewerDeviceRemoval, coordinatorRevokeDeviceAction } from "@codemem/core";
2
+ type RemovalInput = Parameters<typeof commitViewerDeviceRemoval>[0];
3
+ type RemovalContext = ReturnType<Parameters<typeof commitViewerDeviceRemoval>[1]["readContext"]>;
4
+ type RemovalOutcome = Awaited<ReturnType<typeof commitViewerDeviceRemoval>>;
5
+ type Removed = Extract<RemovalOutcome, {
6
+ kind: "removed";
7
+ }>;
8
+ export interface ViewerDeviceBlockInput {
9
+ groupId: string;
10
+ deviceId: string;
11
+ /** The coordinator and canonical key shown in the confirmed Block review. */
12
+ expectedContext: {
13
+ coordinatorId: string;
14
+ keyId: string;
15
+ };
16
+ removal: RemovalInput;
17
+ }
18
+ export interface ViewerDeviceBlockDependencies {
19
+ /** The caller adapts the existing verified identity/config reader. */
20
+ readContext(): RemovalContext;
21
+ revoke: typeof coordinatorRevokeDeviceAction;
22
+ /** Adapt commitViewerDeviceRemoval with its existing database and refresh hooks. */
23
+ remove(input: RemovalInput): ReturnType<typeof commitViewerDeviceRemoval>;
24
+ }
25
+ export type ViewerDeviceBlockOutcome = {
26
+ kind: "refused";
27
+ error: "invalid_input" | "block_preflight_refused" | "block_context_changed";
28
+ } | Extract<RemovalOutcome, {
29
+ kind: "rejected" | "unknown";
30
+ }> | {
31
+ kind: "blocked";
32
+ removal: Removed;
33
+ block: CoordinatorDeviceRevocationCommit;
34
+ } | {
35
+ kind: "removed-but-block-refused";
36
+ removal: Removed;
37
+ error: "block_context_changed" | "block_preview_refused" | "block_commit_refused";
38
+ } | {
39
+ kind: "removed-block-unknown";
40
+ removal: Removed;
41
+ error: "block_outcome_unknown";
42
+ };
43
+ /**
44
+ * In-process composition for the existing admin-authorized Viewer transport.
45
+ * No routes, credentials, authorization defaults, retries or local-only fallback.
46
+ * A removed result from the existing Remove helper includes verified receipt or
47
+ * listing evidence. Only that result admits the pinned second Block preview.
48
+ */
49
+ export declare function commitViewerDeviceBlock(confirmed: ViewerDeviceBlockInput, deps: ViewerDeviceBlockDependencies): Promise<ViewerDeviceBlockOutcome>;
50
+ export {};
51
+ //# sourceMappingURL=device-block-action.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"device-block-action.d.ts","sourceRoot":"","sources":["../../src/routes/device-block-action.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,iCAAiC,EAEjC,yBAAyB,EACzB,6BAA6B,EAC7B,MAAM,eAAe,CAAC;AAEvB,KAAK,YAAY,GAAG,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC,CAAC,CAAC,CAAC;AACpE,KAAK,cAAc,GAAG,UAAU,CAAC,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC;AACjG,KAAK,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC,CAAC;AAC5E,KAAK,OAAO,GAAG,OAAO,CAAC,cAAc,EAAE;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,CAAC,CAAC;AAG5D,MAAM,WAAW,sBAAsB;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,6EAA6E;IAC7E,eAAe,EAAE;QAAE,aAAa,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1D,OAAO,EAAE,YAAY,CAAC;CACtB;AAED,MAAM,WAAW,6BAA6B;IAC7C,sEAAsE;IACtE,WAAW,IAAI,cAAc,CAAC;IAC9B,MAAM,EAAE,OAAO,6BAA6B,CAAC;IAC7C,oFAAoF;IACpF,MAAM,CAAC,KAAK,EAAE,YAAY,GAAG,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC;CAC1E;AAED,MAAM,MAAM,wBAAwB,GACjC;IACA,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,eAAe,GAAG,yBAAyB,GAAG,uBAAuB,CAAC;CAC5E,GACD,OAAO,CAAC,cAAc,EAAE;IAAE,IAAI,EAAE,UAAU,GAAG,SAAS,CAAA;CAAE,CAAC,GACzD;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,iCAAiC,CAAA;CAAE,GAC/E;IACA,IAAI,EAAE,2BAA2B,CAAC;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,uBAAuB,GAAG,uBAAuB,GAAG,sBAAsB,CAAC;CACjF,GACD;IAAE,IAAI,EAAE,uBAAuB,CAAC;IAAC,OAAO,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,uBAAuB,CAAA;CAAE,CAAC;AA2KvF;;;;;GAKG;AACH,wBAAsB,uBAAuB,CAC5C,SAAS,EAAE,sBAAsB,EACjC,IAAI,EAAE,6BAA6B,GACjC,OAAO,CAAC,wBAAwB,CAAC,CAYnC"}
@@ -0,0 +1,58 @@
1
+ import { type MemoryStore, readCoordinatorSyncConfig } from "@codemem/core";
2
+ import type { DeviceRemovalRefreshHooksFactory } from "./device-removal-commit.js";
3
+ type Options = {
4
+ getStore(): Pick<MemoryStore, "db" | "dbPath" | "deviceId">;
5
+ readCoordinatorConfig?: typeof readCoordinatorSyncConfig;
6
+ createDeviceRemovalRefreshHooks: DeviceRemovalRefreshHooksFactory;
7
+ };
8
+ export declare function enrolledDeviceBlockRoutes(options: Options): import("hono/hono-base").HonoBase<import("hono/types").BlankEnv, {
9
+ "/api/sync/devices/:device_id/block-enrolled/preview": {
10
+ $post: {
11
+ output: {};
12
+ outputFormat: string;
13
+ status: import("hono/utils/http-status").StatusCode;
14
+ input: {
15
+ param: {
16
+ device_id: string;
17
+ };
18
+ };
19
+ } | {
20
+ output: {
21
+ error: string;
22
+ };
23
+ outputFormat: "json";
24
+ status: 403;
25
+ input: {
26
+ param: {
27
+ device_id: string;
28
+ };
29
+ };
30
+ };
31
+ };
32
+ } & {
33
+ "/api/sync/devices/:device_id/block-enrolled": {
34
+ $post: {
35
+ output: {};
36
+ outputFormat: string;
37
+ status: import("hono/utils/http-status").StatusCode;
38
+ input: {
39
+ param: {
40
+ device_id: string;
41
+ };
42
+ };
43
+ } | {
44
+ output: {
45
+ error: string;
46
+ };
47
+ outputFormat: "json";
48
+ status: 403;
49
+ input: {
50
+ param: {
51
+ device_id: string;
52
+ };
53
+ };
54
+ };
55
+ };
56
+ }, "/", "/api/sync/devices/:device_id/block-enrolled">;
57
+ export {};
58
+ //# sourceMappingURL=device-block-enrolled.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"device-block-enrolled.d.ts","sourceRoot":"","sources":["../../src/routes/device-block-enrolled.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,KAAK,WAAW,EAChB,yBAAyB,EAEzB,MAAM,eAAe,CAAC;AAKvB,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,4BAA4B,CAAC;AAInF,KAAK,OAAO,GAAG;IACd,QAAQ,IAAI,IAAI,CAAC,WAAW,EAAE,IAAI,GAAG,QAAQ,GAAG,UAAU,CAAC,CAAC;IAC5D,qBAAqB,CAAC,EAAE,OAAO,yBAAyB,CAAC;IACzD,+BAA+B,EAAE,gCAAgC,CAAC;CAClE,CAAC;AAsGF,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uDAIzD"}
@@ -0,0 +1,57 @@
1
+ import { type MemoryStore, readCoordinatorSyncConfig } from "@codemem/core";
2
+ type Options = {
3
+ getStore(): Pick<MemoryStore, "db" | "deviceId">;
4
+ readCoordinatorConfig?: typeof readCoordinatorSyncConfig;
5
+ };
6
+ /** Viewer bridge for Block from a listed tombstone. The coordinator checks the exact removal. */
7
+ export declare function removedDeviceBlockRoutes(options: Options): import("hono/hono-base").HonoBase<import("hono/types").BlankEnv, {
8
+ "/api/sync/devices/:device_id/block/preview": {
9
+ $post: {
10
+ output: {};
11
+ outputFormat: string;
12
+ status: import("hono/utils/http-status").StatusCode;
13
+ input: {
14
+ param: {
15
+ device_id: string;
16
+ };
17
+ };
18
+ } | {
19
+ output: {
20
+ error: string;
21
+ };
22
+ outputFormat: "json";
23
+ status: 403;
24
+ input: {
25
+ param: {
26
+ device_id: string;
27
+ };
28
+ };
29
+ };
30
+ };
31
+ } & {
32
+ "/api/sync/devices/:device_id/block": {
33
+ $post: {
34
+ output: {};
35
+ outputFormat: string;
36
+ status: import("hono/utils/http-status").StatusCode;
37
+ input: {
38
+ param: {
39
+ device_id: string;
40
+ };
41
+ };
42
+ } | {
43
+ output: {
44
+ error: string;
45
+ };
46
+ outputFormat: "json";
47
+ status: 403;
48
+ input: {
49
+ param: {
50
+ device_id: string;
51
+ };
52
+ };
53
+ };
54
+ };
55
+ }, "/", "/api/sync/devices/:device_id/block">;
56
+ export {};
57
+ //# sourceMappingURL=device-block-removed.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"device-block-removed.d.ts","sourceRoot":"","sources":["../../src/routes/device-block-removed.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,KAAK,WAAW,EAEhB,yBAAyB,EAEzB,MAAM,eAAe,CAAC;AAMvB,KAAK,OAAO,GAAG;IACd,QAAQ,IAAI,IAAI,CAAC,WAAW,EAAE,IAAI,GAAG,UAAU,CAAC,CAAC;IACjD,qBAAqB,CAAC,EAAE,OAAO,yBAAyB,CAAC;CACzD,CAAC;AA4EF,iGAAiG;AACjG,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8CAIxD"}
@@ -0,0 +1,47 @@
1
+ import { type MemoryStore, readCoordinatorSyncConfig } from "@codemem/core";
2
+ type Options = {
3
+ getStore: () => MemoryStore;
4
+ readConfig?: typeof readCoordinatorSyncConfig;
5
+ };
6
+ /** The browser supplies only a cursor. The profile selects the coordinator, signer and groups. */
7
+ export declare function deviceRejoinEventRoutes(options: Options): import("hono/hono-base").HonoBase<import("hono/types").BlankEnv, {
8
+ "/api/sync/devices/rejoin-events": {
9
+ $get: {
10
+ output: null;
11
+ outputFormat: "json";
12
+ status: import("hono/utils/http-status").ContentfulStatusCode;
13
+ input: {};
14
+ } | {
15
+ output: {
16
+ error: string;
17
+ };
18
+ outputFormat: "json";
19
+ status: 503;
20
+ input: {};
21
+ } | {
22
+ output: {
23
+ scope: string;
24
+ localDeviceId: string;
25
+ items: {
26
+ eventId: string;
27
+ deviceId: string;
28
+ groupIds: string[];
29
+ finalizedAtMs: number;
30
+ }[];
31
+ nextCursor: string | null;
32
+ };
33
+ outputFormat: "json";
34
+ status: import("hono/utils/http-status").ContentfulStatusCode;
35
+ input: {};
36
+ } | {
37
+ output: {
38
+ error: string;
39
+ };
40
+ outputFormat: "json";
41
+ status: 400;
42
+ input: {};
43
+ };
44
+ };
45
+ }, "/", "/api/sync/devices/rejoin-events">;
46
+ export {};
47
+ //# sourceMappingURL=device-rejoin-events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"device-rejoin-events.d.ts","sourceRoot":"","sources":["../../src/routes/device-rejoin-events.ts"],"names":[],"mappings":"AACA,OAAO,EACN,KAAK,WAAW,EAIhB,yBAAyB,EACzB,MAAM,eAAe,CAAC;AAKvB,KAAK,OAAO,GAAG;IAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;IAAC,UAAU,CAAC,EAAE,OAAO,yBAAyB,CAAA;CAAE,CAAC;AA4E9F,kGAAkG;AAClG,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CAWvD"}
@@ -0,0 +1,6 @@
1
+ import { type DeviceIdentityInventoryInput, type DeviceIdentityInventoryV1, type MemoryStore, readCoordinatorSyncConfig } from "@codemem/core";
2
+ type ReadConfig = typeof readCoordinatorSyncConfig;
3
+ /** Confirm the signed enrollment against the same local key used to project the row. */
4
+ export declare function readInventoryWithRejoinEvidence(store: MemoryStore, input: DeviceIdentityInventoryInput, readConfig?: ReadConfig, signal?: AbortSignal): Promise<DeviceIdentityInventoryV1>;
5
+ export {};
6
+ //# sourceMappingURL=device-rejoin-evidence.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"device-rejoin-evidence.d.ts","sourceRoot":"","sources":["../../src/routes/device-rejoin-evidence.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,4BAA4B,EACjC,KAAK,yBAAyB,EAG9B,KAAK,WAAW,EAEhB,yBAAyB,EACzB,MAAM,eAAe,CAAC;AAEvB,KAAK,UAAU,GAAG,OAAO,yBAAyB,CAAC;AAiDnD,wFAAwF;AACxF,wBAAsB,+BAA+B,CACpD,KAAK,EAAE,WAAW,EAClB,KAAK,EAAE,4BAA4B,EACnC,UAAU,GAAE,UAAsC,EAClD,MAAM,CAAC,EAAE,WAAW,GAClB,OAAO,CAAC,yBAAyB,CAAC,CA2BpC"}
@@ -0,0 +1,38 @@
1
+ import { type MemoryStore, readCoordinatorSyncConfig } from "@codemem/core";
2
+ export type DeviceRemovalRefreshHooksFactory = () => {
3
+ waitForRefresh(): Promise<void>;
4
+ refresh(): Promise<void>;
5
+ };
6
+ interface Options {
7
+ getStore(): Pick<MemoryStore, "db" | "deviceId">;
8
+ readCoordinatorConfig?: typeof readCoordinatorSyncConfig;
9
+ createDeviceRemovalRefreshHooks: DeviceRemovalRefreshHooksFactory;
10
+ getSignedLookupStore?: () => Pick<MemoryStore, "db" | "dbPath" | "deviceId">;
11
+ }
12
+ export declare function deviceRemovalCommitRoutes(options: Options): import("hono/hono-base").HonoBase<import("hono/types").BlankEnv, {
13
+ "/api/sync/devices/:device_id/remove": {
14
+ $post: {
15
+ output: {
16
+ error: string;
17
+ };
18
+ outputFormat: "json";
19
+ status: 403;
20
+ input: {
21
+ param: {
22
+ device_id: string;
23
+ };
24
+ };
25
+ } | {
26
+ output: {};
27
+ outputFormat: string;
28
+ status: import("hono/utils/http-status").StatusCode;
29
+ input: {
30
+ param: {
31
+ device_id: string;
32
+ };
33
+ };
34
+ };
35
+ };
36
+ }, "/", "/api/sync/devices/:device_id/remove">;
37
+ export {};
38
+ //# sourceMappingURL=device-removal-commit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"device-removal-commit.d.ts","sourceRoot":"","sources":["../../src/routes/device-removal-commit.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,KAAK,WAAW,EAChB,yBAAyB,EAIzB,MAAM,eAAe,CAAC;AASvB,MAAM,MAAM,gCAAgC,GAAG,MAAM;IACpD,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAChC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACzB,CAAC;AAEF,UAAU,OAAO;IAChB,QAAQ,IAAI,IAAI,CAAC,WAAW,EAAE,IAAI,GAAG,UAAU,CAAC,CAAC;IACjD,qBAAqB,CAAC,EAAE,OAAO,yBAAyB,CAAC;IACzD,+BAA+B,EAAE,gCAAgC,CAAC;IAClE,oBAAoB,CAAC,EAAE,MAAM,IAAI,CAAC,WAAW,EAAE,IAAI,GAAG,QAAQ,GAAG,UAAU,CAAC,CAAC;CAC7E;AA8ID,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;+CAKzD"}
@@ -0,0 +1,41 @@
1
+ import { type MemoryStore, readCoordinatorSyncConfig } from "@codemem/core";
2
+ type LocalStore = Pick<MemoryStore, "db" | "deviceId">;
3
+ /** A malformed setting must never authorize a local-only removal. */
4
+ export declare function hasNoRemovalCoordinator(readConfig?: typeof readCoordinatorSyncConfig): boolean;
5
+ export declare function readLocalRemoval(store: LocalStore, deviceId: string): {
6
+ readonly error: "cannot_remove_this_device";
7
+ readonly status: 400;
8
+ readonly mode?: undefined;
9
+ readonly device_id?: undefined;
10
+ readonly expected_digest?: undefined;
11
+ } | {
12
+ readonly error: "local_identity_unverified";
13
+ readonly status: 409;
14
+ readonly mode?: undefined;
15
+ readonly device_id?: undefined;
16
+ readonly expected_digest?: undefined;
17
+ } | {
18
+ readonly error: "removal_target_not_enrolled";
19
+ readonly status: 404;
20
+ readonly mode?: undefined;
21
+ readonly device_id?: undefined;
22
+ readonly expected_digest?: undefined;
23
+ } | {
24
+ readonly error: "removal_target_unavailable";
25
+ readonly status: 409;
26
+ readonly mode?: undefined;
27
+ readonly device_id?: undefined;
28
+ readonly expected_digest?: undefined;
29
+ } | {
30
+ readonly error?: undefined;
31
+ readonly status?: undefined;
32
+ readonly mode: "local";
33
+ readonly device_id: string;
34
+ readonly expected_digest: string;
35
+ };
36
+ export declare function commitLocalRemoval(store: LocalStore, input: {
37
+ deviceId: string;
38
+ expectedDigest: string;
39
+ }, readConfig?: typeof readCoordinatorSyncConfig): boolean;
40
+ export {};
41
+ //# sourceMappingURL=device-removal-local.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"device-removal-local.d.ts","sourceRoot":"","sources":["../../src/routes/device-removal-local.ts"],"names":[],"mappings":"AACA,OAAO,EAIN,KAAK,WAAW,EAEhB,yBAAyB,EAGzB,MAAM,eAAe,CAAC;AAEvB,KAAK,UAAU,GAAG,IAAI,CAAC,WAAW,EAAE,IAAI,GAAG,UAAU,CAAC,CAAC;AAEvD,qEAAqE;AACrE,wBAAgB,uBAAuB,CAAC,UAAU,CAAC,EAAE,OAAO,yBAAyB,GAAG,OAAO,CAS9F;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM;oBAElD,2BAA2B;qBAAU,GAAG;;;;;oBAExB,2BAA2B;qBAAU,GAAG;;;;;oBAY/C,6BAA6B;qBAAU,GAAG;;;;;oBAQnD,4BAA4B;qBAAU,GAAG;;;;;;;mBAEnD,OAAO;;;EAed;AAED,wBAAgB,kBAAkB,CACjC,KAAK,EAAE,UAAU,EACjB,KAAK,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,MAAM,CAAA;CAAE,EACnD,UAAU,CAAC,EAAE,OAAO,yBAAyB,WAe7C"}
@@ -0,0 +1,37 @@
1
+ import { type MemoryStore, type readCoordinatorSyncConfig } from "@codemem/core";
2
+ type RemovalStore = Pick<MemoryStore, "db" | "dbPath" | "deviceId">;
3
+ type ConfigReader = typeof readCoordinatorSyncConfig;
4
+ type Refusal = {
5
+ error: string;
6
+ status: 400 | 404 | 409 | 503;
7
+ };
8
+ type PairingPin = {
9
+ public_key: string | null;
10
+ pinned_fingerprint: string | null;
11
+ created_at: string;
12
+ };
13
+ type Subject = {
14
+ localId: string;
15
+ localKeyId: string;
16
+ pin?: PairingPin;
17
+ binding: unknown;
18
+ };
19
+ type LookupContext = {
20
+ subject: Subject;
21
+ config: ReturnType<ConfigReader>;
22
+ digest: string;
23
+ };
24
+ type LookupResult = Refusal | {
25
+ mode: "coordinator";
26
+ context: LookupContext;
27
+ } | {
28
+ mode: "local" | "already_removed";
29
+ expectedDigest: string;
30
+ contextDigest: string;
31
+ revoked: boolean;
32
+ };
33
+ /** Signed global evidence, without a fallback to the list of enabled peers. */
34
+ export declare function lookupViewerRemoval(store: RemovalStore, deviceId: string, readConfig: ConfigReader): Promise<LookupResult>;
35
+ export declare function matchesViewerRemovalContext(store: RemovalStore, deviceId: string, readConfig: ConfigReader, digest: string): boolean;
36
+ export {};
37
+ //# sourceMappingURL=device-removal-lookup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"device-removal-lookup.d.ts","sourceRoot":"","sources":["../../src/routes/device-removal-lookup.ts"],"names":[],"mappings":"AACA,OAAO,EAGN,KAAK,WAAW,EAGhB,KAAK,yBAAyB,EAE9B,MAAM,eAAe,CAAC;AAEvB,KAAK,YAAY,GAAG,IAAI,CAAC,WAAW,EAAE,IAAI,GAAG,QAAQ,GAAG,UAAU,CAAC,CAAC;AACpE,KAAK,YAAY,GAAG,OAAO,yBAAyB,CAAC;AACrD,KAAK,OAAO,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAA;CAAE,CAAC;AAChE,KAAK,UAAU,GAAG;IACjB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,UAAU,EAAE,MAAM,CAAC;CACnB,CAAC;AACF,KAAK,OAAO,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,UAAU,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC;AAC3F,KAAK,aAAa,GAAG;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,UAAU,CAAC,YAAY,CAAC,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAC5F,KAAK,YAAY,GACd,OAAO,GACP;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,OAAO,EAAE,aAAa,CAAA;CAAE,GAC/C;IACA,IAAI,EAAE,OAAO,GAAG,iBAAiB,CAAC;IAClC,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC;CAChB,CAAC;AAwCL,+EAA+E;AAC/E,wBAAsB,mBAAmB,CACxC,KAAK,EAAE,YAAY,EACnB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,YAAY,GACtB,OAAO,CAAC,YAAY,CAAC,CAiBvB;AAaD,wBAAgB,2BAA2B,CAC1C,KAAK,EAAE,YAAY,EACnB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,YAAY,EACxB,MAAM,EAAE,MAAM,WAId"}
@@ -0,0 +1,14 @@
1
+ import type { readCoordinatorSyncConfig } from "@codemem/core";
2
+ type Config = ReturnType<typeof readCoordinatorSyncConfig>;
3
+ export declare function readRemovalProgress(config: Config, readConfig: () => Config, input: {
4
+ localId: string;
5
+ removalSeq: number;
6
+ }): Promise<{
7
+ device_id: string;
8
+ group_id: string;
9
+ display_name: string | null;
10
+ state: "applied" | "older" | "pending";
11
+ }[] | null>;
12
+ export declare function previewOlderRemovalPeers(config: Config, excludedIds: Set<string>): Promise<string[] | null>;
13
+ export {};
14
+ //# sourceMappingURL=device-removal-progress.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"device-removal-progress.d.ts","sourceRoot":"","sources":["../../src/routes/device-removal-progress.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAyB,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAGtF,KAAK,MAAM,GAAG,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAS3D,wBAAsB,mBAAmB,CACxC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,MAAM,EACxB,KAAK,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE;;;;;YAsB9C;AAED,wBAAsB,wBAAwB,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,4BAiBtF"}
@@ -0,0 +1,126 @@
1
+ import { type MemoryStore, readCoordinatorSyncConfig } from "@codemem/core";
2
+ export declare function readDeviceRemovalCoordinator(readConfig: typeof readCoordinatorSyncConfig): {
3
+ url: string;
4
+ adminSecret: string;
5
+ timeoutS: number;
6
+ } | null;
7
+ interface Options {
8
+ readCoordinatorConfig?: typeof readCoordinatorSyncConfig;
9
+ localIdentity: () => {
10
+ deviceId: string;
11
+ keyId: string | null;
12
+ };
13
+ getLocalStore?: () => Pick<MemoryStore, "db" | "deviceId">;
14
+ getSignedLookupStore?: () => Pick<MemoryStore, "db" | "dbPath" | "deviceId">;
15
+ }
16
+ /** Read-only coordinator evidence. No removal or local pairing mutation is mounted here. */
17
+ export declare function deviceRemovalReviewRoutes(options: Options): import("hono/hono-base").HonoBase<{}, {
18
+ "/api/sync/devices/removals": {
19
+ $get: {
20
+ output: {
21
+ error: string;
22
+ };
23
+ outputFormat: "json";
24
+ status: 503;
25
+ input: {};
26
+ } | {
27
+ output: {
28
+ error: string;
29
+ };
30
+ outputFormat: "json";
31
+ status: 409;
32
+ input: {};
33
+ } | {
34
+ output: {
35
+ items: {
36
+ device_id: string;
37
+ group_id: string;
38
+ display_name: string | null;
39
+ removal_seq: number;
40
+ removal_id?: string | undefined;
41
+ }[];
42
+ };
43
+ outputFormat: "json";
44
+ status: import("hono/utils/http-status").ContentfulStatusCode;
45
+ input: {};
46
+ };
47
+ };
48
+ } & {
49
+ "/api/sync/devices/:device_id/remove/preview": {
50
+ $post: {
51
+ output: {
52
+ error: "cannot_remove_this_device" | "local_identity_unverified" | "removal_target_not_enrolled" | "removal_target_unavailable" | undefined;
53
+ };
54
+ outputFormat: "json";
55
+ status: 400 | 404 | 409;
56
+ input: {
57
+ param: {
58
+ device_id: string;
59
+ };
60
+ };
61
+ } | {
62
+ output: {
63
+ readonly mode: "local";
64
+ readonly device_id: string;
65
+ readonly expected_digest: string;
66
+ };
67
+ outputFormat: "json";
68
+ status: import("hono/utils/http-status").ContentfulStatusCode;
69
+ input: {
70
+ param: {
71
+ device_id: string;
72
+ };
73
+ };
74
+ } | {
75
+ output: {
76
+ error: string;
77
+ };
78
+ outputFormat: "json";
79
+ status: 400 | 404 | 409 | 503;
80
+ input: {
81
+ param: {
82
+ device_id: string;
83
+ };
84
+ };
85
+ } | {
86
+ output: {
87
+ mode: "already_removed" | "local";
88
+ device_id: string;
89
+ expected_digest: string;
90
+ };
91
+ outputFormat: "json";
92
+ status: import("hono/utils/http-status").ContentfulStatusCode;
93
+ input: {
94
+ param: {
95
+ device_id: string;
96
+ };
97
+ };
98
+ } | {
99
+ output: {
100
+ device_id: string;
101
+ rejoin: string;
102
+ expected_digest: string;
103
+ key_id: string | null;
104
+ coordinator_origin: string;
105
+ group_id?: any;
106
+ } | {
107
+ device_id: string;
108
+ rejoin: string;
109
+ expected_digest: string;
110
+ key_id: string | null;
111
+ coordinator_origin: string;
112
+ group_id?: any;
113
+ older_device_names: string[];
114
+ };
115
+ outputFormat: "json";
116
+ status: import("hono/utils/http-status").ContentfulStatusCode;
117
+ input: {
118
+ param: {
119
+ device_id: string;
120
+ };
121
+ };
122
+ };
123
+ };
124
+ }, "/", "/api/sync/devices/:device_id/remove/preview">;
125
+ export {};
126
+ //# sourceMappingURL=device-removal-review.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"device-removal-review.d.ts","sourceRoot":"","sources":["../../src/routes/device-removal-review.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,KAAK,WAAW,EAGhB,yBAAyB,EAEzB,MAAM,eAAe,CAAC;AAUvB,wBAAgB,4BAA4B,CAAC,UAAU,EAAE,OAAO,yBAAyB;;;;SAMxF;AA0FD,UAAU,OAAO;IAChB,qBAAqB,CAAC,EAAE,OAAO,yBAAyB,CAAC;IACzD,aAAa,EAAE,MAAM;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;IAChE,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC,WAAW,EAAE,IAAI,GAAG,UAAU,CAAC,CAAC;IAC3D,oBAAoB,CAAC,EAAE,MAAM,IAAI,CAAC,WAAW,EAAE,IAAI,GAAG,QAAQ,GAAG,UAAU,CAAC,CAAC;CAC7E;AAkFD,4FAA4F;AAC5F,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uDAWzD"}
@@ -1,4 +1,11 @@
1
- import { type MemoryStore } from "@codemem/core";
1
+ import { type CoordinatorEnrollment, type MemoryStore, readCoordinatorSyncConfig } from "@codemem/core";
2
+ type CoordinatorConfig = ReturnType<typeof readCoordinatorSyncConfig>;
3
+ /** Every enrollment in every coordinator group, or a thrown error when that can't be read. */
4
+ export declare function listAllEnrollments(config: CoordinatorConfig, options?: {
5
+ includeArchived?: boolean;
6
+ }): Promise<CoordinatorEnrollment[]>;
7
+ /** Every coordinator group enrolling this device, or a thrown error when that can't be read. */
8
+ export declare function enrolledGroups(config: CoordinatorConfig, deviceId: string): Promise<string[]>;
2
9
  export declare function deviceRenameRoutes(getStore: () => MemoryStore): import("hono/hono-base").HonoBase<import("hono/types").BlankEnv, {
3
10
  "/api/sync/recipient-policy/v1/devices/:device_id/rename": {
4
11
  $post: {
@@ -6,7 +13,7 @@ export declare function deviceRenameRoutes(getStore: () => MemoryStore): import(
6
13
  error: string;
7
14
  };
8
15
  outputFormat: "json";
9
- status: 400;
16
+ status: 404;
10
17
  input: {
11
18
  param: {
12
19
  device_id: string;
@@ -17,7 +24,7 @@ export declare function deviceRenameRoutes(getStore: () => MemoryStore): import(
17
24
  error: string;
18
25
  };
19
26
  outputFormat: "json";
20
- status: 404;
27
+ status: 400;
21
28
  input: {
22
29
  param: {
23
30
  device_id: string;
@@ -36,10 +43,13 @@ export declare function deviceRenameRoutes(getStore: () => MemoryStore): import(
36
43
  };
37
44
  } | {
38
45
  output: {
46
+ ok: false;
39
47
  error: string;
48
+ status: 409 | 503;
49
+ renamedGroupCount?: number;
40
50
  };
41
51
  outputFormat: "json";
42
- status: 503;
52
+ status: 409 | 503;
43
53
  input: {
44
54
  param: {
45
55
  device_id: string;
@@ -59,13 +69,10 @@ export declare function deviceRenameRoutes(getStore: () => MemoryStore): import(
59
69
  };
60
70
  } | {
61
71
  output: {
62
- ok: false;
63
72
  error: string;
64
- status: 409 | 503;
65
- renamedGroupCount?: number;
66
73
  };
67
74
  outputFormat: "json";
68
- status: 409 | 503;
75
+ status: 503;
69
76
  input: {
70
77
  param: {
71
78
  device_id: string;
@@ -74,4 +81,5 @@ export declare function deviceRenameRoutes(getStore: () => MemoryStore): import(
74
81
  };
75
82
  };
76
83
  }, "/", "/api/sync/recipient-policy/v1/devices/:device_id/rename">;
84
+ export {};
77
85
  //# sourceMappingURL=device-rename.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"device-rename.d.ts","sourceRoot":"","sources":["../../src/routes/device-rename.ts"],"names":[],"mappings":"AAAA,OAAO,EAIN,KAAK,WAAW,EAGhB,MAAM,eAAe,CAAC;AA6GvB,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBArDrD,IAAI;8BAAgB,MAAM;;;;;;;;;;;oBAC1B,KAAK;uBAAS,MAAM;wBAAU,GAAG,GAAG,GAAG;oCAAsB,MAAM;;;;;;;;;;;mEAqF3E"}
1
+ {"version":3,"file":"device-rename.d.ts","sourceRoot":"","sources":["../../src/routes/device-rename.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,qBAAqB,EAI1B,KAAK,WAAW,EAEhB,yBAAyB,EACzB,MAAM,eAAe,CAAC;AAGvB,KAAK,iBAAiB,GAAG,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAEtE,8FAA8F;AAC9F,wBAAsB,kBAAkB,CACvC,MAAM,EAAE,iBAAiB,EACzB,OAAO,GAAE;IAAE,eAAe,CAAC,EAAE,OAAO,CAAA;CAAO,GACzC,OAAO,CAAC,qBAAqB,EAAE,CAAC,CA0BlC;AAED,gGAAgG;AAChG,wBAAsB,cAAc,CACnC,MAAM,EAAE,iBAAiB,EACzB,QAAQ,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,EAAE,CAAC,CAOnB;AAiFD,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBApDrD,KAAK;uBAAS,MAAM;wBAAU,GAAG,GAAG,GAAG;oCAAsB,MAAM;;;;;;;;;;;oBADnE,IAAI;8BAAgB,MAAM;;;;;;;;;;;;;;;;;;;;;;mEAsFlC"}