@expandai/sdk 0.17.0 → 0.17.1
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/LICENSE +2 -1
- package/README.md +83 -307
- package/build/dts/Client.d.ts +61 -0
- package/build/dts/Client.d.ts.map +1 -0
- package/build/dts/Error.d.ts +90 -0
- package/build/dts/Error.d.ts.map +1 -0
- package/build/dts/FetchJson.d.ts +364 -0
- package/build/dts/FetchJson.d.ts.map +1 -0
- package/build/dts/Generated.d.ts +1863 -0
- package/build/dts/Generated.d.ts.map +1 -0
- package/build/dts/HttpClientHelpers.d.ts +5 -0
- package/build/dts/HttpClientHelpers.d.ts.map +1 -0
- package/build/dts/Internal.d.ts +49 -0
- package/build/dts/Internal.d.ts.map +1 -0
- package/build/dts/Playground.d.ts +24 -0
- package/build/dts/Playground.d.ts.map +1 -0
- package/build/dts/Service.d.ts +277 -0
- package/build/dts/Service.d.ts.map +1 -0
- package/build/dts/index.d.ts +6 -0
- package/build/dts/index.d.ts.map +1 -0
- package/build/esm/Client.js +87 -0
- package/build/esm/Client.js.map +1 -0
- package/build/esm/Error.js +91 -0
- package/build/esm/Error.js.map +1 -0
- package/build/esm/FetchJson.js +70 -0
- package/build/esm/FetchJson.js.map +1 -0
- package/build/esm/Generated.js +646 -0
- package/build/esm/Generated.js.map +1 -0
- package/build/esm/HttpClientHelpers.js +14 -0
- package/build/esm/HttpClientHelpers.js.map +1 -0
- package/build/esm/Internal.js +95 -0
- package/build/esm/Internal.js.map +1 -0
- package/build/esm/Playground.js +55 -0
- package/build/esm/Playground.js.map +1 -0
- package/build/esm/Service.js +174 -0
- package/build/esm/Service.js.map +1 -0
- package/build/esm/index.js +4 -0
- package/build/esm/index.js.map +1 -0
- package/package.json +53 -136
- package/src/Client.ts +128 -0
- package/src/Error.ts +105 -0
- package/src/FetchJson.ts +109 -0
- package/src/Generated.ts +949 -0
- package/src/HttpClientHelpers.ts +24 -0
- package/src/Internal.ts +246 -0
- package/src/Playground.ts +76 -0
- package/src/Service.ts +264 -0
- package/src/index.ts +27 -21
- package/CHANGELOG.md +0 -238
- package/api-promise.d.mts +0 -2
- package/api-promise.d.mts.map +0 -1
- package/api-promise.d.ts +0 -2
- package/api-promise.d.ts.map +0 -1
- package/api-promise.js +0 -6
- package/api-promise.js.map +0 -1
- package/api-promise.mjs +0 -2
- package/api-promise.mjs.map +0 -1
- package/client.d.mts +0 -184
- package/client.d.mts.map +0 -1
- package/client.d.ts +0 -184
- package/client.d.ts.map +0 -1
- package/client.js +0 -476
- package/client.js.map +0 -1
- package/client.mjs +0 -472
- package/client.mjs.map +0 -1
- package/core/api-promise.d.mts +0 -46
- package/core/api-promise.d.mts.map +0 -1
- package/core/api-promise.d.ts +0 -46
- package/core/api-promise.d.ts.map +0 -1
- package/core/api-promise.js +0 -74
- package/core/api-promise.js.map +0 -1
- package/core/api-promise.mjs +0 -70
- package/core/api-promise.mjs.map +0 -1
- package/core/error.d.mts +0 -46
- package/core/error.d.mts.map +0 -1
- package/core/error.d.ts +0 -46
- package/core/error.d.ts.map +0 -1
- package/core/error.js +0 -113
- package/core/error.js.map +0 -1
- package/core/error.mjs +0 -97
- package/core/error.mjs.map +0 -1
- package/core/resource.d.mts +0 -6
- package/core/resource.d.mts.map +0 -1
- package/core/resource.d.ts +0 -6
- package/core/resource.d.ts.map +0 -1
- package/core/resource.js +0 -11
- package/core/resource.js.map +0 -1
- package/core/resource.mjs +0 -7
- package/core/resource.mjs.map +0 -1
- package/core/uploads.d.mts +0 -3
- package/core/uploads.d.mts.map +0 -1
- package/core/uploads.d.ts +0 -3
- package/core/uploads.d.ts.map +0 -1
- package/core/uploads.js +0 -6
- package/core/uploads.js.map +0 -1
- package/core/uploads.mjs +0 -2
- package/core/uploads.mjs.map +0 -1
- package/error.d.mts +0 -2
- package/error.d.mts.map +0 -1
- package/error.d.ts +0 -2
- package/error.d.ts.map +0 -1
- package/error.js +0 -6
- package/error.js.map +0 -1
- package/error.mjs +0 -2
- package/error.mjs.map +0 -1
- package/index.d.mts +0 -6
- package/index.d.mts.map +0 -1
- package/index.d.ts +0 -6
- package/index.d.ts.map +0 -1
- package/index.js +0 -30
- package/index.js.map +0 -1
- package/index.mjs +0 -7
- package/index.mjs.map +0 -1
- package/internal/builtin-types.d.mts +0 -73
- package/internal/builtin-types.d.mts.map +0 -1
- package/internal/builtin-types.d.ts +0 -73
- package/internal/builtin-types.d.ts.map +0 -1
- package/internal/builtin-types.js +0 -4
- package/internal/builtin-types.js.map +0 -1
- package/internal/builtin-types.mjs +0 -3
- package/internal/builtin-types.mjs.map +0 -1
- package/internal/detect-platform.d.mts +0 -15
- package/internal/detect-platform.d.mts.map +0 -1
- package/internal/detect-platform.d.ts +0 -15
- package/internal/detect-platform.d.ts.map +0 -1
- package/internal/detect-platform.js +0 -162
- package/internal/detect-platform.js.map +0 -1
- package/internal/detect-platform.mjs +0 -157
- package/internal/detect-platform.mjs.map +0 -1
- package/internal/errors.d.mts +0 -3
- package/internal/errors.d.mts.map +0 -1
- package/internal/errors.d.ts +0 -3
- package/internal/errors.d.ts.map +0 -1
- package/internal/errors.js +0 -41
- package/internal/errors.js.map +0 -1
- package/internal/errors.mjs +0 -36
- package/internal/errors.mjs.map +0 -1
- package/internal/headers.d.mts +0 -20
- package/internal/headers.d.mts.map +0 -1
- package/internal/headers.d.ts +0 -20
- package/internal/headers.d.ts.map +0 -1
- package/internal/headers.js +0 -79
- package/internal/headers.js.map +0 -1
- package/internal/headers.mjs +0 -74
- package/internal/headers.mjs.map +0 -1
- package/internal/parse.d.mts +0 -12
- package/internal/parse.d.mts.map +0 -1
- package/internal/parse.d.ts +0 -12
- package/internal/parse.d.ts.map +0 -1
- package/internal/parse.js +0 -40
- package/internal/parse.js.map +0 -1
- package/internal/parse.mjs +0 -37
- package/internal/parse.mjs.map +0 -1
- package/internal/request-options.d.mts +0 -75
- package/internal/request-options.d.mts.map +0 -1
- package/internal/request-options.d.ts +0 -75
- package/internal/request-options.d.ts.map +0 -1
- package/internal/request-options.js +0 -14
- package/internal/request-options.js.map +0 -1
- package/internal/request-options.mjs +0 -10
- package/internal/request-options.mjs.map +0 -1
- package/internal/shim-types.d.mts +0 -17
- package/internal/shim-types.d.mts.map +0 -1
- package/internal/shim-types.d.ts +0 -17
- package/internal/shim-types.d.ts.map +0 -1
- package/internal/shim-types.js +0 -4
- package/internal/shim-types.js.map +0 -1
- package/internal/shim-types.mjs +0 -3
- package/internal/shim-types.mjs.map +0 -1
- package/internal/shims.d.mts +0 -20
- package/internal/shims.d.mts.map +0 -1
- package/internal/shims.d.ts +0 -20
- package/internal/shims.d.ts.map +0 -1
- package/internal/shims.js +0 -92
- package/internal/shims.js.map +0 -1
- package/internal/shims.mjs +0 -85
- package/internal/shims.mjs.map +0 -1
- package/internal/to-file.d.mts +0 -45
- package/internal/to-file.d.mts.map +0 -1
- package/internal/to-file.d.ts +0 -45
- package/internal/to-file.d.ts.map +0 -1
- package/internal/to-file.js +0 -91
- package/internal/to-file.js.map +0 -1
- package/internal/to-file.mjs +0 -88
- package/internal/to-file.mjs.map +0 -1
- package/internal/tslib.js +0 -81
- package/internal/tslib.mjs +0 -17
- package/internal/types.d.mts +0 -69
- package/internal/types.d.mts.map +0 -1
- package/internal/types.d.ts +0 -69
- package/internal/types.d.ts.map +0 -1
- package/internal/types.js +0 -4
- package/internal/types.js.map +0 -1
- package/internal/types.mjs +0 -3
- package/internal/types.mjs.map +0 -1
- package/internal/uploads.d.mts +0 -42
- package/internal/uploads.d.mts.map +0 -1
- package/internal/uploads.d.ts +0 -42
- package/internal/uploads.d.ts.map +0 -1
- package/internal/uploads.js +0 -141
- package/internal/uploads.js.map +0 -1
- package/internal/uploads.mjs +0 -131
- package/internal/uploads.mjs.map +0 -1
- package/internal/utils/base64.d.mts +0 -3
- package/internal/utils/base64.d.mts.map +0 -1
- package/internal/utils/base64.d.ts +0 -3
- package/internal/utils/base64.d.ts.map +0 -1
- package/internal/utils/base64.js +0 -38
- package/internal/utils/base64.js.map +0 -1
- package/internal/utils/base64.mjs +0 -33
- package/internal/utils/base64.mjs.map +0 -1
- package/internal/utils/bytes.d.mts +0 -4
- package/internal/utils/bytes.d.mts.map +0 -1
- package/internal/utils/bytes.d.ts +0 -4
- package/internal/utils/bytes.d.ts.map +0 -1
- package/internal/utils/bytes.js +0 -31
- package/internal/utils/bytes.js.map +0 -1
- package/internal/utils/bytes.mjs +0 -26
- package/internal/utils/bytes.mjs.map +0 -1
- package/internal/utils/env.d.mts +0 -9
- package/internal/utils/env.d.mts.map +0 -1
- package/internal/utils/env.d.ts +0 -9
- package/internal/utils/env.d.ts.map +0 -1
- package/internal/utils/env.js +0 -22
- package/internal/utils/env.js.map +0 -1
- package/internal/utils/env.mjs +0 -18
- package/internal/utils/env.mjs.map +0 -1
- package/internal/utils/log.d.mts +0 -37
- package/internal/utils/log.d.mts.map +0 -1
- package/internal/utils/log.d.ts +0 -37
- package/internal/utils/log.d.ts.map +0 -1
- package/internal/utils/log.js +0 -86
- package/internal/utils/log.js.map +0 -1
- package/internal/utils/log.mjs +0 -80
- package/internal/utils/log.mjs.map +0 -1
- package/internal/utils/path.d.mts +0 -15
- package/internal/utils/path.d.mts.map +0 -1
- package/internal/utils/path.d.ts +0 -15
- package/internal/utils/path.d.ts.map +0 -1
- package/internal/utils/path.js +0 -79
- package/internal/utils/path.js.map +0 -1
- package/internal/utils/path.mjs +0 -74
- package/internal/utils/path.mjs.map +0 -1
- package/internal/utils/sleep.d.mts +0 -2
- package/internal/utils/sleep.d.mts.map +0 -1
- package/internal/utils/sleep.d.ts +0 -2
- package/internal/utils/sleep.d.ts.map +0 -1
- package/internal/utils/sleep.js +0 -7
- package/internal/utils/sleep.js.map +0 -1
- package/internal/utils/sleep.mjs +0 -3
- package/internal/utils/sleep.mjs.map +0 -1
- package/internal/utils/uuid.d.mts +0 -5
- package/internal/utils/uuid.d.mts.map +0 -1
- package/internal/utils/uuid.d.ts +0 -5
- package/internal/utils/uuid.d.ts.map +0 -1
- package/internal/utils/uuid.js +0 -19
- package/internal/utils/uuid.js.map +0 -1
- package/internal/utils/uuid.mjs +0 -15
- package/internal/utils/uuid.mjs.map +0 -1
- package/internal/utils/values.d.mts +0 -18
- package/internal/utils/values.d.mts.map +0 -1
- package/internal/utils/values.d.ts +0 -18
- package/internal/utils/values.d.ts.map +0 -1
- package/internal/utils/values.js +0 -112
- package/internal/utils/values.js.map +0 -1
- package/internal/utils/values.mjs +0 -94
- package/internal/utils/values.mjs.map +0 -1
- package/internal/utils.d.mts +0 -7
- package/internal/utils.d.mts.map +0 -1
- package/internal/utils.d.ts +0 -7
- package/internal/utils.d.ts.map +0 -1
- package/internal/utils.js +0 -11
- package/internal/utils.js.map +0 -1
- package/internal/utils.mjs +0 -8
- package/internal/utils.mjs.map +0 -1
- package/resource.d.mts +0 -2
- package/resource.d.mts.map +0 -1
- package/resource.d.ts +0 -2
- package/resource.d.ts.map +0 -1
- package/resource.js +0 -6
- package/resource.js.map +0 -1
- package/resource.mjs +0 -2
- package/resource.mjs.map +0 -1
- package/resources/index.d.mts +0 -2
- package/resources/index.d.mts.map +0 -1
- package/resources/index.d.ts +0 -2
- package/resources/index.d.ts.map +0 -1
- package/resources/index.js +0 -4
- package/resources/index.js.map +0 -1
- package/resources/index.mjs +0 -3
- package/resources/index.mjs.map +0 -1
- package/resources/top-level.d.mts +0 -469
- package/resources/top-level.d.mts.map +0 -1
- package/resources/top-level.d.ts +0 -469
- package/resources/top-level.d.ts.map +0 -1
- package/resources/top-level.js +0 -4
- package/resources/top-level.js.map +0 -1
- package/resources/top-level.mjs +0 -3
- package/resources/top-level.mjs.map +0 -1
- package/resources.d.mts +0 -2
- package/resources.d.mts.map +0 -1
- package/resources.d.ts +0 -2
- package/resources.d.ts.map +0 -1
- package/resources.js +0 -5
- package/resources.js.map +0 -1
- package/resources.mjs +0 -2
- package/resources.mjs.map +0 -1
- package/src/api-promise.ts +0 -2
- package/src/client.ts +0 -744
- package/src/core/README.md +0 -3
- package/src/core/api-promise.ts +0 -92
- package/src/core/error.ts +0 -130
- package/src/core/resource.ts +0 -11
- package/src/core/uploads.ts +0 -2
- package/src/error.ts +0 -2
- package/src/internal/README.md +0 -3
- package/src/internal/builtin-types.ts +0 -93
- package/src/internal/detect-platform.ts +0 -196
- package/src/internal/errors.ts +0 -33
- package/src/internal/headers.ts +0 -97
- package/src/internal/parse.ts +0 -56
- package/src/internal/request-options.ts +0 -91
- package/src/internal/shim-types.ts +0 -26
- package/src/internal/shims.ts +0 -107
- package/src/internal/to-file.ts +0 -154
- package/src/internal/types.ts +0 -95
- package/src/internal/uploads.ts +0 -187
- package/src/internal/utils/base64.ts +0 -40
- package/src/internal/utils/bytes.ts +0 -32
- package/src/internal/utils/env.ts +0 -18
- package/src/internal/utils/log.ts +0 -127
- package/src/internal/utils/path.ts +0 -88
- package/src/internal/utils/sleep.ts +0 -3
- package/src/internal/utils/uuid.ts +0 -17
- package/src/internal/utils/values.ts +0 -105
- package/src/internal/utils.ts +0 -8
- package/src/lib/.keep +0 -4
- package/src/resource.ts +0 -2
- package/src/resources/index.ts +0 -3
- package/src/resources/top-level.ts +0 -552
- package/src/resources.ts +0 -1
- package/src/tsconfig.json +0 -11
- package/src/uploads.ts +0 -2
- package/src/version.ts +0 -1
- package/uploads.d.mts +0 -2
- package/uploads.d.mts.map +0 -1
- package/uploads.d.ts +0 -2
- package/uploads.d.ts.map +0 -1
- package/uploads.js +0 -6
- package/uploads.js.map +0 -1
- package/uploads.mjs +0 -2
- package/uploads.mjs.map +0 -1
- package/version.d.mts +0 -2
- package/version.d.mts.map +0 -1
- package/version.d.ts +0 -2
- package/version.d.ts.map +0 -1
- package/version.js +0 -5
- package/version.js.map +0 -1
- package/version.mjs +0 -2
- package/version.mjs.map +0 -1
|
@@ -0,0 +1,646 @@
|
|
|
1
|
+
import * as HttpClientError from '@effect/platform/HttpClientError';
|
|
2
|
+
import * as HttpClientRequest from '@effect/platform/HttpClientRequest';
|
|
3
|
+
import * as HttpClientResponse from '@effect/platform/HttpClientResponse';
|
|
4
|
+
import * as Effect from 'effect/Effect';
|
|
5
|
+
import * as S from 'effect/Schema';
|
|
6
|
+
export class FetchFetchParams extends S.Struct({
|
|
7
|
+
include: S.optionalWith(S.String, { nullable: true }),
|
|
8
|
+
}) {
|
|
9
|
+
}
|
|
10
|
+
export class FetchFetchRequest extends S.Class('FetchFetchRequest')({
|
|
11
|
+
url: S.String,
|
|
12
|
+
include: S.optionalWith(S.Struct({
|
|
13
|
+
html: S.optionalWith(S.Union(S.Boolean, S.Record({ key: S.String, value: S.Unknown })), { nullable: true }),
|
|
14
|
+
markdown: S.optionalWith(S.Union(S.Boolean, S.Record({ key: S.String, value: S.Unknown })), { nullable: true }),
|
|
15
|
+
screenshot: S.optionalWith(S.Union(S.Boolean, S.Struct({
|
|
16
|
+
fullPage: S.optionalWith(S.Boolean, { nullable: true }),
|
|
17
|
+
})), { nullable: true }),
|
|
18
|
+
summary: S.optionalWith(S.Union(S.Boolean, S.Struct({
|
|
19
|
+
prompt: S.optionalWith(S.String.pipe(S.maxLength(5000)), { nullable: true }),
|
|
20
|
+
})), { nullable: true }),
|
|
21
|
+
links: S.optionalWith(S.Union(S.Boolean, S.Struct({
|
|
22
|
+
skipEmptyText: S.optionalWith(S.Boolean, { nullable: true }),
|
|
23
|
+
includeNavigation: S.optionalWith(S.Boolean, { nullable: true }),
|
|
24
|
+
})), { nullable: true }),
|
|
25
|
+
meta: S.optionalWith(S.Boolean, { nullable: true, default: () => false }),
|
|
26
|
+
response: S.optionalWith(S.Boolean, { nullable: true, default: () => false }),
|
|
27
|
+
json: S.optionalWith(S.Boolean, { nullable: true, default: () => false }),
|
|
28
|
+
appendix: S.optionalWith(S.Boolean, { nullable: true }),
|
|
29
|
+
}), { nullable: true }),
|
|
30
|
+
search: S.optionalWith(S.Struct({
|
|
31
|
+
query: S.String,
|
|
32
|
+
maxResults: S.optionalWith(S.Int.pipe(S.greaterThanOrEqualTo(1), S.lessThanOrEqualTo(50)), {
|
|
33
|
+
nullable: true,
|
|
34
|
+
default: () => 5,
|
|
35
|
+
}),
|
|
36
|
+
minScore: S.optionalWith(S.Number.pipe(S.greaterThanOrEqualTo(0), S.lessThanOrEqualTo(1)), {
|
|
37
|
+
nullable: true,
|
|
38
|
+
default: () => 0.6,
|
|
39
|
+
}),
|
|
40
|
+
}), { nullable: true }),
|
|
41
|
+
browserConfig: S.optionalWith(S.Struct({
|
|
42
|
+
scrollFullPage: S.optionalWith(S.Boolean, { nullable: true, default: () => false }),
|
|
43
|
+
}), { nullable: true }),
|
|
44
|
+
}) {
|
|
45
|
+
}
|
|
46
|
+
export class IssueTag extends S.Literal('Pointer', 'Unexpected', 'Missing', 'Composite', 'Refinement', 'Transformation', 'Type', 'Forbidden') {
|
|
47
|
+
}
|
|
48
|
+
export class PropertyKeyEnumTag extends S.Literal('symbol') {
|
|
49
|
+
}
|
|
50
|
+
export class PropertyKey extends S.Union(S.String, S.Number, S.Struct({
|
|
51
|
+
_tag: PropertyKeyEnumTag,
|
|
52
|
+
key: S.String,
|
|
53
|
+
})) {
|
|
54
|
+
}
|
|
55
|
+
export class Issue extends S.Struct({
|
|
56
|
+
_tag: IssueTag,
|
|
57
|
+
path: S.Array(PropertyKey),
|
|
58
|
+
message: S.String,
|
|
59
|
+
}) {
|
|
60
|
+
}
|
|
61
|
+
export class HttpApiDecodeErrorTag extends S.Literal('HttpApiDecodeError') {
|
|
62
|
+
}
|
|
63
|
+
export class HttpApiDecodeError extends S.Struct({
|
|
64
|
+
issues: S.Array(Issue),
|
|
65
|
+
message: S.String,
|
|
66
|
+
_tag: HttpApiDecodeErrorTag,
|
|
67
|
+
}) {
|
|
68
|
+
}
|
|
69
|
+
export class BadRequestTag extends S.Literal('BadRequest') {
|
|
70
|
+
}
|
|
71
|
+
export class BadRequest extends S.Struct({
|
|
72
|
+
message: S.String,
|
|
73
|
+
_tag: BadRequestTag,
|
|
74
|
+
}) {
|
|
75
|
+
}
|
|
76
|
+
export class FetchFetch400 extends S.Union(HttpApiDecodeError, BadRequest) {
|
|
77
|
+
}
|
|
78
|
+
export class AuthFailedReason extends S.Literal('InvalidApiKey', 'InvalidToken', 'InvalidSession', 'InvalidTenant') {
|
|
79
|
+
}
|
|
80
|
+
export class AuthFailedTag extends S.Literal('AuthFailed') {
|
|
81
|
+
}
|
|
82
|
+
export class AuthFailed extends S.Class('AuthFailed')({
|
|
83
|
+
reason: AuthFailedReason,
|
|
84
|
+
description: S.optionalWith(S.Union(S.String, S.Struct({
|
|
85
|
+
message: S.String,
|
|
86
|
+
})), { nullable: true }),
|
|
87
|
+
_tag: AuthFailedTag,
|
|
88
|
+
}) {
|
|
89
|
+
}
|
|
90
|
+
export class DateTimeUtc extends S.String {
|
|
91
|
+
}
|
|
92
|
+
export class FetchBlockedTag extends S.Literal('FetchBlocked') {
|
|
93
|
+
}
|
|
94
|
+
export class FetchBlocked extends S.Struct({
|
|
95
|
+
url: S.String,
|
|
96
|
+
blockedType: S.optionalWith(S.String, { nullable: true }),
|
|
97
|
+
_tag: FetchBlockedTag,
|
|
98
|
+
}) {
|
|
99
|
+
}
|
|
100
|
+
export class FetchFetch403 extends S.Union(S.Struct({
|
|
101
|
+
organizationId: S.String.pipe(S.minLength(1)),
|
|
102
|
+
blockedUntil: S.optionalWith(S.Union(DateTimeUtc, S.Null), { nullable: true }),
|
|
103
|
+
_tag: S.Literal('AccessBlocked'),
|
|
104
|
+
}), FetchBlocked) {
|
|
105
|
+
}
|
|
106
|
+
export class PayloadTooLargeTag extends S.Literal('PayloadTooLarge') {
|
|
107
|
+
}
|
|
108
|
+
export class PayloadTooLarge extends S.Class('PayloadTooLarge')({
|
|
109
|
+
_tag: PayloadTooLargeTag,
|
|
110
|
+
}) {
|
|
111
|
+
}
|
|
112
|
+
export class TooManyRequestsTag extends S.Literal('TooManyRequests') {
|
|
113
|
+
}
|
|
114
|
+
export class TooManyRequests extends S.Class('TooManyRequests')({
|
|
115
|
+
_tag: TooManyRequestsTag,
|
|
116
|
+
}) {
|
|
117
|
+
}
|
|
118
|
+
export class InternalErrorTag extends S.Literal('InternalError') {
|
|
119
|
+
}
|
|
120
|
+
export class InternalError extends S.Class('InternalError')({
|
|
121
|
+
_tag: InternalErrorTag,
|
|
122
|
+
}) {
|
|
123
|
+
}
|
|
124
|
+
export class ServiceUnavailableTag extends S.Literal('ServiceUnavailable') {
|
|
125
|
+
}
|
|
126
|
+
export class ServiceUnavailable extends S.Class('ServiceUnavailable')({
|
|
127
|
+
_tag: ServiceUnavailableTag,
|
|
128
|
+
}) {
|
|
129
|
+
}
|
|
130
|
+
export class FetchFetchJsonParams extends S.Struct({
|
|
131
|
+
include: S.optionalWith(S.String, { nullable: true }),
|
|
132
|
+
}) {
|
|
133
|
+
}
|
|
134
|
+
export class FetchFetchJsonRequest extends S.Class('FetchFetchJsonRequest')({
|
|
135
|
+
url: S.String,
|
|
136
|
+
include: S.optionalWith(S.Struct({
|
|
137
|
+
html: S.optionalWith(S.Union(S.Boolean, S.Record({ key: S.String, value: S.Unknown })), { nullable: true }),
|
|
138
|
+
markdown: S.optionalWith(S.Union(S.Boolean, S.Record({ key: S.String, value: S.Unknown })), { nullable: true }),
|
|
139
|
+
screenshot: S.optionalWith(S.Union(S.Boolean, S.Struct({
|
|
140
|
+
fullPage: S.optionalWith(S.Boolean, { nullable: true }),
|
|
141
|
+
})), { nullable: true }),
|
|
142
|
+
summary: S.optionalWith(S.Union(S.Boolean, S.Struct({
|
|
143
|
+
prompt: S.optionalWith(S.String.pipe(S.maxLength(5000)), { nullable: true }),
|
|
144
|
+
})), { nullable: true }),
|
|
145
|
+
links: S.optionalWith(S.Union(S.Boolean, S.Struct({
|
|
146
|
+
skipEmptyText: S.optionalWith(S.Boolean, { nullable: true }),
|
|
147
|
+
includeNavigation: S.optionalWith(S.Boolean, { nullable: true }),
|
|
148
|
+
})), { nullable: true }),
|
|
149
|
+
meta: S.optionalWith(S.Boolean, { nullable: true, default: () => false }),
|
|
150
|
+
response: S.optionalWith(S.Boolean, { nullable: true, default: () => false }),
|
|
151
|
+
json: S.optionalWith(S.Boolean, { nullable: true, default: () => false }),
|
|
152
|
+
appendix: S.optionalWith(S.Boolean, { nullable: true }),
|
|
153
|
+
}), { nullable: true }),
|
|
154
|
+
search: S.optionalWith(S.Struct({
|
|
155
|
+
query: S.String,
|
|
156
|
+
maxResults: S.optionalWith(S.Int.pipe(S.greaterThanOrEqualTo(1), S.lessThanOrEqualTo(50)), {
|
|
157
|
+
nullable: true,
|
|
158
|
+
default: () => 5,
|
|
159
|
+
}),
|
|
160
|
+
minScore: S.optionalWith(S.Number.pipe(S.greaterThanOrEqualTo(0), S.lessThanOrEqualTo(1)), {
|
|
161
|
+
nullable: true,
|
|
162
|
+
default: () => 0.6,
|
|
163
|
+
}),
|
|
164
|
+
}), { nullable: true }),
|
|
165
|
+
browserConfig: S.optionalWith(S.Struct({
|
|
166
|
+
scrollFullPage: S.optionalWith(S.Boolean, { nullable: true, default: () => false }),
|
|
167
|
+
}), { nullable: true }),
|
|
168
|
+
}) {
|
|
169
|
+
}
|
|
170
|
+
export class FetchObjectModeMetaVersion extends S.Literal(1) {
|
|
171
|
+
}
|
|
172
|
+
export class FetchObjectModeAppendixLinks extends S.Struct({
|
|
173
|
+
sameDomain: S.Number,
|
|
174
|
+
external: S.Number,
|
|
175
|
+
}) {
|
|
176
|
+
}
|
|
177
|
+
export class FetchObjectModeAppendixHint extends S.Struct({
|
|
178
|
+
url: S.String,
|
|
179
|
+
links: FetchObjectModeAppendixLinks,
|
|
180
|
+
}) {
|
|
181
|
+
}
|
|
182
|
+
export class FetchObjectModeStateJsonHint extends S.Struct({
|
|
183
|
+
moreTokens: S.Number,
|
|
184
|
+
}) {
|
|
185
|
+
}
|
|
186
|
+
export class FetchObjectModeMarkdownHint extends S.Struct({
|
|
187
|
+
url: S.String,
|
|
188
|
+
moreTokens: S.Number,
|
|
189
|
+
}) {
|
|
190
|
+
}
|
|
191
|
+
export class FetchObjectModeMeta extends S.Struct({
|
|
192
|
+
version: FetchObjectModeMetaVersion,
|
|
193
|
+
url: S.String,
|
|
194
|
+
capturedAt: S.String,
|
|
195
|
+
snapshotId: S.String,
|
|
196
|
+
lang: S.String,
|
|
197
|
+
pageType: S.String,
|
|
198
|
+
playground: S.String,
|
|
199
|
+
title: S.optionalWith(S.String, { nullable: true }),
|
|
200
|
+
finalUrl: S.optionalWith(S.String, { nullable: true }),
|
|
201
|
+
canonical: S.optionalWith(S.String, { nullable: true }),
|
|
202
|
+
description: S.optionalWith(S.String, { nullable: true }),
|
|
203
|
+
author: S.optionalWith(S.String, { nullable: true }),
|
|
204
|
+
createdAt: S.optionalWith(S.String, { nullable: true }),
|
|
205
|
+
updatedAt: S.optionalWith(S.String, { nullable: true }),
|
|
206
|
+
image: S.optionalWith(S.String, { nullable: true }),
|
|
207
|
+
paginationNext: S.optionalWith(S.String, { nullable: true }),
|
|
208
|
+
appendix: S.optionalWith(FetchObjectModeAppendixHint, { nullable: true }),
|
|
209
|
+
stateJson: S.optionalWith(FetchObjectModeStateJsonHint, { nullable: true }),
|
|
210
|
+
markdown: S.optionalWith(FetchObjectModeMarkdownHint, { nullable: true }),
|
|
211
|
+
blocked: S.optionalWith(S.String, { nullable: true }),
|
|
212
|
+
loadingStatus: S.optionalWith(S.String, { nullable: true }),
|
|
213
|
+
}) {
|
|
214
|
+
}
|
|
215
|
+
export class FetchObjectModeEvidenceKind extends S.Literal('inline', 'network') {
|
|
216
|
+
}
|
|
217
|
+
export class FetchObjectModeEvidenceRole extends S.Literal('ld+json', 'next-data', 'nuxt', 'apollo-state', 'initial-state', 'application-json', 'script-tag', 'data-attribute', 'network-json', 'network-response', 'other') {
|
|
218
|
+
}
|
|
219
|
+
export class FetchObjectModeEvidence extends S.Struct({
|
|
220
|
+
id: S.Number,
|
|
221
|
+
kind: FetchObjectModeEvidenceKind,
|
|
222
|
+
role: FetchObjectModeEvidenceRole,
|
|
223
|
+
score: S.Number,
|
|
224
|
+
url: S.optionalWith(S.String, { nullable: true }),
|
|
225
|
+
method: S.optionalWith(S.String, { nullable: true }),
|
|
226
|
+
moreTokens: S.optionalWith(S.Number, { nullable: true }),
|
|
227
|
+
keys: S.optionalWith(S.Array(S.String), { nullable: true }),
|
|
228
|
+
}) {
|
|
229
|
+
}
|
|
230
|
+
export class FetchAssetReferenceKind extends S.Literal('data-url') {
|
|
231
|
+
}
|
|
232
|
+
export class FetchAssetReference extends S.Struct({
|
|
233
|
+
id: S.String,
|
|
234
|
+
kind: FetchAssetReferenceKind,
|
|
235
|
+
placeholder: S.String,
|
|
236
|
+
archiveKey: S.String,
|
|
237
|
+
mimeType: S.String,
|
|
238
|
+
sha256: S.String,
|
|
239
|
+
bytes: S.Number,
|
|
240
|
+
}) {
|
|
241
|
+
}
|
|
242
|
+
export class CaptureTelemetryInfoRequestedStyleMode extends S.Literal('compat_full', 'native_default') {
|
|
243
|
+
}
|
|
244
|
+
export class CaptureTelemetryInfoSelected extends S.Literal('rust') {
|
|
245
|
+
}
|
|
246
|
+
export class CaptureTelemetryInfoActual extends S.Literal('rust') {
|
|
247
|
+
}
|
|
248
|
+
export class CaptureTelemetryInfoActualStyleMode extends S.Literal('compat_full', 'native_default') {
|
|
249
|
+
}
|
|
250
|
+
export class CaptureTelemetryInfoIconBackendDecision extends S.Literal('cpu', 'remote_gpu') {
|
|
251
|
+
}
|
|
252
|
+
export class CaptureTelemetryInfo extends S.Struct({
|
|
253
|
+
requestedStyleMode: S.optionalWith(CaptureTelemetryInfoRequestedStyleMode, { nullable: true }),
|
|
254
|
+
selected: CaptureTelemetryInfoSelected,
|
|
255
|
+
actual: CaptureTelemetryInfoActual,
|
|
256
|
+
actualStyleMode: S.optionalWith(CaptureTelemetryInfoActualStyleMode, { nullable: true }),
|
|
257
|
+
rolloutApplied: S.Boolean,
|
|
258
|
+
preparedSessionHit: S.optionalWith(S.Boolean, { nullable: true }),
|
|
259
|
+
nativePoolHit: S.optionalWith(S.Boolean, { nullable: true }),
|
|
260
|
+
preparedPageHit: S.optionalWith(S.Boolean, { nullable: true }),
|
|
261
|
+
nativePoolCapacity: S.optionalWith(S.Number, { nullable: true }),
|
|
262
|
+
nativePoolProfile: S.optionalWith(S.String, { nullable: true }),
|
|
263
|
+
poolHit: S.optionalWith(S.Boolean, { nullable: true }),
|
|
264
|
+
connectMs: S.optionalWith(S.Number, { nullable: true }),
|
|
265
|
+
warmConnectionAgeMs: S.optionalWith(S.Number, { nullable: true }),
|
|
266
|
+
iconBackendDecision: S.optionalWith(CaptureTelemetryInfoIconBackendDecision, { nullable: true }),
|
|
267
|
+
}) {
|
|
268
|
+
}
|
|
269
|
+
export class FetchSearchSnippetLocation extends S.Struct({
|
|
270
|
+
markdownBlockId: S.optionalWith(S.String, { nullable: true }),
|
|
271
|
+
nodeIds: S.optionalWith(S.Array(S.Number), { nullable: true }),
|
|
272
|
+
stateJsonSourceId: S.optionalWith(S.Number, { nullable: true }),
|
|
273
|
+
jsonPath: S.optionalWith(S.String, { nullable: true }),
|
|
274
|
+
}) {
|
|
275
|
+
}
|
|
276
|
+
export class FetchSearchSourceMetaSource extends S.Literal('markdown', 'appendix', 'statejson') {
|
|
277
|
+
}
|
|
278
|
+
export class FetchSearchSourceMetaRanker extends S.Literal('zeroentropy', 'local_lexical') {
|
|
279
|
+
}
|
|
280
|
+
export class FetchSearchSourceMetaFallbackReason extends S.Literal('timeout', 'error') {
|
|
281
|
+
}
|
|
282
|
+
export class FetchSearchSourceMeta extends S.Struct({
|
|
283
|
+
source: FetchSearchSourceMetaSource,
|
|
284
|
+
chunkCount: S.Int.pipe(S.greaterThanOrEqualTo(0)),
|
|
285
|
+
batchCount: S.Int.pipe(S.greaterThanOrEqualTo(0)),
|
|
286
|
+
ranker: FetchSearchSourceMetaRanker,
|
|
287
|
+
fallback: S.Boolean,
|
|
288
|
+
fallbackReason: S.optionalWith(FetchSearchSourceMetaFallbackReason, { nullable: true }),
|
|
289
|
+
durationMs: S.Number.pipe(S.greaterThanOrEqualTo(0)),
|
|
290
|
+
}) {
|
|
291
|
+
}
|
|
292
|
+
export class FetchSearchMeta extends S.Struct({
|
|
293
|
+
durationMs: S.Number.pipe(S.greaterThanOrEqualTo(0)),
|
|
294
|
+
sources: S.Array(FetchSearchSourceMeta),
|
|
295
|
+
}) {
|
|
296
|
+
}
|
|
297
|
+
export class FetchSearchResult extends S.Struct({
|
|
298
|
+
query: S.String,
|
|
299
|
+
snippets: S.Array(S.Struct({
|
|
300
|
+
type: S.optionalWith(S.Literal('text'), { nullable: true, default: () => 'text' }),
|
|
301
|
+
source: S.Literal('markdown', 'appendix', 'statejson'),
|
|
302
|
+
text: S.String,
|
|
303
|
+
score: S.Number.pipe(S.greaterThanOrEqualTo(0), S.lessThanOrEqualTo(1)),
|
|
304
|
+
location: S.optionalWith(FetchSearchSnippetLocation, { nullable: true }),
|
|
305
|
+
})),
|
|
306
|
+
meta: S.optionalWith(FetchSearchMeta, { nullable: true }),
|
|
307
|
+
}) {
|
|
308
|
+
}
|
|
309
|
+
export class FetchObjectModeResult extends S.Class('FetchObjectModeResult')({
|
|
310
|
+
meta: FetchObjectModeMeta,
|
|
311
|
+
markdown: S.String,
|
|
312
|
+
json: S.Array(FetchObjectModeEvidence),
|
|
313
|
+
data: S.optionalWith(S.Struct({
|
|
314
|
+
assets: S.optionalWith(S.Array(FetchAssetReference), { nullable: true }),
|
|
315
|
+
captureTelemetry: S.optionalWith(CaptureTelemetryInfo, { nullable: true }),
|
|
316
|
+
search: S.optionalWith(FetchSearchResult, { nullable: true }),
|
|
317
|
+
screenshot: S.optionalWith(S.Struct({
|
|
318
|
+
url: S.String,
|
|
319
|
+
fullPage: S.Boolean,
|
|
320
|
+
}), { nullable: true }),
|
|
321
|
+
}), { nullable: true }),
|
|
322
|
+
}) {
|
|
323
|
+
}
|
|
324
|
+
export class FetchFetchJson400 extends S.Union(HttpApiDecodeError, BadRequest) {
|
|
325
|
+
}
|
|
326
|
+
export class FetchFetchJson403 extends S.Union(S.Struct({
|
|
327
|
+
organizationId: S.String.pipe(S.minLength(1)),
|
|
328
|
+
blockedUntil: S.optionalWith(S.Union(DateTimeUtc, S.Null), { nullable: true }),
|
|
329
|
+
_tag: S.Literal('AccessBlocked'),
|
|
330
|
+
}), FetchBlocked) {
|
|
331
|
+
}
|
|
332
|
+
export class IncludeHtmlConfig extends S.Record({ key: S.String, value: S.Unknown }) {
|
|
333
|
+
}
|
|
334
|
+
export class IncludeMarkdownConfig extends S.Record({ key: S.String, value: S.Unknown }) {
|
|
335
|
+
}
|
|
336
|
+
export class IncludeScreenshotConfig extends S.Struct({
|
|
337
|
+
fullPage: S.optionalWith(S.Boolean, { nullable: true }),
|
|
338
|
+
}) {
|
|
339
|
+
}
|
|
340
|
+
export class FetchFetchSearchRequest extends S.Class('FetchFetchSearchRequest')({
|
|
341
|
+
snapshotId: S.String.pipe(S.minLength(1)),
|
|
342
|
+
search: S.Struct({
|
|
343
|
+
query: S.String,
|
|
344
|
+
maxResults: S.optionalWith(S.Int.pipe(S.greaterThanOrEqualTo(1), S.lessThanOrEqualTo(50)), {
|
|
345
|
+
nullable: true,
|
|
346
|
+
default: () => 5,
|
|
347
|
+
}),
|
|
348
|
+
minScore: S.optionalWith(S.Number.pipe(S.greaterThanOrEqualTo(0), S.lessThanOrEqualTo(1)), {
|
|
349
|
+
nullable: true,
|
|
350
|
+
default: () => 0.6,
|
|
351
|
+
}),
|
|
352
|
+
}),
|
|
353
|
+
include: S.optionalWith(S.Struct({
|
|
354
|
+
html: S.optionalWith(S.Union(S.Boolean, IncludeHtmlConfig), { nullable: true }),
|
|
355
|
+
markdown: S.optionalWith(S.Union(S.Boolean, IncludeMarkdownConfig), { nullable: true }),
|
|
356
|
+
screenshot: S.optionalWith(S.Union(S.Boolean, IncludeScreenshotConfig), { nullable: true }),
|
|
357
|
+
summary: S.optionalWith(S.Union(S.Boolean, S.Struct({
|
|
358
|
+
prompt: S.optionalWith(S.String.pipe(S.maxLength(5000)), {
|
|
359
|
+
nullable: true,
|
|
360
|
+
default: () => '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.',
|
|
361
|
+
}),
|
|
362
|
+
})), { nullable: true }),
|
|
363
|
+
links: S.optionalWith(S.Union(S.Boolean, S.Struct({
|
|
364
|
+
sameDomainOnly: S.optionalWith(S.Boolean, { nullable: true, default: () => true }),
|
|
365
|
+
includePatterns: S.optionalWith(S.Array(S.String), { nullable: true }),
|
|
366
|
+
excludePatterns: S.optionalWith(S.Array(S.String), { nullable: true }),
|
|
367
|
+
})), { nullable: true }),
|
|
368
|
+
meta: S.optionalWith(S.Boolean, { nullable: true, default: () => true }),
|
|
369
|
+
response: S.optionalWith(S.Struct({
|
|
370
|
+
includeHeaders: S.optionalWith(S.Boolean, { nullable: true, default: () => false }),
|
|
371
|
+
}), { nullable: true }),
|
|
372
|
+
json: S.optionalWith(S.Boolean, { nullable: true, default: () => false }),
|
|
373
|
+
appendix: S.optionalWith(S.Boolean, { nullable: true }),
|
|
374
|
+
}), { nullable: true }),
|
|
375
|
+
}) {
|
|
376
|
+
}
|
|
377
|
+
export class URL extends S.String {
|
|
378
|
+
}
|
|
379
|
+
export class ResponseInfo extends S.Struct({
|
|
380
|
+
url: S.String,
|
|
381
|
+
requestedUrl: S.optionalWith(URL, { nullable: true }),
|
|
382
|
+
originStatusCode: S.optionalWith(S.Number, { nullable: true }),
|
|
383
|
+
redirectStatusCode: S.optionalWith(S.Number, { nullable: true }),
|
|
384
|
+
headers: S.optionalWith(S.Struct({}), { nullable: true }),
|
|
385
|
+
}) {
|
|
386
|
+
}
|
|
387
|
+
export class FetchSnapshotSearchResult extends S.Class('FetchSnapshotSearchResult')({
|
|
388
|
+
snapshotId: S.String.pipe(S.minLength(1)),
|
|
389
|
+
response: ResponseInfo,
|
|
390
|
+
search: FetchSearchResult,
|
|
391
|
+
durationMs: S.Number.pipe(S.greaterThanOrEqualTo(0)),
|
|
392
|
+
}) {
|
|
393
|
+
}
|
|
394
|
+
export class FetchFetchSearch400 extends S.Union(HttpApiDecodeError, BadRequest) {
|
|
395
|
+
}
|
|
396
|
+
export class FetchFetchSearch403Tag extends S.Literal('AccessBlocked') {
|
|
397
|
+
}
|
|
398
|
+
export class FetchFetchSearch403 extends S.Struct({
|
|
399
|
+
organizationId: S.String.pipe(S.minLength(1)),
|
|
400
|
+
blockedUntil: S.optionalWith(S.Union(DateTimeUtc, S.Null), { nullable: true }),
|
|
401
|
+
_tag: FetchFetchSearch403Tag,
|
|
402
|
+
}) {
|
|
403
|
+
}
|
|
404
|
+
export class NonEmptyString extends S.String.pipe(S.minLength(1)) {
|
|
405
|
+
}
|
|
406
|
+
export class FetchSnapshotSearchNotFoundTag extends S.Literal('FetchSnapshotSearchNotFound') {
|
|
407
|
+
}
|
|
408
|
+
export class FetchSnapshotSearchNotFound extends S.Class('FetchSnapshotSearchNotFound')({
|
|
409
|
+
snapshotId: NonEmptyString,
|
|
410
|
+
_tag: FetchSnapshotSearchNotFoundTag,
|
|
411
|
+
}) {
|
|
412
|
+
}
|
|
413
|
+
export class FetchBatchedRequest extends S.Class('FetchBatchedRequest')({
|
|
414
|
+
urls: S.NonEmptyArray(S.String),
|
|
415
|
+
include: S.optionalWith(S.Struct({
|
|
416
|
+
html: S.optionalWith(S.Union(S.Boolean, IncludeHtmlConfig), { nullable: true }),
|
|
417
|
+
markdown: S.optionalWith(S.Union(S.Boolean, IncludeMarkdownConfig), { nullable: true }),
|
|
418
|
+
screenshot: S.optionalWith(S.Union(S.Boolean, IncludeScreenshotConfig), { nullable: true }),
|
|
419
|
+
summary: S.optionalWith(S.Union(S.Boolean, S.Struct({
|
|
420
|
+
prompt: S.optionalWith(S.String.pipe(S.maxLength(5000)), {
|
|
421
|
+
nullable: true,
|
|
422
|
+
default: () => '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.',
|
|
423
|
+
}),
|
|
424
|
+
})), { nullable: true }),
|
|
425
|
+
links: S.optionalWith(S.Union(S.Boolean, S.Struct({
|
|
426
|
+
sameDomainOnly: S.optionalWith(S.Boolean, { nullable: true, default: () => true }),
|
|
427
|
+
includePatterns: S.optionalWith(S.Array(S.String), { nullable: true }),
|
|
428
|
+
excludePatterns: S.optionalWith(S.Array(S.String), { nullable: true }),
|
|
429
|
+
})), { nullable: true }),
|
|
430
|
+
meta: S.optionalWith(S.Boolean, { nullable: true, default: () => true }),
|
|
431
|
+
response: S.optionalWith(S.Struct({
|
|
432
|
+
includeHeaders: S.optionalWith(S.Boolean, { nullable: true, default: () => false }),
|
|
433
|
+
}), { nullable: true }),
|
|
434
|
+
json: S.optionalWith(S.Boolean, { nullable: true, default: () => false }),
|
|
435
|
+
appendix: S.optionalWith(S.Boolean, { nullable: true }),
|
|
436
|
+
}), { nullable: true }),
|
|
437
|
+
browserConfig: S.optionalWith(S.Struct({
|
|
438
|
+
scrollFullPage: S.optionalWith(S.Boolean, { nullable: true, default: () => false }),
|
|
439
|
+
}), { nullable: true }),
|
|
440
|
+
}) {
|
|
441
|
+
}
|
|
442
|
+
export class BatchedRun extends S.Class('BatchedRun')({
|
|
443
|
+
id: S.String,
|
|
444
|
+
}) {
|
|
445
|
+
}
|
|
446
|
+
export class FetchBatched400 extends S.Union(HttpApiDecodeError, BadRequest) {
|
|
447
|
+
}
|
|
448
|
+
export class FetchBatched403Tag extends S.Literal('AccessBlocked') {
|
|
449
|
+
}
|
|
450
|
+
export class FetchBatched403 extends S.Struct({
|
|
451
|
+
organizationId: S.String.pipe(S.minLength(1)),
|
|
452
|
+
blockedUntil: S.optionalWith(S.Union(DateTimeUtc, S.Null), { nullable: true }),
|
|
453
|
+
_tag: FetchBatched403Tag,
|
|
454
|
+
}) {
|
|
455
|
+
}
|
|
456
|
+
export class FetchGetBatchedParams extends S.Struct({
|
|
457
|
+
limit: S.optionalWith(S.String, { nullable: true }),
|
|
458
|
+
offset: S.optionalWith(S.String, { nullable: true }),
|
|
459
|
+
include: S.optionalWith(S.String, { nullable: true }),
|
|
460
|
+
}) {
|
|
461
|
+
}
|
|
462
|
+
export class BatchedStatusStatus extends S.Literal('QUEUED', 'RUNNING', 'COMPLETED', 'FAILED', 'CANCELLED') {
|
|
463
|
+
}
|
|
464
|
+
export class BatchedStatusBatchedStatus extends S.Literal('QUEUED', 'RUNNING', 'COMPLETED', 'FAILED', 'CANCELLED') {
|
|
465
|
+
}
|
|
466
|
+
export class IconMeta extends S.Struct({
|
|
467
|
+
href: S.String.pipe(S.minLength(1)),
|
|
468
|
+
rel: S.String.pipe(S.minLength(1)),
|
|
469
|
+
type: S.optionalWith(S.String.pipe(S.minLength(1)), { nullable: true }),
|
|
470
|
+
sizes: S.optionalWith(S.String.pipe(S.minLength(1)), { nullable: true }),
|
|
471
|
+
}) {
|
|
472
|
+
}
|
|
473
|
+
export class OgImage extends S.Struct({
|
|
474
|
+
url: S.String.pipe(S.minLength(1)),
|
|
475
|
+
width: S.optionalWith(S.Number, { nullable: true }),
|
|
476
|
+
height: S.optionalWith(S.Number, { nullable: true }),
|
|
477
|
+
alt: S.optionalWith(S.String, { nullable: true }),
|
|
478
|
+
}) {
|
|
479
|
+
}
|
|
480
|
+
export class OpenGraphMeta extends S.Struct({
|
|
481
|
+
title: S.optionalWith(S.String, { nullable: true }),
|
|
482
|
+
description: S.optionalWith(S.String, { nullable: true }),
|
|
483
|
+
type: S.optionalWith(S.String.pipe(S.minLength(1)), { nullable: true }),
|
|
484
|
+
url: S.optionalWith(S.String.pipe(S.minLength(1)), { nullable: true }),
|
|
485
|
+
siteName: S.optionalWith(S.String, { nullable: true }),
|
|
486
|
+
locale: S.optionalWith(S.String, { nullable: true }),
|
|
487
|
+
images: S.optionalWith(S.Array(OgImage), { nullable: true }),
|
|
488
|
+
}) {
|
|
489
|
+
}
|
|
490
|
+
export class TwitterCardMeta extends S.Struct({
|
|
491
|
+
card: S.optionalWith(S.String.pipe(S.minLength(1)), { nullable: true }),
|
|
492
|
+
site: S.optionalWith(S.String, { nullable: true }),
|
|
493
|
+
creator: S.optionalWith(S.String, { nullable: true }),
|
|
494
|
+
title: S.optionalWith(S.String, { nullable: true }),
|
|
495
|
+
description: S.optionalWith(S.String, { nullable: true }),
|
|
496
|
+
image: S.optionalWith(S.String.pipe(S.minLength(1)), { nullable: true }),
|
|
497
|
+
}) {
|
|
498
|
+
}
|
|
499
|
+
export class PageMeta extends S.Struct({
|
|
500
|
+
title: S.optionalWith(S.String, { nullable: true }),
|
|
501
|
+
description: S.optionalWith(S.String, { nullable: true }),
|
|
502
|
+
canonicalUrl: S.optionalWith(S.String.pipe(S.minLength(1)), { nullable: true }),
|
|
503
|
+
language: S.optionalWith(S.String.pipe(S.minLength(1)), { nullable: true }),
|
|
504
|
+
charset: S.optionalWith(S.String.pipe(S.minLength(1)), { nullable: true }),
|
|
505
|
+
favicon: S.optionalWith(S.String.pipe(S.minLength(1)), { nullable: true }),
|
|
506
|
+
icons: S.optionalWith(S.Array(IconMeta), { nullable: true }),
|
|
507
|
+
openGraph: S.optionalWith(OpenGraphMeta, { nullable: true }),
|
|
508
|
+
twitter: S.optionalWith(TwitterCardMeta, { nullable: true }),
|
|
509
|
+
}) {
|
|
510
|
+
}
|
|
511
|
+
export class FetchLink extends S.Struct({
|
|
512
|
+
url: S.String,
|
|
513
|
+
text: S.optionalWith(S.String, { nullable: true }),
|
|
514
|
+
}) {
|
|
515
|
+
}
|
|
516
|
+
export class RenderEnginesInfoCapture extends S.Literal('rust') {
|
|
517
|
+
}
|
|
518
|
+
export class RenderEnginesInfoMarkdown extends S.Literal('rust') {
|
|
519
|
+
}
|
|
520
|
+
export class RenderEnginesInfoTree extends S.Literal('rust') {
|
|
521
|
+
}
|
|
522
|
+
export class RenderEnginesInfo extends S.Struct({
|
|
523
|
+
capture: S.optionalWith(RenderEnginesInfoCapture, { nullable: true }),
|
|
524
|
+
markdown: S.optionalWith(RenderEnginesInfoMarkdown, { nullable: true }),
|
|
525
|
+
tree: S.optionalWith(RenderEnginesInfoTree, { nullable: true }),
|
|
526
|
+
}) {
|
|
527
|
+
}
|
|
528
|
+
export class PaginationMeta extends S.Struct({
|
|
529
|
+
total: S.Number,
|
|
530
|
+
limit: S.Number,
|
|
531
|
+
offset: S.Number,
|
|
532
|
+
hasMore: S.Boolean,
|
|
533
|
+
}) {
|
|
534
|
+
}
|
|
535
|
+
export class BatchedStatus extends S.Class('BatchedStatus')({
|
|
536
|
+
id: S.String,
|
|
537
|
+
status: BatchedStatusStatus,
|
|
538
|
+
batchedStatus: BatchedStatusBatchedStatus,
|
|
539
|
+
totalUrls: S.Number,
|
|
540
|
+
results: S.Array(S.Struct({
|
|
541
|
+
data: S.Struct({
|
|
542
|
+
response: ResponseInfo,
|
|
543
|
+
meta: S.optionalWith(PageMeta, { nullable: true }),
|
|
544
|
+
json: S.optionalWith(S.Array(S.Struct({})), { nullable: true }),
|
|
545
|
+
snapshotId: S.optionalWith(NonEmptyString, { nullable: true }),
|
|
546
|
+
html: S.optionalWith(S.String.pipe(S.minLength(1)), { nullable: true }),
|
|
547
|
+
markdown: S.optionalWith(S.String.pipe(S.minLength(1)), { nullable: true }),
|
|
548
|
+
screenshot: S.optionalWith(S.Struct({
|
|
549
|
+
url: S.String,
|
|
550
|
+
fullPage: S.Boolean,
|
|
551
|
+
}), { nullable: true }),
|
|
552
|
+
summary: S.optionalWith(S.String.pipe(S.minLength(1)), { nullable: true }),
|
|
553
|
+
search: S.optionalWith(FetchSearchResult, { nullable: true }),
|
|
554
|
+
links: S.optionalWith(S.Array(FetchLink), { nullable: true }),
|
|
555
|
+
appendix: S.optionalWith(S.String.pipe(S.minLength(1)), { nullable: true }),
|
|
556
|
+
renderEngines: S.optionalWith(RenderEnginesInfo, { nullable: true }),
|
|
557
|
+
captureTelemetry: S.optionalWith(CaptureTelemetryInfo, { nullable: true }),
|
|
558
|
+
assets: S.optionalWith(S.Array(FetchAssetReference), { nullable: true }),
|
|
559
|
+
blocked: S.optionalWith(S.Struct({
|
|
560
|
+
blockedType: S.optionalWith(S.String, { nullable: true }),
|
|
561
|
+
}), { nullable: true }),
|
|
562
|
+
}),
|
|
563
|
+
})),
|
|
564
|
+
pagination: PaginationMeta,
|
|
565
|
+
}) {
|
|
566
|
+
}
|
|
567
|
+
export class BatchedIncludeUnsupportedTag extends S.Literal('BatchedIncludeUnsupported') {
|
|
568
|
+
}
|
|
569
|
+
export class BatchedIncludeUnsupported extends S.Struct({
|
|
570
|
+
unsupportedFields: S.Array(S.String),
|
|
571
|
+
_tag: BatchedIncludeUnsupportedTag,
|
|
572
|
+
}) {
|
|
573
|
+
}
|
|
574
|
+
export class FetchGetBatched400 extends S.Union(HttpApiDecodeError, BatchedIncludeUnsupported) {
|
|
575
|
+
}
|
|
576
|
+
export const make = (httpClient, options = {}) => {
|
|
577
|
+
const unexpectedStatus = (request, response) => Effect.flatMap(Effect.orElseSucceed(response.text, () => 'Unexpected status code'), (description) => Effect.fail(new HttpClientError.ResponseError({
|
|
578
|
+
request,
|
|
579
|
+
response,
|
|
580
|
+
reason: 'StatusCode',
|
|
581
|
+
description,
|
|
582
|
+
})));
|
|
583
|
+
const applyClientTransform = (client) => options.transformClient ? options.transformClient(client) : Effect.succeed(client);
|
|
584
|
+
const decodeError = (response, schema) => Effect.flatMap(HttpClientResponse.schemaBodyJson(schema)(response), Effect.fail);
|
|
585
|
+
return {
|
|
586
|
+
fetchFetch: (options) => HttpClientRequest.make('POST')(`/v1/fetch`).pipe(HttpClientRequest.setUrlParams({ include: options.params['include'] }), (req) => Effect.orDie(HttpClientRequest.bodyJson(req, options.payload)), Effect.flatMap((request) => Effect.flatMap(applyClientTransform(httpClient), (httpClient) => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
|
|
587
|
+
'400': (r) => decodeError(r, FetchFetch400),
|
|
588
|
+
'401': (r) => decodeError(r, AuthFailed),
|
|
589
|
+
'403': (r) => decodeError(r, FetchFetch403),
|
|
590
|
+
'413': (r) => decodeError(r, PayloadTooLarge),
|
|
591
|
+
'429': (r) => decodeError(r, TooManyRequests),
|
|
592
|
+
'500': (r) => decodeError(r, InternalError),
|
|
593
|
+
'503': (r) => decodeError(r, ServiceUnavailable),
|
|
594
|
+
orElse: (response) => unexpectedStatus(request, response),
|
|
595
|
+
}))))),
|
|
596
|
+
fetchFetchJson: (options) => HttpClientRequest.make('POST')(`/v1/fetch/json`).pipe(HttpClientRequest.setUrlParams({ include: options.params['include'] }), (req) => Effect.orDie(HttpClientRequest.bodyJson(req, options.payload)), Effect.flatMap((request) => Effect.flatMap(applyClientTransform(httpClient), (httpClient) => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
|
|
597
|
+
'200': (r) => HttpClientResponse.schemaBodyJson(FetchObjectModeResult)(r),
|
|
598
|
+
'400': (r) => decodeError(r, FetchFetchJson400),
|
|
599
|
+
'401': (r) => decodeError(r, AuthFailed),
|
|
600
|
+
'403': (r) => decodeError(r, FetchFetchJson403),
|
|
601
|
+
'413': (r) => decodeError(r, PayloadTooLarge),
|
|
602
|
+
'429': (r) => decodeError(r, TooManyRequests),
|
|
603
|
+
'500': (r) => decodeError(r, InternalError),
|
|
604
|
+
'503': (r) => decodeError(r, ServiceUnavailable),
|
|
605
|
+
orElse: (response) => unexpectedStatus(request, response),
|
|
606
|
+
}))))),
|
|
607
|
+
fetchFetchSearch: (options) => HttpClientRequest.make('POST')(`/v1/fetch/search`).pipe((req) => Effect.orDie(HttpClientRequest.bodyJson(req, options)), Effect.flatMap((request) => Effect.flatMap(applyClientTransform(httpClient), (httpClient) => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
|
|
608
|
+
'200': (r) => HttpClientResponse.schemaBodyJson(FetchSnapshotSearchResult)(r),
|
|
609
|
+
'400': (r) => decodeError(r, FetchFetchSearch400),
|
|
610
|
+
'401': (r) => decodeError(r, AuthFailed),
|
|
611
|
+
'403': (r) => decodeError(r, FetchFetchSearch403),
|
|
612
|
+
'404': (r) => decodeError(r, FetchSnapshotSearchNotFound),
|
|
613
|
+
'413': (r) => decodeError(r, PayloadTooLarge),
|
|
614
|
+
'429': (r) => decodeError(r, TooManyRequests),
|
|
615
|
+
'500': (r) => decodeError(r, InternalError),
|
|
616
|
+
'503': (r) => decodeError(r, ServiceUnavailable),
|
|
617
|
+
orElse: (response) => unexpectedStatus(request, response),
|
|
618
|
+
}))))),
|
|
619
|
+
fetchBatched: (options) => HttpClientRequest.make('POST')(`/v1/fetch/batched`).pipe((req) => Effect.orDie(HttpClientRequest.bodyJson(req, options)), Effect.flatMap((request) => Effect.flatMap(applyClientTransform(httpClient), (httpClient) => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
|
|
620
|
+
'200': (r) => HttpClientResponse.schemaBodyJson(BatchedRun)(r),
|
|
621
|
+
'400': (r) => decodeError(r, FetchBatched400),
|
|
622
|
+
'401': (r) => decodeError(r, AuthFailed),
|
|
623
|
+
'403': (r) => decodeError(r, FetchBatched403),
|
|
624
|
+
'413': (r) => decodeError(r, PayloadTooLarge),
|
|
625
|
+
'429': (r) => decodeError(r, TooManyRequests),
|
|
626
|
+
'500': (r) => decodeError(r, InternalError),
|
|
627
|
+
'503': (r) => decodeError(r, ServiceUnavailable),
|
|
628
|
+
orElse: (response) => unexpectedStatus(request, response),
|
|
629
|
+
}))))),
|
|
630
|
+
fetchGetBatched: (id, options) => HttpClientRequest.make('GET')(`/v1/fetch/batched/${id}`).pipe(HttpClientRequest.setUrlParams({
|
|
631
|
+
limit: options['limit'],
|
|
632
|
+
offset: options['offset'],
|
|
633
|
+
include: options['include'],
|
|
634
|
+
}), Effect.succeed, Effect.flatMap((request) => Effect.flatMap(applyClientTransform(httpClient), (httpClient) => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
|
|
635
|
+
'200': (r) => HttpClientResponse.schemaBodyJson(BatchedStatus)(r),
|
|
636
|
+
'400': (r) => decodeError(r, FetchGetBatched400),
|
|
637
|
+
'401': (r) => decodeError(r, AuthFailed),
|
|
638
|
+
'413': (r) => decodeError(r, PayloadTooLarge),
|
|
639
|
+
'429': (r) => decodeError(r, TooManyRequests),
|
|
640
|
+
'500': (r) => decodeError(r, InternalError),
|
|
641
|
+
'503': (r) => decodeError(r, ServiceUnavailable),
|
|
642
|
+
orElse: (response) => unexpectedStatus(request, response),
|
|
643
|
+
}))))),
|
|
644
|
+
};
|
|
645
|
+
};
|
|
646
|
+
//# sourceMappingURL=Generated.js.map
|