@jsonbored/metagraphed 0.3.0 → 0.3.1

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/index.d.cts CHANGED
@@ -632,6 +632,23 @@ interface paths {
632
632
  patch?: never;
633
633
  trace?: never;
634
634
  };
635
+ "/api/v1/rpc/usage": {
636
+ parameters: {
637
+ query?: never;
638
+ header?: never;
639
+ path?: never;
640
+ cookie?: never;
641
+ };
642
+ /** Fetch RPC reverse-proxy usage analytics — request volume, latency p50/p95, failover + error rate, cache-hit rate, and the per-endpoint request distribution — over a 7d or 30d window (computed live from D1 telemetry). */
643
+ get: operations["rpcUsage"];
644
+ put?: never;
645
+ post?: never;
646
+ delete?: never;
647
+ options?: never;
648
+ head?: never;
649
+ patch?: never;
650
+ trace?: never;
651
+ };
635
652
  "/api/v1/schemas": {
636
653
  parameters: {
637
654
  query?: never;
@@ -1958,6 +1975,11 @@ interface components {
1958
1975
  github_url?: string;
1959
1976
  id: string;
1960
1977
  kind: components["schemas"]["ProviderKind"];
1978
+ /**
1979
+ * Format: uri
1980
+ * @description Curated provider logo, else backfilled from the on-chain logo of the single subnet this provider operates. Display-only; never feeds completeness.
1981
+ */
1982
+ logo_url?: string;
1961
1983
  name: string;
1962
1984
  /** @description Sorted unique netuids this provider operates a curated surface on (issue #347). Derived/reporting — never feeds completeness. */
1963
1985
  netuids?: number[];
@@ -2543,6 +2565,53 @@ interface components {
2543
2565
  } & {
2544
2566
  [key: string]: unknown;
2545
2567
  });
2568
+ /** @description RPC reverse-proxy usage analytics over a 7d/30d window: request volume, latency percentiles, failover + error rate, cache-hit rate, and the per-endpoint request distribution. Computed live from the rpc_proxy_events telemetry (no static file). */
2569
+ RpcUsageArtifact: {
2570
+ endpoints: ({
2571
+ avg_latency_ms?: number | null;
2572
+ endpoint_id: string | null;
2573
+ error_rate?: number | null;
2574
+ ok_requests: number;
2575
+ provider?: string | null;
2576
+ rank?: number;
2577
+ requests: number;
2578
+ } & {
2579
+ [key: string]: unknown;
2580
+ })[];
2581
+ networks: ({
2582
+ error_rate?: number | null;
2583
+ network: string;
2584
+ ok_requests: number;
2585
+ requests: number;
2586
+ } & {
2587
+ [key: string]: unknown;
2588
+ })[];
2589
+ observed_at?: string | null;
2590
+ schema_version: number;
2591
+ source: string;
2592
+ summary: {
2593
+ cache_hit_rate?: number | null;
2594
+ cache_hits?: number;
2595
+ error_rate?: number | null;
2596
+ error_requests: number;
2597
+ failover_rate?: number | null;
2598
+ failover_requests?: number;
2599
+ latency_ms?: {
2600
+ avg?: number | null;
2601
+ p50?: number | null;
2602
+ p95?: number | null;
2603
+ } & {
2604
+ [key: string]: unknown;
2605
+ };
2606
+ ok_requests: number;
2607
+ total_requests: number;
2608
+ } & {
2609
+ [key: string]: unknown;
2610
+ };
2611
+ window?: string | null;
2612
+ } & {
2613
+ [key: string]: unknown;
2614
+ };
2546
2615
  SchemaDriftArtifact: components["schemas"]["ArtifactBase"] & ({
2547
2616
  openapi_surface_count: number;
2548
2617
  schema_backed_surface_count: number;
@@ -6474,6 +6543,7 @@ interface operations {
6474
6543
  * "github_url": "https://api.metagraph.sh/example",
6475
6544
  * "id": "example-subnet",
6476
6545
  * "kind": "subnet-team",
6546
+ * "logo_url": "https://api.metagraph.sh/example",
6477
6547
  * "name": "Example Subnet",
6478
6548
  * "netuids": [
6479
6549
  * 7
@@ -8258,6 +8328,131 @@ interface operations {
8258
8328
  };
8259
8329
  };
8260
8330
  };
8331
+ rpcUsage: {
8332
+ parameters: {
8333
+ query?: {
8334
+ window?: "7d" | "30d";
8335
+ };
8336
+ header?: never;
8337
+ path?: never;
8338
+ cookie?: never;
8339
+ };
8340
+ requestBody?: never;
8341
+ responses: {
8342
+ /** @description Canonical artifact wrapped in the Metagraphed API envelope. */
8343
+ 200: {
8344
+ headers: {
8345
+ "cache-control": components["headers"]["CacheControl"];
8346
+ etag: components["headers"]["ETag"];
8347
+ "x-metagraph-contract-version": components["headers"]["ContractVersion"];
8348
+ [name: string]: unknown;
8349
+ };
8350
+ content: {
8351
+ /**
8352
+ * @example {
8353
+ * "data": {
8354
+ * "endpoints": [
8355
+ * {
8356
+ * "endpoint_id": "https://api.metagraph.sh/example",
8357
+ * "ok_requests": 1,
8358
+ * "requests": 1
8359
+ * }
8360
+ * ],
8361
+ * "networks": [
8362
+ * {
8363
+ * "network": "example",
8364
+ * "ok_requests": 1,
8365
+ * "requests": 1
8366
+ * }
8367
+ * ],
8368
+ * "observed_at": "2026-06-01T00:00:00.000Z",
8369
+ * "schema_version": 1,
8370
+ * "source": "live-cron-prober",
8371
+ * "summary": {
8372
+ * "cache_hit_rate": 0.5,
8373
+ * "cache_hits": 1,
8374
+ * "error_rate": 0.5,
8375
+ * "error_requests": 1,
8376
+ * "failover_rate": 0.5,
8377
+ * "failover_requests": 1,
8378
+ * "latency_ms": {},
8379
+ * "ok_requests": 1,
8380
+ * "total_requests": 1
8381
+ * },
8382
+ * "window": "30d"
8383
+ * },
8384
+ * "meta": {
8385
+ * "artifact_path": "example",
8386
+ * "cache": "short",
8387
+ * "contract_version": "2026-06-06.1",
8388
+ * "generated_at": "2026-06-01T00:00:00.000Z",
8389
+ * "pagination": {
8390
+ * "collection": "example",
8391
+ * "cursor": 1,
8392
+ * "limit": 1,
8393
+ * "next_cursor": 1,
8394
+ * "order": "asc",
8395
+ * "returned": 1,
8396
+ * "sort": "example",
8397
+ * "total": 1
8398
+ * },
8399
+ * "published_at": "2026-06-01T00:00:00.000Z",
8400
+ * "source": "live-cron-prober"
8401
+ * },
8402
+ * "ok": true,
8403
+ * "schema_version": 1
8404
+ * }
8405
+ */
8406
+ "application/json": components["schemas"]["SuccessEnvelope"] & {
8407
+ data?: components["schemas"]["RpcUsageArtifact"];
8408
+ };
8409
+ };
8410
+ };
8411
+ /** @description ETag matched and the cached response is still valid. */
8412
+ 304: {
8413
+ headers: {
8414
+ [name: string]: unknown;
8415
+ };
8416
+ content?: never;
8417
+ };
8418
+ /** @description Query parameters were malformed or unsupported. */
8419
+ 400: {
8420
+ headers: {
8421
+ [name: string]: unknown;
8422
+ };
8423
+ content: {
8424
+ "application/json": components["schemas"]["ErrorEnvelope"];
8425
+ };
8426
+ };
8427
+ /** @description Artifact or API route was not found. */
8428
+ 404: {
8429
+ headers: {
8430
+ [name: string]: unknown;
8431
+ };
8432
+ content: {
8433
+ "application/json": components["schemas"]["ErrorEnvelope"];
8434
+ };
8435
+ };
8436
+ /** @description HTTP method is not supported. */
8437
+ 405: {
8438
+ headers: {
8439
+ [name: string]: unknown;
8440
+ };
8441
+ content: {
8442
+ "application/json": components["schemas"]["ErrorEnvelope"];
8443
+ };
8444
+ };
8445
+ /** @description Unexpected backend error. */
8446
+ 500: {
8447
+ headers: {
8448
+ [name: string]: unknown;
8449
+ };
8450
+ content: {
8451
+ "application/json": components["schemas"]["ErrorEnvelope"];
8452
+ };
8453
+ };
8454
+ };
8455
+ };
8261
8456
  schemas: {
8262
8457
  parameters: {
8263
8458
  query?: never;
package/dist/index.d.ts CHANGED
@@ -632,6 +632,23 @@ interface paths {
632
632
  patch?: never;
633
633
  trace?: never;
634
634
  };
635
+ "/api/v1/rpc/usage": {
636
+ parameters: {
637
+ query?: never;
638
+ header?: never;
639
+ path?: never;
640
+ cookie?: never;
641
+ };
642
+ /** Fetch RPC reverse-proxy usage analytics — request volume, latency p50/p95, failover + error rate, cache-hit rate, and the per-endpoint request distribution — over a 7d or 30d window (computed live from D1 telemetry). */
643
+ get: operations["rpcUsage"];
644
+ put?: never;
645
+ post?: never;
646
+ delete?: never;
647
+ options?: never;
648
+ head?: never;
649
+ patch?: never;
650
+ trace?: never;
651
+ };
635
652
  "/api/v1/schemas": {
636
653
  parameters: {
637
654
  query?: never;
@@ -1958,6 +1975,11 @@ interface components {
1958
1975
  github_url?: string;
1959
1976
  id: string;
1960
1977
  kind: components["schemas"]["ProviderKind"];
1978
+ /**
1979
+ * Format: uri
1980
+ * @description Curated provider logo, else backfilled from the on-chain logo of the single subnet this provider operates. Display-only; never feeds completeness.
1981
+ */
1982
+ logo_url?: string;
1961
1983
  name: string;
1962
1984
  /** @description Sorted unique netuids this provider operates a curated surface on (issue #347). Derived/reporting — never feeds completeness. */
1963
1985
  netuids?: number[];
@@ -2543,6 +2565,53 @@ interface components {
2543
2565
  } & {
2544
2566
  [key: string]: unknown;
2545
2567
  });
2568
+ /** @description RPC reverse-proxy usage analytics over a 7d/30d window: request volume, latency percentiles, failover + error rate, cache-hit rate, and the per-endpoint request distribution. Computed live from the rpc_proxy_events telemetry (no static file). */
2569
+ RpcUsageArtifact: {
2570
+ endpoints: ({
2571
+ avg_latency_ms?: number | null;
2572
+ endpoint_id: string | null;
2573
+ error_rate?: number | null;
2574
+ ok_requests: number;
2575
+ provider?: string | null;
2576
+ rank?: number;
2577
+ requests: number;
2578
+ } & {
2579
+ [key: string]: unknown;
2580
+ })[];
2581
+ networks: ({
2582
+ error_rate?: number | null;
2583
+ network: string;
2584
+ ok_requests: number;
2585
+ requests: number;
2586
+ } & {
2587
+ [key: string]: unknown;
2588
+ })[];
2589
+ observed_at?: string | null;
2590
+ schema_version: number;
2591
+ source: string;
2592
+ summary: {
2593
+ cache_hit_rate?: number | null;
2594
+ cache_hits?: number;
2595
+ error_rate?: number | null;
2596
+ error_requests: number;
2597
+ failover_rate?: number | null;
2598
+ failover_requests?: number;
2599
+ latency_ms?: {
2600
+ avg?: number | null;
2601
+ p50?: number | null;
2602
+ p95?: number | null;
2603
+ } & {
2604
+ [key: string]: unknown;
2605
+ };
2606
+ ok_requests: number;
2607
+ total_requests: number;
2608
+ } & {
2609
+ [key: string]: unknown;
2610
+ };
2611
+ window?: string | null;
2612
+ } & {
2613
+ [key: string]: unknown;
2614
+ };
2546
2615
  SchemaDriftArtifact: components["schemas"]["ArtifactBase"] & ({
2547
2616
  openapi_surface_count: number;
2548
2617
  schema_backed_surface_count: number;
@@ -6474,6 +6543,7 @@ interface operations {
6474
6543
  * "github_url": "https://api.metagraph.sh/example",
6475
6544
  * "id": "example-subnet",
6476
6545
  * "kind": "subnet-team",
6546
+ * "logo_url": "https://api.metagraph.sh/example",
6477
6547
  * "name": "Example Subnet",
6478
6548
  * "netuids": [
6479
6549
  * 7
@@ -8258,6 +8328,131 @@ interface operations {
8258
8328
  };
8259
8329
  };
8260
8330
  };
8331
+ rpcUsage: {
8332
+ parameters: {
8333
+ query?: {
8334
+ window?: "7d" | "30d";
8335
+ };
8336
+ header?: never;
8337
+ path?: never;
8338
+ cookie?: never;
8339
+ };
8340
+ requestBody?: never;
8341
+ responses: {
8342
+ /** @description Canonical artifact wrapped in the Metagraphed API envelope. */
8343
+ 200: {
8344
+ headers: {
8345
+ "cache-control": components["headers"]["CacheControl"];
8346
+ etag: components["headers"]["ETag"];
8347
+ "x-metagraph-contract-version": components["headers"]["ContractVersion"];
8348
+ [name: string]: unknown;
8349
+ };
8350
+ content: {
8351
+ /**
8352
+ * @example {
8353
+ * "data": {
8354
+ * "endpoints": [
8355
+ * {
8356
+ * "endpoint_id": "https://api.metagraph.sh/example",
8357
+ * "ok_requests": 1,
8358
+ * "requests": 1
8359
+ * }
8360
+ * ],
8361
+ * "networks": [
8362
+ * {
8363
+ * "network": "example",
8364
+ * "ok_requests": 1,
8365
+ * "requests": 1
8366
+ * }
8367
+ * ],
8368
+ * "observed_at": "2026-06-01T00:00:00.000Z",
8369
+ * "schema_version": 1,
8370
+ * "source": "live-cron-prober",
8371
+ * "summary": {
8372
+ * "cache_hit_rate": 0.5,
8373
+ * "cache_hits": 1,
8374
+ * "error_rate": 0.5,
8375
+ * "error_requests": 1,
8376
+ * "failover_rate": 0.5,
8377
+ * "failover_requests": 1,
8378
+ * "latency_ms": {},
8379
+ * "ok_requests": 1,
8380
+ * "total_requests": 1
8381
+ * },
8382
+ * "window": "30d"
8383
+ * },
8384
+ * "meta": {
8385
+ * "artifact_path": "example",
8386
+ * "cache": "short",
8387
+ * "contract_version": "2026-06-06.1",
8388
+ * "generated_at": "2026-06-01T00:00:00.000Z",
8389
+ * "pagination": {
8390
+ * "collection": "example",
8391
+ * "cursor": 1,
8392
+ * "limit": 1,
8393
+ * "next_cursor": 1,
8394
+ * "order": "asc",
8395
+ * "returned": 1,
8396
+ * "sort": "example",
8397
+ * "total": 1
8398
+ * },
8399
+ * "published_at": "2026-06-01T00:00:00.000Z",
8400
+ * "source": "live-cron-prober"
8401
+ * },
8402
+ * "ok": true,
8403
+ * "schema_version": 1
8404
+ * }
8405
+ */
8406
+ "application/json": components["schemas"]["SuccessEnvelope"] & {
8407
+ data?: components["schemas"]["RpcUsageArtifact"];
8408
+ };
8409
+ };
8410
+ };
8411
+ /** @description ETag matched and the cached response is still valid. */
8412
+ 304: {
8413
+ headers: {
8414
+ [name: string]: unknown;
8415
+ };
8416
+ content?: never;
8417
+ };
8418
+ /** @description Query parameters were malformed or unsupported. */
8419
+ 400: {
8420
+ headers: {
8421
+ [name: string]: unknown;
8422
+ };
8423
+ content: {
8424
+ "application/json": components["schemas"]["ErrorEnvelope"];
8425
+ };
8426
+ };
8427
+ /** @description Artifact or API route was not found. */
8428
+ 404: {
8429
+ headers: {
8430
+ [name: string]: unknown;
8431
+ };
8432
+ content: {
8433
+ "application/json": components["schemas"]["ErrorEnvelope"];
8434
+ };
8435
+ };
8436
+ /** @description HTTP method is not supported. */
8437
+ 405: {
8438
+ headers: {
8439
+ [name: string]: unknown;
8440
+ };
8441
+ content: {
8442
+ "application/json": components["schemas"]["ErrorEnvelope"];
8443
+ };
8444
+ };
8445
+ /** @description Unexpected backend error. */
8446
+ 500: {
8447
+ headers: {
8448
+ [name: string]: unknown;
8449
+ };
8450
+ content: {
8451
+ "application/json": components["schemas"]["ErrorEnvelope"];
8452
+ };
8453
+ };
8454
+ };
8455
+ };
8261
8456
  schemas: {
8262
8457
  parameters: {
8263
8458
  query?: never;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsonbored/metagraphed",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Typed TypeScript client for the metagraph.sh backend API — operational metadata, health, schemas, and interface discovery for Bittensor subnets.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -41,7 +41,10 @@
41
41
  "prepublishOnly": "npm run build"
42
42
  },
43
43
  "devDependencies": {
44
- "tsup": "^8.5.0",
45
- "typescript": "^5.9.0"
44
+ "tsup": "^8.5.1",
45
+ "typescript": "^5.9.3"
46
+ },
47
+ "overrides": {
48
+ "esbuild": "^0.28.1"
46
49
  }
47
50
  }