diff --git a/schema.json b/schema.json index 09e4894e1..8e55a3f25 100644 --- a/schema.json +++ b/schema.json @@ -129,13 +129,6 @@ } ] }, - { - "allOf": [ - { - "$ref": "#/$defs/SubsquidOperationsIndexConfig" - } - ] - }, { "allOf": [ { @@ -178,6 +171,13 @@ } ] }, + { + "allOf": [ + { + "$ref": "#/$defs/TzktTokenBalancesIndexConfig" + } + ] + }, { "allOf": [ { @@ -199,13 +199,6 @@ } ] }, - { - "allOf": [ - { - "$ref": "#/$defs/SubsquidOperationsIndexConfig" - } - ] - }, { "allOf": [ { @@ -247,6 +240,13 @@ "$ref": "#/$defs/TzktTokenTransfersIndexConfig" } ] + }, + { + "allOf": [ + { + "$ref": "#/$defs/TzktTokenBalancesIndexConfig" + } + ] } ] } @@ -287,11 +287,19 @@ "default": null }, "sentry": { - "allOf": [ + "anyOf": [ + { + "allOf": [ + { + "$ref": "#/$defs/SentryConfig" + } + ] + }, { - "$ref": "#/$defs/SentryConfig" + "type": "null" } - ] + ], + "default": null }, "prometheus": { "anyOf": [ @@ -1116,124 +1124,9 @@ ], "default": null }, - "first_level": { - "type": "integer", - "default": 0 - }, - "last_level": { - "type": "integer", - "default": 0 - } - }, - "required": [ - "kind", - "datasource", - "handlers" - ] - }, - "SubsquidOperationsHandlerConfig": { - "type": "object", - "title": "SubsquidOperationsHandlerConfig", - "properties": { - "callback": { - "type": "string" - }, - "contract": { - "anyOf": [ - { - "type": "string" - }, - { - "allOf": [ - { - "$ref": "#/$defs/EvmContractConfig" - } - ] - } - ] - }, - "method": { - "type": "string" - }, - "events": { - "type": "array", - "items": {} - } - }, - "required": [ - "callback", - "contract", - "method", - "events" - ] - }, - "SubsquidOperationsIndexConfig": { - "type": "object", - "title": "SubsquidOperationsIndexConfig", - "properties": { - "kind": { - "enum": [ - "evm.subsquid.operations" - ] - }, - "datasource": { - "anyOf": [ - { - "type": "string" - }, - { - "allOf": [ - { - "$ref": "#/$defs/SubsquidDatasourceConfig" - } - ] - } - ] - }, - "handlers": { - "type": "array", - "items": { - "allOf": [ - { - "$ref": "#/$defs/SubsquidOperationsHandlerConfig" - } - ] - } - }, - "contracts": { - "type": "array", - "items": { - "allOf": [ - { - "$ref": "#/$defs/EvmContractConfig" - } - ] - } - }, - "abi": { - "anyOf": [ - { - "allOf": [ - { - "$ref": "#/$defs/AbiDatasourceConfig" - } - ] - }, - { - "type": "array", - "items": { - "allOf": [ - { - "$ref": "#/$defs/AbiDatasourceConfig" - } - ] - } - }, - { - "type": "null" - } - ], - "default": null + "node_only": { + "type": "boolean", + "default": false }, "first_level": { "type": "integer", @@ -1247,8 +1140,7 @@ "required": [ "kind", "datasource", - "handlers", - "contracts" + "handlers" ] }, "TzktBigMapsHandlerConfig": { @@ -1936,6 +1828,94 @@ "datasource" ] }, + "TzktTokenBalancesHandlerConfig": { + "type": "object", + "title": "TzktTokenBalancesHandlerConfig", + "properties": { + "callback": { + "type": "string" + }, + "contract": { + "anyOf": [ + { + "type": "string" + }, + { + "allOf": [ + { + "$ref": "#/$defs/TezosContractConfig" + } + ] + }, + { + "type": "null" + } + ], + "default": null + }, + "token_id": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "required": [ + "callback" + ] + }, + "TzktTokenBalancesIndexConfig": { + "type": "object", + "title": "TzktTokenBalancesIndexConfig", + "properties": { + "kind": { + "enum": [ + "tezos.tzkt.token_balances" + ] + }, + "datasource": { + "anyOf": [ + { + "type": "string" + }, + { + "allOf": [ + { + "$ref": "#/$defs/TzktDatasourceConfig" + } + ] + } + ] + }, + "handlers": { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/$defs/TzktTokenBalancesHandlerConfig" + } + ] + } + }, + "first_level": { + "type": "integer", + "default": 0 + }, + "last_level": { + "type": "integer", + "default": 0 + } + }, + "required": [ + "kind", + "datasource" + ] + }, "IndexTemplateConfig": { "type": "object", "title": "IndexTemplateConfig", @@ -2110,8 +2090,7 @@ "title": "SentryConfig", "properties": { "dsn": { - "type": "string", - "default": "" + "type": "string" }, "environment": { "anyOf": [ @@ -2161,7 +2140,10 @@ "type": "boolean", "default": false } - } + }, + "required": [ + "dsn" + ] }, "PrometheusConfig": { "type": "object", @@ -2274,11 +2256,19 @@ "default": false }, "api": { - "allOf": [ + "anyOf": [ { - "$ref": "#/$defs/ApiConfig" + "allOf": [ + { + "$ref": "#/$defs/ApiConfig" + } + ] + }, + { + "type": "null" } - ] + ], + "default": null }, "metrics": { "allOf": [ diff --git a/scripts/dump_schema.py b/scripts/dump_schema.py index 55cc32f69..34bf80230 100644 --- a/scripts/dump_schema.py +++ b/scripts/dump_schema.py @@ -1,4 +1,5 @@ #!/usr/bin/env python3 +# NOTE: Run `pdm add -G dev -e ../dc_schema` first. from pathlib import Path import orjson