@gscdump/contracts 4.4.0 → 4.5.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.
@@ -5,6 +5,7 @@ import { HTTP_V1_ERROR_CODES, defineHttpOperation, defineHttpSurface, defineResp
5
5
  import { bingDataQueryV1Schema, bingDataV1Schemas } from "./bing-data.mjs";
6
6
  import { GSCDUMP_REALTIME_ACK_POLICY, GSCDUMP_REALTIME_CLOSE_CODES, GSCDUMP_REALTIME_CONNECTION_POLICY, GSCDUMP_REALTIME_LIMITS, GSCDUMP_REALTIME_PING, GSCDUMP_REALTIME_PONG, GSCDUMP_REALTIME_REPLAY_POLICY, GSCDUMP_REALTIME_SUBPROTOCOL, GSCDUMP_REALTIME_TICKET_AUDIENCE, GSCDUMP_REALTIME_TICKET_ISSUER, GSCDUMP_REALTIME_TICKET_POLICY, GSCDUMP_REALTIME_TICKET_PREFIX, REALTIME_V1_EVENT_SEMANTICS, createRealtimeV1Schemas } from "./realtime.mjs";
7
7
  import { GSCDUMP_V1_ANALYTICS_DIMENSIONS, createGscdumpV1BrowserSchemas } from "./browser.mjs";
8
+ import { indexNowConfigureV1Schema, indexNowConnectionV1Schemas, indexNowSubmissionReceiptV1Schemas, indexNowSubmitV1Schema } from "./indexnow.mjs";
8
9
  import { gscdumpV1OperationRoute, gscdumpV1Surface } from "./route-catalog.mjs";
9
10
  import { z } from "zod";
10
11
  function errorEnvelopeSchemas(codes, publicRequestId) {
@@ -259,6 +260,15 @@ function createGscdumpV1Protocol() {
259
260
  pagination: bingIndexingEvidencePagination.client
260
261
  }), partnerResponseMeta);
261
262
  const bingConnectionResponse = defineSuccessResponse(bingConnectionV1Schemas, partnerResponseMeta);
263
+ const indexNowConnectionResponse = defineSuccessResponse(indexNowConnectionV1Schemas, partnerResponseMeta);
264
+ const indexNowSubmissionResponse = defineSuccessResponse(defineResponseObject({ submissionReceipt: indexNowSubmissionReceiptV1Schemas.producer }, { submissionReceipt: indexNowSubmissionReceiptV1Schemas.client }), partnerResponseMeta);
265
+ const indexNowSubmissionReceiptsResponse = defineSuccessResponse(defineResponseObject({
266
+ submissionReceipts: z.array(indexNowSubmissionReceiptV1Schemas.producer),
267
+ pagination: bingIndexingEvidencePagination.producer
268
+ }, {
269
+ submissionReceipts: z.array(indexNowSubmissionReceiptV1Schemas.client),
270
+ pagination: bingIndexingEvidencePagination.client
271
+ }), partnerResponseMeta);
262
272
  const indexingTransition = defineResponseObject({
263
273
  url: z.string(),
264
274
  field: gscdumpIndexingTransitionFieldSchema,
@@ -1363,6 +1373,339 @@ function createGscdumpV1Protocol() {
1363
1373
  }
1364
1374
  }
1365
1375
  }),
1376
+ getSiteIndexNowConnection: defineHttpOperation({
1377
+ ...gscdumpV1OperationRoute("partner.sites.indexing.indexnow.connection.get"),
1378
+ visibility: "public",
1379
+ semantics: {
1380
+ kind: "query",
1381
+ sideEffects: "none",
1382
+ idempotent: true,
1383
+ retry: "idempotent",
1384
+ readConsistency: "primary"
1385
+ },
1386
+ auth: {
1387
+ credentials: ["user_key", "partner_key"],
1388
+ scopes: ["indexing:read"],
1389
+ ownership: [{
1390
+ credential: "user_key",
1391
+ rule: "authorized_site"
1392
+ }, {
1393
+ credential: "partner_key",
1394
+ rule: "authorized_site"
1395
+ }]
1396
+ },
1397
+ request: {
1398
+ params: z.strictObject({ siteId: realtimeSchemas.publicSiteId }),
1399
+ query: null,
1400
+ headers: requestHeaders,
1401
+ body: null
1402
+ },
1403
+ responses: { 200: indexNowConnectionResponse },
1404
+ errors: partnerSiteErrors,
1405
+ errorResponse: errorEnvelopeSchemas(partnerSiteErrors, realtimeSchemas.publicRequestId),
1406
+ resources: {
1407
+ reads: [{
1408
+ type: "site.indexing",
1409
+ idFrom: "params.siteId"
1410
+ }],
1411
+ changes: []
1412
+ },
1413
+ lifecycle: { introduced: "1.7.0" },
1414
+ docs: {
1415
+ summary: "Get IndexNow connection",
1416
+ description: "Returns the exact Site host and IndexNow key verification state.",
1417
+ tags: ["Indexing"],
1418
+ examples: {
1419
+ request: { params: { siteId: "s_01" } },
1420
+ response: {
1421
+ data: {
1422
+ _tag: "disconnected",
1423
+ host: "example.com"
1424
+ },
1425
+ meta: {
1426
+ requestId: "req_01",
1427
+ surface: "partner",
1428
+ version: "1.0"
1429
+ }
1430
+ }
1431
+ }
1432
+ }
1433
+ }),
1434
+ configureSiteIndexNowConnection: defineHttpOperation({
1435
+ ...gscdumpV1OperationRoute("partner.sites.indexing.indexnow.connection.configure"),
1436
+ visibility: "public",
1437
+ semantics: {
1438
+ kind: "mutation",
1439
+ sideEffects: "state",
1440
+ idempotent: true,
1441
+ retry: "idempotent",
1442
+ readConsistency: null
1443
+ },
1444
+ auth: {
1445
+ credentials: ["user_key", "partner_key"],
1446
+ scopes: ["indexing:write"],
1447
+ ownership: [{
1448
+ credential: "user_key",
1449
+ rule: "authorized_site"
1450
+ }, {
1451
+ credential: "partner_key",
1452
+ rule: "authorized_site"
1453
+ }]
1454
+ },
1455
+ request: {
1456
+ params: z.strictObject({ siteId: realtimeSchemas.publicSiteId }),
1457
+ query: null,
1458
+ headers: requestHeaders,
1459
+ body: indexNowConfigureV1Schema
1460
+ },
1461
+ responses: { 200: indexNowConnectionResponse },
1462
+ errors: partnerSiteErrors,
1463
+ errorResponse: errorEnvelopeSchemas(partnerSiteErrors, realtimeSchemas.publicRequestId),
1464
+ resources: {
1465
+ reads: [{
1466
+ type: "site.indexing",
1467
+ idFrom: "params.siteId"
1468
+ }],
1469
+ changes: [{
1470
+ type: "site.indexing",
1471
+ idFrom: "params.siteId"
1472
+ }]
1473
+ },
1474
+ lifecycle: { introduced: "1.7.0" },
1475
+ docs: {
1476
+ summary: "Configure IndexNow connection",
1477
+ description: "Stores an IndexNow key and key file location for the Site.",
1478
+ tags: ["Indexing"],
1479
+ examples: {
1480
+ request: {
1481
+ params: { siteId: "s_01" },
1482
+ body: { key: "abc12345" }
1483
+ },
1484
+ response: {
1485
+ data: {
1486
+ _tag: "verification-required",
1487
+ host: "example.com",
1488
+ keyLocation: "https://example.com/abc12345.txt",
1489
+ reason: null
1490
+ },
1491
+ meta: {
1492
+ requestId: "req_01",
1493
+ surface: "partner",
1494
+ version: "1.0"
1495
+ }
1496
+ }
1497
+ }
1498
+ }
1499
+ }),
1500
+ verifySiteIndexNowConnection: defineHttpOperation({
1501
+ ...gscdumpV1OperationRoute("partner.sites.indexing.indexnow.connection.verify"),
1502
+ visibility: "public",
1503
+ semantics: {
1504
+ kind: "mutation",
1505
+ sideEffects: "state",
1506
+ idempotent: true,
1507
+ retry: "idempotent",
1508
+ readConsistency: null
1509
+ },
1510
+ auth: {
1511
+ credentials: ["user_key", "partner_key"],
1512
+ scopes: ["indexing:write"],
1513
+ ownership: [{
1514
+ credential: "user_key",
1515
+ rule: "authorized_site"
1516
+ }, {
1517
+ credential: "partner_key",
1518
+ rule: "authorized_site"
1519
+ }]
1520
+ },
1521
+ request: {
1522
+ params: z.strictObject({ siteId: realtimeSchemas.publicSiteId }),
1523
+ query: null,
1524
+ headers: requestHeaders,
1525
+ body: null
1526
+ },
1527
+ responses: { 200: indexNowConnectionResponse },
1528
+ errors: partnerSiteErrors,
1529
+ errorResponse: errorEnvelopeSchemas(partnerSiteErrors, realtimeSchemas.publicRequestId),
1530
+ resources: {
1531
+ reads: [{
1532
+ type: "site.indexing",
1533
+ idFrom: "params.siteId"
1534
+ }],
1535
+ changes: [{
1536
+ type: "site.indexing",
1537
+ idFrom: "params.siteId"
1538
+ }]
1539
+ },
1540
+ lifecycle: { introduced: "1.7.0" },
1541
+ docs: {
1542
+ summary: "Verify IndexNow key file",
1543
+ description: "Checks the key file on the exact Site host.",
1544
+ tags: ["Indexing"],
1545
+ examples: {
1546
+ request: { params: { siteId: "s_01" } },
1547
+ response: {
1548
+ data: {
1549
+ _tag: "connected",
1550
+ host: "example.com",
1551
+ keyLocation: "https://example.com/abc12345.txt",
1552
+ verifiedAt: "2026-09-30T00:00:00.000Z"
1553
+ },
1554
+ meta: {
1555
+ requestId: "req_01",
1556
+ surface: "partner",
1557
+ version: "1.0"
1558
+ }
1559
+ }
1560
+ }
1561
+ }
1562
+ }),
1563
+ submitSiteIndexNow: defineHttpOperation({
1564
+ ...gscdumpV1OperationRoute("partner.sites.indexing.indexnow.submissions.create"),
1565
+ visibility: "public",
1566
+ semantics: {
1567
+ kind: "mutation",
1568
+ sideEffects: "state",
1569
+ idempotent: true,
1570
+ retry: "idempotent",
1571
+ readConsistency: null
1572
+ },
1573
+ auth: {
1574
+ credentials: ["user_key", "partner_key"],
1575
+ scopes: ["indexing:write"],
1576
+ ownership: [{
1577
+ credential: "user_key",
1578
+ rule: "authorized_site"
1579
+ }, {
1580
+ credential: "partner_key",
1581
+ rule: "authorized_site"
1582
+ }]
1583
+ },
1584
+ request: {
1585
+ params: z.strictObject({ siteId: realtimeSchemas.publicSiteId }),
1586
+ query: null,
1587
+ headers: requestHeaders,
1588
+ body: indexNowSubmitV1Schema
1589
+ },
1590
+ responses: { 200: indexNowSubmissionResponse },
1591
+ errors: partnerSiteErrors,
1592
+ errorResponse: errorEnvelopeSchemas(partnerSiteErrors, realtimeSchemas.publicRequestId),
1593
+ resources: {
1594
+ reads: [{
1595
+ type: "site.indexing",
1596
+ idFrom: "params.siteId"
1597
+ }],
1598
+ changes: [{
1599
+ type: "site.indexing",
1600
+ idFrom: "params.siteId"
1601
+ }]
1602
+ },
1603
+ lifecycle: { introduced: "1.7.0" },
1604
+ docs: {
1605
+ summary: "Submit IndexNow change notifications",
1606
+ description: "Queues change notifications and returns a Submission Receipt. Acceptance does not prove indexing.",
1607
+ tags: ["Indexing"],
1608
+ examples: {
1609
+ request: {
1610
+ params: { siteId: "s_01" },
1611
+ body: {
1612
+ urls: ["https://example.com/page"],
1613
+ idempotencyKey: "req_01"
1614
+ }
1615
+ },
1616
+ response: {
1617
+ data: { submissionReceipt: {
1618
+ _tag: "queued",
1619
+ id: "in_01",
1620
+ urls: ["https://example.com/page"],
1621
+ createdAt: "2026-09-30T00:00:00.000Z",
1622
+ updatedAt: "2026-09-30T00:00:00.000Z",
1623
+ attempts: 0,
1624
+ httpStatus: null,
1625
+ reason: null,
1626
+ retryAt: null
1627
+ } },
1628
+ meta: {
1629
+ requestId: "req_01",
1630
+ surface: "partner",
1631
+ version: "1.0"
1632
+ }
1633
+ }
1634
+ }
1635
+ }
1636
+ }),
1637
+ listSiteIndexNowSubmissionReceipts: defineHttpOperation({
1638
+ ...gscdumpV1OperationRoute("partner.sites.indexing.indexnow.submissions.list"),
1639
+ visibility: "public",
1640
+ semantics: {
1641
+ kind: "query",
1642
+ sideEffects: "none",
1643
+ idempotent: true,
1644
+ retry: "idempotent",
1645
+ readConsistency: "primary"
1646
+ },
1647
+ auth: {
1648
+ credentials: ["user_key", "partner_key"],
1649
+ scopes: ["indexing:read"],
1650
+ ownership: [{
1651
+ credential: "user_key",
1652
+ rule: "authorized_site"
1653
+ }, {
1654
+ credential: "partner_key",
1655
+ rule: "authorized_site"
1656
+ }]
1657
+ },
1658
+ request: {
1659
+ params: z.strictObject({ siteId: realtimeSchemas.publicSiteId }),
1660
+ query: z.strictObject({
1661
+ limit: z.coerce.number().int().min(1).max(100).default(25),
1662
+ offset: z.coerce.number().int().min(0).default(0)
1663
+ }),
1664
+ headers: requestHeaders,
1665
+ body: null
1666
+ },
1667
+ responses: { 200: indexNowSubmissionReceiptsResponse },
1668
+ errors: partnerSiteErrors,
1669
+ errorResponse: errorEnvelopeSchemas(partnerSiteErrors, realtimeSchemas.publicRequestId),
1670
+ resources: {
1671
+ reads: [{
1672
+ type: "site.indexing",
1673
+ idFrom: "params.siteId"
1674
+ }],
1675
+ changes: []
1676
+ },
1677
+ lifecycle: { introduced: "1.7.0" },
1678
+ docs: {
1679
+ summary: "List IndexNow Submission Receipts",
1680
+ description: "Returns Submission Receipts for this Site.",
1681
+ tags: ["Indexing"],
1682
+ examples: {
1683
+ request: {
1684
+ params: { siteId: "s_01" },
1685
+ query: {
1686
+ limit: 25,
1687
+ offset: 0
1688
+ }
1689
+ },
1690
+ response: {
1691
+ data: {
1692
+ submissionReceipts: [],
1693
+ pagination: {
1694
+ total: 0,
1695
+ limit: 25,
1696
+ offset: 0,
1697
+ hasMore: false
1698
+ }
1699
+ },
1700
+ meta: {
1701
+ requestId: "req_01",
1702
+ surface: "partner",
1703
+ version: "1.0"
1704
+ }
1705
+ }
1706
+ }
1707
+ }
1708
+ }),
1366
1709
  getSiteBingConnection: defineHttpOperation({
1367
1710
  ...gscdumpV1OperationRoute("partner.sites.indexing.bing.connection.get"),
1368
1711
  visibility: "public",
@@ -4724,6 +5067,9 @@ function createGscdumpV1Protocol() {
4724
5067
  bingIndexingEvidenceQuery,
4725
5068
  bingIndexingEvidenceResponse,
4726
5069
  bingConnectionResponse,
5070
+ indexNowConnectionResponse,
5071
+ indexNowSubmissionResponse,
5072
+ indexNowSubmissionReceiptsResponse,
4727
5073
  lifecycleResponse,
4728
5074
  registerSiteRequest,
4729
5075
  sitemapChangesQuery,
@@ -61,6 +61,31 @@ export declare const GSCDUMP_V1_ROUTE_CATALOG: {
61
61
  readonly method: "GET";
62
62
  readonly template: "/sites/{siteId}/indexing/bing/evidence";
63
63
  };
64
+ readonly 'partner.sites.indexing.indexnow.connection.get': {
65
+ readonly surface: "partner";
66
+ readonly method: "GET";
67
+ readonly template: "/sites/{siteId}/indexing/indexnow/connection";
68
+ };
69
+ readonly 'partner.sites.indexing.indexnow.connection.configure': {
70
+ readonly surface: "partner";
71
+ readonly method: "POST";
72
+ readonly template: "/sites/{siteId}/indexing/indexnow/connection";
73
+ };
74
+ readonly 'partner.sites.indexing.indexnow.connection.verify': {
75
+ readonly surface: "partner";
76
+ readonly method: "POST";
77
+ readonly template: "/sites/{siteId}/indexing/indexnow/connection/verify";
78
+ };
79
+ readonly 'partner.sites.indexing.indexnow.submissions.create': {
80
+ readonly surface: "partner";
81
+ readonly method: "POST";
82
+ readonly template: "/sites/{siteId}/indexing/indexnow/submissions";
83
+ };
84
+ readonly 'partner.sites.indexing.indexnow.submissions.list': {
85
+ readonly surface: "partner";
86
+ readonly method: "GET";
87
+ readonly template: "/sites/{siteId}/indexing/indexnow/submissions";
88
+ };
64
89
  readonly 'partner.sites.indexing.bing.connection.get': {
65
90
  readonly surface: "partner";
66
91
  readonly method: "GET";
@@ -48,6 +48,31 @@ const GSCDUMP_V1_ROUTE_CATALOG = {
48
48
  method: "GET",
49
49
  template: "/sites/{siteId}/indexing/bing/evidence"
50
50
  },
51
+ "partner.sites.indexing.indexnow.connection.get": {
52
+ surface: "partner",
53
+ method: "GET",
54
+ template: "/sites/{siteId}/indexing/indexnow/connection"
55
+ },
56
+ "partner.sites.indexing.indexnow.connection.configure": {
57
+ surface: "partner",
58
+ method: "POST",
59
+ template: "/sites/{siteId}/indexing/indexnow/connection"
60
+ },
61
+ "partner.sites.indexing.indexnow.connection.verify": {
62
+ surface: "partner",
63
+ method: "POST",
64
+ template: "/sites/{siteId}/indexing/indexnow/connection/verify"
65
+ },
66
+ "partner.sites.indexing.indexnow.submissions.create": {
67
+ surface: "partner",
68
+ method: "POST",
69
+ template: "/sites/{siteId}/indexing/indexnow/submissions"
70
+ },
71
+ "partner.sites.indexing.indexnow.submissions.list": {
72
+ surface: "partner",
73
+ method: "GET",
74
+ template: "/sites/{siteId}/indexing/indexnow/submissions"
75
+ },
51
76
  "partner.sites.indexing.bing.connection.get": {
52
77
  surface: "partner",
53
78
  method: "GET",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gscdump/contracts",
3
3
  "type": "module",
4
- "version": "4.4.0",
4
+ "version": "4.5.0",
5
5
  "description": "Shared gscdump.com API, webhook, realtime, and lifecycle contracts.",
6
6
  "author": {
7
7
  "name": "Harlan Wilton",