@opendatalabs/personal-server-ts-core 1.6.0 → 1.8.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 (106) hide show
  1. package/dist/api/index.d.ts +53 -2
  2. package/dist/api/index.d.ts.map +1 -1
  3. package/dist/api/index.js +300 -25
  4. package/dist/api/index.js.map +1 -1
  5. package/dist/contracts/data.d.ts +30 -1
  6. package/dist/contracts/data.d.ts.map +1 -1
  7. package/dist/contracts/data.js +126 -33
  8. package/dist/contracts/data.js.map +1 -1
  9. package/dist/errors/catalog.d.ts +40 -0
  10. package/dist/errors/catalog.d.ts.map +1 -1
  11. package/dist/errors/catalog.js +53 -0
  12. package/dist/errors/catalog.js.map +1 -1
  13. package/dist/lineage/attestation.d.ts +42 -0
  14. package/dist/lineage/attestation.d.ts.map +1 -0
  15. package/dist/lineage/attestation.js +25 -0
  16. package/dist/lineage/attestation.js.map +1 -0
  17. package/dist/lineage/gateway.d.ts +105 -0
  18. package/dist/lineage/gateway.d.ts.map +1 -0
  19. package/dist/lineage/gateway.js +242 -0
  20. package/dist/lineage/gateway.js.map +1 -0
  21. package/dist/lineage/index.d.ts +5 -0
  22. package/dist/lineage/index.d.ts.map +1 -0
  23. package/dist/lineage/index.js +5 -0
  24. package/dist/lineage/index.js.map +1 -0
  25. package/dist/lineage/lineage.d.ts +141 -0
  26. package/dist/lineage/lineage.d.ts.map +1 -0
  27. package/dist/lineage/lineage.js +255 -0
  28. package/dist/lineage/lineage.js.map +1 -0
  29. package/dist/logging/access-log.d.ts +7 -1
  30. package/dist/logging/access-log.d.ts.map +1 -1
  31. package/dist/mcp/read-client.d.ts.map +1 -1
  32. package/dist/mcp/read-client.js +25 -1
  33. package/dist/mcp/read-client.js.map +1 -1
  34. package/dist/mcp/session.d.ts.map +1 -1
  35. package/dist/mcp/session.js +10 -1
  36. package/dist/mcp/session.js.map +1 -1
  37. package/dist/ports/index.d.ts +125 -0
  38. package/dist/ports/index.d.ts.map +1 -1
  39. package/dist/ports/index.js.map +1 -1
  40. package/dist/signing/request-signer.d.ts +2 -0
  41. package/dist/signing/request-signer.d.ts.map +1 -1
  42. package/dist/signing/request-signer.js +1 -0
  43. package/dist/signing/request-signer.js.map +1 -1
  44. package/dist/signing/signer.d.ts +8 -0
  45. package/dist/signing/signer.d.ts.map +1 -1
  46. package/dist/signing/signer.js +9 -0
  47. package/dist/signing/signer.js.map +1 -1
  48. package/dist/storage/adapters/index.d.ts +1 -1
  49. package/dist/storage/adapters/index.d.ts.map +1 -1
  50. package/dist/storage/adapters/index.js +1 -1
  51. package/dist/storage/adapters/index.js.map +1 -1
  52. package/dist/storage/adapters/vana.d.ts +2 -0
  53. package/dist/storage/adapters/vana.d.ts.map +1 -1
  54. package/dist/storage/adapters/vana.js +5 -1
  55. package/dist/storage/adapters/vana.js.map +1 -1
  56. package/dist/storage/index/types.d.ts +1 -0
  57. package/dist/storage/index/types.d.ts.map +1 -1
  58. package/dist/sync/data-point-feed.d.ts +35 -0
  59. package/dist/sync/data-point-feed.d.ts.map +1 -0
  60. package/dist/sync/data-point-feed.js +122 -0
  61. package/dist/sync/data-point-feed.js.map +1 -0
  62. package/dist/sync/data-point-id.d.ts +7 -0
  63. package/dist/sync/data-point-id.d.ts.map +1 -0
  64. package/dist/sync/data-point-id.js +16 -0
  65. package/dist/sync/data-point-id.js.map +1 -0
  66. package/dist/sync/delete-data-port.d.ts +50 -0
  67. package/dist/sync/delete-data-port.d.ts.map +1 -0
  68. package/dist/sync/delete-data-port.js +244 -0
  69. package/dist/sync/delete-data-port.js.map +1 -0
  70. package/dist/sync/engine/sync-manager.d.ts +14 -4
  71. package/dist/sync/engine/sync-manager.d.ts.map +1 -1
  72. package/dist/sync/engine/sync-manager.js +53 -8
  73. package/dist/sync/engine/sync-manager.js.map +1 -1
  74. package/dist/sync/index.d.ts +7 -0
  75. package/dist/sync/index.d.ts.map +1 -1
  76. package/dist/sync/index.js +7 -0
  77. package/dist/sync/index.js.map +1 -1
  78. package/dist/sync/pending-blob-deletions.d.ts +29 -0
  79. package/dist/sync/pending-blob-deletions.d.ts.map +1 -0
  80. package/dist/sync/pending-blob-deletions.js +116 -0
  81. package/dist/sync/pending-blob-deletions.js.map +1 -0
  82. package/dist/sync/scope-deletions.d.ts +155 -0
  83. package/dist/sync/scope-deletions.d.ts.map +1 -0
  84. package/dist/sync/scope-deletions.js +225 -0
  85. package/dist/sync/scope-deletions.js.map +1 -0
  86. package/dist/sync/tombstone.d.ts +27 -0
  87. package/dist/sync/tombstone.d.ts.map +1 -0
  88. package/dist/sync/tombstone.js +28 -0
  89. package/dist/sync/tombstone.js.map +1 -0
  90. package/dist/sync/workers/delete.d.ts +152 -31
  91. package/dist/sync/workers/delete.d.ts.map +1 -1
  92. package/dist/sync/workers/delete.js +461 -27
  93. package/dist/sync/workers/delete.js.map +1 -1
  94. package/dist/sync/workers/download.d.ts +38 -1
  95. package/dist/sync/workers/download.d.ts.map +1 -1
  96. package/dist/sync/workers/download.js +106 -2
  97. package/dist/sync/workers/download.js.map +1 -1
  98. package/dist/sync/workers/upload.d.ts +41 -7
  99. package/dist/sync/workers/upload.d.ts.map +1 -1
  100. package/dist/sync/workers/upload.js +147 -21
  101. package/dist/sync/workers/upload.js.map +1 -1
  102. package/dist/write/attribution.d.ts +6 -4
  103. package/dist/write/attribution.d.ts.map +1 -1
  104. package/dist/write/attribution.js +51 -3
  105. package/dist/write/attribution.js.map +1 -1
  106. package/package.json +5 -1
@@ -96,4 +96,57 @@ export class ContentTooLargeError extends ProtocolError {
96
96
  super(413, "CONTENT_TOO_LARGE", "Content too large", details);
97
97
  }
98
98
  }
99
+ // Derivative data / lineage (see docs/derivative-data-api.md)
100
+ export class LineageInvalidError extends ProtocolError {
101
+ constructor(message, details) {
102
+ super(400, "LINEAGE_INVALID", message, details);
103
+ }
104
+ }
105
+ export class LineageScopeUnderSourcePrefixError extends ProtocolError {
106
+ constructor(details) {
107
+ super(400, "LINEAGE_SCOPE_UNDER_SOURCE_PREFIX", `Derived scope "${details.scope}" shares its first segment with source scope "${details.sourceScope}"; a wildcard grant on that namespace would read both. Name derivatives under their own namespace.`, details);
108
+ }
109
+ }
110
+ export class LineageSourceUnknownError extends ProtocolError {
111
+ constructor(details) {
112
+ super(422, "LINEAGE_SOURCE_UNKNOWN", "One or more lineage sources are not data points of this owner", details);
113
+ }
114
+ }
115
+ export class LineageSourceLookupFailedError extends ProtocolError {
116
+ constructor(details) {
117
+ super(502, "LINEAGE_SOURCE_LOOKUP_FAILED", "Could not resolve a lineage source at the gateway", details);
118
+ }
119
+ }
120
+ export class LineageUnavailableError extends ProtocolError {
121
+ constructor(details) {
122
+ super(503, "LINEAGE_UNAVAILABLE", "This server is not configured to reach the gateway lineage graph (gateway URL or server signing key missing)", details);
123
+ }
124
+ }
125
+ export class LineageGatewayError extends ProtocolError {
126
+ constructor(details) {
127
+ super(502, "LINEAGE_GATEWAY_ERROR", `Gateway lineage request failed with status ${details.status}`, details);
128
+ }
129
+ }
130
+ export class LineageCascadeUnavailableError extends ProtocolError {
131
+ constructor(details) {
132
+ super(501, "LINEAGE_CASCADE_UNAVAILABLE", "DELETE ?cascade=lineage is specified but not implemented yet: the lineage walk that finds every derivative is missing. Delete scopes one at a time; each single-scope delete is durable.", details);
133
+ }
134
+ }
135
+ export class InvalidCascadeError extends ProtocolError {
136
+ constructor(details) {
137
+ super(400, "INVALID_CASCADE", 'Unsupported cascade mode; the only supported value is "lineage"', details);
138
+ }
139
+ }
140
+ // 502 - Upstream (gateway) errors
141
+ export class DeleteTombstoneFailedError extends ProtocolError {
142
+ constructor(details) {
143
+ super(502, "DELETE_TOMBSTONE_FAILED", "Gateway did not acknowledge the deletion tombstone; nothing was deleted", details);
144
+ }
145
+ }
146
+ // 410 - Deleted resources
147
+ export class DataDeletedError extends ProtocolError {
148
+ constructor(details) {
149
+ super(410, "DATA_DELETED", "Data point has been deleted", details);
150
+ }
151
+ }
99
152
  //# sourceMappingURL=catalog.js.map
@@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 @@
1
+ /**
2
+ * LineageAttestation: the server-signed statement that binds a derivative's
3
+ * lineage to the version it is registered with.
4
+ *
5
+ * The on-chain AddData struct is unchanged and `dataHash` (keccak256 of the
6
+ * plaintext envelope, `$lineage` included) already commits to the lineage.
7
+ * The gateway cannot open that commitment, so the plaintext source list it
8
+ * stores next to the registration needs its own proof of authorship: the
9
+ * AddData signature is public in every gateway attestation, so without one
10
+ * anybody could replay a registration as a same-version refresh carrying a
11
+ * different lineage. The attestation is EIP-712 under the DataRegistry
12
+ * domain (same as AddData), signed by the owner or a registered server,
13
+ * and bound to the exact version and dataHash so it cannot be moved to
14
+ * another registration either.
15
+ */
16
+ export declare const LINEAGE_ATTESTATION_TYPES: {
17
+ readonly LineageAttestation: readonly [{
18
+ readonly name: "ownerAddress";
19
+ readonly type: "address";
20
+ }, {
21
+ readonly name: "scope";
22
+ readonly type: "string";
23
+ }, {
24
+ readonly name: "expectedVersion";
25
+ readonly type: "uint256";
26
+ }, {
27
+ readonly name: "dataHash";
28
+ readonly type: "bytes32";
29
+ }, {
30
+ readonly name: "sources";
31
+ readonly type: "bytes32[]";
32
+ }];
33
+ };
34
+ export interface LineageAttestationMessage {
35
+ ownerAddress: `0x${string}`;
36
+ scope: string;
37
+ expectedVersion: bigint;
38
+ dataHash: `0x${string}`;
39
+ /** Lowercase source data point ids in the registered order. */
40
+ sources: readonly `0x${string}`[];
41
+ }
42
+ //# sourceMappingURL=attestation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attestation.d.ts","sourceRoot":"","sources":["../../src/lineage/attestation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;CAQ5B,CAAC;AAEX,MAAM,WAAW,yBAAyB;IACxC,YAAY,EAAE,KAAK,MAAM,EAAE,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,KAAK,MAAM,EAAE,CAAC;IACxB,+DAA+D;IAC/D,OAAO,EAAE,SAAS,KAAK,MAAM,EAAE,EAAE,CAAC;CACnC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * LineageAttestation: the server-signed statement that binds a derivative's
3
+ * lineage to the version it is registered with.
4
+ *
5
+ * The on-chain AddData struct is unchanged and `dataHash` (keccak256 of the
6
+ * plaintext envelope, `$lineage` included) already commits to the lineage.
7
+ * The gateway cannot open that commitment, so the plaintext source list it
8
+ * stores next to the registration needs its own proof of authorship: the
9
+ * AddData signature is public in every gateway attestation, so without one
10
+ * anybody could replay a registration as a same-version refresh carrying a
11
+ * different lineage. The attestation is EIP-712 under the DataRegistry
12
+ * domain (same as AddData), signed by the owner or a registered server,
13
+ * and bound to the exact version and dataHash so it cannot be moved to
14
+ * another registration either.
15
+ */
16
+ export const LINEAGE_ATTESTATION_TYPES = {
17
+ LineageAttestation: [
18
+ { name: "ownerAddress", type: "address" },
19
+ { name: "scope", type: "string" },
20
+ { name: "expectedVersion", type: "uint256" },
21
+ { name: "dataHash", type: "bytes32" },
22
+ { name: "sources", type: "bytes32[]" },
23
+ ],
24
+ };
25
+ //# sourceMappingURL=attestation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attestation.js","sourceRoot":"","sources":["../../src/lineage/attestation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,kBAAkB,EAAE;QAClB,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,SAAS,EAAE;QACzC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE;QACjC,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,SAAS,EAAE;QAC5C,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE;QACrC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE;KACvC;CACO,CAAC"}
@@ -0,0 +1,105 @@
1
+ /**
2
+ * Gateway client for the lineage endpoints. A thin fetch wrapper (not the SDK
3
+ * GatewayClient) because the three calls need things the SDK client does not
4
+ * expose yet: `includeDeleted=true` on the data point lookup, a server-signed
5
+ * request on the lineage read, and the `lineage` field on registration.
6
+ */
7
+ import type { RequestSigner } from "../signing/request-signer.js";
8
+ import type { LineageDataPointRecord } from "./lineage.js";
9
+ export type LineageNode = {
10
+ dataPointId: string;
11
+ scope: string;
12
+ version: string;
13
+ deletedAt: string | null;
14
+ }
15
+ /**
16
+ * A node the caller's grant does not cover. It carries NO identifier:
17
+ * dataPointId is keccak256(owner, scope) and a grantee knows the owner,
18
+ * so an id would let it dictionary-test scope names. Only position and
19
+ * count survive, which is all a consent UI needs to show the shape.
20
+ */
21
+ | {
22
+ redacted: true;
23
+ };
24
+ /** `data` of a gateway lineage response (see docs/derivative-data-api.md). */
25
+ export interface LineageView {
26
+ dataPointId: string;
27
+ ownerAddress: string;
28
+ scope: string;
29
+ version: string;
30
+ deletedAt: string | null;
31
+ sources: LineageNode[];
32
+ derivatives: LineageNode[];
33
+ /** Present (true) only when the gateway capped `derivatives`. */
34
+ derivativesTruncated?: true;
35
+ /**
36
+ * The grant this view was attested for. Absent on the owner's full view;
37
+ * set (lowercase) on a redacted grant view. The client refuses a view
38
+ * whose grantId does not match the one it asked for.
39
+ */
40
+ grantId?: string;
41
+ }
42
+ export type LineageGatewayResult = {
43
+ ok: true;
44
+ data: LineageView;
45
+ proof: GatewayProof;
46
+ } | {
47
+ ok: false;
48
+ status: number;
49
+ body: unknown;
50
+ };
51
+ export interface GetLineageInput {
52
+ dataPointId: string;
53
+ /** Decimal version string; absent = the current version. */
54
+ version?: string;
55
+ /**
56
+ * Ask for the view a specific grant sees (nodes outside the grant's scopes
57
+ * come back redacted), attested as such. The gateway only honors it for the
58
+ * owner or one of the owner's registered servers.
59
+ */
60
+ grantId?: string;
61
+ }
62
+ export interface RegisterDataPointWithLineageParams {
63
+ ownerAddress: string;
64
+ scope: string;
65
+ dataHash: string;
66
+ metadataHash: string;
67
+ expectedVersion: string;
68
+ signature: string;
69
+ lineage: readonly string[];
70
+ /** LineageAttestation signature over (owner, scope, version, dataHash, lineage). */
71
+ lineageSignature: string;
72
+ }
73
+ export interface RegisterDataPointWithLineageResult {
74
+ dataPointId?: string;
75
+ expectedVersion?: string;
76
+ }
77
+ export interface LineageGatewayPort {
78
+ /** GET /v1/data/:id?includeDeleted=true; null on 404. */
79
+ getDataPoint(dataPointId: string): Promise<LineageDataPointRecord | null>;
80
+ /** GET /v1/data/:id/lineage, signed with the server key. */
81
+ getLineage(input: GetLineageInput): Promise<LineageGatewayResult>;
82
+ /**
83
+ * POST /v1/data with `lineage`. Same body and error contract as the SDK's
84
+ * registerDataPoint (a non-2xx throws `Gateway error: <status> <detail>`)
85
+ * so the upload worker's stale-version handling applies unchanged.
86
+ */
87
+ registerDataPoint(params: RegisterDataPointWithLineageParams): Promise<RegisterDataPointWithLineageResult>;
88
+ }
89
+ export interface GatewayLineageClientOptions {
90
+ gatewayUrl: string;
91
+ /** Signs lineage reads as this server; absent = getLineage is unavailable. */
92
+ requestSigner?: RequestSigner;
93
+ fetch?: typeof fetch;
94
+ }
95
+ /** The gateway attestation shape (ProofData); a 200 without it is not a view. */
96
+ export interface GatewayProof {
97
+ userSignature: string;
98
+ gatewaySignature: string;
99
+ timestamp: number;
100
+ status: string;
101
+ estimatedConfirmation: string | null;
102
+ chainBlockHeight: number | null;
103
+ }
104
+ export declare function createGatewayLineageClient(options: GatewayLineageClientOptions): LineageGatewayPort;
105
+ //# sourceMappingURL=gateway.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gateway.d.ts","sourceRoot":"","sources":["../../src/lineage/gateway.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM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M,CAAC;IAClB,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,oFAAoF;IACpF,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,kCAAkC;IACjD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,kBAAkB;IACjC,yDAAyD;IACzD,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,sBAAsB,GAAG,IAAI,CAAC,CAAC;IAC1E,4DAA4D;IAC5D,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAClE;;;;OAIG;IACH,iBAAiB,CACf,MAAM,EAAE,kCAAkC,GACzC,OAAO,CAAC,kCAAkC,CAAC,CAAC;CAChD;AAED,MAAM,WAAW,2BAA2B;IAC1C,UAAU,EAAE,MAAM,CAAC;IACnB,8EAA8E;IAC9E,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;CACtB;AAwBD,iFAAiF;AACjF,MAAM,WAAW,YAAY;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AA2DD,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,2BAA2B,GACnC,kBAAkB,CA2LpB"}
@@ -0,0 +1,242 @@
1
+ /**
2
+ * Gateway client for the lineage endpoints. A thin fetch wrapper (not the SDK
3
+ * GatewayClient) because the three calls need things the SDK client does not
4
+ * expose yet: `includeDeleted=true` on the data point lookup, a server-signed
5
+ * request on the lineage read, and the `lineage` field on registration.
6
+ */
7
+ import { LineageUnavailableError } from "../errors/catalog.js";
8
+ import { computeDataPointId } from "../sync/data-point-id.js";
9
+ function isRecord(value) {
10
+ return value !== null && typeof value === "object" && !Array.isArray(value);
11
+ }
12
+ function isLineageNode(value) {
13
+ if (!isRecord(value))
14
+ return false;
15
+ if (value.redacted === true) {
16
+ // A redacted node must be exactly { redacted: true }. A gateway that
17
+ // attaches an id, scope or version to a redacted node is leaking, and the
18
+ // view is refused rather than passed on with the leak intact.
19
+ return Object.keys(value).length === 1;
20
+ }
21
+ if (typeof value.dataPointId !== "string")
22
+ return false;
23
+ return (typeof value.scope === "string" &&
24
+ typeof value.version === "string" &&
25
+ (value.deletedAt === null || typeof value.deletedAt === "string"));
26
+ }
27
+ function isGatewayProof(value) {
28
+ return (isRecord(value) &&
29
+ typeof value.userSignature === "string" &&
30
+ typeof value.gatewaySignature === "string" &&
31
+ typeof value.timestamp === "number" &&
32
+ typeof value.status === "string" &&
33
+ (value.estimatedConfirmation === null ||
34
+ typeof value.estimatedConfirmation === "string") &&
35
+ (value.chainBlockHeight === null ||
36
+ typeof value.chainBlockHeight === "number"));
37
+ }
38
+ /**
39
+ * A data point id is keccak256(owner, scope). Any gateway response that
40
+ * labels an owner and scope with an id must derive that id from them; an
41
+ * owner that is not an address, or a pair that hashes elsewhere, fails.
42
+ */
43
+ function derivesDataPointId(id, ownerAddress, scope) {
44
+ try {
45
+ return (computeDataPointId(ownerAddress, scope).toLowerCase() ===
46
+ id.toLowerCase());
47
+ }
48
+ catch {
49
+ return false;
50
+ }
51
+ }
52
+ function parseLineageView(value) {
53
+ if (!isRecord(value) ||
54
+ typeof value.dataPointId !== "string" ||
55
+ typeof value.ownerAddress !== "string" ||
56
+ typeof value.scope !== "string" ||
57
+ typeof value.version !== "string" ||
58
+ !(value.deletedAt === null || typeof value.deletedAt === "string") ||
59
+ !Array.isArray(value.sources) ||
60
+ !value.sources.every(isLineageNode) ||
61
+ !Array.isArray(value.derivatives) ||
62
+ !value.derivatives.every(isLineageNode) ||
63
+ !(value.grantId === undefined || typeof value.grantId === "string") ||
64
+ !(value.derivativesTruncated === undefined ||
65
+ value.derivativesTruncated === true)) {
66
+ return null;
67
+ }
68
+ return value;
69
+ }
70
+ export function createGatewayLineageClient(options) {
71
+ const base = options.gatewayUrl.replace(/\/+$/, "");
72
+ const origin = new URL(base).origin;
73
+ const doFetch = options.fetch ?? fetch;
74
+ async function readJson(res) {
75
+ try {
76
+ return await res.json();
77
+ }
78
+ catch {
79
+ return null;
80
+ }
81
+ }
82
+ return {
83
+ async getDataPoint(dataPointId) {
84
+ const res = await doFetch(`${base}/v1/data/${encodeURIComponent(dataPointId)}?includeDeleted=true`);
85
+ if (res.status === 404)
86
+ return null;
87
+ if (!res.ok) {
88
+ throw new Error(`Gateway error: ${res.status} ${res.statusText}`);
89
+ }
90
+ const body = await readJson(res);
91
+ const data = isRecord(body) ? body.data : undefined;
92
+ if (!isRecord(data) ||
93
+ typeof data.id !== "string" ||
94
+ typeof data.ownerAddress !== "string" ||
95
+ typeof data.scope !== "string" ||
96
+ typeof data.expectedVersion !== "string") {
97
+ throw new Error("Gateway error: malformed data point response");
98
+ }
99
+ // Bind the record to what was asked for: a stale or misrouted 200 must
100
+ // not validate a different source than the one the caller named.
101
+ if (data.id.toLowerCase() !== dataPointId.toLowerCase()) {
102
+ throw new Error(`Gateway error: data point response is for ${data.id}, requested ${dataPointId}`);
103
+ }
104
+ // The id is keccak256(owner, scope): the record's own owner and scope
105
+ // must derive the id it claims, or a malformed response could pair the
106
+ // requested id with an arbitrary same-owner scope and slip past local
107
+ // naming validation.
108
+ if (!derivesDataPointId(data.id, data.ownerAddress, data.scope)) {
109
+ throw new Error(`Gateway error: data point ${data.id} does not derive from its owner and scope`);
110
+ }
111
+ return {
112
+ dataPointId: data.id,
113
+ ownerAddress: data.ownerAddress,
114
+ scope: data.scope,
115
+ version: data.expectedVersion,
116
+ deletedAt: typeof data.deletedAt === "string" ? data.deletedAt : null,
117
+ };
118
+ },
119
+ async getLineage(input) {
120
+ if (!options.requestSigner) {
121
+ throw new LineageUnavailableError({ reason: "no request signer" });
122
+ }
123
+ // The view selectors are signed, never free query parameters: the
124
+ // version is a path segment (inside the signed uri) and the grant view
125
+ // is the scheme's own `grantId` claim, so a captured signature cannot
126
+ // be replayed for another version or grant view.
127
+ const uri = `/v1/data/${input.dataPointId.toLowerCase()}/lineage` +
128
+ (input.version !== undefined ? `/${input.version}` : "");
129
+ const authorization = await options.requestSigner.signRequest({
130
+ aud: origin,
131
+ method: "GET",
132
+ uri,
133
+ grantId: input.grantId?.toLowerCase(),
134
+ });
135
+ const res = await doFetch(`${base}${uri}`, {
136
+ headers: { Authorization: authorization },
137
+ });
138
+ const body = await readJson(res);
139
+ if (!res.ok)
140
+ return { ok: false, status: res.status, body };
141
+ // The API promises an attested view: a 200 whose data or proof does
142
+ // not have the documented shape is reported as a gateway error, never
143
+ // passed on as a view.
144
+ const data = parseLineageView(isRecord(body) ? body.data : undefined);
145
+ const proof = isRecord(body) ? body.proof : undefined;
146
+ if (!data || !isGatewayProof(proof)) {
147
+ return {
148
+ ok: false,
149
+ status: res.status,
150
+ body: { error: "malformed lineage response", received: body },
151
+ };
152
+ }
153
+ // The attested view must be the one that was requested. A response for
154
+ // another data point, or for a version other than the signed path
155
+ // segment, is a gateway error, never served to an authorized caller.
156
+ const requestedId = input.dataPointId.toLowerCase();
157
+ // The grant view is part of the identity of the response: a builder
158
+ // asking under its grant must get a view attested for that grant, and
159
+ // a full owner view (no grantId) must never be handed to a builder.
160
+ const requestedGrant = input.grantId?.toLowerCase();
161
+ const servedGrant = data.grantId?.toLowerCase();
162
+ const viewMismatch = data.dataPointId.toLowerCase() !== requestedId ||
163
+ (input.version !== undefined && data.version !== input.version) ||
164
+ requestedGrant !== servedGrant;
165
+ if (viewMismatch) {
166
+ return {
167
+ ok: false,
168
+ status: res.status,
169
+ body: {
170
+ error: "lineage response does not match the requested view",
171
+ requested: {
172
+ dataPointId: requestedId,
173
+ version: input.version,
174
+ grantId: requestedGrant,
175
+ },
176
+ received: {
177
+ dataPointId: data.dataPointId,
178
+ version: data.version,
179
+ grantId: servedGrant,
180
+ },
181
+ },
182
+ };
183
+ }
184
+ // The view's own owner and scope must derive the id it is labeled
185
+ // with, exactly as getDataPoint demands of a record. Otherwise a
186
+ // malformed response could carry the requested id while exposing the
187
+ // lineage of another owner or scope under that label.
188
+ if (!derivesDataPointId(data.dataPointId, data.ownerAddress, data.scope)) {
189
+ return {
190
+ ok: false,
191
+ status: res.status,
192
+ body: {
193
+ error: "lineage view does not derive from its owner and scope",
194
+ received: {
195
+ dataPointId: data.dataPointId,
196
+ ownerAddress: data.ownerAddress,
197
+ scope: data.scope,
198
+ },
199
+ },
200
+ };
201
+ }
202
+ return { ok: true, data, proof };
203
+ },
204
+ async registerDataPoint(params) {
205
+ const res = await doFetch(`${base}/v1/data`, {
206
+ method: "POST",
207
+ headers: {
208
+ "Content-Type": "application/json",
209
+ Authorization: `Web3Signed ${params.signature}`,
210
+ },
211
+ body: JSON.stringify({
212
+ ownerAddress: params.ownerAddress,
213
+ scope: params.scope,
214
+ dataHash: params.dataHash,
215
+ metadataHash: params.metadataHash,
216
+ expectedVersion: params.expectedVersion,
217
+ lineage: [...params.lineage],
218
+ lineageSignature: params.lineageSignature,
219
+ }),
220
+ });
221
+ if (!res.ok) {
222
+ const body = await readJson(res);
223
+ const detail = (isRecord(body) && typeof body.error === "string" && body.error) ||
224
+ res.statusText;
225
+ throw new Error(`Gateway error: ${res.status} ${detail}`);
226
+ }
227
+ const body = await readJson(res);
228
+ const record = isRecord(body) ? body : {};
229
+ return {
230
+ dataPointId: typeof record.dataPointId === "string"
231
+ ? record.dataPointId
232
+ : typeof record.id === "string"
233
+ ? record.id
234
+ : undefined,
235
+ expectedVersion: typeof record.expectedVersion === "string"
236
+ ? record.expectedVersion
237
+ : undefined,
238
+ };
239
+ },
240
+ };
241
+ }
242
+ //# sourceMappingURL=gateway.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gateway.js","sourceRoot":"","sources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,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;YAC1C,OAAO;gBACL,WAAW,EACT,OAAO,MAAM,CAAC,WAAW,KAAK,QAAQ;oBACpC,CAAC,CAAC,MAAM,CAAC,WAAW;oBACpB,CAAC,CAAC,OAAO,MAAM,CAAC,EAAE,KAAK,QAAQ;wBAC7B,CAAC,CAAC,MAAM,CAAC,EAAE;wBACX,CAAC,CAAC,SAAS;gBACjB,eAAe,EACb,OAAO,MAAM,CAAC,eAAe,KAAK,QAAQ;oBACxC,CAAC,CAAC,MAAM,CAAC,eAAe;oBACxB,CAAC,CAAC,SAAS;aAChB,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { LINEAGE_FIELD, LINEAGE_KEY, LOCAL_SCOPE_SCAN_PAGE, MAX_LINEAGE_SOURCES, assertDerivedScopeNaming, derivedScopeViolatesNaming, extractLineageField, hasReservedLineageKey, parseLineageSources, prepareLineage, readStoredLineage, resolveLineageSources, scopeNamespace, stampLineage, type LineageDataPointRecord, type LineageSourceLookup, type PrepareLineageInput, type ResolveLineageSourcesInput, type ResolvedLineageSource, type StoredLineage, } from "./lineage.js";
2
+ export { createGatewayLineageClient, type GatewayLineageClientOptions, type GatewayProof, type GetLineageInput, type LineageGatewayPort, type LineageGatewayResult, type LineageNode, type LineageView, type RegisterDataPointWithLineageParams, type RegisterDataPointWithLineageResult, } from "./gateway.js";
3
+ export { LINEAGE_ATTESTATION_TYPES, type LineageAttestationMessage, } from "./attestation.js";
4
+ export { computeDataPointId } from "../sync/data-point-id.js";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lineage/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,WAAW,EACX,qBAAqB,EACrB,mBAAmB,EACnB,wBAAwB,EACxB,0BAA0B,EAC1B,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,cAAc,EACd,iBAAiB,EACjB,qBAAqB,EACrB,cAAc,EACd,YAAY,EACZ,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,0BAA0B,EAC/B,KAAK,qBAAqB,EAC1B,KAAK,aAAa,GACnB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,0BAA0B,EAC1B,KAAK,2BAA2B,EAChC,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,kCAAkC,EACvC,KAAK,kCAAkC,GACxC,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,yBAAyB,EACzB,KAAK,yBAAyB,GAC/B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { LINEAGE_FIELD, LINEAGE_KEY, LOCAL_SCOPE_SCAN_PAGE, MAX_LINEAGE_SOURCES, assertDerivedScopeNaming, derivedScopeViolatesNaming, extractLineageField, hasReservedLineageKey, parseLineageSources, prepareLineage, readStoredLineage, resolveLineageSources, scopeNamespace, stampLineage, } from "./lineage.js";
2
+ export { createGatewayLineageClient, } from "./gateway.js";
3
+ export { LINEAGE_ATTESTATION_TYPES, } from "./attestation.js";
4
+ export { computeDataPointId } from "../sync/data-point-id.js";
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lineage/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,WAAW,EACX,qBAAqB,EACrB,mBAAmB,EACnB,wBAAwB,EACxB,0BAA0B,EAC1B,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,cAAc,EACd,iBAAiB,EACjB,qBAAqB,EACrB,cAAc,EACd,YAAY,GAOb,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,0BAA0B,GAU3B,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,yBAAyB,GAE1B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC"}