@secondlayer/subgraphs 1.3.2 → 1.3.3
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/README.md +1 -1
- package/dist/src/index.js +9 -9
- package/dist/src/index.js.map +7 -7
- package/dist/src/runtime/block-processor.js +4 -4
- package/dist/src/runtime/block-processor.js.map +5 -5
- package/dist/src/runtime/catchup.d.ts +16 -2
- package/dist/src/runtime/catchup.js +68 -20
- package/dist/src/runtime/catchup.js.map +6 -6
- package/dist/src/runtime/context.js +4 -4
- package/dist/src/runtime/context.js.map +3 -3
- package/dist/src/runtime/processor.js +73 -28
- package/dist/src/runtime/processor.js.map +11 -11
- package/dist/src/runtime/reindex.js +9 -9
- package/dist/src/runtime/reindex.js.map +6 -6
- package/dist/src/runtime/reorg.js +4 -4
- package/dist/src/runtime/reorg.js.map +5 -5
- package/dist/src/schema/index.js +6 -6
- package/dist/src/schema/index.js.map +4 -4
- package/dist/src/service.js +73 -28
- package/dist/src/service.js.map +11 -11
- package/dist/src/validate.js.map +2 -2
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -51,7 +51,7 @@ export default defineSubgraph({
|
|
|
51
51
|
});
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
-
Deploy via CLI (`sl subgraphs deploy path/to/definition.ts`), SDK (`sl.subgraphs.deploy({...})`), or MCP (`subgraphs_deploy`). The dashboard is read-only — creation always happens through an API surface.
|
|
54
|
+
Deploy via CLI (`sl subgraphs deploy path/to/definition.ts`), SDK (`sl.subgraphs.deploy({...})`), or MCP (`subgraphs_deploy`). The CLI can also scaffold from a deployed contract with `sl subgraphs scaffold <contract> -o subgraphs/name.ts`; scaffold writes or amends `package.json` and runs `bun install` unless `--no-install` is passed. The dashboard is read-only — creation always happens through an API surface.
|
|
55
55
|
|
|
56
56
|
## Exports
|
|
57
57
|
|
package/dist/src/index.js
CHANGED
|
@@ -256,9 +256,9 @@ class SubgraphContext {
|
|
|
256
256
|
const blockHeight = op.data._block_height ?? this.block.height;
|
|
257
257
|
const txId = op.data._tx_id ?? this._tx.txId;
|
|
258
258
|
const baseRow = op.kind === "update" ? { ...op.data, ...op.set ?? {} } : { ...op.data };
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
259
|
+
baseRow._upsert_keys = undefined;
|
|
260
|
+
baseRow._upsert_fallback_keys = undefined;
|
|
261
|
+
baseRow._upsert_fallback_set = undefined;
|
|
262
262
|
return {
|
|
263
263
|
op: op.kind,
|
|
264
264
|
table: op.table,
|
|
@@ -1405,16 +1405,16 @@ function generateSubgraphSQL(def, schemaNameOverride) {
|
|
|
1405
1405
|
const statements = [];
|
|
1406
1406
|
const needsTrgm = Object.values(def.schema).some((table) => Object.values(table.columns).some((col) => col.search));
|
|
1407
1407
|
if (needsTrgm) {
|
|
1408
|
-
statements.push(
|
|
1408
|
+
statements.push("CREATE EXTENSION IF NOT EXISTS pg_trgm");
|
|
1409
1409
|
}
|
|
1410
1410
|
statements.push(`CREATE SCHEMA IF NOT EXISTS ${schemaName}`);
|
|
1411
1411
|
for (const [tableName, tableDef] of Object.entries(def.schema)) {
|
|
1412
1412
|
const qualifiedName = `${schemaName}.${tableName}`;
|
|
1413
1413
|
const columnDefs = [
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1414
|
+
"_id BIGSERIAL PRIMARY KEY",
|
|
1415
|
+
"_block_height BIGINT NOT NULL",
|
|
1416
|
+
"_tx_id TEXT NOT NULL",
|
|
1417
|
+
"_created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()"
|
|
1418
1418
|
];
|
|
1419
1419
|
for (const [colName, col] of Object.entries(tableDef.columns)) {
|
|
1420
1420
|
const sqlType = TYPE_MAP[col.type];
|
|
@@ -2158,5 +2158,5 @@ export {
|
|
|
2158
2158
|
backfillSubgraph
|
|
2159
2159
|
};
|
|
2160
2160
|
|
|
2161
|
-
//# debugId=
|
|
2161
|
+
//# debugId=6E118676092C466764756E2164756E21
|
|
2162
2162
|
//# sourceMappingURL=index.js.map
|