Skip to content

Commit 18adfb0

Browse files
feat(api): api update
1 parent cf896af commit 18adfb0

5 files changed

Lines changed: 15 additions & 6 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: 40
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-1c93116e47cab52ea63490f5bca186ed3acda8bbd7f0ce5a320effb9f5b72b1f.yml
3-
openapi_spec_hash: f56204d55bd4bffb6e4d50d6a5d9471a
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-7f75f39699c1298d16691b5a58b1312a229b78288fba6e2de4040ba1422e530f.yml
3+
openapi_spec_hash: b3ad781596e4c52fde918cfaae54a5d4
44
config_hash: 920678668dd2da6f8966fbf1b8fde4e2

‎pkg/cmd/batch_test.go‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func TestBatchSubmit(t *testing.T) {
8282
t,
8383
"--api-key", "string",
8484
"batch", "submit",
85-
"--input", "{data: {format: markdown, urls: [{url: https://example.com/products/anvil, itemId: sku-1, meta: {category: bar}}, {url: https://example.com/products/hammer, itemId: sku-2, meta: {foo: bar}}], options: {country: de, excludeSelectors: [x], includeImages: true, includeLinks: true, includeSelectors: [x], maxAgeMs: 0, pdf: {end: 1, ocr: 'true', shouldParse: 'true', start: 1}, settleAnimations: true, shortenBase64Images: true, useMainContentOnly: true, waitForMs: 0}}, mode: scrape}",
85+
"--input", "{data: {format: markdown, urls: [{url: https://example.com/products/anvil, itemId: sku-1, meta: {category: bar}}, {url: https://example.com/products/hammer, itemId: sku-2, meta: {foo: bar}}], options: {country: de, excludeSelectors: [x], includeHTML: true, includeImages: true, includeLinks: true, includeSelectors: [x], maxAgeMs: 0, pdf: {end: 1, ocr: 'true', shouldParse: 'true', start: 1}, settleAnimations: true, shortenBase64Images: true, useMainContentOnly: true, waitForMs: 0}}, mode: scrape}",
8686
"--tag", "docs",
8787
"--tag", "competitor",
8888
"--webhook-url", "webhookUrl",
@@ -109,6 +109,7 @@ func TestBatchSubmit(t *testing.T) {
109109
" country: de\n" +
110110
" excludeSelectors:\n" +
111111
" - x\n" +
112+
" includeHTML: true\n" +
112113
" includeImages: true\n" +
113114
" includeLinks: true\n" +
114115
" includeSelectors:\n" +

‎pkg/cmd/utility.go‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@ import (
1616

1717
var utilityPrefetch = cli.Command{
1818
Name: "prefetch",
19-
Usage: "Signal that you may fetch brand data soon to improve latency. The type field\nselects what to prefetch (currently only 'brand') and identifier carries exactly\none lookup key: a domain, or an email whose domain is extracted and validated\n(free email providers and disposable email addresses are not allowed).",
19+
Usage: "Signal that you may fetch data soon to improve latency. The type field selects\nwhat to prefetch ('brand' queues a brand data fetch, 'styleguide' queues a\nstyleguide extraction) and identifier carries exactly one lookup key: a domain,\nor an email whose domain is extracted and validated (free email providers and\ndisposable email addresses are not allowed).",
2020
Suggest: true,
2121
Flags: []cli.Flag{
2222
&requestflag.Flag[map[string]any]{
2323
Name: "identifier",
24-
Usage: "Identifier of the brand to prefetch. Provide exactly one of domain or email.",
24+
Usage: "Identifier of the target to prefetch. Provide exactly one of domain or email.",
2525
Required: true,
2626
BodyPath: "identifier",
2727
},
2828
&requestflag.Flag[string]{
2929
Name: "type",
30-
Usage: "What to prefetch. Currently only 'brand' is supported.",
30+
Usage: "What to prefetch: 'brand' warms the brand data cache, 'styleguide' warms the styleguide cache.",
3131
Required: true,
3232
BodyPath: "type",
3333
},

‎pkg/cmd/web.go‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -832,6 +832,12 @@ var webWebScrapeMd = requestflag.WithInnerFlags(cli.Command{
832832
Default: false,
833833
QueryPath: "includeFrames",
834834
},
835+
&requestflag.Flag[any]{
836+
Name: "include-html",
837+
Usage: "When true, the response also includes an `html` field with the page HTML the Markdown was converted from — the same body the Scrape HTML endpoint returns for the equivalent request.",
838+
Default: false,
839+
QueryPath: "includeHTML",
840+
},
835841
&requestflag.Flag[any]{
836842
Name: "include-images",
837843
Usage: "Include image references in Markdown output",

‎pkg/cmd/web_test.go‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,7 @@ func TestWebWebScrapeMd(t *testing.T) {
522522
"--exclude-selector", "[x]",
523523
"--headers", "{foo: J!}",
524524
"--include-frames", "'true'",
525+
"--include-html", "'true'",
525526
"--include-images", "'true'",
526527
"--include-links", "'true'",
527528
"--include-selector", "[x]",
@@ -553,6 +554,7 @@ func TestWebWebScrapeMd(t *testing.T) {
553554
"--exclude-selector", "[x]",
554555
"--headers", "{foo: J!}",
555556
"--include-frames", "'true'",
557+
"--include-html", "'true'",
556558
"--include-images", "'true'",
557559
"--include-links", "'true'",
558560
"--include-selector", "[x]",

0 commit comments

Comments
 (0)