@secondlayer/shared 10.0.0 → 11.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/archive/range-digest.d.ts +15 -0
- package/dist/src/archive/semantic-digest-builder.d.ts +15 -0
- package/dist/src/coverage/index.d.ts +15 -0
- package/dist/src/crypto/secrets.js.map +2 -2
- package/dist/src/db/index.d.ts +20 -1
- package/dist/src/db/index.js +2 -1
- package/dist/src/db/index.js.map +5 -5
- package/dist/src/db/queries/chain-reorgs.d.ts +15 -0
- package/dist/src/db/queries/chain-reorgs.js +2 -1
- package/dist/src/db/queries/chain-reorgs.js.map +5 -5
- package/dist/src/db/queries/contracts.d.ts +15 -0
- package/dist/src/db/queries/instance.d.ts +15 -0
- package/dist/src/db/queries/integrity.d.ts +15 -0
- package/dist/src/db/queries/subgraph-gaps.d.ts +15 -0
- package/dist/src/db/queries/subgraph-operations.d.ts +15 -0
- package/dist/src/db/queries/subgraphs.d.ts +16 -8
- package/dist/src/db/queries/subgraphs.js +1 -9
- package/dist/src/db/queries/subgraphs.js.map +4 -4
- package/dist/src/db/queries/subscriptions.d.ts +15 -0
- package/dist/src/db/queries/subscriptions.js.map +2 -2
- package/dist/src/db/queries/sync-scope.d.ts +15 -0
- package/dist/src/db/schema.d.ts +19 -1
- package/dist/src/errors.d.ts +5 -2
- package/dist/src/errors.js +5 -5
- package/dist/src/errors.js.map +3 -3
- package/dist/src/index.d.ts +34 -9
- package/dist/src/index.js +13 -13
- package/dist/src/index.js.map +8 -8
- package/dist/src/mode.d.ts +4 -3
- package/dist/src/mode.js.map +2 -2
- package/dist/src/node/local-client.d.ts +15 -0
- package/dist/src/runtime/index.js +2 -2
- package/dist/src/runtime/index.js.map +3 -3
- package/dist/src/schemas/index.d.ts +0 -6
- package/dist/src/schemas/index.js +2 -3
- package/dist/src/schemas/index.js.map +3 -3
- package/dist/src/schemas/subgraphs.d.ts +0 -6
- package/dist/src/schemas/subgraphs.js +2 -3
- package/dist/src/schemas/subgraphs.js.map +3 -3
- package/dist/src/subgraphs/spec.d.ts +9 -0
- package/dist/src/subgraphs/spec.js +7 -7
- package/dist/src/subgraphs/spec.js.map +3 -3
- package/migrations/0121_archive_fetches.ts +49 -0
- package/package.json +1 -1
package/dist/src/index.js
CHANGED
|
@@ -783,6 +783,7 @@ var TABLE_TO_DB = {
|
|
|
783
783
|
x402_payments: "target",
|
|
784
784
|
x402_balances: "target",
|
|
785
785
|
account_credits: "target",
|
|
786
|
+
archive_fetches: "target",
|
|
786
787
|
service_heartbeats: "both"
|
|
787
788
|
};
|
|
788
789
|
|
|
@@ -1022,8 +1023,8 @@ class DatabaseError extends SecondLayerError {
|
|
|
1022
1023
|
}
|
|
1023
1024
|
|
|
1024
1025
|
class AuthenticationError extends SecondLayerError {
|
|
1025
|
-
constructor(message) {
|
|
1026
|
-
super("AUTHENTICATION_ERROR", message);
|
|
1026
|
+
constructor(message, details) {
|
|
1027
|
+
super("AUTHENTICATION_ERROR", message, undefined, details);
|
|
1027
1028
|
}
|
|
1028
1029
|
}
|
|
1029
1030
|
|
|
@@ -1086,8 +1087,8 @@ var CODE_TO_STATUS = {
|
|
|
1086
1087
|
NO_TENANT_FOR_PROJECT: 404,
|
|
1087
1088
|
INSTANCE_EXISTS: 409,
|
|
1088
1089
|
SUBGRAPH_NOT_FOUND: 404,
|
|
1089
|
-
|
|
1090
|
-
|
|
1090
|
+
GHOST_KEY_READ_ONLY: 403,
|
|
1091
|
+
UNSUPPORTED_MEDIA_TYPE: 415
|
|
1091
1092
|
};
|
|
1092
1093
|
function getErrorMessage(err) {
|
|
1093
1094
|
return err instanceof Error ? err.message : String(err);
|
|
@@ -1104,8 +1105,7 @@ var DeploySubgraphRequestSchema = z2.object({
|
|
|
1104
1105
|
handlerCode: z2.string().max(1048576, "handler code exceeds 1MB limit"),
|
|
1105
1106
|
startBlock: z2.number().int().nonnegative().optional(),
|
|
1106
1107
|
sourceCode: z2.string().max(1048576, "source code exceeds 1MB limit").optional(),
|
|
1107
|
-
dryRun: z2.boolean().optional()
|
|
1108
|
-
visibility: z2.enum(["public", "private"]).optional()
|
|
1108
|
+
dryRun: z2.boolean().optional()
|
|
1109
1109
|
});
|
|
1110
1110
|
|
|
1111
1111
|
// src/schemas/subscriptions.ts
|
|
@@ -1481,14 +1481,14 @@ var SYSTEM_COLUMNS = ["_id", "_block_height", "_tx_id", "_created_at"];
|
|
|
1481
1481
|
var BASE_QUERY_PARAMS = ["_limit", "_offset", "_sort", "_order", "_fields"];
|
|
1482
1482
|
var PUBLIC_BASE_QUERY_PARAMS = ["_limit", "cursor", "_order", "_fields"];
|
|
1483
1483
|
var COMPARISON_OPS = ["neq", "gt", "gte", "lt", "lte"];
|
|
1484
|
-
function isPublicRead(detail) {
|
|
1485
|
-
return detail.visibility === "public";
|
|
1484
|
+
function isPublicRead(detail, options) {
|
|
1485
|
+
return options.forcePublicRead ?? detail.visibility === "public";
|
|
1486
1486
|
}
|
|
1487
1487
|
function generatedAt(options) {
|
|
1488
1488
|
return options.generatedAt ?? new Date().toISOString();
|
|
1489
1489
|
}
|
|
1490
1490
|
function normalizeServerUrl(serverUrl) {
|
|
1491
|
-
return (serverUrl ?? "
|
|
1491
|
+
return (serverUrl ?? "http://127.0.0.1:3800").replace(/\/+$/, "");
|
|
1492
1492
|
}
|
|
1493
1493
|
function tablePath(subgraphName, tableName, publicRead) {
|
|
1494
1494
|
const base = publicRead ? "/v1/subgraphs" : "/api/subgraphs";
|
|
@@ -1675,7 +1675,7 @@ function tableParameters(table, publicRead) {
|
|
|
1675
1675
|
}
|
|
1676
1676
|
function generateSubgraphAgentSchema(detail, options = {}) {
|
|
1677
1677
|
const serverUrl = normalizeServerUrl(options.serverUrl);
|
|
1678
|
-
const publicRead = isPublicRead(detail);
|
|
1678
|
+
const publicRead = isPublicRead(detail, options);
|
|
1679
1679
|
const tables = {};
|
|
1680
1680
|
for (const [tableName, table] of Object.entries(detail.tables)) {
|
|
1681
1681
|
const path = tablePath(detail.name, tableName, publicRead);
|
|
@@ -1717,7 +1717,7 @@ function generateSubgraphAgentSchema(detail, options = {}) {
|
|
|
1717
1717
|
}
|
|
1718
1718
|
function generateSubgraphOpenApi(detail, options = {}) {
|
|
1719
1719
|
const serverUrl = normalizeServerUrl(options.serverUrl);
|
|
1720
|
-
const publicRead = isPublicRead(detail);
|
|
1720
|
+
const publicRead = isPublicRead(detail, options);
|
|
1721
1721
|
const paths = {};
|
|
1722
1722
|
const schemas = {};
|
|
1723
1723
|
for (const [tableName, table] of Object.entries(detail.tables)) {
|
|
@@ -1829,7 +1829,7 @@ function generateSubgraphOpenApi(detail, options = {}) {
|
|
|
1829
1829
|
}
|
|
1830
1830
|
function generateSubgraphMarkdown(detail, options = {}) {
|
|
1831
1831
|
const agent = generateSubgraphAgentSchema(detail, options);
|
|
1832
|
-
const publicRead = isPublicRead(detail);
|
|
1832
|
+
const publicRead = isPublicRead(detail, options);
|
|
1833
1833
|
const lines = [
|
|
1834
1834
|
`# ${detail.name} Subgraph API`,
|
|
1835
1835
|
"",
|
|
@@ -2147,5 +2147,5 @@ export {
|
|
|
2147
2147
|
AuthenticationError
|
|
2148
2148
|
};
|
|
2149
2149
|
|
|
2150
|
-
//# debugId=
|
|
2150
|
+
//# debugId=CC94EE7EB04C7F8864756E2164756E21
|
|
2151
2151
|
//# sourceMappingURL=index.js.map
|