@gscdump/contracts 1.5.3 → 2.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/analytics.d.mts +2 -2
- package/dist/endpoints.d.mts +0 -216
- package/dist/endpoints.mjs +0 -7
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +2 -2
- package/dist/partner.d.mts +2 -2
- package/dist/routes.d.mts +0 -6
- package/dist/routes.mjs +0 -6
- package/dist/schemas.d.mts +214 -438
- package/dist/schemas.mjs +103 -53
- package/dist/types.d.mts +77 -44
- package/dist/v1/browser.d.mts +30 -0
- package/dist/v1/browser.mjs +8 -0
- package/dist/v1/operations.d.mts +711 -54
- package/dist/v1/operations.mjs +174 -21
- package/package.json +1 -1
package/dist/v1/operations.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { addPartnerTeamMemberSchema, bindPartnerSiteTeamSchema, bindPartnerTeamCatalogResponseSchema, bindPartnerTeamCatalogSchema, builderStateSchema, createPartnerTeamSchema, gscComparisonFilterSchema, gscdumpAnalysisBundleResponseSchema, gscdumpAnalysisPresetSchema, gscdumpAnalysisResponseSchema, gscdumpAvailableSiteSchema, gscdumpCanonicalMismatchesResponseSchema, gscdumpDataDetailResponseSchema, gscdumpDataResponseSchema, gscdumpDeletePartnerUserResponseSchema, gscdumpIndexPercentResponseSchema, gscdumpIndexingDiagnosticsResponseSchema, gscdumpIndexingResponseSchema, gscdumpIndexingTransitionFieldSchema, gscdumpKeywordSparklinesResponseSchema, gscdumpPageTrendResponseSchema, gscdumpQueryTrendResponseSchema, gscdumpSiteRegistrationSchema, gscdumpSitemapChangesResponseSchema, gscdumpSitemapMembershipParamsSchema, gscdumpSitemapMembershipResponseSchema, gscdumpSitemapsResponseSchema, gscdumpTeamRoleSchema, gscdumpTopAssociationResponseSchema, gscdumpUserRegistrationSchema, indexingUrlsResponseSchema, partnerSiteTeamBindingResponseSchema, partnerSitemapActionResponseSchema, partnerSitemapActionSchema, partnerTeamCreatedResponseSchema, partnerTeamDeletedResponseSchema, partnerTeamMemberAddedResponseSchema, partnerTeamMemberRemovedResponseSchema, partnerTeamMemberRoleResponseSchema, partnerTeamMembersResponseSchema, partnerTeamRenamedResponseSchema, registerPartnerSiteSchema, registerPartnerUserSchema, renamePartnerTeamSchema, searchTypeSchema, siteIntIdCrosswalkResponseSchema, sitemapChangesTruncationReasonSchema, teamCatalogRefSchema, updatePartnerUserTokensSchema } from "../schemas.mjs";
|
|
1
|
+
import { addPartnerTeamMemberSchema, bindPartnerSiteTeamSchema, bindPartnerTeamCatalogResponseSchema, bindPartnerTeamCatalogSchema, builderStateSchema, createPartnerTeamSchema, gscComparisonFilterSchema, gscdumpAnalysisBundleResponseSchema, gscdumpAnalysisPresetSchema, gscdumpAnalysisResponseSchema, gscdumpAvailableSiteSchema, gscdumpCanonicalMismatchesResponseSchema, gscdumpDataDetailResponseSchema, gscdumpDataResponseSchema, gscdumpDeletePartnerUserResponseSchema, gscdumpIndexPercentResponseSchema, gscdumpIndexingDiagnosticsResponseSchema, gscdumpIndexingResponseSchema, gscdumpIndexingTransitionFieldSchema, gscdumpKeywordSparklinesResponseSchema, gscdumpPageTrendResponseSchema, gscdumpQueryTrendResponseSchema, gscdumpSiteRegistrationSchema, gscdumpSitemapChangesResponseSchema, gscdumpSitemapExportQuerySchema, gscdumpSitemapExportResponseSchema, gscdumpSitemapMembershipParamsSchema, gscdumpSitemapMembershipResponseSchema, gscdumpSitemapUrlsQuerySchema, gscdumpSitemapUrlsResponseSchema, gscdumpSitemapsResponseSchema, gscdumpTeamRoleSchema, gscdumpTopAssociationResponseSchema, gscdumpUserRegistrationSchema, indexingUrlsResponseSchema, partnerSiteTeamBindingResponseSchema, partnerSitemapActionResponseSchema, partnerSitemapActionSchema, partnerTeamCreatedResponseSchema, partnerTeamDeletedResponseSchema, partnerTeamMemberAddedResponseSchema, partnerTeamMemberRemovedResponseSchema, partnerTeamMemberRoleResponseSchema, partnerTeamMembersResponseSchema, partnerTeamRenamedResponseSchema, registerPartnerSiteSchema, registerPartnerUserSchema, renamePartnerTeamSchema, searchTypeSchema, siteIntIdCrosswalkResponseSchema, sitemapChangesTruncationReasonSchema, teamCatalogRefSchema, updatePartnerUserTokensSchema } from "../schemas.mjs";
|
|
2
2
|
import "./version.mjs";
|
|
3
3
|
import { HTTP_V1_ERROR_CODES, defineHttpOperation, defineHttpSurface, defineResponseObject, defineSuccessResponse } from "./http-core.mjs";
|
|
4
4
|
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";
|
|
@@ -52,7 +52,7 @@ function createGscdumpV1Protocol() {
|
|
|
52
52
|
});
|
|
53
53
|
const requestHeaders = z.strictObject({ "x-request-id": realtimeSchemas.publicRequestId.optional() });
|
|
54
54
|
const errorEnvelope = errorEnvelopeSchemas(HTTP_V1_ERROR_CODES, realtimeSchemas.publicRequestId);
|
|
55
|
-
const { analyticsRowsRequest, analyticsRowsResponse, lifecycleResponse } = browserSchemas;
|
|
55
|
+
const { analyticsRowsRequest, analyticsRowsResponse, keywordEnrichmentRequest, keywordEnrichmentResponse, lifecycleResponse } = browserSchemas;
|
|
56
56
|
const dimensions = GSCDUMP_V1_ANALYTICS_DIMENSIONS;
|
|
57
57
|
const analyticsMeta = defineResponseObject({
|
|
58
58
|
requestId: realtimeSchemas.publicRequestId,
|
|
@@ -495,6 +495,16 @@ function createGscdumpV1Protocol() {
|
|
|
495
495
|
}, partnerResponseMeta);
|
|
496
496
|
const sitemapMembershipRequest = gscdumpSitemapMembershipParamsSchema.strict();
|
|
497
497
|
const sitemapMembershipResponse = defineSuccessResponse(defineResponseObject(gscdumpSitemapMembershipResponseSchema.shape), partnerResponseMeta);
|
|
498
|
+
const sitemapUrlsQuery = gscdumpSitemapUrlsQuerySchema;
|
|
499
|
+
const sitemapUrlsResponse = defineSuccessResponse({
|
|
500
|
+
producer: gscdumpSitemapUrlsResponseSchema,
|
|
501
|
+
client: gscdumpSitemapUrlsResponseSchema
|
|
502
|
+
}, partnerResponseMeta);
|
|
503
|
+
const sitemapExportQuery = gscdumpSitemapExportQuerySchema;
|
|
504
|
+
const sitemapExportResponse = defineSuccessResponse({
|
|
505
|
+
producer: gscdumpSitemapExportResponseSchema,
|
|
506
|
+
client: gscdumpSitemapExportResponseSchema
|
|
507
|
+
}, partnerResponseMeta);
|
|
498
508
|
const createTeamRequest = createPartnerTeamSchema.strict();
|
|
499
509
|
const teamCreatedResponse = defineSuccessResponse(defineResponseObject(partnerTeamCreatedResponseSchema.shape), partnerResponseMeta);
|
|
500
510
|
const renameTeamRequest = renamePartnerTeamSchema.strict();
|
|
@@ -564,12 +574,6 @@ function createGscdumpV1Protocol() {
|
|
|
564
574
|
sources: z.array(z.string()),
|
|
565
575
|
rows: z.array(z.record(z.string(), z.json()))
|
|
566
576
|
}), partnerResponseMeta);
|
|
567
|
-
const enrichKeywordsRequest = z.strictObject({ keywords: z.array(z.string().min(1)).min(1).max(500) });
|
|
568
|
-
const enrichKeywordsResponse = defineSuccessResponse(defineResponseObject({ metrics: z.record(z.string(), z.object({
|
|
569
|
-
difficulty: z.number().nullable(),
|
|
570
|
-
searchVolume: z.number().nullable(),
|
|
571
|
-
cpc: z.number().nullable()
|
|
572
|
-
}).loose()) }), partnerResponseMeta);
|
|
573
577
|
const responseStreamHead = defineResponseObject({
|
|
574
578
|
streamId: realtimeSchemas.streamId,
|
|
575
579
|
sequence: realtimeSchemas.sequence
|
|
@@ -1341,6 +1345,7 @@ function createGscdumpV1Protocol() {
|
|
|
1341
1345
|
sitemaps: [],
|
|
1342
1346
|
history: [],
|
|
1343
1347
|
perSitemapHistory: {},
|
|
1348
|
+
generation: null,
|
|
1344
1349
|
meta: {
|
|
1345
1350
|
siteUrl: "sc-domain:example.com",
|
|
1346
1351
|
gscPropertyUrl: "sc-domain:example.com",
|
|
@@ -1413,9 +1418,12 @@ function createGscdumpV1Protocol() {
|
|
|
1413
1418
|
data: {
|
|
1414
1419
|
added: [],
|
|
1415
1420
|
removed: [],
|
|
1421
|
+
updated: [],
|
|
1422
|
+
generation: null,
|
|
1416
1423
|
summary: {
|
|
1417
1424
|
totalAdded: 0,
|
|
1418
1425
|
totalRemoved: 0,
|
|
1426
|
+
totalUpdated: 0,
|
|
1419
1427
|
period: { days: 28 }
|
|
1420
1428
|
},
|
|
1421
1429
|
completeness: {
|
|
@@ -2755,26 +2763,169 @@ function createGscdumpV1Protocol() {
|
|
|
2755
2763
|
lifecycle: { introduced: "1.3.0" },
|
|
2756
2764
|
docs: {
|
|
2757
2765
|
summary: "Query sitemap membership",
|
|
2758
|
-
description: "
|
|
2766
|
+
description: "Returns generation-pinned present, absent, or unknown evidence for each exact requested URL.",
|
|
2759
2767
|
tags: ["Sitemaps"],
|
|
2760
2768
|
examples: {
|
|
2761
2769
|
request: {
|
|
2762
2770
|
params: { siteId: "s_01" },
|
|
2763
|
-
body: {
|
|
2764
|
-
urls: ["https://example.com/"],
|
|
2765
|
-
maxAgeDays: 30
|
|
2766
|
-
}
|
|
2771
|
+
body: { urls: ["https://example.com/"] }
|
|
2767
2772
|
},
|
|
2768
2773
|
response: {
|
|
2769
2774
|
data: {
|
|
2770
|
-
|
|
2775
|
+
generation: null,
|
|
2776
|
+
evidence: [{
|
|
2777
|
+
_tag: "unknown",
|
|
2778
|
+
url: "https://example.com/",
|
|
2779
|
+
reason: "no_generation"
|
|
2780
|
+
}],
|
|
2771
2781
|
meta: {
|
|
2772
|
-
available: true,
|
|
2773
|
-
reason: null,
|
|
2774
2782
|
requested: 1,
|
|
2775
|
-
checked:
|
|
2776
|
-
matched: 0
|
|
2777
|
-
|
|
2783
|
+
checked: 0,
|
|
2784
|
+
matched: 0
|
|
2785
|
+
}
|
|
2786
|
+
},
|
|
2787
|
+
meta: {
|
|
2788
|
+
requestId: "req_01",
|
|
2789
|
+
surface: "partner",
|
|
2790
|
+
version: "1.0"
|
|
2791
|
+
}
|
|
2792
|
+
}
|
|
2793
|
+
}
|
|
2794
|
+
}
|
|
2795
|
+
}),
|
|
2796
|
+
listSitemapUrls: defineHttpOperation({
|
|
2797
|
+
id: "partner.sites.sitemaps.urls.get",
|
|
2798
|
+
method: "GET",
|
|
2799
|
+
path: "/sites/{siteId}/sitemaps/urls",
|
|
2800
|
+
visibility: "public",
|
|
2801
|
+
semantics: {
|
|
2802
|
+
kind: "query",
|
|
2803
|
+
sideEffects: "none",
|
|
2804
|
+
idempotent: true,
|
|
2805
|
+
retry: "idempotent",
|
|
2806
|
+
readConsistency: "primary"
|
|
2807
|
+
},
|
|
2808
|
+
auth: {
|
|
2809
|
+
credentials: ["user_key", "partner_key"],
|
|
2810
|
+
scopes: ["sitemaps:read"],
|
|
2811
|
+
ownership: [{
|
|
2812
|
+
credential: "user_key",
|
|
2813
|
+
rule: "authorized_site"
|
|
2814
|
+
}, {
|
|
2815
|
+
credential: "partner_key",
|
|
2816
|
+
rule: "authorized_site"
|
|
2817
|
+
}]
|
|
2818
|
+
},
|
|
2819
|
+
request: {
|
|
2820
|
+
params: z.strictObject({ siteId: realtimeSchemas.publicSiteId }),
|
|
2821
|
+
query: sitemapUrlsQuery,
|
|
2822
|
+
headers: requestHeaders,
|
|
2823
|
+
body: null
|
|
2824
|
+
},
|
|
2825
|
+
responses: { 200: sitemapUrlsResponse },
|
|
2826
|
+
errors: partnerSiteErrors,
|
|
2827
|
+
errorResponse: errorEnvelopeSchemas(partnerSiteErrors, realtimeSchemas.publicRequestId),
|
|
2828
|
+
resources: {
|
|
2829
|
+
reads: [{
|
|
2830
|
+
type: "site.sitemaps",
|
|
2831
|
+
idFrom: "params.siteId"
|
|
2832
|
+
}],
|
|
2833
|
+
changes: []
|
|
2834
|
+
},
|
|
2835
|
+
lifecycle: { introduced: "2.0.0" },
|
|
2836
|
+
docs: {
|
|
2837
|
+
summary: "List sitemap URLs",
|
|
2838
|
+
description: "Returns an exact generation-pinned cursor page of sitemap membership and lastmod evidence.",
|
|
2839
|
+
tags: ["Sitemaps"],
|
|
2840
|
+
examples: {
|
|
2841
|
+
request: {
|
|
2842
|
+
params: { siteId: "s_01" },
|
|
2843
|
+
query: { limit: 500 }
|
|
2844
|
+
},
|
|
2845
|
+
response: {
|
|
2846
|
+
data: {
|
|
2847
|
+
generation: {
|
|
2848
|
+
id: "site-01JZ",
|
|
2849
|
+
observedAt: 1753746e6,
|
|
2850
|
+
publishedAt: 1753746000100,
|
|
2851
|
+
completeness: { _tag: "complete" },
|
|
2852
|
+
membershipHistoryAvailableFrom: 1753746e6,
|
|
2853
|
+
legacyImport: { _tag: "none" }
|
|
2854
|
+
},
|
|
2855
|
+
items: [],
|
|
2856
|
+
page: {
|
|
2857
|
+
nextCursor: null,
|
|
2858
|
+
limit: 500
|
|
2859
|
+
}
|
|
2860
|
+
},
|
|
2861
|
+
meta: {
|
|
2862
|
+
requestId: "req_01",
|
|
2863
|
+
surface: "partner",
|
|
2864
|
+
version: "1.0"
|
|
2865
|
+
}
|
|
2866
|
+
}
|
|
2867
|
+
}
|
|
2868
|
+
}
|
|
2869
|
+
}),
|
|
2870
|
+
getSitemapExport: defineHttpOperation({
|
|
2871
|
+
id: "partner.sites.sitemaps.export.get",
|
|
2872
|
+
method: "GET",
|
|
2873
|
+
path: "/sites/{siteId}/sitemaps/export",
|
|
2874
|
+
visibility: "public",
|
|
2875
|
+
semantics: {
|
|
2876
|
+
kind: "query",
|
|
2877
|
+
sideEffects: "none",
|
|
2878
|
+
idempotent: true,
|
|
2879
|
+
retry: "idempotent",
|
|
2880
|
+
readConsistency: "primary"
|
|
2881
|
+
},
|
|
2882
|
+
auth: {
|
|
2883
|
+
credentials: ["user_key", "partner_key"],
|
|
2884
|
+
scopes: ["sitemaps:read"],
|
|
2885
|
+
ownership: [{
|
|
2886
|
+
credential: "user_key",
|
|
2887
|
+
rule: "authorized_site"
|
|
2888
|
+
}, {
|
|
2889
|
+
credential: "partner_key",
|
|
2890
|
+
rule: "authorized_site"
|
|
2891
|
+
}]
|
|
2892
|
+
},
|
|
2893
|
+
request: {
|
|
2894
|
+
params: z.strictObject({ siteId: realtimeSchemas.publicSiteId }),
|
|
2895
|
+
query: sitemapExportQuery,
|
|
2896
|
+
headers: requestHeaders,
|
|
2897
|
+
body: null
|
|
2898
|
+
},
|
|
2899
|
+
responses: { 200: sitemapExportResponse },
|
|
2900
|
+
errors: partnerSiteErrors,
|
|
2901
|
+
errorResponse: errorEnvelopeSchemas(partnerSiteErrors, realtimeSchemas.publicRequestId),
|
|
2902
|
+
resources: {
|
|
2903
|
+
reads: [{
|
|
2904
|
+
type: "site.sitemaps",
|
|
2905
|
+
idFrom: "params.siteId"
|
|
2906
|
+
}],
|
|
2907
|
+
changes: []
|
|
2908
|
+
},
|
|
2909
|
+
lifecycle: { introduced: "2.0.0" },
|
|
2910
|
+
docs: {
|
|
2911
|
+
summary: "Get sitemap bulk export",
|
|
2912
|
+
description: "Returns a generation-pinned expiring URL for the full NDJSON sitemap projection.",
|
|
2913
|
+
tags: ["Sitemaps"],
|
|
2914
|
+
examples: {
|
|
2915
|
+
request: { params: { siteId: "s_01" } },
|
|
2916
|
+
response: {
|
|
2917
|
+
data: {
|
|
2918
|
+
generation: {
|
|
2919
|
+
id: "site-01JZ",
|
|
2920
|
+
observedAt: 1753746e6,
|
|
2921
|
+
publishedAt: 1753746000100,
|
|
2922
|
+
completeness: { _tag: "complete" },
|
|
2923
|
+
membershipHistoryAvailableFrom: 1753746e6,
|
|
2924
|
+
legacyImport: { _tag: "none" }
|
|
2925
|
+
},
|
|
2926
|
+
export: {
|
|
2927
|
+
_tag: "unavailable",
|
|
2928
|
+
reason: "export_unavailable"
|
|
2778
2929
|
}
|
|
2779
2930
|
},
|
|
2780
2931
|
meta: {
|
|
@@ -3807,9 +3958,9 @@ function createGscdumpV1Protocol() {
|
|
|
3807
3958
|
params: null,
|
|
3808
3959
|
query: null,
|
|
3809
3960
|
headers: requestHeaders,
|
|
3810
|
-
body:
|
|
3961
|
+
body: keywordEnrichmentRequest
|
|
3811
3962
|
},
|
|
3812
|
-
responses: { 200:
|
|
3963
|
+
responses: { 200: keywordEnrichmentResponse },
|
|
3813
3964
|
errors: partnerUserErrors,
|
|
3814
3965
|
errorResponse: errorEnvelopeSchemas(partnerUserErrors, realtimeSchemas.publicRequestId),
|
|
3815
3966
|
resources: {
|
|
@@ -4251,6 +4402,8 @@ function createGscdumpV1Protocol() {
|
|
|
4251
4402
|
indexingTransitionsResponse,
|
|
4252
4403
|
indexingUrlsQuery,
|
|
4253
4404
|
indexingUrlsResponse,
|
|
4405
|
+
keywordEnrichmentRequest,
|
|
4406
|
+
keywordEnrichmentResponse,
|
|
4254
4407
|
lifecycleResponse,
|
|
4255
4408
|
registerSiteRequest,
|
|
4256
4409
|
sitemapChangesQuery,
|