Skip to content

Commit fa060eb

Browse files
feat(api): api update
1 parent 29115fd commit fa060eb

5 files changed

Lines changed: 242 additions & 2 deletions

File tree

‎.stats.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 29
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-7dbd739a81e6aaf7fc7ef1858606e7d572d309af55082a66431d9292e655e66f.yml
3-
openapi_spec_hash: a6374d5d718a7bd9d3d54fb657e2bd9d
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-6fd8cb15c904d1befd41a85ef8ffa3dfda11e60d560e466857e331e177e0c1e1.yml
3+
openapi_spec_hash: 0f969f518e16e4fc41d00a5229705f5f
44
config_hash: ff35e224e809656528c44163aa41bebd

‎src/context/dev/types/monitor_create_response.py‎

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
"TargetMonitorsPageTarget",
2020
"TargetMonitorsSitemapTarget",
2121
"TargetMonitorsExtractTarget",
22+
"Baseline",
23+
"BaselineMonitorsPageBaseline",
24+
"BaselineMonitorsSitemapBaseline",
25+
"BaselineMonitorsExtractBaseline",
2226
"LastError",
2327
"Webhook",
2428
]
@@ -132,6 +136,54 @@ class TargetMonitorsExtractTarget(BaseModel):
132136
]
133137

134138

139+
class BaselineMonitorsPageBaseline(BaseModel):
140+
"""Current baseline of a `page` monitor: the visible page text as last observed."""
141+
142+
captured_at: datetime
143+
"""When this baseline was last captured or replaced."""
144+
145+
text: str
146+
"""The page's visible text as last observed."""
147+
148+
149+
class BaselineMonitorsSitemapBaseline(BaseModel):
150+
"""
151+
Current baseline of a `sitemap` monitor: the normalized URL set as last observed.
152+
"""
153+
154+
captured_at: datetime
155+
"""When this baseline was last captured or replaced."""
156+
157+
url_count: int
158+
"""Number of URLs in the baseline."""
159+
160+
urls: List[str]
161+
"""The sitemap URLs as last observed (sorted, normalized)."""
162+
163+
164+
class BaselineMonitorsExtractBaseline(BaseModel):
165+
"""
166+
Current baseline of an `extract` monitor: the structured data as last extracted.
167+
"""
168+
169+
captured_at: datetime
170+
"""When this baseline was last captured or replaced."""
171+
172+
data: object
173+
"""
174+
The extracted structured data, matching the monitor's extraction schema (same
175+
shape as the /web/extract endpoint's `data`).
176+
"""
177+
178+
urls_analyzed: List[str]
179+
"""URLs that were analyzed to produce the extracted data."""
180+
181+
182+
Baseline: TypeAlias = Union[
183+
BaselineMonitorsPageBaseline, BaselineMonitorsSitemapBaseline, BaselineMonitorsExtractBaseline, None
184+
]
185+
186+
135187
class LastError(BaseModel):
136188
"""Error from the most recent failed run; null when the last run succeeded."""
137189

@@ -197,6 +249,14 @@ class MonitorCreateResponse(BaseModel):
197249

198250
updated_at: datetime
199251

252+
baseline: Optional[Baseline] = None
253+
"""
254+
Current baseline: the last observed value the monitor compares new snapshots
255+
against. Its shape follows `target.type` (page/sitemap/extract). Only populated
256+
on GET /monitors/{monitor_id}; null until the first baseline run completes (and
257+
after a target or change_detection update, which resets the baseline).
258+
"""
259+
200260
last_change_at: Optional[datetime] = None
201261

202262
last_error: Optional[LastError] = None

‎src/context/dev/types/monitor_list_response.py‎

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
"DataTargetMonitorsPageTarget",
2121
"DataTargetMonitorsSitemapTarget",
2222
"DataTargetMonitorsExtractTarget",
23+
"DataBaseline",
24+
"DataBaselineMonitorsPageBaseline",
25+
"DataBaselineMonitorsSitemapBaseline",
26+
"DataBaselineMonitorsExtractBaseline",
2327
"DataLastError",
2428
"DataWebhook",
2529
]
@@ -133,6 +137,54 @@ class DataTargetMonitorsExtractTarget(BaseModel):
133137
]
134138

135139

140+
class DataBaselineMonitorsPageBaseline(BaseModel):
141+
"""Current baseline of a `page` monitor: the visible page text as last observed."""
142+
143+
captured_at: datetime
144+
"""When this baseline was last captured or replaced."""
145+
146+
text: str
147+
"""The page's visible text as last observed."""
148+
149+
150+
class DataBaselineMonitorsSitemapBaseline(BaseModel):
151+
"""
152+
Current baseline of a `sitemap` monitor: the normalized URL set as last observed.
153+
"""
154+
155+
captured_at: datetime
156+
"""When this baseline was last captured or replaced."""
157+
158+
url_count: int
159+
"""Number of URLs in the baseline."""
160+
161+
urls: List[str]
162+
"""The sitemap URLs as last observed (sorted, normalized)."""
163+
164+
165+
class DataBaselineMonitorsExtractBaseline(BaseModel):
166+
"""
167+
Current baseline of an `extract` monitor: the structured data as last extracted.
168+
"""
169+
170+
captured_at: datetime
171+
"""When this baseline was last captured or replaced."""
172+
173+
data: object
174+
"""
175+
The extracted structured data, matching the monitor's extraction schema (same
176+
shape as the /web/extract endpoint's `data`).
177+
"""
178+
179+
urls_analyzed: List[str]
180+
"""URLs that were analyzed to produce the extracted data."""
181+
182+
183+
DataBaseline: TypeAlias = Union[
184+
DataBaselineMonitorsPageBaseline, DataBaselineMonitorsSitemapBaseline, DataBaselineMonitorsExtractBaseline, None
185+
]
186+
187+
136188
class DataLastError(BaseModel):
137189
"""Error from the most recent failed run; null when the last run succeeded."""
138190

@@ -198,6 +250,14 @@ class Data(BaseModel):
198250

199251
updated_at: datetime
200252

253+
baseline: Optional[DataBaseline] = None
254+
"""
255+
Current baseline: the last observed value the monitor compares new snapshots
256+
against. Its shape follows `target.type` (page/sitemap/extract). Only populated
257+
on GET /monitors/{monitor_id}; null until the first baseline run completes (and
258+
after a target or change_detection update, which resets the baseline).
259+
"""
260+
201261
last_change_at: Optional[datetime] = None
202262

203263
last_error: Optional[DataLastError] = None

‎src/context/dev/types/monitor_retrieve_response.py‎

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
"TargetMonitorsPageTarget",
2020
"TargetMonitorsSitemapTarget",
2121
"TargetMonitorsExtractTarget",
22+
"Baseline",
23+
"BaselineMonitorsPageBaseline",
24+
"BaselineMonitorsSitemapBaseline",
25+
"BaselineMonitorsExtractBaseline",
2226
"LastError",
2327
"Webhook",
2428
]
@@ -132,6 +136,54 @@ class TargetMonitorsExtractTarget(BaseModel):
132136
]
133137

134138

139+
class BaselineMonitorsPageBaseline(BaseModel):
140+
"""Current baseline of a `page` monitor: the visible page text as last observed."""
141+
142+
captured_at: datetime
143+
"""When this baseline was last captured or replaced."""
144+
145+
text: str
146+
"""The page's visible text as last observed."""
147+
148+
149+
class BaselineMonitorsSitemapBaseline(BaseModel):
150+
"""
151+
Current baseline of a `sitemap` monitor: the normalized URL set as last observed.
152+
"""
153+
154+
captured_at: datetime
155+
"""When this baseline was last captured or replaced."""
156+
157+
url_count: int
158+
"""Number of URLs in the baseline."""
159+
160+
urls: List[str]
161+
"""The sitemap URLs as last observed (sorted, normalized)."""
162+
163+
164+
class BaselineMonitorsExtractBaseline(BaseModel):
165+
"""
166+
Current baseline of an `extract` monitor: the structured data as last extracted.
167+
"""
168+
169+
captured_at: datetime
170+
"""When this baseline was last captured or replaced."""
171+
172+
data: object
173+
"""
174+
The extracted structured data, matching the monitor's extraction schema (same
175+
shape as the /web/extract endpoint's `data`).
176+
"""
177+
178+
urls_analyzed: List[str]
179+
"""URLs that were analyzed to produce the extracted data."""
180+
181+
182+
Baseline: TypeAlias = Union[
183+
BaselineMonitorsPageBaseline, BaselineMonitorsSitemapBaseline, BaselineMonitorsExtractBaseline, None
184+
]
185+
186+
135187
class LastError(BaseModel):
136188
"""Error from the most recent failed run; null when the last run succeeded."""
137189

@@ -197,6 +249,14 @@ class MonitorRetrieveResponse(BaseModel):
197249

198250
updated_at: datetime
199251

252+
baseline: Optional[Baseline] = None
253+
"""
254+
Current baseline: the last observed value the monitor compares new snapshots
255+
against. Its shape follows `target.type` (page/sitemap/extract). Only populated
256+
on GET /monitors/{monitor_id}; null until the first baseline run completes (and
257+
after a target or change_detection update, which resets the baseline).
258+
"""
259+
200260
last_change_at: Optional[datetime] = None
201261

202262
last_error: Optional[LastError] = None

‎src/context/dev/types/monitor_update_response.py‎

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
"TargetMonitorsPageTarget",
2020
"TargetMonitorsSitemapTarget",
2121
"TargetMonitorsExtractTarget",
22+
"Baseline",
23+
"BaselineMonitorsPageBaseline",
24+
"BaselineMonitorsSitemapBaseline",
25+
"BaselineMonitorsExtractBaseline",
2226
"LastError",
2327
"Webhook",
2428
]
@@ -132,6 +136,54 @@ class TargetMonitorsExtractTarget(BaseModel):
132136
]
133137

134138

139+
class BaselineMonitorsPageBaseline(BaseModel):
140+
"""Current baseline of a `page` monitor: the visible page text as last observed."""
141+
142+
captured_at: datetime
143+
"""When this baseline was last captured or replaced."""
144+
145+
text: str
146+
"""The page's visible text as last observed."""
147+
148+
149+
class BaselineMonitorsSitemapBaseline(BaseModel):
150+
"""
151+
Current baseline of a `sitemap` monitor: the normalized URL set as last observed.
152+
"""
153+
154+
captured_at: datetime
155+
"""When this baseline was last captured or replaced."""
156+
157+
url_count: int
158+
"""Number of URLs in the baseline."""
159+
160+
urls: List[str]
161+
"""The sitemap URLs as last observed (sorted, normalized)."""
162+
163+
164+
class BaselineMonitorsExtractBaseline(BaseModel):
165+
"""
166+
Current baseline of an `extract` monitor: the structured data as last extracted.
167+
"""
168+
169+
captured_at: datetime
170+
"""When this baseline was last captured or replaced."""
171+
172+
data: object
173+
"""
174+
The extracted structured data, matching the monitor's extraction schema (same
175+
shape as the /web/extract endpoint's `data`).
176+
"""
177+
178+
urls_analyzed: List[str]
179+
"""URLs that were analyzed to produce the extracted data."""
180+
181+
182+
Baseline: TypeAlias = Union[
183+
BaselineMonitorsPageBaseline, BaselineMonitorsSitemapBaseline, BaselineMonitorsExtractBaseline, None
184+
]
185+
186+
135187
class LastError(BaseModel):
136188
"""Error from the most recent failed run; null when the last run succeeded."""
137189

@@ -197,6 +249,14 @@ class MonitorUpdateResponse(BaseModel):
197249

198250
updated_at: datetime
199251

252+
baseline: Optional[Baseline] = None
253+
"""
254+
Current baseline: the last observed value the monitor compares new snapshots
255+
against. Its shape follows `target.type` (page/sitemap/extract). Only populated
256+
on GET /monitors/{monitor_id}; null until the first baseline run completes (and
257+
after a target or change_detection update, which resets the baseline).
258+
"""
259+
200260
last_change_at: Optional[datetime] = None
201261

202262
last_error: Optional[LastError] = None

0 commit comments

Comments
 (0)