@opendatalabs/personal-server-ts-server 1.33.7 → 1.34.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.
Files changed (167) hide show
  1. package/dist/__fixtures__/bound-record-store.d.ts +19 -0
  2. package/dist/__fixtures__/bound-record-store.d.ts.map +1 -0
  3. package/dist/__fixtures__/bound-record-store.js +60 -0
  4. package/dist/__fixtures__/bound-record-store.js.map +1 -0
  5. package/dist/__fixtures__/cg-pdpp-client/pdpp-authorization-strategy.d.ts +41 -0
  6. package/dist/__fixtures__/cg-pdpp-client/pdpp-authorization-strategy.d.ts.map +1 -0
  7. package/dist/__fixtures__/cg-pdpp-client/pdpp-authorization-strategy.js +34 -0
  8. package/dist/__fixtures__/cg-pdpp-client/pdpp-authorization-strategy.js.map +1 -0
  9. package/dist/__fixtures__/cg-pdpp-client/pdpp-context-client.d.ts +112 -0
  10. package/dist/__fixtures__/cg-pdpp-client/pdpp-context-client.d.ts.map +1 -0
  11. package/dist/__fixtures__/cg-pdpp-client/pdpp-context-client.js +226 -0
  12. package/dist/__fixtures__/cg-pdpp-client/pdpp-context-client.js.map +1 -0
  13. package/dist/__fixtures__/cg-pdpp-client/pdpp-types.d.ts +135 -0
  14. package/dist/__fixtures__/cg-pdpp-client/pdpp-types.d.ts.map +1 -0
  15. package/dist/__fixtures__/cg-pdpp-client/pdpp-types.js +21 -0
  16. package/dist/__fixtures__/cg-pdpp-client/pdpp-types.js.map +1 -0
  17. package/dist/api-auth.d.ts +18 -2
  18. package/dist/api-auth.d.ts.map +1 -1
  19. package/dist/api-auth.js +114 -22
  20. package/dist/api-auth.js.map +1 -1
  21. package/dist/app.d.ts +60 -1
  22. package/dist/app.d.ts.map +1 -1
  23. package/dist/app.js +139 -1
  24. package/dist/app.js.map +1 -1
  25. package/dist/bootstrap.d.ts +10 -0
  26. package/dist/bootstrap.d.ts.map +1 -1
  27. package/dist/bootstrap.js +358 -7
  28. package/dist/bootstrap.js.map +1 -1
  29. package/dist/enclave-main.d.ts +4 -0
  30. package/dist/enclave-main.d.ts.map +1 -1
  31. package/dist/enclave-main.js +152 -1
  32. package/dist/enclave-main.js.map +1 -1
  33. package/dist/middleware/body-limit.d.ts +1 -1
  34. package/dist/middleware/body-limit.d.ts.map +1 -1
  35. package/dist/middleware/body-limit.js +8 -3
  36. package/dist/middleware/body-limit.js.map +1 -1
  37. package/dist/middleware/cors.d.ts.map +1 -1
  38. package/dist/middleware/cors.js +1 -0
  39. package/dist/middleware/cors.js.map +1 -1
  40. package/dist/package.json +9 -1
  41. package/dist/pdpp/bootstrap.d.ts +72 -0
  42. package/dist/pdpp/bootstrap.d.ts.map +1 -0
  43. package/dist/pdpp/bootstrap.js +270 -0
  44. package/dist/pdpp/bootstrap.js.map +1 -0
  45. package/dist/pdpp/chain-enforcement.d.ts +95 -0
  46. package/dist/pdpp/chain-enforcement.d.ts.map +1 -0
  47. package/dist/pdpp/chain-enforcement.js +145 -0
  48. package/dist/pdpp/chain-enforcement.js.map +1 -0
  49. package/dist/pdpp/client-document-fetch.d.ts +63 -0
  50. package/dist/pdpp/client-document-fetch.d.ts.map +1 -0
  51. package/dist/pdpp/client-document-fetch.js +254 -0
  52. package/dist/pdpp/client-document-fetch.js.map +1 -0
  53. package/dist/pdpp/declaration-registry.d.ts +83 -0
  54. package/dist/pdpp/declaration-registry.d.ts.map +1 -0
  55. package/dist/pdpp/declaration-registry.js +251 -0
  56. package/dist/pdpp/declaration-registry.js.map +1 -0
  57. package/dist/pdpp/deployment.d.ts +70 -0
  58. package/dist/pdpp/deployment.d.ts.map +1 -0
  59. package/dist/pdpp/deployment.js +104 -0
  60. package/dist/pdpp/deployment.js.map +1 -0
  61. package/dist/pdpp/record-schema.d.ts +2 -0
  62. package/dist/pdpp/record-schema.d.ts.map +1 -0
  63. package/dist/pdpp/record-schema.js +2 -0
  64. package/dist/pdpp/record-schema.js.map +1 -0
  65. package/dist/pdpp/records-bootstrap.d.ts +111 -0
  66. package/dist/pdpp/records-bootstrap.d.ts.map +1 -0
  67. package/dist/pdpp/records-bootstrap.js +353 -0
  68. package/dist/pdpp/records-bootstrap.js.map +1 -0
  69. package/dist/pdpp/source-id-compat.d.ts +5 -0
  70. package/dist/pdpp/source-id-compat.d.ts.map +1 -0
  71. package/dist/pdpp/source-id-compat.js +16 -0
  72. package/dist/pdpp/source-id-compat.js.map +1 -0
  73. package/dist/pdpp/test-connections.d.ts +6 -0
  74. package/dist/pdpp/test-connections.d.ts.map +1 -0
  75. package/dist/pdpp/test-connections.js +37 -0
  76. package/dist/pdpp/test-connections.js.map +1 -0
  77. package/dist/routes/auth-device.d.ts.map +1 -1
  78. package/dist/routes/auth-device.js +3 -0
  79. package/dist/routes/auth-device.js.map +1 -1
  80. package/dist/routes/chunked-scope-import.d.ts +41 -0
  81. package/dist/routes/chunked-scope-import.d.ts.map +1 -0
  82. package/dist/routes/chunked-scope-import.js +901 -0
  83. package/dist/routes/chunked-scope-import.js.map +1 -0
  84. package/dist/routes/data.d.ts +23 -1
  85. package/dist/routes/data.d.ts.map +1 -1
  86. package/dist/routes/data.js +112 -1
  87. package/dist/routes/data.js.map +1 -1
  88. package/dist/routes/grants.d.ts.map +1 -1
  89. package/dist/routes/grants.js +2 -0
  90. package/dist/routes/grants.js.map +1 -1
  91. package/dist/routes/mcp.d.ts.map +1 -1
  92. package/dist/routes/mcp.js +21 -12
  93. package/dist/routes/mcp.js.map +1 -1
  94. package/dist/routes/pdpp-auth.d.ts +157 -0
  95. package/dist/routes/pdpp-auth.d.ts.map +1 -0
  96. package/dist/routes/pdpp-auth.js +953 -0
  97. package/dist/routes/pdpp-auth.js.map +1 -0
  98. package/dist/routes/pdpp-blobs.d.ts +26 -0
  99. package/dist/routes/pdpp-blobs.d.ts.map +1 -0
  100. package/dist/routes/pdpp-blobs.js +179 -0
  101. package/dist/routes/pdpp-blobs.js.map +1 -0
  102. package/dist/routes/pdpp-connections.d.ts +28 -0
  103. package/dist/routes/pdpp-connections.d.ts.map +1 -0
  104. package/dist/routes/pdpp-connections.js +144 -0
  105. package/dist/routes/pdpp-connections.js.map +1 -0
  106. package/dist/routes/pdpp-declarations.d.ts +58 -0
  107. package/dist/routes/pdpp-declarations.d.ts.map +1 -0
  108. package/dist/routes/pdpp-declarations.js +94 -0
  109. package/dist/routes/pdpp-declarations.js.map +1 -0
  110. package/dist/routes/pdpp-instance-bindings.d.ts +26 -0
  111. package/dist/routes/pdpp-instance-bindings.d.ts.map +1 -0
  112. package/dist/routes/pdpp-instance-bindings.js +124 -0
  113. package/dist/routes/pdpp-instance-bindings.js.map +1 -0
  114. package/dist/routes/pdpp-records.d.ts +158 -0
  115. package/dist/routes/pdpp-records.d.ts.map +1 -0
  116. package/dist/routes/pdpp-records.js +1537 -0
  117. package/dist/routes/pdpp-records.js.map +1 -0
  118. package/dist/routes/pdpp-well-known.d.ts +13 -0
  119. package/dist/routes/pdpp-well-known.d.ts.map +1 -0
  120. package/dist/routes/pdpp-well-known.js +20 -0
  121. package/dist/routes/pdpp-well-known.js.map +1 -0
  122. package/dist/storage/declaration-witness.d.ts +56 -0
  123. package/dist/storage/declaration-witness.d.ts.map +1 -0
  124. package/dist/storage/declaration-witness.js +273 -0
  125. package/dist/storage/declaration-witness.js.map +1 -0
  126. package/dist/storage/hierarchy.d.ts +25 -1
  127. package/dist/storage/hierarchy.d.ts.map +1 -1
  128. package/dist/storage/hierarchy.js +210 -16
  129. package/dist/storage/hierarchy.js.map +1 -1
  130. package/dist/storage/import-operations.d.ts +11 -0
  131. package/dist/storage/import-operations.d.ts.map +1 -0
  132. package/dist/storage/import-operations.js +261 -0
  133. package/dist/storage/import-operations.js.map +1 -0
  134. package/dist/storage/index-manager.d.ts +24 -2
  135. package/dist/storage/index-manager.d.ts.map +1 -1
  136. package/dist/storage/index-manager.js +279 -30
  137. package/dist/storage/index-manager.js.map +1 -1
  138. package/dist/storage/index-schema.d.ts +1 -1
  139. package/dist/storage/index-schema.d.ts.map +1 -1
  140. package/dist/storage/index-schema.js +189 -8
  141. package/dist/storage/index-schema.js.map +1 -1
  142. package/dist/storage/legacy-scope-authority.d.ts +14 -0
  143. package/dist/storage/legacy-scope-authority.d.ts.map +1 -0
  144. package/dist/storage/legacy-scope-authority.js +298 -0
  145. package/dist/storage/legacy-scope-authority.js.map +1 -0
  146. package/dist/storage/node-data-storage.d.ts +6 -0
  147. package/dist/storage/node-data-storage.d.ts.map +1 -1
  148. package/dist/storage/node-data-storage.js +161 -2
  149. package/dist/storage/node-data-storage.js.map +1 -1
  150. package/dist/storage/pdpp-grant-binding-sqlite-store.d.ts +17 -0
  151. package/dist/storage/pdpp-grant-binding-sqlite-store.d.ts.map +1 -0
  152. package/dist/storage/pdpp-grant-binding-sqlite-store.js +159 -0
  153. package/dist/storage/pdpp-grant-binding-sqlite-store.js.map +1 -0
  154. package/dist/storage/pdpp-records-sqlite-store.d.ts +112 -0
  155. package/dist/storage/pdpp-records-sqlite-store.d.ts.map +1 -0
  156. package/dist/storage/pdpp-records-sqlite-store.js +1440 -0
  157. package/dist/storage/pdpp-records-sqlite-store.js.map +1 -0
  158. package/dist/storage/pdpp-stream-completion.d.ts +5 -0
  159. package/dist/storage/pdpp-stream-completion.d.ts.map +1 -0
  160. package/dist/storage/pdpp-stream-completion.js +10 -0
  161. package/dist/storage/pdpp-stream-completion.js.map +1 -0
  162. package/dist/storage/scope-deletion-history.d.ts +8 -0
  163. package/dist/storage/scope-deletion-history.d.ts.map +1 -0
  164. package/dist/storage/scope-deletion-history.js +40 -0
  165. package/dist/storage/scope-deletion-history.js.map +1 -0
  166. package/dist/ui/ps-lite-debug.js +3697 -876
  167. package/package.json +12 -4
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pdpp-declarations.js","sourceRoot":"","sources":["../../src/routes/pdpp-declarations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,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 import { Hono } from "hono";
2
+ import type { PdppAuthorizationService } from "@opendatalabs/personal-server-ts-core/ports/pdpp-auth";
3
+ import { type PdppInstanceBinding } from "../storage/pdpp-records-sqlite-store.js";
4
+ interface InstanceBindingStore {
5
+ getInstanceBinding(instance: string): PdppInstanceBinding;
6
+ resetInstanceBinding(input: {
7
+ instance: string;
8
+ expectedMethod: string | null;
9
+ expectedGeneration: number;
10
+ nextMethod: string | null;
11
+ }): {
12
+ binding: PdppInstanceBinding;
13
+ alreadyReset: boolean;
14
+ };
15
+ }
16
+ export interface PdppInstanceBindingRouteDeps {
17
+ store: InstanceBindingStore;
18
+ auth: PdppAuthorizationService;
19
+ ownerSubjectId: string;
20
+ instancesForSubject(subjectId: string): string[];
21
+ instancesForSource?(subjectId: string, sourceId: string): string[];
22
+ configuredMethods: Map<string, string[]>;
23
+ }
24
+ export declare function pdppInstanceBindingRoutes(deps: PdppInstanceBindingRouteDeps): Hono;
25
+ export {};
26
+ //# sourceMappingURL=pdpp-instance-bindings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pdpp-instance-bindings.d.ts","sourceRoot":"","sources":["../../src/routes/pdpp-instance-bindings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uDAAuD,CAAC;AACtG,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,yCAAyC,CAAC;AAEjD,UAAU,oBAAoB;IAC5B,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,mBAAmB,CAAC;IAC1D,oBAAoB,CAAC,KAAK,EAAE;QAC1B,QAAQ,EAAE,MAAM,CAAC;QACjB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;QAC9B,kBAAkB,EAAE,MAAM,CAAC;QAC3B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;KAC3B,GAAG;QAAE,OAAO,EAAE,mBAAmB,CAAC;QAAC,YAAY,EAAE,OAAO,CAAA;KAAE,CAAC;CAC7D;AAED,MAAM,WAAW,4BAA4B;IAC3C,KAAK,EAAE,oBAAoB,CAAC;IAC5B,IAAI,EAAE,wBAAwB,CAAC;IAC/B,cAAc,EAAE,MAAM,CAAC;IACvB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACjD,kBAAkB,CAAC,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACnE,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;CAC1C;AAaD,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,4BAA4B,GACjC,IAAI,CA6JN"}
@@ -0,0 +1,124 @@
1
+ import { Hono } from "hono";
2
+ import { randomUUID } from "node:crypto";
3
+ import { PdppBindingError, } from "../storage/pdpp-records-sqlite-store.js";
4
+ function errorResponse(code, message, status) {
5
+ return Response.json({ error: { code, message }, request_id: `req_${randomUUID()}` }, { status });
6
+ }
7
+ export function pdppInstanceBindingRoutes(deps) {
8
+ const app = new Hono();
9
+ async function ownerContext(request) {
10
+ const token = request.headers
11
+ .get("authorization")
12
+ ?.match(/^Bearer\s+(.+)$/i)?.[1];
13
+ if (!token)
14
+ return {
15
+ error: errorResponse("authentication_error", "Missing access token", 401),
16
+ };
17
+ const context = await deps.auth.resolveToken(token);
18
+ if (!context.active ||
19
+ context.tokenKind !== "owner" ||
20
+ !context.subjectId ||
21
+ context.subjectId.toLowerCase() !== deps.ownerSubjectId.toLowerCase()) {
22
+ return {
23
+ error: errorResponse("authentication_error", "Owner token required", 401),
24
+ };
25
+ }
26
+ return {
27
+ subjectId: context.subjectId,
28
+ instanceIds: context.instanceIds,
29
+ sourceId: context.sourceId,
30
+ };
31
+ }
32
+ function scopedOwnedInstances(owner) {
33
+ if (owner.sourceId) {
34
+ const current = deps.instancesForSource?.(owner.subjectId, owner.sourceId) ?? [];
35
+ if (!owner.instanceIds)
36
+ return current;
37
+ return owner.instanceIds.filter((instance) => current.includes(instance));
38
+ }
39
+ const current = deps.instancesForSubject(owner.subjectId);
40
+ if (!owner.instanceIds)
41
+ return [];
42
+ return owner.instanceIds.filter((instance) => current.includes(instance));
43
+ }
44
+ function canAccessInstance(instance, owner) {
45
+ return scopedOwnedInstances(owner).includes(instance);
46
+ }
47
+ function configuredActiveMethod(instance) {
48
+ const methods = deps.configuredMethods.get(instance) ?? [];
49
+ return methods.length === 1 ? methods[0] : null;
50
+ }
51
+ app.get("/pdpp/instances/:instance/binding", async (c) => {
52
+ const owner = await ownerContext(c.req.raw);
53
+ if ("error" in owner)
54
+ return owner.error;
55
+ const instance = c.req.param("instance");
56
+ if (!canAccessInstance(instance, owner)) {
57
+ return errorResponse("authentication_error", "Instance is not owned", 401);
58
+ }
59
+ const binding = deps.store.getInstanceBinding(instance);
60
+ return c.json({
61
+ method: binding.method,
62
+ generation: binding.generation,
63
+ empty: binding.empty === true,
64
+ configured_active_method: configuredActiveMethod(instance),
65
+ });
66
+ });
67
+ app.post("/pdpp/instances/:instance/reset", async (c) => {
68
+ const owner = await ownerContext(c.req.raw);
69
+ if ("error" in owner)
70
+ return owner.error;
71
+ const instance = c.req.param("instance");
72
+ if (!canAccessInstance(instance, owner)) {
73
+ return errorResponse("authentication_error", "Instance is not owned", 401);
74
+ }
75
+ let body;
76
+ try {
77
+ body = await c.req.json();
78
+ }
79
+ catch {
80
+ return errorResponse("invalid_request", "Reset body must be JSON", 400);
81
+ }
82
+ if (!body || typeof body !== "object" || Array.isArray(body)) {
83
+ return errorResponse("invalid_request", "Reset body must be an object", 400);
84
+ }
85
+ const input = body;
86
+ if (!(typeof input.expected_method === "string" ||
87
+ input.expected_method === null) ||
88
+ !Number.isSafeInteger(input.expected_generation) ||
89
+ typeof input.expected_generation !== "number" ||
90
+ input.expected_generation < 1 ||
91
+ !(typeof input.next_method === "string" || input.next_method === null)) {
92
+ return errorResponse("invalid_request", "Reset fields are invalid", 400);
93
+ }
94
+ // Reject malformed method ids here. Registered connections also enforce
95
+ // their fixed method in the store; the reset route cannot switch them.
96
+ if (typeof input.next_method === "string" &&
97
+ (!input.next_method.trim() ||
98
+ input.next_method !== input.next_method.trim())) {
99
+ return errorResponse("invalid_request", "next_method must be null or an unpadded, non-empty method id", 400);
100
+ }
101
+ try {
102
+ const result = deps.store.resetInstanceBinding({
103
+ instance,
104
+ expectedMethod: input.expected_method,
105
+ expectedGeneration: input.expected_generation,
106
+ nextMethod: input.next_method,
107
+ });
108
+ return c.json({
109
+ method: result.binding.method,
110
+ generation: result.binding.generation,
111
+ reset_clock: result.binding.resetClock,
112
+ ...(result.alreadyReset && { status: "already_reset" }),
113
+ });
114
+ }
115
+ catch (err) {
116
+ if (err instanceof PdppBindingError) {
117
+ return errorResponse(err.reason, err.reason, 409);
118
+ }
119
+ throw err;
120
+ }
121
+ });
122
+ return app;
123
+ }
124
+ //# sourceMappingURL=pdpp-instance-bindings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pdpp-instance-bindings.js","sourceRoot":"","sources":["../../src/routes/pdpp-instance-bindings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EACL,gBAAgB,GAEjB,MAAM,yCAAyC,CAAC;AAqBjD,SAAS,aAAa,CACpB,IAAY,EACZ,OAAe,EACf,MAA6B;IAE7B,OAAO,QAAQ,CAAC,IAAI,CAClB,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,UAAU,EAAE,OAAO,UAAU,EAAE,EAAE,EAAE,EAC/D,EAAE,MAAM,EAAE,CACX,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,yBAAyB,CACvC,IAAkC;IAElC,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;IAEvB,KAAK,UAAU,YAAY,CAAC,O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,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;YACpD,CAAC;YACD,MAAM,GAAG,CAAC;QACZ,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -0,0 +1,158 @@
1
+ import { Hono, type Context } from "hono";
2
+ import { type createSqliteRecordStore } from "../storage/pdpp-records-sqlite-store.js";
3
+ import type { PdppAuthorizationService } from "@opendatalabs/personal-server-ts-core/ports/pdpp-auth";
4
+ import { type PdppRecordStore, type StreamDeclarationRegistry } from "@opendatalabs/personal-server-ts-core/storage/pdpp-records";
5
+ export declare const MAX_BLOB_UPLOAD_BYTES: number;
6
+ /** 512 MiB — max body size for PDPP record ingest and replace routes. */
7
+ export declare const MAX_INGEST_BODY_BYTES: number;
8
+ /** 64 KiB of UTF-8 — max body size for the completion metadata route. */
9
+ export declare const MAX_COMPLETION_BODY_BYTES: number;
10
+ export interface PdppRecordsRouteDeps {
11
+ store: PdppRecordStore;
12
+ bindingStore?: {
13
+ getInstanceBinding(instance: string): {
14
+ sourceId: string | null;
15
+ deletedAt: string | null;
16
+ };
17
+ storeBlobBytesForInstance(input: {
18
+ instance: string;
19
+ method: string;
20
+ generation: number;
21
+ bytes: Uint8Array;
22
+ mimeType: string;
23
+ }): ReturnType<PdppRecordStore["storeBlobBytes"]>;
24
+ replaceStream: ReturnType<typeof createSqliteRecordStore>["replaceStream"];
25
+ /** Absent on a store that cannot record completion metadata. */
26
+ completeStreams?: ReturnType<typeof createSqliteRecordStore>["completeStreams"];
27
+ };
28
+ configuredMethods?: Map<string, string[]>;
29
+ auth: PdppAuthorizationService;
30
+ declarations: StreamDeclarationRegistry;
31
+ /** The exact owner of this Personal Server; required for ingest. */
32
+ ownerSubjectId?: string;
33
+ /** Current ownership used to narrow the instance stored in an owner token. */
34
+ instancesForSubject?: (subjectId: string) => string[];
35
+ /** Active connections covered by a source-scoped owner token. */
36
+ instancesForSource?: (subjectId: string, sourceId: string) => string[];
37
+ /**
38
+ * Owner access feed. PDPP reads must appear in the SAME feed as legacy
39
+ * `/v1/data/{scope}` reads, or adopting PDPP would silently make an owner's
40
+ * access history less complete than it was before — the one thing a data
41
+ * portability product must not do.
42
+ *
43
+ * Optional so a deployment that has not wired a writer still boots; when it
44
+ * is absent no PDPP read is logged, which `records-bootstrap.ts` makes
45
+ * explicit rather than leaving to chance.
46
+ */
47
+ accessLog?: PdppAccessLogPort;
48
+ /**
49
+ * Vana chain enforcement for client reads. Absent by default, and absence
50
+ * is the chain-NEUTRAL path: a standalone PDPP deployment has no chain, so
51
+ * omitting this leaves the bearer path exactly as it was.
52
+ *
53
+ * When a deployment DOES set it, every client-token read must present a
54
+ * PDPP grant that is bound to a live chain permission. This is the gate the
55
+ * bearer path was missing: a PDPP token alone proved consent, but nothing
56
+ * checked the Vana permission that authorizes the read, so a chain-side
57
+ * revocation had no effect on a PDPP client and the ledger's authority was
58
+ * silently not enforced.
59
+ *
60
+ * It fails closed on purpose — see `PdppChainEnforcementPort`.
61
+ */
62
+ chainEnforcement?: PdppChainEnforcementPort;
63
+ /**
64
+ * Where an `api_error` (500) goes. Optional so a deployment that wires no
65
+ * logger still boots, but without one a genuine server fault on this
66
+ * surface leaves nothing behind but the client's 500 — the exact
67
+ * observability hole that made a missing-file read take a day to diagnose.
68
+ */
69
+ logger?: PdppRouteLogger;
70
+ }
71
+ export interface PdppRouteLogger {
72
+ error(payload: Record<string, unknown>, message: string): void;
73
+ }
74
+ /**
75
+ * The chain check a client read must pass, when a deployment enforces one.
76
+ *
77
+ * ## Why this is a port and not a direct chain call
78
+ *
79
+ * The route must not import a chain SDK: PDPP Core is chain-neutral, and a
80
+ * deployment with no chain must still serve reads. Keeping the dependency as
81
+ * an injected port is what lets standalone PDPP stay standalone while a Vana
82
+ * deployment enforces the ledger, without two code paths through the route.
83
+ *
84
+ * ## Fail closed, and the three outcomes are NOT interchangeable
85
+ *
86
+ * `authorize` answers one of three things, and the distinction matters
87
+ * because two of them deny while only one of those is worth retrying:
88
+ *
89
+ * - `{ ok: true }` — a binding exists, the live chain grant is unrevoked,
90
+ * the owner matches, and the grantee is this client's app.
91
+ * - `{ ok: false, retryable: false }` — a definite denial. No binding, or
92
+ * a revoked/mismatched one. The answer will not change by asking again.
93
+ * - `{ ok: false, retryable: true }` — the chain or gateway could not be
94
+ * reached, so we do not KNOW the answer.
95
+ *
96
+ * The third case is the one that decides whether this design is honest. Not
97
+ * knowing is not permission. Serving a read because the gateway was down
98
+ * would make an outage into an authorization bypass, and it would do so
99
+ * silently, which is worse than refusing. So an unknown answer denies, and
100
+ * is reported as `503` with `Retry-After` rather than `403`, because the
101
+ * client's grant may be perfectly valid and a permanent-looking refusal
102
+ * would send them to re-consent for no reason.
103
+ *
104
+ * This also means a binding is never accepted as nullable: a deployment that
105
+ * enforces the chain and cannot resolve a grant denies the read. There is no
106
+ * "no binding yet, allow it" state, because that state is indistinguishable
107
+ * from "never bound".
108
+ */
109
+ export interface PdppChainEnforcementPort {
110
+ authorize(input: {
111
+ /** The PDPP grant presented by the client token. */
112
+ pdppGrantId: string;
113
+ /** The OAuth client the token was issued to. */
114
+ clientId: string;
115
+ }): Promise<PdppChainDecision>;
116
+ }
117
+ export type PdppChainDecision = {
118
+ ok: true;
119
+ } | {
120
+ ok: false;
121
+ retryable: boolean;
122
+ reason: string;
123
+ };
124
+ /**
125
+ * The slice of the owner access feed a PDPP read can populate.
126
+ *
127
+ * Deliberately narrower than `AccessLogWriter`: this route knows the grant,
128
+ * the client, the stream and the outcome, and nothing about scopes or
129
+ * builders in the legacy sense. Keeping the port small is what lets the
130
+ * bootstrap adapt it onto the existing writer without this module importing
131
+ * the legacy entry shape.
132
+ */
133
+ export interface PdppAccessLogPort {
134
+ record(entry: {
135
+ grantId: string;
136
+ clientId: string;
137
+ /** `{source}.{stream}` — the legacy feed's `scope` position. */
138
+ stream: string;
139
+ operation: "read";
140
+ outcome: "completed" | "denied" | "failed";
141
+ requestId: string;
142
+ ipAddress: string;
143
+ userAgent: string;
144
+ }): Promise<void>;
145
+ }
146
+ /**
147
+ * The RFC 9728 protected-resource metadata URL for THIS request's origin.
148
+ *
149
+ * RFC 9728 §5.1 requires `resource_metadata` to be a URI the client can
150
+ * dereference. A relative path only resolves if the client already knows the
151
+ * origin -- which an unauthenticated client bootstrapping discovery from a
152
+ * failed read cannot be assumed to have. Deriving it from the request also
153
+ * keeps it correct behind a tunnel or proxy, where a hardcoded origin would
154
+ * point the client somewhere it cannot reach.
155
+ */
156
+ export declare function resourceMetadataUrlFor(c: Context): string;
157
+ export declare function pdppRecordsRoutes(deps: PdppRecordsRouteDeps): Hono;
158
+ //# sourceMappingURL=pdpp-records.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pdpp-records.d.ts","sourceRoot":"","sources":["../../src/routes/pdpp-records.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,OAAO,EAAE,MAAM,MAAM,CAAC;AAE1C,OAAO,EAGL,KAAK,uBAAuB,EAC7B,MAAM,yCAAyC,CAAC;AAGjD,OAAO,KAAK,EACV,wBAAwB,EAGzB,MAAM,uDAAuD,CAAC;AAC/D,OAAO,EAcL,KAAK,eAAe,EAEpB,KAAK,yBAAyB,EAC/B,MAAM,4DAA4D,CAAC;AASpE,eAAO,MAAM,qBAAqB,QAAoB,CAAC;AAgBvD,yEAAyE;AACzE,eAAO,MAAM,qBAAqB,QAAoB,CAAC;AACvD,yEAAyE;AACzE,eAAO,MAAM,yBAAyB,QAAY,CAAC;AAwJnD,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,eAAe,CAAC;IACvB,YAAY,CAAC,EAAE;QACb,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG;YACpC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;YACxB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;SAC1B,CAAC;QACF,yBAAyB,CAAC,KAAK,EAAE;YAC/B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