diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 2fbefb9..85c3118 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.58.0" + ".": "0.59.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 3cfc09d..f41061c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 117 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel/kernel-3b34d85c005a4058ac1faaea092615af577d12cee6e420f102de57339251672d.yml -openapi_spec_hash: fad386b8e8712e6639ed9689e9dfc070 -config_hash: 0f222358f24700d1811c5d27078a3849 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel/kernel-4bada2a5bdbde93018e5a1b1e80e134acbc5509cfdea94db6e4c5b799eba7b82.yml +openapi_spec_hash: e0d541d480f5663b1e6bd3bb19a0fe61 +config_hash: e0741f8035aea13f71e54e0fdb88eaa4 diff --git a/CHANGELOG.md b/CHANGELOG.md index 065f2bd..d7c8965 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 0.59.0 (2026-05-29) + +Full Changelog: [v0.58.0...v0.59.0](https://github.com/kernel/kernel-go-sdk/compare/v0.58.0...v0.59.0) + +### Features + +* api: surface category field on browser telemetry events ([803734d](https://github.com/kernel/kernel-go-sdk/commit/803734d1179cb14da37173537fa25cb10995fd78)) +* Support Byteful mobile proxies ([d7162b5](https://github.com/kernel/kernel-go-sdk/commit/d7162b5cbb1a39b46cb25ff9a0124a8584d3efaf)) + ## 0.58.0 (2026-05-27) Full Changelog: [v0.57.0...v0.58.0](https://github.com/kernel/kernel-go-sdk/compare/v0.57.0...v0.58.0) diff --git a/README.md b/README.md index 12b1b42..61ad32f 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ Or to pin the version: ```sh -go get -u 'github.com/kernel/kernel-go-sdk@v0.58.0' +go get -u 'github.com/kernel/kernel-go-sdk@v0.59.0' ``` diff --git a/browsertelemetry.go b/browsertelemetry.go index d4e02f8..405df97 100644 --- a/browsertelemetry.go +++ b/browsertelemetry.go @@ -128,6 +128,7 @@ func (r *BrowserCallStackCallFrame) UnmarshalJSON(data []byte) error { // Runtime.exceptionThrown (uncaught exceptions) produces text, line, column, // source_url, and stack_trace. Fields not applicable to the source are absent. type BrowserConsoleErrorEvent struct { + Category constant.Console `json:"category" default:"console"` // Provenance metadata identifying which producer emitted the event. Source BrowserEventSource `json:"source" api:"required"` // Event timestamp in Unix microseconds. @@ -141,6 +142,7 @@ type BrowserConsoleErrorEvent struct { Truncated bool `json:"truncated"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { + Category respjson.Field Source respjson.Field Ts respjson.Field Type respjson.Field @@ -205,6 +207,7 @@ func (r *BrowserConsoleErrorEventData) UnmarshalJSON(data []byte) error { // A browser console log event (console.log, console.info, console.warn, etc.). type BrowserConsoleLogEvent struct { + Category constant.Console `json:"category" default:"console"` // Provenance metadata identifying which producer emitted the event. Source BrowserEventSource `json:"source" api:"required"` // Event timestamp in Unix microseconds. @@ -218,6 +221,7 @@ type BrowserConsoleLogEvent struct { Truncated bool `json:"truncated"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { + Category respjson.Field Source respjson.Field Ts respjson.Field Type respjson.Field @@ -366,6 +370,7 @@ type BrowserHTTPHeaders map[string]any // A browser user click event captured via injected page script. type BrowserInteractionClickEvent struct { + Category constant.Interaction `json:"category" default:"interaction"` // Provenance metadata identifying which producer emitted the event. Source BrowserEventSource `json:"source" api:"required"` // Event timestamp in Unix microseconds. @@ -379,6 +384,7 @@ type BrowserInteractionClickEvent struct { Truncated bool `json:"truncated"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { + Category respjson.Field Source respjson.Field Ts respjson.Field Type respjson.Field @@ -430,6 +436,7 @@ func (r *BrowserInteractionClickEventData) UnmarshalJSON(data []byte) error { // A browser keyboard event captured via injected page script. type BrowserInteractionKeyEvent struct { + Category constant.Interaction `json:"category" default:"interaction"` // Provenance metadata identifying which producer emitted the event. Source BrowserEventSource `json:"source" api:"required"` // Event timestamp in Unix microseconds. @@ -443,6 +450,7 @@ type BrowserInteractionKeyEvent struct { Truncated bool `json:"truncated"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { + Category respjson.Field Source respjson.Field Ts respjson.Field Type respjson.Field @@ -489,6 +497,7 @@ func (r *BrowserInteractionKeyEventData) UnmarshalJSON(data []byte) error { // A browser scroll settled event emitted after scroll position stops changing, // captured via injected page script. type BrowserInteractionScrollSettledEvent struct { + Category constant.Interaction `json:"category" default:"interaction"` // Provenance metadata identifying which producer emitted the event. Source BrowserEventSource `json:"source" api:"required"` // Event timestamp in Unix microseconds. @@ -502,6 +511,7 @@ type BrowserInteractionScrollSettledEvent struct { Truncated bool `json:"truncated"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { + Category respjson.Field Source respjson.Field Ts respjson.Field Type respjson.Field @@ -555,6 +565,7 @@ func (r *BrowserInteractionScrollSettledEventData) UnmarshalJSON(data []byte) er // monitor_reconnected arrives. Treat any in-progress computed state (network_idle, // page_layout_settled) as unreliable until then. type BrowserMonitorDisconnectedEvent struct { + Category constant.System `json:"category" default:"system"` // Provenance metadata identifying which producer emitted the event. Source BrowserEventSource `json:"source" api:"required"` // Event timestamp in Unix microseconds. @@ -565,6 +576,7 @@ type BrowserMonitorDisconnectedEvent struct { Truncated bool `json:"truncated"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { + Category respjson.Field Source respjson.Field Ts respjson.Field Type respjson.Field @@ -602,6 +614,7 @@ func (r *BrowserMonitorDisconnectedEventData) UnmarshalJSON(data []byte) error { // The CDP session could not be initialized. type BrowserMonitorInitFailedEvent struct { + Category constant.System `json:"category" default:"system"` // Provenance metadata identifying which producer emitted the event. Source BrowserEventSource `json:"source" api:"required"` // Event timestamp in Unix microseconds. @@ -612,6 +625,7 @@ type BrowserMonitorInitFailedEvent struct { Truncated bool `json:"truncated"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { + Category respjson.Field Source respjson.Field Ts respjson.Field Type respjson.Field @@ -648,6 +662,7 @@ func (r *BrowserMonitorInitFailedEventData) UnmarshalJSON(data []byte) error { // The CDP connection to Chrome could not be re-established after exhausting all // reconnection attempts. No further telemetry events will arrive on this session. type BrowserMonitorReconnectFailedEvent struct { + Category constant.System `json:"category" default:"system"` // Provenance metadata identifying which producer emitted the event. Source BrowserEventSource `json:"source" api:"required"` // Event timestamp in Unix microseconds. @@ -658,6 +673,7 @@ type BrowserMonitorReconnectFailedEvent struct { Truncated bool `json:"truncated"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { + Category respjson.Field Source respjson.Field Ts respjson.Field Type respjson.Field @@ -698,6 +714,7 @@ func (r *BrowserMonitorReconnectFailedEventData) UnmarshalJSON(data []byte) erro // disconnection. Events emitted during the gap are lost. Computed state is reset, // so navigation and network tracking restart fresh from this point. type BrowserMonitorReconnectedEvent struct { + Category constant.System `json:"category" default:"system"` // Provenance metadata identifying which producer emitted the event. Source BrowserEventSource `json:"source" api:"required"` // Event timestamp in Unix microseconds. @@ -708,6 +725,7 @@ type BrowserMonitorReconnectedEvent struct { Truncated bool `json:"truncated"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { + Category respjson.Field Source respjson.Field Ts respjson.Field Type respjson.Field @@ -743,6 +761,7 @@ func (r *BrowserMonitorReconnectedEventData) UnmarshalJSON(data []byte) error { // A periodic screenshot of the browser viewport. type BrowserMonitorScreenshotEvent struct { + Category constant.System `json:"category" default:"system"` // Provenance metadata identifying which producer emitted the event. Source BrowserEventSource `json:"source" api:"required"` // Event timestamp in Unix microseconds. @@ -753,6 +772,7 @@ type BrowserMonitorScreenshotEvent struct { Truncated bool `json:"truncated"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { + Category respjson.Field Source respjson.Field Ts respjson.Field Type respjson.Field @@ -789,6 +809,7 @@ func (r *BrowserMonitorScreenshotEventData) UnmarshalJSON(data []byte) error { // A browser network idle event emitted after a 500ms quiet period with no // in-flight HTTP requests. type BrowserNetworkIdleEvent struct { + Category constant.Network `json:"category" default:"network"` // Provenance metadata identifying which producer emitted the event. Source BrowserEventSource `json:"source" api:"required"` // Event timestamp in Unix microseconds. @@ -802,6 +823,7 @@ type BrowserNetworkIdleEvent struct { Truncated bool `json:"truncated"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { + Category respjson.Field Source respjson.Field Ts respjson.Field Type respjson.Field @@ -823,6 +845,7 @@ func (r *BrowserNetworkIdleEvent) UnmarshalJSON(data []byte) error { // loader_id, and resource_type are absent; BrowserEventContext is partially // populated in that case. type BrowserNetworkLoadingFailedEvent struct { + Category constant.Network `json:"category" default:"network"` // Provenance metadata identifying which producer emitted the event. Source BrowserEventSource `json:"source" api:"required"` // Event timestamp in Unix microseconds. @@ -836,6 +859,7 @@ type BrowserNetworkLoadingFailedEvent struct { Truncated bool `json:"truncated"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { + Category respjson.Field Source respjson.Field Ts respjson.Field Type respjson.Field @@ -886,6 +910,7 @@ func (r *BrowserNetworkLoadingFailedEventData) UnmarshalJSON(data []byte) error // A browser network request sent event. type BrowserNetworkRequestEvent struct { + Category constant.Network `json:"category" default:"network"` // Provenance metadata identifying which producer emitted the event. Source BrowserEventSource `json:"source" api:"required"` // Event timestamp in Unix microseconds. @@ -899,6 +924,7 @@ type BrowserNetworkRequestEvent struct { Truncated bool `json:"truncated"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { + Category respjson.Field Source respjson.Field Ts respjson.Field Type respjson.Field @@ -966,6 +992,7 @@ func (r *BrowserNetworkRequestEventData) UnmarshalJSON(data []byte) error { // A browser network response received event. Fired after the response body is // fully received, not when headers arrive. type BrowserNetworkResponseEvent struct { + Category constant.Network `json:"category" default:"network"` // Provenance metadata identifying which producer emitted the event. Source BrowserEventSource `json:"source" api:"required"` // Event timestamp in Unix microseconds. @@ -979,6 +1006,7 @@ type BrowserNetworkResponseEvent struct { Truncated bool `json:"truncated"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { + Category respjson.Field Source respjson.Field Ts respjson.Field Type respjson.Field @@ -1041,6 +1069,7 @@ func (r *BrowserNetworkResponseEventData) UnmarshalJSON(data []byte) error { // A browser DOMContentLoaded event (CDP Page.domContentEventFired). type BrowserPageDomContentLoadedEvent struct { + Category constant.Page `json:"category" default:"page"` // Provenance metadata identifying which producer emitted the event. Source BrowserEventSource `json:"source" api:"required"` // Event timestamp in Unix microseconds. @@ -1054,6 +1083,7 @@ type BrowserPageDomContentLoadedEvent struct { Truncated bool `json:"truncated"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { + Category respjson.Field Source respjson.Field Ts respjson.Field Type respjson.Field @@ -1096,6 +1126,7 @@ func (r *BrowserPageDomContentLoadedEventData) UnmarshalJSON(data []byte) error // intervening layout shifts, indicating visual stability. Each layout shift resets // the 1-second timer. type BrowserPageLayoutSettledEvent struct { + Category constant.Page `json:"category" default:"page"` // Provenance metadata identifying which producer emitted the event. Source BrowserEventSource `json:"source" api:"required"` // Event timestamp in Unix microseconds. @@ -1109,6 +1140,7 @@ type BrowserPageLayoutSettledEvent struct { Truncated bool `json:"truncated"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { + Category respjson.Field Source respjson.Field Ts respjson.Field Type respjson.Field @@ -1127,6 +1159,7 @@ func (r *BrowserPageLayoutSettledEvent) UnmarshalJSON(data []byte) error { // A browser cumulative layout shift (CLS) event from the Performance Timeline API. type BrowserPageLayoutShiftEvent struct { + Category constant.Page `json:"category" default:"page"` // Provenance metadata identifying which producer emitted the event. Source BrowserEventSource `json:"source" api:"required"` // Event timestamp in Unix microseconds. @@ -1140,6 +1173,7 @@ type BrowserPageLayoutShiftEvent struct { Truncated bool `json:"truncated"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { + Category respjson.Field Source respjson.Field Ts respjson.Field Type respjson.Field @@ -1212,6 +1246,7 @@ func (r *BrowserPageLayoutShiftEventDataLayoutShiftDetails) UnmarshalJSON(data [ // A browser Largest Contentful Paint (LCP) event from the Performance Timeline // API. type BrowserPageLcpEvent struct { + Category constant.Page `json:"category" default:"page"` // Provenance metadata identifying which producer emitted the event. Source BrowserEventSource `json:"source" api:"required"` // Event timestamp in Unix microseconds. @@ -1225,6 +1260,7 @@ type BrowserPageLcpEvent struct { Truncated bool `json:"truncated"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { + Category respjson.Field Source respjson.Field Ts respjson.Field Type respjson.Field @@ -1304,6 +1340,7 @@ func (r *BrowserPageLcpEventDataLcpDetails) UnmarshalJSON(data []byte) error { // A browser page load event (CDP Page.loadEventFired). type BrowserPageLoadEvent struct { + Category constant.Page `json:"category" default:"page"` // Provenance metadata identifying which producer emitted the event. Source BrowserEventSource `json:"source" api:"required"` // Event timestamp in Unix microseconds. @@ -1317,6 +1354,7 @@ type BrowserPageLoadEvent struct { Truncated bool `json:"truncated"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { + Category respjson.Field Source respjson.Field Ts respjson.Field Type respjson.Field @@ -1359,6 +1397,7 @@ func (r *BrowserPageLoadEventData) UnmarshalJSON(data []byte) error { // context fields inline but not nav_seq, as this event resets the navigation // epoch. type BrowserPageNavigationEvent struct { + Category constant.Page `json:"category" default:"page"` // Provenance metadata identifying which producer emitted the event. Source BrowserEventSource `json:"source" api:"required"` // Event timestamp in Unix microseconds. @@ -1369,6 +1408,7 @@ type BrowserPageNavigationEvent struct { Truncated bool `json:"truncated"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { + Category respjson.Field Source respjson.Field Ts respjson.Field Type respjson.Field @@ -1427,6 +1467,7 @@ func (r *BrowserPageNavigationEventData) UnmarshalJSON(data []byte) error { // the same navigation, indicating the page is loaded and visually stable. // Independent of network_idle; a single pending request does not block it. type BrowserPageNavigationSettledEvent struct { + Category constant.Page `json:"category" default:"page"` // Provenance metadata identifying which producer emitted the event. Source BrowserEventSource `json:"source" api:"required"` // Event timestamp in Unix microseconds. @@ -1440,6 +1481,7 @@ type BrowserPageNavigationSettledEvent struct { Truncated bool `json:"truncated"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { + Category respjson.Field Source respjson.Field Ts respjson.Field Type respjson.Field @@ -1462,6 +1504,7 @@ func (r *BrowserPageNavigationSettledEvent) UnmarshalJSON(data []byte) error { // compose BrowserEventContext. Consumers reading context fields generically should // treat it as a special case. type BrowserPageTabOpenedEvent struct { + Category constant.Page `json:"category" default:"page"` // Provenance metadata identifying which producer emitted the event. Source BrowserEventSource `json:"source" api:"required"` // Event timestamp in Unix microseconds. @@ -1472,6 +1515,7 @@ type BrowserPageTabOpenedEvent struct { Truncated bool `json:"truncated"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { + Category respjson.Field Source respjson.Field Ts respjson.Field Type respjson.Field @@ -1663,6 +1707,7 @@ func (r *BrowserTelemetryConfig) UnmarshalJSON(data []byte) error { // // Use the methods beginning with 'As' to cast the union to one of its variants. type BrowserTelemetryEventUnion struct { + Category string `json:"category"` // This field is from variant [BrowserConsoleLogEvent]. Source BrowserEventSource `json:"source"` Ts int64 `json:"ts"` @@ -1688,6 +1733,7 @@ type BrowserTelemetryEventUnion struct { Data BrowserTelemetryEventUnionData `json:"data"` Truncated bool `json:"truncated"` JSON struct { + Category respjson.Field Source respjson.Field Ts respjson.Field Type respjson.Field diff --git a/internal/version.go b/internal/version.go index b02ed08..271b28c 100644 --- a/internal/version.go +++ b/internal/version.go @@ -2,4 +2,4 @@ package internal -const PackageVersion = "0.58.0" // x-release-please-version +const PackageVersion = "0.59.0" // x-release-please-version diff --git a/proxy.go b/proxy.go index ba58f87..0759f2f 100644 --- a/proxy.go +++ b/proxy.go @@ -167,14 +167,14 @@ const ( // Use the methods beginning with 'As' to cast the union to one of its variants. type ProxyNewResponseConfigUnion struct { Country string `json:"country"` - Asn string `json:"asn"` - City string `json:"city"` + // This field is from variant [ProxyNewResponseConfigResidentialProxyConfig]. + Asn string `json:"asn"` + City string `json:"city"` // This field is from variant [ProxyNewResponseConfigResidentialProxyConfig]. Os string `json:"os"` State string `json:"state"` - Zip string `json:"zip"` - // This field is from variant [ProxyNewResponseConfigMobileProxyConfig]. - Carrier string `json:"carrier"` + // This field is from variant [ProxyNewResponseConfigResidentialProxyConfig]. + Zip string `json:"zip"` // This field is from variant [ProxyNewResponseConfigCustomProxyConfig]. Host string `json:"host"` // This field is from variant [ProxyNewResponseConfigCustomProxyConfig]. @@ -190,7 +190,6 @@ type ProxyNewResponseConfigUnion struct { Os respjson.Field State respjson.Field Zip respjson.Field - Carrier respjson.Field Host respjson.Field Port respjson.Field HasPassword respjson.Field @@ -307,36 +306,17 @@ func (r *ProxyNewResponseConfigResidentialProxyConfig) UnmarshalJSON(data []byte // Configuration for mobile proxies. type ProxyNewResponseConfigMobileProxyConfig struct { - // Autonomous system number. See https://bgp.potaroo.net/cidr/autnums.html - Asn string `json:"asn"` - // Mobile carrier. - // - // Any of "a1", "aircel", "airtel", "att", "celcom", "chinamobile", "claro", - // "comcast", "cox", "digi", "dt", "docomo", "dtac", "etisalat", "idea", - // "kyivstar", "meo", "megafon", "mtn", "mtnza", "mts", "optus", "orange", "qwest", - // "reliance_jio", "robi", "sprint", "telefonica", "telstra", "tmobile", "tigo", - // "tim", "verizon", "vimpelcom", "vodacomza", "vodafone", "vivo", "zain", - // "vivabo", "telenormyanmar", "kcelljsc", "swisscom", "singtel", "asiacell", - // "windit", "cellc", "ooredoo", "drei", "umobile", "cableone", "proximus", - // "tele2", "mobitel", "o2", "bouygues", "free", "sfr", "digicel". - Carrier string `json:"carrier"` - // City name (no spaces, e.g. `sanfrancisco`). If provided, `country` must also be - // provided. + // Provider city alias. Mobile carrier routing can make observed geo vary. City string `json:"city"` // ISO 3166 country code Country string `json:"country"` - // Two-letter state code. + // US-only state code. Mobile carrier routing can make observed geo vary. State string `json:"state"` - // US ZIP code. - Zip string `json:"zip"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { - Asn respjson.Field - Carrier respjson.Field City respjson.Field Country respjson.Field State respjson.Field - Zip respjson.Field ExtraFields map[string]respjson.Field raw string } `json:"-"` @@ -461,14 +441,14 @@ const ( // Use the methods beginning with 'As' to cast the union to one of its variants. type ProxyGetResponseConfigUnion struct { Country string `json:"country"` - Asn string `json:"asn"` - City string `json:"city"` + // This field is from variant [ProxyGetResponseConfigResidentialProxyConfig]. + Asn string `json:"asn"` + City string `json:"city"` // This field is from variant [ProxyGetResponseConfigResidentialProxyConfig]. Os string `json:"os"` State string `json:"state"` - Zip string `json:"zip"` - // This field is from variant [ProxyGetResponseConfigMobileProxyConfig]. - Carrier string `json:"carrier"` + // This field is from variant [ProxyGetResponseConfigResidentialProxyConfig]. + Zip string `json:"zip"` // This field is from variant [ProxyGetResponseConfigCustomProxyConfig]. Host string `json:"host"` // This field is from variant [ProxyGetResponseConfigCustomProxyConfig]. @@ -484,7 +464,6 @@ type ProxyGetResponseConfigUnion struct { Os respjson.Field State respjson.Field Zip respjson.Field - Carrier respjson.Field Host respjson.Field Port respjson.Field HasPassword respjson.Field @@ -601,36 +580,17 @@ func (r *ProxyGetResponseConfigResidentialProxyConfig) UnmarshalJSON(data []byte // Configuration for mobile proxies. type ProxyGetResponseConfigMobileProxyConfig struct { - // Autonomous system number. See https://bgp.potaroo.net/cidr/autnums.html - Asn string `json:"asn"` - // Mobile carrier. - // - // Any of "a1", "aircel", "airtel", "att", "celcom", "chinamobile", "claro", - // "comcast", "cox", "digi", "dt", "docomo", "dtac", "etisalat", "idea", - // "kyivstar", "meo", "megafon", "mtn", "mtnza", "mts", "optus", "orange", "qwest", - // "reliance_jio", "robi", "sprint", "telefonica", "telstra", "tmobile", "tigo", - // "tim", "verizon", "vimpelcom", "vodacomza", "vodafone", "vivo", "zain", - // "vivabo", "telenormyanmar", "kcelljsc", "swisscom", "singtel", "asiacell", - // "windit", "cellc", "ooredoo", "drei", "umobile", "cableone", "proximus", - // "tele2", "mobitel", "o2", "bouygues", "free", "sfr", "digicel". - Carrier string `json:"carrier"` - // City name (no spaces, e.g. `sanfrancisco`). If provided, `country` must also be - // provided. + // Provider city alias. Mobile carrier routing can make observed geo vary. City string `json:"city"` // ISO 3166 country code Country string `json:"country"` - // Two-letter state code. + // US-only state code. Mobile carrier routing can make observed geo vary. State string `json:"state"` - // US ZIP code. - Zip string `json:"zip"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { - Asn respjson.Field - Carrier respjson.Field City respjson.Field Country respjson.Field State respjson.Field - Zip respjson.Field ExtraFields map[string]respjson.Field raw string } `json:"-"` @@ -755,14 +715,14 @@ const ( // Use the methods beginning with 'As' to cast the union to one of its variants. type ProxyListResponseConfigUnion struct { Country string `json:"country"` - Asn string `json:"asn"` - City string `json:"city"` + // This field is from variant [ProxyListResponseConfigResidentialProxyConfig]. + Asn string `json:"asn"` + City string `json:"city"` // This field is from variant [ProxyListResponseConfigResidentialProxyConfig]. Os string `json:"os"` State string `json:"state"` - Zip string `json:"zip"` - // This field is from variant [ProxyListResponseConfigMobileProxyConfig]. - Carrier string `json:"carrier"` + // This field is from variant [ProxyListResponseConfigResidentialProxyConfig]. + Zip string `json:"zip"` // This field is from variant [ProxyListResponseConfigCustomProxyConfig]. Host string `json:"host"` // This field is from variant [ProxyListResponseConfigCustomProxyConfig]. @@ -778,7 +738,6 @@ type ProxyListResponseConfigUnion struct { Os respjson.Field State respjson.Field Zip respjson.Field - Carrier respjson.Field Host respjson.Field Port respjson.Field HasPassword respjson.Field @@ -895,36 +854,17 @@ func (r *ProxyListResponseConfigResidentialProxyConfig) UnmarshalJSON(data []byt // Configuration for mobile proxies. type ProxyListResponseConfigMobileProxyConfig struct { - // Autonomous system number. See https://bgp.potaroo.net/cidr/autnums.html - Asn string `json:"asn"` - // Mobile carrier. - // - // Any of "a1", "aircel", "airtel", "att", "celcom", "chinamobile", "claro", - // "comcast", "cox", "digi", "dt", "docomo", "dtac", "etisalat", "idea", - // "kyivstar", "meo", "megafon", "mtn", "mtnza", "mts", "optus", "orange", "qwest", - // "reliance_jio", "robi", "sprint", "telefonica", "telstra", "tmobile", "tigo", - // "tim", "verizon", "vimpelcom", "vodacomza", "vodafone", "vivo", "zain", - // "vivabo", "telenormyanmar", "kcelljsc", "swisscom", "singtel", "asiacell", - // "windit", "cellc", "ooredoo", "drei", "umobile", "cableone", "proximus", - // "tele2", "mobitel", "o2", "bouygues", "free", "sfr", "digicel". - Carrier string `json:"carrier"` - // City name (no spaces, e.g. `sanfrancisco`). If provided, `country` must also be - // provided. + // Provider city alias. Mobile carrier routing can make observed geo vary. City string `json:"city"` // ISO 3166 country code Country string `json:"country"` - // Two-letter state code. + // US-only state code. Mobile carrier routing can make observed geo vary. State string `json:"state"` - // US ZIP code. - Zip string `json:"zip"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { - Asn respjson.Field - Carrier respjson.Field City respjson.Field Country respjson.Field State respjson.Field - Zip respjson.Field ExtraFields map[string]respjson.Field raw string } `json:"-"` @@ -1049,14 +989,14 @@ const ( // Use the methods beginning with 'As' to cast the union to one of its variants. type ProxyCheckResponseConfigUnion struct { Country string `json:"country"` - Asn string `json:"asn"` - City string `json:"city"` + // This field is from variant [ProxyCheckResponseConfigResidentialProxyConfig]. + Asn string `json:"asn"` + City string `json:"city"` // This field is from variant [ProxyCheckResponseConfigResidentialProxyConfig]. Os string `json:"os"` State string `json:"state"` - Zip string `json:"zip"` - // This field is from variant [ProxyCheckResponseConfigMobileProxyConfig]. - Carrier string `json:"carrier"` + // This field is from variant [ProxyCheckResponseConfigResidentialProxyConfig]. + Zip string `json:"zip"` // This field is from variant [ProxyCheckResponseConfigCustomProxyConfig]. Host string `json:"host"` // This field is from variant [ProxyCheckResponseConfigCustomProxyConfig]. @@ -1072,7 +1012,6 @@ type ProxyCheckResponseConfigUnion struct { Os respjson.Field State respjson.Field Zip respjson.Field - Carrier respjson.Field Host respjson.Field Port respjson.Field HasPassword respjson.Field @@ -1189,36 +1128,17 @@ func (r *ProxyCheckResponseConfigResidentialProxyConfig) UnmarshalJSON(data []by // Configuration for mobile proxies. type ProxyCheckResponseConfigMobileProxyConfig struct { - // Autonomous system number. See https://bgp.potaroo.net/cidr/autnums.html - Asn string `json:"asn"` - // Mobile carrier. - // - // Any of "a1", "aircel", "airtel", "att", "celcom", "chinamobile", "claro", - // "comcast", "cox", "digi", "dt", "docomo", "dtac", "etisalat", "idea", - // "kyivstar", "meo", "megafon", "mtn", "mtnza", "mts", "optus", "orange", "qwest", - // "reliance_jio", "robi", "sprint", "telefonica", "telstra", "tmobile", "tigo", - // "tim", "verizon", "vimpelcom", "vodacomza", "vodafone", "vivo", "zain", - // "vivabo", "telenormyanmar", "kcelljsc", "swisscom", "singtel", "asiacell", - // "windit", "cellc", "ooredoo", "drei", "umobile", "cableone", "proximus", - // "tele2", "mobitel", "o2", "bouygues", "free", "sfr", "digicel". - Carrier string `json:"carrier"` - // City name (no spaces, e.g. `sanfrancisco`). If provided, `country` must also be - // provided. + // Provider city alias. Mobile carrier routing can make observed geo vary. City string `json:"city"` // ISO 3166 country code Country string `json:"country"` - // Two-letter state code. + // US-only state code. Mobile carrier routing can make observed geo vary. State string `json:"state"` - // US ZIP code. - Zip string `json:"zip"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { - Asn respjson.Field - Carrier respjson.Field City respjson.Field Country respjson.Field State respjson.Field - Zip respjson.Field ExtraFields map[string]respjson.Field raw string } `json:"-"` @@ -1350,6 +1270,14 @@ func (u *ProxyNewParamsConfigUnion) asAny() any { return nil } +// Returns a pointer to the underlying variant's property, if present. +func (u ProxyNewParamsConfigUnion) GetAsn() *string { + if vt := u.OfProxyNewsConfigResidentialProxyConfig; vt != nil && vt.Asn.Valid() { + return &vt.Asn.Value + } + return nil +} + // Returns a pointer to the underlying variant's property, if present. func (u ProxyNewParamsConfigUnion) GetOs() *string { if vt := u.OfProxyNewsConfigResidentialProxyConfig; vt != nil { @@ -1359,9 +1287,9 @@ func (u ProxyNewParamsConfigUnion) GetOs() *string { } // Returns a pointer to the underlying variant's property, if present. -func (u ProxyNewParamsConfigUnion) GetCarrier() *string { - if vt := u.OfProxyNewsConfigMobileProxyConfig; vt != nil { - return &vt.Carrier +func (u ProxyNewParamsConfigUnion) GetZip() *string { + if vt := u.OfProxyNewsConfigResidentialProxyConfig; vt != nil && vt.Zip.Valid() { + return &vt.Zip.Value } return nil } @@ -1412,16 +1340,6 @@ func (u ProxyNewParamsConfigUnion) GetCountry() *string { return nil } -// Returns a pointer to the underlying variant's property, if present. -func (u ProxyNewParamsConfigUnion) GetAsn() *string { - if vt := u.OfProxyNewsConfigResidentialProxyConfig; vt != nil && vt.Asn.Valid() { - return &vt.Asn.Value - } else if vt := u.OfProxyNewsConfigMobileProxyConfig; vt != nil && vt.Asn.Valid() { - return &vt.Asn.Value - } - return nil -} - // Returns a pointer to the underlying variant's property, if present. func (u ProxyNewParamsConfigUnion) GetCity() *string { if vt := u.OfProxyNewsConfigResidentialProxyConfig; vt != nil && vt.City.Valid() { @@ -1442,16 +1360,6 @@ func (u ProxyNewParamsConfigUnion) GetState() *string { return nil } -// Returns a pointer to the underlying variant's property, if present. -func (u ProxyNewParamsConfigUnion) GetZip() *string { - if vt := u.OfProxyNewsConfigResidentialProxyConfig; vt != nil && vt.Zip.Valid() { - return &vt.Zip.Value - } else if vt := u.OfProxyNewsConfigMobileProxyConfig; vt != nil && vt.Zip.Valid() { - return &vt.Zip.Value - } - return nil -} - // Configuration for a datacenter proxy. type ProxyNewParamsConfigDatacenterProxyConfig struct { // ISO 3166 country code. Defaults to US if not provided. @@ -1520,28 +1428,12 @@ func init() { // Configuration for mobile proxies. type ProxyNewParamsConfigMobileProxyConfig struct { - // Autonomous system number. See https://bgp.potaroo.net/cidr/autnums.html - Asn param.Opt[string] `json:"asn,omitzero"` - // City name (no spaces, e.g. `sanfrancisco`). If provided, `country` must also be - // provided. + // Provider city alias. Mobile carrier routing can make observed geo vary. City param.Opt[string] `json:"city,omitzero"` // ISO 3166 country code Country param.Opt[string] `json:"country,omitzero"` - // Two-letter state code. + // US-only state code. Mobile carrier routing can make observed geo vary. State param.Opt[string] `json:"state,omitzero"` - // US ZIP code. - Zip param.Opt[string] `json:"zip,omitzero"` - // Mobile carrier. - // - // Any of "a1", "aircel", "airtel", "att", "celcom", "chinamobile", "claro", - // "comcast", "cox", "digi", "dt", "docomo", "dtac", "etisalat", "idea", - // "kyivstar", "meo", "megafon", "mtn", "mtnza", "mts", "optus", "orange", "qwest", - // "reliance_jio", "robi", "sprint", "telefonica", "telstra", "tmobile", "tigo", - // "tim", "verizon", "vimpelcom", "vodacomza", "vodafone", "vivo", "zain", - // "vivabo", "telenormyanmar", "kcelljsc", "swisscom", "singtel", "asiacell", - // "windit", "cellc", "ooredoo", "drei", "umobile", "cableone", "proximus", - // "tele2", "mobitel", "o2", "bouygues", "free", "sfr", "digicel". - Carrier string `json:"carrier,omitzero"` paramObj } @@ -1553,12 +1445,6 @@ func (r *ProxyNewParamsConfigMobileProxyConfig) UnmarshalJSON(data []byte) error return apijson.UnmarshalRoot(data, r) } -func init() { - apijson.RegisterFieldValidator[ProxyNewParamsConfigMobileProxyConfig]( - "carrier", "a1", "aircel", "airtel", "att", "celcom", "chinamobile", "claro", "comcast", "cox", "digi", "dt", "docomo", "dtac", "etisalat", "idea", "kyivstar", "meo", "megafon", "mtn", "mtnza", "mts", "optus", "orange", "qwest", "reliance_jio", "robi", "sprint", "telefonica", "telstra", "tmobile", "tigo", "tim", "verizon", "vimpelcom", "vodacomza", "vodafone", "vivo", "zain", "vivabo", "telenormyanmar", "kcelljsc", "swisscom", "singtel", "asiacell", "windit", "cellc", "ooredoo", "drei", "umobile", "cableone", "proximus", "tele2", "mobitel", "o2", "bouygues", "free", "sfr", "digicel", - ) -} - // Configuration for a custom proxy (e.g., private proxy server). // // The properties Host, Port are required. diff --git a/shared/constant/constants.go b/shared/constant/constants.go index 8188adf..edc6a0a 100644 --- a/shared/constant/constants.go +++ b/shared/constant/constants.go @@ -20,10 +20,12 @@ func ValueOf[T Constant[T]]() T { type AppVersionSummary string // Always "app_version_summary" type AwsUsEast1a string // Always "aws.us-east-1a" +type Console string // Always "console" type ConsoleError string // Always "console_error" type ConsoleLog string // Always "console_log" type DeploymentState string // Always "deployment_state" type Error string // Always "error" +type Interaction string // Always "interaction" type InteractionClick string // Always "interaction_click" type InteractionKey string // Always "interaction_key" type InteractionScrollSettled string // Always "interaction_scroll_settled" @@ -35,10 +37,12 @@ type MonitorInitFailed string // Always "monitor_init_failed" type MonitorReconnectFailed string // Always "monitor_reconnect_failed" type MonitorReconnected string // Always "monitor_reconnected" type MonitorScreenshot string // Always "monitor_screenshot" +type Network string // Always "network" type NetworkIdle string // Always "network_idle" type NetworkLoadingFailed string // Always "network_loading_failed" type NetworkRequest string // Always "network_request" type NetworkResponse string // Always "network_response" +type Page string // Always "page" type PageDomContentLoaded string // Always "page_dom_content_loaded" type PageLayoutSettled string // Always "page_layout_settled" type PageLayoutShift string // Always "page_layout_shift" @@ -48,13 +52,16 @@ type PageNavigation string // Always "page_navigation" type PageNavigationSettled string // Always "page_navigation_settled" type PageTabOpened string // Always "page_tab_opened" type SseHeartbeat string // Always "sse_heartbeat" +type System string // Always "system" func (c AppVersionSummary) Default() AppVersionSummary { return "app_version_summary" } func (c AwsUsEast1a) Default() AwsUsEast1a { return "aws.us-east-1a" } +func (c Console) Default() Console { return "console" } func (c ConsoleError) Default() ConsoleError { return "console_error" } func (c ConsoleLog) Default() ConsoleLog { return "console_log" } func (c DeploymentState) Default() DeploymentState { return "deployment_state" } func (c Error) Default() Error { return "error" } +func (c Interaction) Default() Interaction { return "interaction" } func (c InteractionClick) Default() InteractionClick { return "interaction_click" } func (c InteractionKey) Default() InteractionKey { return "interaction_key" } func (c InteractionScrollSettled) Default() InteractionScrollSettled { @@ -68,10 +75,12 @@ func (c MonitorInitFailed) Default() MonitorInitFailed { return "monit func (c MonitorReconnectFailed) Default() MonitorReconnectFailed { return "monitor_reconnect_failed" } func (c MonitorReconnected) Default() MonitorReconnected { return "monitor_reconnected" } func (c MonitorScreenshot) Default() MonitorScreenshot { return "monitor_screenshot" } +func (c Network) Default() Network { return "network" } func (c NetworkIdle) Default() NetworkIdle { return "network_idle" } func (c NetworkLoadingFailed) Default() NetworkLoadingFailed { return "network_loading_failed" } func (c NetworkRequest) Default() NetworkRequest { return "network_request" } func (c NetworkResponse) Default() NetworkResponse { return "network_response" } +func (c Page) Default() Page { return "page" } func (c PageDomContentLoaded) Default() PageDomContentLoaded { return "page_dom_content_loaded" } func (c PageLayoutSettled) Default() PageLayoutSettled { return "page_layout_settled" } func (c PageLayoutShift) Default() PageLayoutShift { return "page_layout_shift" } @@ -81,13 +90,16 @@ func (c PageNavigation) Default() PageNavigation { return "page_ func (c PageNavigationSettled) Default() PageNavigationSettled { return "page_navigation_settled" } func (c PageTabOpened) Default() PageTabOpened { return "page_tab_opened" } func (c SseHeartbeat) Default() SseHeartbeat { return "sse_heartbeat" } +func (c System) Default() System { return "system" } func (c AppVersionSummary) MarshalJSON() ([]byte, error) { return marshalString(c) } func (c AwsUsEast1a) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c Console) MarshalJSON() ([]byte, error) { return marshalString(c) } func (c ConsoleError) MarshalJSON() ([]byte, error) { return marshalString(c) } func (c ConsoleLog) MarshalJSON() ([]byte, error) { return marshalString(c) } func (c DeploymentState) MarshalJSON() ([]byte, error) { return marshalString(c) } func (c Error) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c Interaction) MarshalJSON() ([]byte, error) { return marshalString(c) } func (c InteractionClick) MarshalJSON() ([]byte, error) { return marshalString(c) } func (c InteractionKey) MarshalJSON() ([]byte, error) { return marshalString(c) } func (c InteractionScrollSettled) MarshalJSON() ([]byte, error) { return marshalString(c) } @@ -99,10 +111,12 @@ func (c MonitorInitFailed) MarshalJSON() ([]byte, error) { return marshal func (c MonitorReconnectFailed) MarshalJSON() ([]byte, error) { return marshalString(c) } func (c MonitorReconnected) MarshalJSON() ([]byte, error) { return marshalString(c) } func (c MonitorScreenshot) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c Network) MarshalJSON() ([]byte, error) { return marshalString(c) } func (c NetworkIdle) MarshalJSON() ([]byte, error) { return marshalString(c) } func (c NetworkLoadingFailed) MarshalJSON() ([]byte, error) { return marshalString(c) } func (c NetworkRequest) MarshalJSON() ([]byte, error) { return marshalString(c) } func (c NetworkResponse) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c Page) MarshalJSON() ([]byte, error) { return marshalString(c) } func (c PageDomContentLoaded) MarshalJSON() ([]byte, error) { return marshalString(c) } func (c PageLayoutSettled) MarshalJSON() ([]byte, error) { return marshalString(c) } func (c PageLayoutShift) MarshalJSON() ([]byte, error) { return marshalString(c) } @@ -112,6 +126,7 @@ func (c PageNavigation) MarshalJSON() ([]byte, error) { return marshal func (c PageNavigationSettled) MarshalJSON() ([]byte, error) { return marshalString(c) } func (c PageTabOpened) MarshalJSON() ([]byte, error) { return marshalString(c) } func (c SseHeartbeat) MarshalJSON() ([]byte, error) { return marshalString(c) } +func (c System) MarshalJSON() ([]byte, error) { return marshalString(c) } type constant[T any] interface { Constant[T]