@expandai/sdk 0.17.2 → 0.19.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/README.md +4 -0
- package/build/dts/Client.d.ts +10 -4
- package/build/dts/Client.d.ts.map +1 -1
- package/build/dts/Error.d.ts.map +1 -1
- package/build/dts/FetchJson.d.ts +171 -149
- package/build/dts/FetchJson.d.ts.map +1 -1
- package/build/dts/Generated.d.ts +512 -452
- package/build/dts/Generated.d.ts.map +1 -1
- package/build/dts/HttpClientHelpers.d.ts +1 -1
- package/build/dts/Internal.d.ts +4 -3
- package/build/dts/Internal.d.ts.map +1 -1
- package/build/dts/Playground.d.ts +8 -4
- package/build/dts/Playground.d.ts.map +1 -1
- package/build/dts/Service.d.ts +91 -85
- package/build/dts/Service.d.ts.map +1 -1
- package/build/dts/index.d.ts +1 -1
- package/build/dts/index.d.ts.map +1 -1
- package/build/esm/Client.js +9 -1
- package/build/esm/Client.js.map +1 -1
- package/build/esm/Error.js.map +1 -1
- package/build/esm/FetchJson.js +8 -12
- package/build/esm/FetchJson.js.map +1 -1
- package/build/esm/Generated.js +155 -84
- package/build/esm/Generated.js.map +1 -1
- package/build/esm/Internal.js +38 -9
- package/build/esm/Internal.js.map +1 -1
- package/build/esm/Playground.js +38 -18
- package/build/esm/Playground.js.map +1 -1
- package/build/esm/Service.js +45 -23
- package/build/esm/Service.js.map +1 -1
- package/build/esm/index.js.map +1 -1
- package/package.json +4 -3
- package/src/Client.ts +15 -2
- package/src/FetchJson.ts +8 -12
- package/src/Generated.ts +217 -111
- package/src/Internal.ts +59 -10
- package/src/Playground.ts +54 -20
- package/src/Service.ts +78 -24
- package/src/index.ts +2 -0
package/src/Generated.ts
CHANGED
|
@@ -27,15 +27,6 @@ export class FetchFetchRequest extends S.Class<FetchFetchRequest>('FetchFetchReq
|
|
|
27
27
|
),
|
|
28
28
|
{ nullable: true },
|
|
29
29
|
),
|
|
30
|
-
summary: S.optionalWith(
|
|
31
|
-
S.Union(
|
|
32
|
-
S.Boolean,
|
|
33
|
-
S.Struct({
|
|
34
|
-
prompt: S.optionalWith(S.String.pipe(S.maxLength(5000)), { nullable: true }),
|
|
35
|
-
}),
|
|
36
|
-
),
|
|
37
|
-
{ nullable: true },
|
|
38
|
-
),
|
|
39
30
|
links: S.optionalWith(
|
|
40
31
|
S.Union(
|
|
41
32
|
S.Boolean,
|
|
@@ -165,10 +156,24 @@ export class FetchFetch403 extends S.Union(
|
|
|
165
156
|
|
|
166
157
|
export class PayloadTooLargeTag extends S.Literal('PayloadTooLarge') {}
|
|
167
158
|
|
|
168
|
-
export class PayloadTooLarge extends S.
|
|
159
|
+
export class PayloadTooLarge extends S.Struct({
|
|
169
160
|
_tag: PayloadTooLargeTag,
|
|
170
161
|
}) {}
|
|
171
162
|
|
|
163
|
+
export class FetchPageTooLargeLimitKind extends S.Literal('transfer_bytes', 'domsnapshot_bytes', 'ast_bytes') {}
|
|
164
|
+
|
|
165
|
+
export class FetchPageTooLargeTag extends S.Literal('FetchPageTooLarge') {}
|
|
166
|
+
|
|
167
|
+
export class FetchPageTooLarge extends S.Struct({
|
|
168
|
+
url: S.String,
|
|
169
|
+
limitKind: S.optionalWith(FetchPageTooLargeLimitKind, { nullable: true }),
|
|
170
|
+
limitBytes: S.optionalWith(S.Number, { nullable: true }),
|
|
171
|
+
measuredBytes: S.optionalWith(S.Number, { nullable: true }),
|
|
172
|
+
_tag: FetchPageTooLargeTag,
|
|
173
|
+
}) {}
|
|
174
|
+
|
|
175
|
+
export class FetchFetch413 extends S.Union(PayloadTooLarge, FetchPageTooLarge) {}
|
|
176
|
+
|
|
172
177
|
export class TooManyRequestsTag extends S.Literal('TooManyRequests') {}
|
|
173
178
|
|
|
174
179
|
export class TooManyRequests extends S.Class<TooManyRequests>('TooManyRequests')({
|
|
@@ -181,12 +186,40 @@ export class InternalError extends S.Class<InternalError>('InternalError')({
|
|
|
181
186
|
_tag: InternalErrorTag,
|
|
182
187
|
}) {}
|
|
183
188
|
|
|
189
|
+
export class FetchNavigationFailedFailureType extends S.Literal('browserInternalDocument') {}
|
|
190
|
+
|
|
191
|
+
export class FetchNavigationFailedTag extends S.Literal('FetchNavigationFailed') {}
|
|
192
|
+
|
|
193
|
+
export class FetchNavigationFailed extends S.Class<FetchNavigationFailed>('FetchNavigationFailed')({
|
|
194
|
+
url: S.String,
|
|
195
|
+
failureType: FetchNavigationFailedFailureType,
|
|
196
|
+
_tag: FetchNavigationFailedTag,
|
|
197
|
+
}) {}
|
|
198
|
+
|
|
184
199
|
export class ServiceUnavailableTag extends S.Literal('ServiceUnavailable') {}
|
|
185
200
|
|
|
186
201
|
export class ServiceUnavailable extends S.Class<ServiceUnavailable>('ServiceUnavailable')({
|
|
202
|
+
message: S.optionalWith(S.String, { nullable: true }),
|
|
203
|
+
requestId: S.optionalWith(S.String, { nullable: true }),
|
|
187
204
|
_tag: ServiceUnavailableTag,
|
|
188
205
|
}) {}
|
|
189
206
|
|
|
207
|
+
export class FetchCaptureTimeoutTag extends S.Literal('FetchCaptureTimeout') {}
|
|
208
|
+
|
|
209
|
+
export class FetchCaptureTimeout extends S.Class<FetchCaptureTimeout>('FetchCaptureTimeout')({
|
|
210
|
+
url: S.String,
|
|
211
|
+
timeoutMs: S.optionalWith(S.Number, { nullable: true }),
|
|
212
|
+
_tag: FetchCaptureTimeoutTag,
|
|
213
|
+
}) {}
|
|
214
|
+
|
|
215
|
+
export class FetchCapacityTimeoutTag extends S.Literal('FetchCapacityTimeout') {}
|
|
216
|
+
|
|
217
|
+
export class FetchCapacityTimeout extends S.Class<FetchCapacityTimeout>('FetchCapacityTimeout')({
|
|
218
|
+
url: S.String,
|
|
219
|
+
timeoutMs: S.optionalWith(S.Number, { nullable: true }),
|
|
220
|
+
_tag: FetchCapacityTimeoutTag,
|
|
221
|
+
}) {}
|
|
222
|
+
|
|
190
223
|
export class FetchFetchJsonParams extends S.Struct({
|
|
191
224
|
include: S.optionalWith(S.String, { nullable: true }),
|
|
192
225
|
}) {}
|
|
@@ -206,15 +239,6 @@ export class FetchFetchJsonRequest extends S.Class<FetchFetchJsonRequest>('Fetch
|
|
|
206
239
|
),
|
|
207
240
|
{ nullable: true },
|
|
208
241
|
),
|
|
209
|
-
summary: S.optionalWith(
|
|
210
|
-
S.Union(
|
|
211
|
-
S.Boolean,
|
|
212
|
-
S.Struct({
|
|
213
|
-
prompt: S.optionalWith(S.String.pipe(S.maxLength(5000)), { nullable: true }),
|
|
214
|
-
}),
|
|
215
|
-
),
|
|
216
|
-
{ nullable: true },
|
|
217
|
-
),
|
|
218
242
|
links: S.optionalWith(
|
|
219
243
|
S.Union(
|
|
220
244
|
S.Boolean,
|
|
@@ -278,7 +302,7 @@ export class FetchObjectModeStateJsonHint extends S.Struct({
|
|
|
278
302
|
|
|
279
303
|
export class FetchObjectModeMarkdownHint extends S.Struct({
|
|
280
304
|
url: S.String,
|
|
281
|
-
moreTokens: S.Number,
|
|
305
|
+
moreTokens: S.optionalWith(S.Number, { nullable: true }),
|
|
282
306
|
}) {}
|
|
283
307
|
|
|
284
308
|
export class FetchObjectModeMeta extends S.Struct({
|
|
@@ -321,6 +345,10 @@ export class FetchObjectModeEvidenceRole extends S.Literal(
|
|
|
321
345
|
'other',
|
|
322
346
|
) {}
|
|
323
347
|
|
|
348
|
+
export class FetchObjectModeEvidenceUrlRedacted extends S.Literal(true) {}
|
|
349
|
+
|
|
350
|
+
export class FetchObjectModeEvidenceUrlOmitted extends S.Literal('invalid', 'unsafe', 'too-long') {}
|
|
351
|
+
|
|
324
352
|
export class FetchObjectModeEvidence extends S.Struct({
|
|
325
353
|
id: S.Number,
|
|
326
354
|
kind: FetchObjectModeEvidenceKind,
|
|
@@ -330,6 +358,8 @@ export class FetchObjectModeEvidence extends S.Struct({
|
|
|
330
358
|
method: S.optionalWith(S.String, { nullable: true }),
|
|
331
359
|
moreTokens: S.optionalWith(S.Number, { nullable: true }),
|
|
332
360
|
keys: S.optionalWith(S.Array(S.String), { nullable: true }),
|
|
361
|
+
urlRedacted: S.optionalWith(FetchObjectModeEvidenceUrlRedacted, { nullable: true }),
|
|
362
|
+
urlOmitted: S.optionalWith(FetchObjectModeEvidenceUrlOmitted, { nullable: true }),
|
|
333
363
|
}) {}
|
|
334
364
|
|
|
335
365
|
export class FetchAssetReferenceKind extends S.Literal('data-url') {}
|
|
@@ -344,33 +374,24 @@ export class FetchAssetReference extends S.Struct({
|
|
|
344
374
|
bytes: S.Number,
|
|
345
375
|
}) {}
|
|
346
376
|
|
|
347
|
-
export class
|
|
348
|
-
|
|
349
|
-
export class CaptureTelemetryInfoSelected extends S.Literal('rust') {}
|
|
350
|
-
|
|
351
|
-
export class CaptureTelemetryInfoActual extends S.Literal('rust') {}
|
|
377
|
+
export class FetchDegradedInfoReason extends S.Literal('pageTooLarge', 'modelInputTooLarge') {}
|
|
352
378
|
|
|
353
|
-
export class
|
|
379
|
+
export class FetchDegradedInfoLimitKind extends S.Literal('domsnapshot_bytes', 'ast_bytes', 'hfc_tokens') {}
|
|
354
380
|
|
|
355
|
-
export class
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
preparedSessionHit: S.optionalWith(S.Boolean, { nullable: true }),
|
|
364
|
-
nativePoolHit: S.optionalWith(S.Boolean, { nullable: true }),
|
|
365
|
-
nativePoolCapacity: S.optionalWith(S.Number, { nullable: true }),
|
|
366
|
-
nativePoolProfile: S.optionalWith(S.String, { nullable: true }),
|
|
367
|
-
poolHit: S.optionalWith(S.Boolean, { nullable: true }),
|
|
368
|
-
connectMs: S.optionalWith(S.Number, { nullable: true }),
|
|
369
|
-
warmConnectionAgeMs: S.optionalWith(S.Number, { nullable: true }),
|
|
370
|
-
iconBackendDecision: S.optionalWith(CaptureTelemetryInfoIconBackendDecision, { nullable: true }),
|
|
381
|
+
export class FetchDegradedInfo extends S.Struct({
|
|
382
|
+
reason: FetchDegradedInfoReason,
|
|
383
|
+
skipped: S.Array(S.Literal('hfc')),
|
|
384
|
+
limitKind: FetchDegradedInfoLimitKind,
|
|
385
|
+
measuredBytes: S.optionalWith(S.Int.pipe(S.greaterThanOrEqualTo(0)), { nullable: true }),
|
|
386
|
+
thresholdBytes: S.optionalWith(S.Int.pipe(S.greaterThanOrEqualTo(0)), { nullable: true }),
|
|
387
|
+
measuredTokens: S.optionalWith(S.Int.pipe(S.greaterThanOrEqualTo(0)), { nullable: true }),
|
|
388
|
+
thresholdTokens: S.optionalWith(S.Int.pipe(S.greaterThanOrEqualTo(0)), { nullable: true }),
|
|
371
389
|
}) {}
|
|
372
390
|
|
|
391
|
+
export class Int extends S.Int {}
|
|
392
|
+
|
|
373
393
|
export class FetchSearchSnippetLocation extends S.Struct({
|
|
394
|
+
evidenceId: S.optionalWith(Int, { nullable: true }),
|
|
374
395
|
markdownBlockId: S.optionalWith(S.String, { nullable: true }),
|
|
375
396
|
nodeIds: S.optionalWith(S.Array(S.Number), { nullable: true }),
|
|
376
397
|
stateJsonSourceId: S.optionalWith(S.Number, { nullable: true }),
|
|
@@ -379,7 +400,7 @@ export class FetchSearchSnippetLocation extends S.Struct({
|
|
|
379
400
|
|
|
380
401
|
export class FetchSearchSourceMetaSource extends S.Literal('markdown', 'appendix', 'statejson') {}
|
|
381
402
|
|
|
382
|
-
export class FetchSearchSourceMetaRanker extends S.Literal('zeroentropy', 'local_lexical') {}
|
|
403
|
+
export class FetchSearchSourceMetaRanker extends S.Literal('zeroentropy', 'mixedbread', 'local_lexical') {}
|
|
383
404
|
|
|
384
405
|
export class FetchSearchSourceMetaFallbackReason extends S.Literal('timeout', 'error') {}
|
|
385
406
|
|
|
@@ -419,7 +440,7 @@ export class FetchObjectModeResult extends S.Class<FetchObjectModeResult>('Fetch
|
|
|
419
440
|
data: S.optionalWith(
|
|
420
441
|
S.Struct({
|
|
421
442
|
assets: S.optionalWith(S.Array(FetchAssetReference), { nullable: true }),
|
|
422
|
-
|
|
443
|
+
degraded: S.optionalWith(FetchDegradedInfo, { nullable: true }),
|
|
423
444
|
search: S.optionalWith(FetchSearchResult, { nullable: true }),
|
|
424
445
|
screenshot: S.optionalWith(
|
|
425
446
|
S.Struct({
|
|
@@ -444,13 +465,7 @@ export class FetchFetchJson403 extends S.Union(
|
|
|
444
465
|
FetchBlocked,
|
|
445
466
|
) {}
|
|
446
467
|
|
|
447
|
-
export class
|
|
448
|
-
|
|
449
|
-
export class IncludeMarkdownConfig extends S.Record({ key: S.String, value: S.Unknown }) {}
|
|
450
|
-
|
|
451
|
-
export class IncludeScreenshotConfig extends S.Struct({
|
|
452
|
-
fullPage: S.optionalWith(S.Boolean, { nullable: true }),
|
|
453
|
-
}) {}
|
|
468
|
+
export class FetchFetchJson413 extends S.Union(PayloadTooLarge, FetchPageTooLarge) {}
|
|
454
469
|
|
|
455
470
|
export class FetchFetchSearchRequest extends S.Class<FetchFetchSearchRequest>('FetchFetchSearchRequest')({
|
|
456
471
|
snapshotId: S.String.pipe(S.minLength(1)),
|
|
@@ -467,18 +482,13 @@ export class FetchFetchSearchRequest extends S.Class<FetchFetchSearchRequest>('F
|
|
|
467
482
|
}),
|
|
468
483
|
include: S.optionalWith(
|
|
469
484
|
S.Struct({
|
|
470
|
-
html: S.optionalWith(S.Union(S.Boolean,
|
|
471
|
-
markdown: S.optionalWith(S.Union(S.Boolean,
|
|
472
|
-
screenshot: S.optionalWith(
|
|
473
|
-
summary: S.optionalWith(
|
|
485
|
+
html: S.optionalWith(S.Union(S.Boolean, S.Record({ key: S.String, value: S.Unknown })), { nullable: true }),
|
|
486
|
+
markdown: S.optionalWith(S.Union(S.Boolean, S.Record({ key: S.String, value: S.Unknown })), { nullable: true }),
|
|
487
|
+
screenshot: S.optionalWith(
|
|
474
488
|
S.Union(
|
|
475
489
|
S.Boolean,
|
|
476
490
|
S.Struct({
|
|
477
|
-
|
|
478
|
-
nullable: true,
|
|
479
|
-
default: () =>
|
|
480
|
-
'You are a helpful assistant that summarizes web page content.\nGiven the markdown content of a web page, provide a clear and concise summary.\nFocus on the main points and key information.\nKeep the summary informative but brief.' as const,
|
|
481
|
-
}),
|
|
491
|
+
fullPage: S.optionalWith(S.Boolean, { nullable: true }),
|
|
482
492
|
}),
|
|
483
493
|
),
|
|
484
494
|
{ nullable: true },
|
|
@@ -523,6 +533,7 @@ export class FetchSnapshotSearchResult extends S.Class<FetchSnapshotSearchResult
|
|
|
523
533
|
response: ResponseInfo,
|
|
524
534
|
search: FetchSearchResult,
|
|
525
535
|
durationMs: S.Number.pipe(S.greaterThanOrEqualTo(0)),
|
|
536
|
+
playground: S.String,
|
|
526
537
|
}) {}
|
|
527
538
|
|
|
528
539
|
export class FetchFetchSearch400 extends S.Union(HttpApiDecodeError, BadRequest) {}
|
|
@@ -544,22 +555,21 @@ export class FetchSnapshotSearchNotFound extends S.Class<FetchSnapshotSearchNotF
|
|
|
544
555
|
_tag: FetchSnapshotSearchNotFoundTag,
|
|
545
556
|
}) {}
|
|
546
557
|
|
|
558
|
+
export class FetchBatchedParams extends S.Struct({
|
|
559
|
+
'x-idempotency-key': S.optionalWith(S.String.pipe(S.minLength(1), S.maxLength(255)), { nullable: true }),
|
|
560
|
+
}) {}
|
|
561
|
+
|
|
547
562
|
export class FetchBatchedRequest extends S.Class<FetchBatchedRequest>('FetchBatchedRequest')({
|
|
548
563
|
urls: S.NonEmptyArray(S.String),
|
|
549
564
|
include: S.optionalWith(
|
|
550
565
|
S.Struct({
|
|
551
|
-
html: S.optionalWith(S.Union(S.Boolean,
|
|
552
|
-
markdown: S.optionalWith(S.Union(S.Boolean,
|
|
553
|
-
screenshot: S.optionalWith(
|
|
554
|
-
summary: S.optionalWith(
|
|
566
|
+
html: S.optionalWith(S.Union(S.Boolean, S.Record({ key: S.String, value: S.Unknown })), { nullable: true }),
|
|
567
|
+
markdown: S.optionalWith(S.Union(S.Boolean, S.Record({ key: S.String, value: S.Unknown })), { nullable: true }),
|
|
568
|
+
screenshot: S.optionalWith(
|
|
555
569
|
S.Union(
|
|
556
570
|
S.Boolean,
|
|
557
571
|
S.Struct({
|
|
558
|
-
|
|
559
|
-
nullable: true,
|
|
560
|
-
default: () =>
|
|
561
|
-
'You are a helpful assistant that summarizes web page content.\nGiven the markdown content of a web page, provide a clear and concise summary.\nFocus on the main points and key information.\nKeep the summary informative but brief.' as const,
|
|
562
|
-
}),
|
|
572
|
+
fullPage: S.optionalWith(S.Boolean, { nullable: true }),
|
|
563
573
|
}),
|
|
564
574
|
),
|
|
565
575
|
{ nullable: true },
|
|
@@ -609,15 +619,41 @@ export class FetchBatched403 extends S.Struct({
|
|
|
609
619
|
_tag: FetchBatched403Tag,
|
|
610
620
|
}) {}
|
|
611
621
|
|
|
622
|
+
export class BatchedIdempotencyConflictReason extends S.Literal('payload_mismatch') {}
|
|
623
|
+
|
|
624
|
+
export class BatchedIdempotencyConflictTag extends S.Literal('BatchedIdempotencyConflict') {}
|
|
625
|
+
|
|
626
|
+
export class BatchedIdempotencyConflict extends S.Class<BatchedIdempotencyConflict>('BatchedIdempotencyConflict')({
|
|
627
|
+
existingRunId: S.String,
|
|
628
|
+
reason: BatchedIdempotencyConflictReason,
|
|
629
|
+
_tag: BatchedIdempotencyConflictTag,
|
|
630
|
+
}) {}
|
|
631
|
+
|
|
612
632
|
export class FetchGetBatchedParams extends S.Struct({
|
|
613
633
|
limit: S.optionalWith(S.String, { nullable: true }),
|
|
614
634
|
offset: S.optionalWith(S.String, { nullable: true }),
|
|
615
635
|
include: S.optionalWith(S.String, { nullable: true }),
|
|
616
636
|
}) {}
|
|
617
637
|
|
|
618
|
-
export class BatchedStatusStatus extends S.Literal(
|
|
638
|
+
export class BatchedStatusStatus extends S.Literal(
|
|
639
|
+
'QUEUED',
|
|
640
|
+
'RUNNING',
|
|
641
|
+
'CANCELLING',
|
|
642
|
+
'COMPLETED',
|
|
643
|
+
'FAILED',
|
|
644
|
+
'CANCELLED',
|
|
645
|
+
) {}
|
|
646
|
+
|
|
647
|
+
export class BatchedStatusBatchedStatus extends S.Literal(
|
|
648
|
+
'QUEUED',
|
|
649
|
+
'RUNNING',
|
|
650
|
+
'CANCELLING',
|
|
651
|
+
'COMPLETED',
|
|
652
|
+
'FAILED',
|
|
653
|
+
'CANCELLED',
|
|
654
|
+
) {}
|
|
619
655
|
|
|
620
|
-
export class
|
|
656
|
+
export class BatchedFetchItemStatus extends S.Literal('QUEUED', 'RUNNING', 'SUCCEEDED', 'FAILED', 'CANCELLED') {}
|
|
621
657
|
|
|
622
658
|
export class IconMeta extends S.Struct({
|
|
623
659
|
href: S.String.pipe(S.minLength(1)),
|
|
@@ -681,6 +717,38 @@ export class RenderEnginesInfo extends S.Struct({
|
|
|
681
717
|
tree: S.optionalWith(RenderEnginesInfoTree, { nullable: true }),
|
|
682
718
|
}) {}
|
|
683
719
|
|
|
720
|
+
export class BatchedFetchItem extends S.Struct({
|
|
721
|
+
status: BatchedFetchItemStatus,
|
|
722
|
+
data: S.optionalWith(
|
|
723
|
+
S.Struct({
|
|
724
|
+
response: ResponseInfo,
|
|
725
|
+
meta: S.optionalWith(PageMeta, { nullable: true }),
|
|
726
|
+
json: S.optionalWith(S.Array(S.Struct({})), { nullable: true }),
|
|
727
|
+
snapshotId: S.optionalWith(NonEmptyString, { nullable: true }),
|
|
728
|
+
html: S.optionalWith(S.String.pipe(S.minLength(1)), { nullable: true }),
|
|
729
|
+
markdown: S.optionalWith(S.String.pipe(S.minLength(1)), { nullable: true }),
|
|
730
|
+
screenshot: S.optionalWith(
|
|
731
|
+
S.Struct({
|
|
732
|
+
url: S.String,
|
|
733
|
+
fullPage: S.Boolean,
|
|
734
|
+
}),
|
|
735
|
+
{ nullable: true },
|
|
736
|
+
),
|
|
737
|
+
search: S.optionalWith(FetchSearchResult, { nullable: true }),
|
|
738
|
+
links: S.optionalWith(S.Array(FetchLink), { nullable: true }),
|
|
739
|
+
appendix: S.optionalWith(S.String.pipe(S.minLength(1)), { nullable: true }),
|
|
740
|
+
renderEngines: S.optionalWith(RenderEnginesInfo, { nullable: true }),
|
|
741
|
+
assets: S.optionalWith(S.Array(FetchAssetReference), { nullable: true }),
|
|
742
|
+
degraded: S.optionalWith(FetchDegradedInfo, { nullable: true }),
|
|
743
|
+
}),
|
|
744
|
+
{ nullable: true },
|
|
745
|
+
),
|
|
746
|
+
error: S.optionalWith(
|
|
747
|
+
S.Union(FetchBlocked, FetchPageTooLarge, FetchNavigationFailed, FetchCaptureTimeout, FetchCapacityTimeout),
|
|
748
|
+
{ nullable: true },
|
|
749
|
+
),
|
|
750
|
+
}) {}
|
|
751
|
+
|
|
684
752
|
export class PaginationMeta extends S.Struct({
|
|
685
753
|
total: S.Number,
|
|
686
754
|
limit: S.Number,
|
|
@@ -693,38 +761,7 @@ export class BatchedStatus extends S.Class<BatchedStatus>('BatchedStatus')({
|
|
|
693
761
|
status: BatchedStatusStatus,
|
|
694
762
|
batchedStatus: BatchedStatusBatchedStatus,
|
|
695
763
|
totalUrls: S.Number,
|
|
696
|
-
results: S.Array(
|
|
697
|
-
S.Struct({
|
|
698
|
-
data: S.Struct({
|
|
699
|
-
response: ResponseInfo,
|
|
700
|
-
meta: S.optionalWith(PageMeta, { nullable: true }),
|
|
701
|
-
json: S.optionalWith(S.Array(S.Struct({})), { nullable: true }),
|
|
702
|
-
snapshotId: S.optionalWith(NonEmptyString, { nullable: true }),
|
|
703
|
-
html: S.optionalWith(S.String.pipe(S.minLength(1)), { nullable: true }),
|
|
704
|
-
markdown: S.optionalWith(S.String.pipe(S.minLength(1)), { nullable: true }),
|
|
705
|
-
screenshot: S.optionalWith(
|
|
706
|
-
S.Struct({
|
|
707
|
-
url: S.String,
|
|
708
|
-
fullPage: S.Boolean,
|
|
709
|
-
}),
|
|
710
|
-
{ nullable: true },
|
|
711
|
-
),
|
|
712
|
-
summary: S.optionalWith(S.String.pipe(S.minLength(1)), { nullable: true }),
|
|
713
|
-
search: S.optionalWith(FetchSearchResult, { nullable: true }),
|
|
714
|
-
links: S.optionalWith(S.Array(FetchLink), { nullable: true }),
|
|
715
|
-
appendix: S.optionalWith(S.String.pipe(S.minLength(1)), { nullable: true }),
|
|
716
|
-
renderEngines: S.optionalWith(RenderEnginesInfo, { nullable: true }),
|
|
717
|
-
captureTelemetry: S.optionalWith(CaptureTelemetryInfo, { nullable: true }),
|
|
718
|
-
assets: S.optionalWith(S.Array(FetchAssetReference), { nullable: true }),
|
|
719
|
-
blocked: S.optionalWith(
|
|
720
|
-
S.Struct({
|
|
721
|
-
blockedType: S.optionalWith(S.String, { nullable: true }),
|
|
722
|
-
}),
|
|
723
|
-
{ nullable: true },
|
|
724
|
-
),
|
|
725
|
-
}),
|
|
726
|
-
}),
|
|
727
|
-
),
|
|
764
|
+
results: S.Array(BatchedFetchItem),
|
|
728
765
|
pagination: PaginationMeta,
|
|
729
766
|
}) {}
|
|
730
767
|
|
|
@@ -737,6 +774,23 @@ export class BatchedIncludeUnsupported extends S.Struct({
|
|
|
737
774
|
|
|
738
775
|
export class FetchGetBatched400 extends S.Union(HttpApiDecodeError, BatchedIncludeUnsupported) {}
|
|
739
776
|
|
|
777
|
+
export class BatchedCancellationStatus extends S.Literal('CANCELLING', 'CANCELLED') {}
|
|
778
|
+
|
|
779
|
+
export class BatchedCancellation extends S.Class<BatchedCancellation>('BatchedCancellation')({
|
|
780
|
+
id: S.String,
|
|
781
|
+
status: BatchedCancellationStatus,
|
|
782
|
+
}) {}
|
|
783
|
+
|
|
784
|
+
export class BatchedCancellationConflictStatus extends S.Literal('COMPLETED', 'FAILED') {}
|
|
785
|
+
|
|
786
|
+
export class BatchedCancellationConflictTag extends S.Literal('BatchedCancellationConflict') {}
|
|
787
|
+
|
|
788
|
+
export class BatchedCancellationConflict extends S.Class<BatchedCancellationConflict>('BatchedCancellationConflict')({
|
|
789
|
+
id: S.String,
|
|
790
|
+
status: BatchedCancellationConflictStatus,
|
|
791
|
+
_tag: BatchedCancellationConflictTag,
|
|
792
|
+
}) {}
|
|
793
|
+
|
|
740
794
|
export const make = (
|
|
741
795
|
httpClient: HttpClient.HttpClient,
|
|
742
796
|
options: {
|
|
@@ -776,10 +830,13 @@ export const make = (
|
|
|
776
830
|
'400': (r) => decodeError(r, FetchFetch400),
|
|
777
831
|
'401': (r) => decodeError(r, AuthFailed),
|
|
778
832
|
'403': (r) => decodeError(r, FetchFetch403),
|
|
779
|
-
'413': (r) => decodeError(r,
|
|
833
|
+
'413': (r) => decodeError(r, FetchFetch413),
|
|
780
834
|
'429': (r) => decodeError(r, TooManyRequests),
|
|
781
835
|
'500': (r) => decodeError(r, InternalError),
|
|
836
|
+
'502': (r) => decodeError(r, FetchNavigationFailed),
|
|
782
837
|
'503': (r) => decodeError(r, ServiceUnavailable),
|
|
838
|
+
'504': (r) => decodeError(r, FetchCaptureTimeout),
|
|
839
|
+
'529': (r) => decodeError(r, FetchCapacityTimeout),
|
|
783
840
|
orElse: (response) => unexpectedStatus(request, response),
|
|
784
841
|
}),
|
|
785
842
|
),
|
|
@@ -799,10 +856,13 @@ export const make = (
|
|
|
799
856
|
'400': (r) => decodeError(r, FetchFetchJson400),
|
|
800
857
|
'401': (r) => decodeError(r, AuthFailed),
|
|
801
858
|
'403': (r) => decodeError(r, FetchFetchJson403),
|
|
802
|
-
'413': (r) => decodeError(r,
|
|
859
|
+
'413': (r) => decodeError(r, FetchFetchJson413),
|
|
803
860
|
'429': (r) => decodeError(r, TooManyRequests),
|
|
804
861
|
'500': (r) => decodeError(r, InternalError),
|
|
862
|
+
'502': (r) => decodeError(r, FetchNavigationFailed),
|
|
805
863
|
'503': (r) => decodeError(r, ServiceUnavailable),
|
|
864
|
+
'504': (r) => decodeError(r, FetchCaptureTimeout),
|
|
865
|
+
'529': (r) => decodeError(r, FetchCapacityTimeout),
|
|
806
866
|
orElse: (response) => unexpectedStatus(request, response),
|
|
807
867
|
}),
|
|
808
868
|
),
|
|
@@ -834,7 +894,8 @@ export const make = (
|
|
|
834
894
|
),
|
|
835
895
|
fetchBatched: (options) =>
|
|
836
896
|
HttpClientRequest.make('POST')(`/v1/fetch/batched`).pipe(
|
|
837
|
-
(
|
|
897
|
+
HttpClientRequest.setHeaders({ 'x-idempotency-key': options.params['x-idempotency-key'] ?? undefined }),
|
|
898
|
+
(req) => Effect.orDie(HttpClientRequest.bodyJson(req, options.payload)),
|
|
838
899
|
Effect.flatMap((request) =>
|
|
839
900
|
Effect.flatMap(applyClientTransform(httpClient), (httpClient) =>
|
|
840
901
|
Effect.flatMap(
|
|
@@ -844,6 +905,7 @@ export const make = (
|
|
|
844
905
|
'400': (r) => decodeError(r, FetchBatched400),
|
|
845
906
|
'401': (r) => decodeError(r, AuthFailed),
|
|
846
907
|
'403': (r) => decodeError(r, FetchBatched403),
|
|
908
|
+
'409': (r) => decodeError(r, BatchedIdempotencyConflict),
|
|
847
909
|
'413': (r) => decodeError(r, PayloadTooLarge),
|
|
848
910
|
'429': (r) => decodeError(r, TooManyRequests),
|
|
849
911
|
'500': (r) => decodeError(r, InternalError),
|
|
@@ -880,6 +942,28 @@ export const make = (
|
|
|
880
942
|
),
|
|
881
943
|
),
|
|
882
944
|
),
|
|
945
|
+
fetchCancelBatched: (id) =>
|
|
946
|
+
HttpClientRequest.make('POST')(`/v1/fetch/batched/${id}/cancel`).pipe(
|
|
947
|
+
Effect.succeed,
|
|
948
|
+
Effect.flatMap((request) =>
|
|
949
|
+
Effect.flatMap(applyClientTransform(httpClient), (httpClient) =>
|
|
950
|
+
Effect.flatMap(
|
|
951
|
+
httpClient.execute(request),
|
|
952
|
+
HttpClientResponse.matchStatus({
|
|
953
|
+
'200': (r) => HttpClientResponse.schemaBodyJson(BatchedCancellation)(r),
|
|
954
|
+
'400': (r) => decodeError(r, HttpApiDecodeError),
|
|
955
|
+
'401': (r) => decodeError(r, AuthFailed),
|
|
956
|
+
'409': (r) => decodeError(r, BatchedCancellationConflict),
|
|
957
|
+
'413': (r) => decodeError(r, PayloadTooLarge),
|
|
958
|
+
'429': (r) => decodeError(r, TooManyRequests),
|
|
959
|
+
'500': (r) => decodeError(r, InternalError),
|
|
960
|
+
'503': (r) => decodeError(r, ServiceUnavailable),
|
|
961
|
+
orElse: (response) => unexpectedStatus(request, response),
|
|
962
|
+
}),
|
|
963
|
+
),
|
|
964
|
+
),
|
|
965
|
+
),
|
|
966
|
+
),
|
|
883
967
|
}
|
|
884
968
|
}
|
|
885
969
|
|
|
@@ -894,10 +978,13 @@ export interface Client {
|
|
|
894
978
|
| typeof FetchFetch400.Type
|
|
895
979
|
| typeof AuthFailed.Type
|
|
896
980
|
| typeof FetchFetch403.Type
|
|
897
|
-
| typeof
|
|
981
|
+
| typeof FetchFetch413.Type
|
|
898
982
|
| typeof TooManyRequests.Type
|
|
899
983
|
| typeof InternalError.Type
|
|
984
|
+
| typeof FetchNavigationFailed.Type
|
|
900
985
|
| typeof ServiceUnavailable.Type
|
|
986
|
+
| typeof FetchCaptureTimeout.Type
|
|
987
|
+
| typeof FetchCapacityTimeout.Type
|
|
901
988
|
>
|
|
902
989
|
readonly fetchFetchJson: (options: {
|
|
903
990
|
readonly params: typeof FetchFetchJsonParams.Encoded
|
|
@@ -909,10 +996,13 @@ export interface Client {
|
|
|
909
996
|
| typeof FetchFetchJson400.Type
|
|
910
997
|
| typeof AuthFailed.Type
|
|
911
998
|
| typeof FetchFetchJson403.Type
|
|
912
|
-
| typeof
|
|
999
|
+
| typeof FetchFetchJson413.Type
|
|
913
1000
|
| typeof TooManyRequests.Type
|
|
914
1001
|
| typeof InternalError.Type
|
|
1002
|
+
| typeof FetchNavigationFailed.Type
|
|
915
1003
|
| typeof ServiceUnavailable.Type
|
|
1004
|
+
| typeof FetchCaptureTimeout.Type
|
|
1005
|
+
| typeof FetchCapacityTimeout.Type
|
|
916
1006
|
>
|
|
917
1007
|
readonly fetchFetchSearch: (
|
|
918
1008
|
options: typeof FetchFetchSearchRequest.Encoded,
|
|
@@ -929,15 +1019,17 @@ export interface Client {
|
|
|
929
1019
|
| typeof InternalError.Type
|
|
930
1020
|
| typeof ServiceUnavailable.Type
|
|
931
1021
|
>
|
|
932
|
-
readonly fetchBatched: (
|
|
933
|
-
|
|
934
|
-
|
|
1022
|
+
readonly fetchBatched: (options: {
|
|
1023
|
+
readonly params: typeof FetchBatchedParams.Encoded
|
|
1024
|
+
readonly payload: typeof FetchBatchedRequest.Encoded
|
|
1025
|
+
}) => Effect.Effect<
|
|
935
1026
|
typeof BatchedRun.Type,
|
|
936
1027
|
| HttpClientError.HttpClientError
|
|
937
1028
|
| ParseError
|
|
938
1029
|
| typeof FetchBatched400.Type
|
|
939
1030
|
| typeof AuthFailed.Type
|
|
940
1031
|
| typeof FetchBatched403.Type
|
|
1032
|
+
| typeof BatchedIdempotencyConflict.Type
|
|
941
1033
|
| typeof PayloadTooLarge.Type
|
|
942
1034
|
| typeof TooManyRequests.Type
|
|
943
1035
|
| typeof InternalError.Type
|
|
@@ -957,4 +1049,18 @@ export interface Client {
|
|
|
957
1049
|
| typeof InternalError.Type
|
|
958
1050
|
| typeof ServiceUnavailable.Type
|
|
959
1051
|
>
|
|
1052
|
+
readonly fetchCancelBatched: (
|
|
1053
|
+
id: string,
|
|
1054
|
+
) => Effect.Effect<
|
|
1055
|
+
typeof BatchedCancellation.Type,
|
|
1056
|
+
| HttpClientError.HttpClientError
|
|
1057
|
+
| ParseError
|
|
1058
|
+
| typeof HttpApiDecodeError.Type
|
|
1059
|
+
| typeof AuthFailed.Type
|
|
1060
|
+
| typeof BatchedCancellationConflict.Type
|
|
1061
|
+
| typeof PayloadTooLarge.Type
|
|
1062
|
+
| typeof TooManyRequests.Type
|
|
1063
|
+
| typeof InternalError.Type
|
|
1064
|
+
| typeof ServiceUnavailable.Type
|
|
1065
|
+
>
|
|
960
1066
|
}
|