ghostcrawl 2.3.5 → 2.3.7
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.
- checksums.yaml +4 -4
- data/README.md +59 -12
- data/_generated/models/arrival_body.rb +325 -0
- data/_generated/models/arrival_body_profile_id_member1.rb +62 -0
- data/_generated/models/arrival_body_referrer_shape.rb +8 -0
- data/_generated/models/arrival_body_session_id_member1.rb +62 -0
- data/_generated/models/close_popups_body.rb +264 -0
- data/_generated/models/close_popups_body_keep_host_member1.rb +62 -0
- data/_generated/models/close_popups_body_profile_id_member1.rb +62 -0
- data/_generated/models/models.rb +18 -0
- data/_generated/models/mouse_body.rb +264 -0
- data/_generated/models/mouse_body_ops.rb +62 -0
- data/_generated/models/mouse_body_profile_id_member1.rb +62 -0
- data/_generated/models/mouse_body_session_id_member1.rb +62 -0
- data/_generated/models/scrape_request.rb +6 -6
- data/_generated/models/scrape_request_engine.rb +1 -1
- data/_generated/models/session_create_request.rb +3 -3
- data/_generated/models/tab_visit_body.rb +285 -0
- data/_generated/models/tab_visit_body_profile_id_member1.rb +62 -0
- data/_generated/models/tab_visit_body_session_id_member1.rb +62 -0
- data/_generated/models/touch_body.rb +264 -0
- data/_generated/models/touch_body_ops.rb +62 -0
- data/_generated/models/touch_body_profile_id_member1.rb +62 -0
- data/_generated/models/touch_body_session_id_member1.rb +62 -0
- data/_generated/v1/cdp/frame/frame_request_builder.rb +2 -2
- data/_generated/v1/crawl_runs/item/with_run_item_request_builder.rb +3 -3
- data/_generated/v1/page/arrival/arrival.rb +0 -0
- data/_generated/v1/page/arrival/arrival_request_builder.rb +74 -0
- data/_generated/v1/page/close_popups/close_popups.rb +0 -0
- data/_generated/v1/page/close_popups/close_popups_request_builder.rb +74 -0
- data/_generated/v1/page/mouse/mouse.rb +0 -0
- data/_generated/v1/page/mouse/mouse_request_builder.rb +74 -0
- data/_generated/v1/page/page_request_builder.rb +30 -0
- data/_generated/v1/page/tab_visit/tab_visit.rb +0 -0
- data/_generated/v1/page/tab_visit/tab_visit_request_builder.rb +74 -0
- data/_generated/v1/page/touch/touch.rb +0 -0
- data/_generated/v1/page/touch/touch_request_builder.rb +74 -0
- data/_generated/v1/profiles/item/with_name_item_request_builder.rb +2 -2
- data/_generated/v1/schedules/item/runs/runs_request_builder.rb +2 -2
- data/_generated/v1/search/jobs/item/with_job_item_request_builder.rb +2 -2
- data/_generated/v1/sessions/item/takeover/takeover_request_builder.rb +2 -2
- data/_generated/v1/sessions/sessions_request_builder.rb +3 -3
- data/lib/ghostcrawl/client.rb +1001 -46
- data/lib/ghostcrawl/error_codes.rb +26 -25
- data/lib/ghostcrawl/errors.rb +35 -2
- data/lib/ghostcrawl/version.rb +1 -1
- metadata +30 -2
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
require 'microsoft_kiota_abstractions'
|
|
2
|
+
require_relative '../../../ghostcrawl'
|
|
3
|
+
require_relative '../../../models/problem_details'
|
|
4
|
+
require_relative '../../../models/touch_body'
|
|
5
|
+
require_relative '../../v1'
|
|
6
|
+
require_relative '../page'
|
|
7
|
+
require_relative './touch'
|
|
8
|
+
|
|
9
|
+
module GhostCrawl
|
|
10
|
+
module V1
|
|
11
|
+
module Page
|
|
12
|
+
module Touch
|
|
13
|
+
##
|
|
14
|
+
# Builds and executes requests for operations under #v1#page#touch
|
|
15
|
+
class TouchRequestBuilder < MicrosoftKiotaAbstractions::BaseRequestBuilder
|
|
16
|
+
|
|
17
|
+
##
|
|
18
|
+
## Instantiates a new TouchRequestBuilder and sets the default values.
|
|
19
|
+
## @param path_parameters Path parameters for the request
|
|
20
|
+
## @param request_adapter The request adapter to use to execute the requests.
|
|
21
|
+
## @return a void
|
|
22
|
+
##
|
|
23
|
+
def initialize(path_parameters, request_adapter)
|
|
24
|
+
super(path_parameters, request_adapter, "{+baseurl}/v1/page/touch")
|
|
25
|
+
end
|
|
26
|
+
##
|
|
27
|
+
## Replay a touch op-stream (start/move/end taps) natively on the live page of the pinned session, so a mobile identity issues real trusted taps. Engine-agnostic. Tier and ownership checks mirror /v1/page/mouse.
|
|
28
|
+
## @param body The request body
|
|
29
|
+
## @param request_configuration Configuration for the request such as headers, query parameters, and middleware options.
|
|
30
|
+
## @return a Fiber of binary
|
|
31
|
+
##
|
|
32
|
+
def post(body, request_configuration=nil)
|
|
33
|
+
raise StandardError, 'body cannot be null' if body.nil?
|
|
34
|
+
request_info = self.to_post_request_information(
|
|
35
|
+
body, request_configuration
|
|
36
|
+
)
|
|
37
|
+
error_mapping = Hash.new
|
|
38
|
+
error_mapping["422"] = lambda {|pn| GhostCrawl::Models::ProblemDetails.create_from_discriminator_value(pn) }
|
|
39
|
+
return @request_adapter.send_async(request_info, Binary, error_mapping)
|
|
40
|
+
end
|
|
41
|
+
##
|
|
42
|
+
## Replay a touch op-stream (start/move/end taps) natively on the live page of the pinned session, so a mobile identity issues real trusted taps. Engine-agnostic. Tier and ownership checks mirror /v1/page/mouse.
|
|
43
|
+
## @param body The request body
|
|
44
|
+
## @param request_configuration Configuration for the request such as headers, query parameters, and middleware options.
|
|
45
|
+
## @return a request_information
|
|
46
|
+
##
|
|
47
|
+
def to_post_request_information(body, request_configuration=nil)
|
|
48
|
+
raise StandardError, 'body cannot be null' if body.nil?
|
|
49
|
+
request_info = MicrosoftKiotaAbstractions::RequestInformation.new()
|
|
50
|
+
unless request_configuration.nil?
|
|
51
|
+
request_info.add_headers_from_raw_object(request_configuration.headers)
|
|
52
|
+
request_info.add_request_options(request_configuration.options)
|
|
53
|
+
end
|
|
54
|
+
request_info.set_content_from_parsable(@request_adapter, 'application/json', body)
|
|
55
|
+
request_info.url_template = @url_template
|
|
56
|
+
request_info.path_parameters = @path_parameters
|
|
57
|
+
request_info.http_method = :POST
|
|
58
|
+
request_info.headers.try_add('Accept', 'application/json')
|
|
59
|
+
return request_info
|
|
60
|
+
end
|
|
61
|
+
##
|
|
62
|
+
## Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
|
|
63
|
+
## @param raw_url The raw URL to use for the request builder.
|
|
64
|
+
## @return a touch_request_builder
|
|
65
|
+
##
|
|
66
|
+
def with_url(raw_url)
|
|
67
|
+
raise StandardError, 'raw_url cannot be null' if raw_url.nil?
|
|
68
|
+
return TouchRequestBuilder.new(raw_url, @request_adapter)
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
end
|
|
@@ -50,7 +50,7 @@ module GhostCrawl
|
|
|
50
50
|
return @request_adapter.send_async(request_info, Binary, error_mapping)
|
|
51
51
|
end
|
|
52
52
|
##
|
|
53
|
-
## rename and/or rebind storage_state. The identity_id is IMMUTABLE (changing it would silently change the
|
|
53
|
+
## rename and/or rebind storage_state. The identity_id is IMMUTABLE (changing it would silently change the browser identity and break multi-accounting coherence). 404 if absent; 409 on rename collision.
|
|
54
54
|
## @param body PUT /v1/profiles/{name} body, rename and/or rebind storage_state.
|
|
55
55
|
## @param request_configuration Configuration for the request such as headers, query parameters, and middleware options.
|
|
56
56
|
## @return a Fiber of binary
|
|
@@ -99,7 +99,7 @@ module GhostCrawl
|
|
|
99
99
|
return request_info
|
|
100
100
|
end
|
|
101
101
|
##
|
|
102
|
-
## rename and/or rebind storage_state. The identity_id is IMMUTABLE (changing it would silently change the
|
|
102
|
+
## rename and/or rebind storage_state. The identity_id is IMMUTABLE (changing it would silently change the browser identity and break multi-accounting coherence). 404 if absent; 409 on rename collision.
|
|
103
103
|
## @param body PUT /v1/profiles/{name} body, rename and/or rebind storage_state.
|
|
104
104
|
## @param request_configuration Configuration for the request such as headers, query parameters, and middleware options.
|
|
105
105
|
## @return a request_information
|
|
@@ -25,7 +25,7 @@ module GhostCrawl
|
|
|
25
25
|
super(path_parameters, request_adapter, "{+baseurl}/v1/schedules/{schedule_id}/runs")
|
|
26
26
|
end
|
|
27
27
|
##
|
|
28
|
-
##
|
|
28
|
+
## run history derived from last_run_at. Returns a list of run summary objects derived from the schedule's stored last_run_at + last_result_hash. A schedule that has never fired returns an empty list. One that has fired returns a single summary with status='completed'. Status values: 'completed' (ran and produced a hash), 'pending' (never ran). This endpoint allows callers to poll for schedule execution without a separate run-history table, the writes last_run_at on every successful fire.
|
|
29
29
|
## @param request_configuration Configuration for the request such as headers, query parameters, and middleware options.
|
|
30
30
|
## @return a Fiber of binary
|
|
31
31
|
##
|
|
@@ -38,7 +38,7 @@ module GhostCrawl
|
|
|
38
38
|
return @request_adapter.send_async(request_info, Binary, error_mapping)
|
|
39
39
|
end
|
|
40
40
|
##
|
|
41
|
-
##
|
|
41
|
+
## run history derived from last_run_at. Returns a list of run summary objects derived from the schedule's stored last_run_at + last_result_hash. A schedule that has never fired returns an empty list. One that has fired returns a single summary with status='completed'. Status values: 'completed' (ran and produced a hash), 'pending' (never ran). This endpoint allows callers to poll for schedule execution without a separate run-history table, the writes last_run_at on every successful fire.
|
|
42
42
|
## @param request_configuration Configuration for the request such as headers, query parameters, and middleware options.
|
|
43
43
|
## @return a request_information
|
|
44
44
|
##
|
|
@@ -25,7 +25,7 @@ module GhostCrawl
|
|
|
25
25
|
super(path_parameters, request_adapter, "{+baseurl}/v1/search/jobs/{job_id}")
|
|
26
26
|
end
|
|
27
27
|
##
|
|
28
|
-
## 200 + SearchResult when done (real result items = GREEN); 202 {status:"running"} while the extended rotation is still going (carrying ``deadline``/``poll_max_seconds`` so the client loop is bounded); 200 {status:"open", items:[]} on honest exhaustion (challenged/0-result, never a faked GREEN); 200 {status:"temporarily_unavailable"} when the deadline passes with the record still ``running`` (
|
|
28
|
+
## 200 + SearchResult when done (real result items = GREEN); 202 {status:"running"} while the extended rotation is still going (carrying ``deadline``/``poll_max_seconds`` so the client loop is bounded); 200 {status:"open", items:[]} on honest exhaustion (challenged/0-result, never a faked GREEN); 200 {status:"temporarily_unavailable"} when the deadline passes with the record still ``running`` (retryable terminal); 404 if unknown/expired/foreign. Ownership-scoped: a job created by another tenant reads as 404. BOUNDED-TERMINAL CONTRACT (no infinite poll): every poll resolves to a terminal within the stamped deadline, whatever happens server-side. A 404 is TERMINAL, the job expired or is unknown; the query may be retried at a HUMAN pace after Retry-After, but a 404 must NEVER be auto-interpreted as "resubmit the same query in a tight loop" (that is the one behavior that turns a recoverable miss into an infinite loop). See the SDK/MCP wrapper.
|
|
29
29
|
## @param request_configuration Configuration for the request such as headers, query parameters, and middleware options.
|
|
30
30
|
## @return a Fiber of binary
|
|
31
31
|
##
|
|
@@ -38,7 +38,7 @@ module GhostCrawl
|
|
|
38
38
|
return @request_adapter.send_async(request_info, Binary, error_mapping)
|
|
39
39
|
end
|
|
40
40
|
##
|
|
41
|
-
## 200 + SearchResult when done (real result items = GREEN); 202 {status:"running"} while the extended rotation is still going (carrying ``deadline``/``poll_max_seconds`` so the client loop is bounded); 200 {status:"open", items:[]} on honest exhaustion (challenged/0-result, never a faked GREEN); 200 {status:"temporarily_unavailable"} when the deadline passes with the record still ``running`` (
|
|
41
|
+
## 200 + SearchResult when done (real result items = GREEN); 202 {status:"running"} while the extended rotation is still going (carrying ``deadline``/``poll_max_seconds`` so the client loop is bounded); 200 {status:"open", items:[]} on honest exhaustion (challenged/0-result, never a faked GREEN); 200 {status:"temporarily_unavailable"} when the deadline passes with the record still ``running`` (retryable terminal); 404 if unknown/expired/foreign. Ownership-scoped: a job created by another tenant reads as 404. BOUNDED-TERMINAL CONTRACT (no infinite poll): every poll resolves to a terminal within the stamped deadline, whatever happens server-side. A 404 is TERMINAL, the job expired or is unknown; the query may be retried at a HUMAN pace after Retry-After, but a 404 must NEVER be auto-interpreted as "resubmit the same query in a tight loop" (that is the one behavior that turns a recoverable miss into an infinite loop). See the SDK/MCP wrapper.
|
|
42
42
|
## @param request_configuration Configuration for the request such as headers, query parameters, and middleware options.
|
|
43
43
|
## @return a request_information
|
|
44
44
|
##
|
|
@@ -26,7 +26,7 @@ module GhostCrawl
|
|
|
26
26
|
super(path_parameters, request_adapter, "{+baseurl}/v1/sessions/{profile_%2Did}/takeover")
|
|
27
27
|
end
|
|
28
28
|
##
|
|
29
|
-
## POST /v1/sessions/{id}/takeover with {"action": "mint"} delegates to the
|
|
29
|
+
## POST /v1/sessions/{id}/takeover with {"action": "mint"} delegates to the token creation logic (same as /takeover_token). {"action": "release"} delegates to the control flag release logic (same as /takeover_release). with an action discriminator, while the underlying REST surface exposes two dedicated sub-paths. Both entry points share identical auth, tier,
|
|
30
30
|
## @param body The request body
|
|
31
31
|
## @param request_configuration Configuration for the request such as headers, query parameters, and middleware options.
|
|
32
32
|
## @return a Fiber of binary
|
|
@@ -41,7 +41,7 @@ module GhostCrawl
|
|
|
41
41
|
return @request_adapter.send_async(request_info, Binary, error_mapping)
|
|
42
42
|
end
|
|
43
43
|
##
|
|
44
|
-
## POST /v1/sessions/{id}/takeover with {"action": "mint"} delegates to the
|
|
44
|
+
## POST /v1/sessions/{id}/takeover with {"action": "mint"} delegates to the token creation logic (same as /takeover_token). {"action": "release"} delegates to the control flag release logic (same as /takeover_release). with an action discriminator, while the underlying REST surface exposes two dedicated sub-paths. Both entry points share identical auth, tier,
|
|
45
45
|
## @param body The request body
|
|
46
46
|
## @param request_configuration Configuration for the request such as headers, query parameters, and middleware options.
|
|
47
47
|
## @return a request_information
|
|
@@ -39,7 +39,7 @@ module GhostCrawl
|
|
|
39
39
|
super(path_parameters, request_adapter, "{+baseurl}/v1/sessions{?created_at_from*,created_at_to*,cursor*,limit*,tags*}")
|
|
40
40
|
end
|
|
41
41
|
##
|
|
42
|
-
## cursor-paginated listing of active sessions. Sessions
|
|
42
|
+
## cursor-paginated listing of active sessions. Sessions opened by scrape jobs and via the API are unified in the same listing, all sessions for your organisation are visible. Results are strictly; no cross-organisation sessions are returned.
|
|
43
43
|
## @param request_configuration Configuration for the request such as headers, query parameters, and middleware options.
|
|
44
44
|
## @return a Fiber of binary
|
|
45
45
|
##
|
|
@@ -52,7 +52,7 @@ module GhostCrawl
|
|
|
52
52
|
return @request_adapter.send_async(request_info, Binary, error_mapping)
|
|
53
53
|
end
|
|
54
54
|
##
|
|
55
|
-
## cursor-paginated listing of active sessions. Sessions
|
|
55
|
+
## cursor-paginated listing of active sessions. Sessions opened by scrape jobs and via the API are unified in the same listing, all sessions for your organisation are visible. Results are strictly; no cross-organisation sessions are returned.
|
|
56
56
|
## @param request_configuration Configuration for the request such as headers, query parameters, and middleware options.
|
|
57
57
|
## @return a request_information
|
|
58
58
|
##
|
|
@@ -80,7 +80,7 @@ module GhostCrawl
|
|
|
80
80
|
end
|
|
81
81
|
|
|
82
82
|
##
|
|
83
|
-
# cursor-paginated listing of active sessions. Sessions
|
|
83
|
+
# cursor-paginated listing of active sessions. Sessions opened by scrape jobs and via the API are unified in the same listing, all sessions for your organisation are visible. Results are strictly; no cross-organisation sessions are returned.
|
|
84
84
|
class SessionsRequestBuilderGetQueryParameters
|
|
85
85
|
|
|
86
86
|
attr_accessor :created_at_from
|