@eco-foundation/api-schemas 0.12.0 → 0.14.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 +98 -13
- package/dist/fixtures/v1/routes-list.response.default.json +36 -9
- package/dist/generated/build-digest.json +1 -1
- package/dist/v1/endpoints/registry.d.ts +32 -9
- package/dist/v1/endpoints/registry.js +3 -1
- package/dist/v1/endpoints/registry.js.map +1 -1
- package/dist/v1/endpoints/routes.d.ts +106 -16
- package/dist/v1/endpoints/routes.js +34 -8
- package/dist/v1/endpoints/routes.js.map +1 -1
- package/dist/v1/errors/catalog.d.ts +7 -0
- package/dist/v1/errors/catalog.js +1 -0
- package/dist/v1/errors/catalog.js.map +1 -1
- package/dist/v1/index.d.ts +1 -0
- package/dist/v1/index.js +1 -0
- package/dist/v1/index.js.map +1 -1
- package/dist/v1/maintenance/schema.d.ts +30 -0
- package/dist/v1/maintenance/schema.js +65 -0
- package/dist/v1/maintenance/schema.js.map +1 -0
- package/errors/catalog.lock.json +5 -0
- package/fixtures/maintenance-boundaries.json +405 -0
- package/openapi/v1.json +198 -62
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ Zod-first schemas, error catalog, golden fixtures, and generated OpenAPI 3.1 for
|
|
|
4
4
|
API. The Zod schemas are the source of truth; everything else (OpenAPI, fixtures, plain types)
|
|
5
5
|
is generated from or gated against them.
|
|
6
6
|
|
|
7
|
-
Today the package covers **13 endpoints across 12 paths**, **
|
|
7
|
+
Today the package covers **13 endpoints across 12 paths**, **40 error codes** (51 namespaced
|
|
8
8
|
legacy references), and **21 golden fixtures**.
|
|
9
9
|
|
|
10
10
|
## Install
|
|
@@ -14,13 +14,13 @@ While the package is 0.x, pin the patch range or the exact version:
|
|
|
14
14
|
```json
|
|
15
15
|
{
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@eco-foundation/api-schemas": "~0.
|
|
17
|
+
"@eco-foundation/api-schemas": "~0.14.0"
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
**Never write `^0`.** npm resolves `^0.x` as `>=0.0.0 <1.0.0`, so it silently accepts every
|
|
23
|
-
future breaking `0.y` — it is not a pin at all. Use `~0.
|
|
23
|
+
future breaking `0.y` — it is not a pin at all. Use `~0.14.0` or the exact `0.14.0`.
|
|
24
24
|
|
|
25
25
|
A matching version string is not evidence of a matching artifact: also compare
|
|
26
26
|
`V1_SCHEMA_DIGEST` (see [Invariants](#invariants-enforced-in-ci)). Two builds both called
|
|
@@ -30,6 +30,85 @@ A matching version string is not evidence of a matching artifact: also compare
|
|
|
30
30
|
zod-bearing entry point. Which case you are in is decided entirely by your imports; see
|
|
31
31
|
[Consumers](#consumers).
|
|
32
32
|
|
|
33
|
+
## Migrating 0.13.0 -> 0.14.0
|
|
34
|
+
|
|
35
|
+
**BREAKING only for consumers of the draft `/v1/routes` schemas.** No stable endpoint changes.
|
|
36
|
+
`/v1/routes` stays `stability: 'draft'`.
|
|
37
|
+
|
|
38
|
+
**`V1_SCHEMA_DIGEST` MOVES** to
|
|
39
|
+
`b5a7e99f743687c57fb0cda933a772c03e71e43f6581766eae2c79935b061c5b`, because `openapi/v1.json`
|
|
40
|
+
changed. Every consumer running `assertNoSkew` moves in the same rollout.
|
|
41
|
+
|
|
42
|
+
New exports: `ROUTES_LIST_QUERY_SHAPE`, `ROUTES_CURSOR_MAX_LENGTH`, `RoutesListQuerySchema`,
|
|
43
|
+
`RouteLimitsSchema`, `RoutePairLegSchema`, `RoutePairSchema`, `RouteChainSchema`,
|
|
44
|
+
`RouteAnyAssetSchema`, and the types `RoutesListQuery`, `RouteEntry`, `RoutesResponse`.
|
|
45
|
+
|
|
46
|
+
**1. `RouteEntrySchema` is one row per chain pair.** A row is
|
|
47
|
+
`{ source: { chainId }, destination: { chainId }, pairs, anyAsset }`. `pairs[]` holds
|
|
48
|
+
`{ baseline, source, destination }`, where each side is `{ token, symbol, decimals, limits }` and
|
|
49
|
+
`limits` is `{ min?, max? }` in base-unit integer strings. `anyAsset` is
|
|
50
|
+
`{ source: boolean, destination: boolean }`. The placeholder fields `source.token`,
|
|
51
|
+
`destination.token` and `swapTypes` are gone.
|
|
52
|
+
|
|
53
|
+
**2. `RoutesResponseSchema` gains a required `updatedAt`**, a Unix-seconds number (`UnixSeconds`),
|
|
54
|
+
matching every other /v1 timestamp.
|
|
55
|
+
|
|
56
|
+
**3. `/v1/routes` publishes three optional query parameters** through
|
|
57
|
+
`ROUTES_LIST_QUERY_SHAPE` / `RoutesListQuerySchema`: `sourceChainId`, `destinationChainId`
|
|
58
|
+
(both `ChainIdParam`) and `cursor`.
|
|
59
|
+
|
|
60
|
+
**4. The `routes.list` golden fixture** now carries a Base -> Arbitrum row with two pairs. It is
|
|
61
|
+
still draft-tagged, so live replay still skips it.
|
|
62
|
+
|
|
63
|
+
## Migrating 0.12.0 -> 0.13.0
|
|
64
|
+
|
|
65
|
+
**BREAKING under 0.x semver only for exhaustive handling of `V1ErrorCode`.** Nothing on the wire
|
|
66
|
+
that `0.12.0` accepted is rejected and no response shape changes. The release adds one error code,
|
|
67
|
+
one config schema, and one fixture file for scheduled maintenance windows (PER-673).
|
|
68
|
+
|
|
69
|
+
**`V1_SCHEMA_DIGEST` MOVES** to
|
|
70
|
+
`e5a684f678f80135ddf7241029d965d2a206b3b573a9969ad1352610d1b4abc9`, because both digest inputs
|
|
71
|
+
changed (`errors/catalog.lock.json` gained one code and `openapi/v1.json` its `x-error-catalog`
|
|
72
|
+
entry). Every consumer running `assertNoSkew` moves in the same rollout.
|
|
73
|
+
|
|
74
|
+
**1. New error code `maintenance` (503, audience `all`, no legacy codes).** It is a planned stop,
|
|
75
|
+
distinct from `service-unavailable` (an outage). eco-router, eco-quotes and deposit-addresses
|
|
76
|
+
return it from every quote-creating and address-creating endpoint while a configured window is
|
|
77
|
+
active, with `startsAt`/`endsAt` in the body and a `Retry-After` header. `V1ProblemSchema` now
|
|
78
|
+
checks a `maintenance` body's `status`/`type` against the catalog, and an exhaustive `switch`
|
|
79
|
+
over `V1ErrorCode` stops compiling until it handles the new member. That is the breaking item.
|
|
80
|
+
|
|
81
|
+
**2. New config schemas `MaintenanceWindowSchema` and `MaintenanceConfigSchema`** (on the `v1`
|
|
82
|
+
namespace, with types `MaintenanceWindow`, `MaintenanceConfig`, `MaintenanceConfigInput`). A
|
|
83
|
+
window is `{ startsAt, endsAt, message }`: `startsAt` inclusive, `endsAt` exclusive, both
|
|
84
|
+
ISO-8601 UTC strings ending in `Z` with at most three fractional digits (offsets and impossible
|
|
85
|
+
dates such as `2026-02-30` are rejected), `message` 1-200 characters and not blank (whitespace-only
|
|
86
|
+
is rejected — it is echoed verbatim to partners), and `endsAt` must be after `startsAt`. `windows`
|
|
87
|
+
defaults to `[]`. Both schemas reject any key not in their shape (e.g. a `window` typo for
|
|
88
|
+
`windows`) at parse time, naming the key — this is scoped to the raw input's own enumerable
|
|
89
|
+
properties, so a config object read through node-config (whose hidden, non-enumerable `get`/`has`/
|
|
90
|
+
`util` helpers are unaffected) still parses. Overlapping windows are allowed; past windows are valid
|
|
91
|
+
(services drop them at boot). **Quote the timestamps in YAML**: an unquoted
|
|
92
|
+
`2026-10-04T02:00:00Z` is loaded as a `Date` and fails with "quote it in YAML". There is no
|
|
93
|
+
`./v1/maintenance` subpath, because the schemas need zod anyway, so import them from the root
|
|
94
|
+
`v1` namespace.
|
|
95
|
+
|
|
96
|
+
**3. New fixture `fixtures/maintenance-boundaries.json`** (served by the existing `./fixtures/*`
|
|
97
|
+
subpath). Each entry service implements its own resolver (the package deliberately ships none)
|
|
98
|
+
and asserts it against every vector: active when `startsAt <= now < endsAt`; with several
|
|
99
|
+
active, the latest `endsAt` wins and a tie goes to the first in the list;
|
|
100
|
+
`retryAfterSeconds = max(1, ceil((endsAt - now) / 1000))`.
|
|
101
|
+
|
|
102
|
+
**4. Consumers** pin `~0.13.0` (never `^0`) and re-run `assertNoSkew`. No golden fixture under
|
|
103
|
+
`src/fixtures/v1` changed.
|
|
104
|
+
|
|
105
|
+
**5. The `zod` peer range rises to `^4.4.0`** (from `^4.3.0`), still optional. The maintenance
|
|
106
|
+
schemas' exported types (`MaintenanceWindowSchema`, `MaintenanceConfigSchema`) use
|
|
107
|
+
`z.ZodPreprocess`, which zod only exports from 4.4 — on zod 4.3.x those `.d.ts` types silently
|
|
108
|
+
collapse to `any` under `skipLibCheck` (and fail `TS2724` without it). A consumer that imports
|
|
109
|
+
zod-bearing entry points must upgrade to zod `^4.4.0`+ before adopting `0.13.0`; the two
|
|
110
|
+
zod-free subpaths (`./v1/signature`, `./v1/types`) are unaffected.
|
|
111
|
+
|
|
33
112
|
## Migrating 0.11.0 -> 0.12.0
|
|
34
113
|
|
|
35
114
|
**Non-breaking for callers, a new version for consumers.** `GET /v1/intents/status` now accepts
|
|
@@ -989,7 +1068,7 @@ must: it is the artifact identity, not the version string.
|
|
|
989
1068
|
declared optional (`peerDependenciesMeta: { zod: { optional: true } }`), because for two of the
|
|
990
1069
|
published entry points it is genuinely not needed:
|
|
991
1070
|
|
|
992
|
-
- **Needs `zod` (`^4.
|
|
1071
|
+
- **Needs `zod` (`^4.4.0`):** the bare package name `.`, `./testing`, and anything reached
|
|
993
1072
|
through the `v1` namespace on either. These load schema modules, and their `.d.ts` names zod
|
|
994
1073
|
types.
|
|
995
1074
|
- **Needs NO `zod`:** `./v1/signature` (runtime code importing `@noble/hashes` and nothing else)
|
|
@@ -998,8 +1077,8 @@ published entry points it is genuinely not needed:
|
|
|
998
1077
|
|
|
999
1078
|
Read `optional` narrowly: it says zod **may be absent**, not that any zod version works. pnpm
|
|
1000
1079
|
suppresses the unmet-peer warning only when zod is MISSING (verified against pnpm 10.16); a
|
|
1001
|
-
consumer that HAS a zod outside `^4.
|
|
1002
|
-
`unmet peer zod@^4.
|
|
1080
|
+
consumer that HAS a zod outside `^4.4.0` — solver-v2, on zod 3 — still sees
|
|
1081
|
+
`unmet peer zod@^4.4.0: found <version>`, since that is a version mismatch rather than a missing
|
|
1003
1082
|
peer. Suppressing that one is the consumer's own call
|
|
1004
1083
|
(`pnpm.peerDependencyRules.allowedVersions`), and it is safe exactly while its imports are
|
|
1005
1084
|
limited to the two zod-free subpaths above. The range itself cannot be widened — the schemas
|
|
@@ -1007,14 +1086,16 @@ require Zod 4.
|
|
|
1007
1086
|
|
|
1008
1087
|
Zod-major compatibility is the reason there are two interfaces, not one:
|
|
1009
1088
|
|
|
1010
|
-
- **Zod-4 consumers** (eco-router `^4.4.3
|
|
1011
|
-
|
|
1089
|
+
- **Zod-4 consumers** (eco-router `^4.4.3`) import the schemas directly. Since `0.2.0`, `zod` is
|
|
1090
|
+
a **`peerDependency` with a range (`^4.4.0` since `0.13.0`, raised from `^4.3.0`)** — optional
|
|
1012
1091
|
since `0.3.1` — not a hard-pinned dependency: the consumer's own single copy satisfies it. For
|
|
1013
|
-
these consumers optional changes nothing; they must still install zod.
|
|
1014
|
-
|
|
1015
|
-
|
|
1092
|
+
these consumers optional changes nothing; they must still install zod. deposit-addresses'
|
|
1093
|
+
prior `^4.3.5` install is now below the floor and must upgrade to `^4.4.0`+ to consume `0.13.0`
|
|
1094
|
+
— see [Migrating 0.12.0 -> 0.13.0](#migrating-0120---0130). The previous exact `dependencies`
|
|
1095
|
+
pin at `4.4.3` materialised a SECOND nested zod for every consumer not on that exact version,
|
|
1096
|
+
and two zod instances in one type graph is the documented failure — `TS2345` on
|
|
1016
1097
|
`_zod.version.minor` when a package schema is passed to a local `z.ZodType<T>`, and `tsc`
|
|
1017
|
-
OOMing at 4 GB with no message. A consumer therefore installs zod itself (any `4.
|
|
1098
|
+
OOMing at 4 GB with no message. A consumer therefore installs zod itself (any `4.4.x`+ `4.x`);
|
|
1018
1099
|
the package keeps an exact `4.4.3` **devDependency** so its own build and its generated
|
|
1019
1100
|
OpenAPI stay byte-stable.
|
|
1020
1101
|
- **solver-v2 is on Zod 3 and must never be forced to Zod 4.** It consumes the zod-free
|
|
@@ -1041,6 +1122,7 @@ Zod-major compatibility is the reason there are two interfaces, not one:
|
|
|
1041
1122
|
| `./openapi/v1.json` | the generated OpenAPI 3.1 document |
|
|
1042
1123
|
| `./fixtures/signature-hash/vectors.json` | cross-repo `signatureHash` vectors |
|
|
1043
1124
|
| `./fixtures/quote-signature/vector-*.json` | cross-repo F3 quote-signature (EIP-712) vectors |
|
|
1125
|
+
| `./fixtures/maintenance-boundaries.json` | cross-repo maintenance-window (PER-673) resolver boundary vectors |
|
|
1044
1126
|
|
|
1045
1127
|
## Fixtures
|
|
1046
1128
|
|
|
@@ -1057,7 +1139,10 @@ There are two fixture locations and they serve different jobs — do not conflat
|
|
|
1057
1139
|
`fixtures/signature-hash/vectors.json` (the `signatureHash` canonicalization contract) and
|
|
1058
1140
|
`fixtures/quote-signature/vector-*.json` (the F3 EIP-712 `EcoQuoteV1` vectors, each with its
|
|
1059
1141
|
`digest`, `signature`, and `signer`; the signing key is derived from a public domain string,
|
|
1060
|
-
so this repo ships no private-key bytes).
|
|
1142
|
+
so this repo ships no private-key bytes), and `fixtures/maintenance-boundaries.json` (the
|
|
1143
|
+
PER-673 maintenance-window boundary vectors: `{ name, windows, nowIso, expected }`, which each
|
|
1144
|
+
entry service's local resolver asserts; this package's own suite checks every vector against a
|
|
1145
|
+
reference resolver kept in the spec file, so a wrong `expected` fails here first).
|
|
1061
1146
|
|
|
1062
1147
|
`routes.list` is the one fixture tagged `stability: 'draft'`. A live-replay consumer skips it
|
|
1063
1148
|
with the reason `draft endpoint (x-stability: draft) — not served at launch` instead of
|
|
@@ -10,17 +10,44 @@
|
|
|
10
10
|
"payload": {
|
|
11
11
|
"routes": [
|
|
12
12
|
{
|
|
13
|
-
"source": {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
"source": { "chainId": 8453 },
|
|
14
|
+
"destination": { "chainId": 42161 },
|
|
15
|
+
"pairs": [
|
|
16
|
+
{
|
|
17
|
+
"baseline": true,
|
|
18
|
+
"source": {
|
|
19
|
+
"token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
|
|
20
|
+
"symbol": "USDC",
|
|
21
|
+
"decimals": 6,
|
|
22
|
+
"limits": { "min": "1000000", "max": "50000000000" }
|
|
23
|
+
},
|
|
24
|
+
"destination": {
|
|
25
|
+
"token": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
|
|
26
|
+
"symbol": "USDC",
|
|
27
|
+
"decimals": 6,
|
|
28
|
+
"limits": { "min": "1000000", "max": "50000000000" }
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"baseline": false,
|
|
33
|
+
"source": {
|
|
34
|
+
"token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
|
|
35
|
+
"symbol": "USDC",
|
|
36
|
+
"decimals": 6,
|
|
37
|
+
"limits": { "min": "1000000", "max": "20000000000" }
|
|
38
|
+
},
|
|
39
|
+
"destination": {
|
|
40
|
+
"token": "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",
|
|
41
|
+
"symbol": "USDT",
|
|
42
|
+
"decimals": 6,
|
|
43
|
+
"limits": { "max": "20000000000" }
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
"anyAsset": { "source": true, "destination": true }
|
|
22
48
|
}
|
|
23
49
|
],
|
|
50
|
+
"updatedAt": 1791381600,
|
|
24
51
|
"nextCursor": null
|
|
25
52
|
}
|
|
26
53
|
}
|
|
@@ -683,27 +683,50 @@ export declare const V1_ENDPOINTS: {
|
|
|
683
683
|
readonly 'routes.list': {
|
|
684
684
|
readonly method: "GET";
|
|
685
685
|
readonly path: "/v1/routes";
|
|
686
|
-
readonly summary:
|
|
686
|
+
readonly summary: string;
|
|
687
687
|
readonly tag: "discovery";
|
|
688
688
|
readonly stability: "draft";
|
|
689
689
|
readonly successStatus: 200;
|
|
690
|
+
readonly query: {
|
|
691
|
+
sourceChainId: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
692
|
+
destinationChainId: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
693
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
694
|
+
};
|
|
690
695
|
readonly response: z.ZodObject<{
|
|
691
696
|
routes: z.ZodArray<z.ZodObject<{
|
|
692
697
|
source: z.ZodObject<{
|
|
693
698
|
chainId: z.ZodNumber;
|
|
694
|
-
token: z.ZodUnion<readonly [z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodString]>, z.ZodString]>;
|
|
695
699
|
}, z.core.$loose>;
|
|
696
700
|
destination: z.ZodObject<{
|
|
697
701
|
chainId: z.ZodNumber;
|
|
698
|
-
token: z.ZodUnion<readonly [z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodString]>, z.ZodString]>;
|
|
699
702
|
}, z.core.$loose>;
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
703
|
+
pairs: z.ZodArray<z.ZodObject<{
|
|
704
|
+
baseline: z.ZodBoolean;
|
|
705
|
+
source: z.ZodObject<{
|
|
706
|
+
token: z.ZodUnion<readonly [z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodString]>, z.ZodString]>;
|
|
707
|
+
symbol: z.ZodString;
|
|
708
|
+
decimals: z.ZodNumber;
|
|
709
|
+
limits: z.ZodObject<{
|
|
710
|
+
min: z.ZodOptional<z.ZodString>;
|
|
711
|
+
max: z.ZodOptional<z.ZodString>;
|
|
712
|
+
}, z.core.$loose>;
|
|
713
|
+
}, z.core.$loose>;
|
|
714
|
+
destination: z.ZodObject<{
|
|
715
|
+
token: z.ZodUnion<readonly [z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodString]>, z.ZodString]>;
|
|
716
|
+
symbol: z.ZodString;
|
|
717
|
+
decimals: z.ZodNumber;
|
|
718
|
+
limits: z.ZodObject<{
|
|
719
|
+
min: z.ZodOptional<z.ZodString>;
|
|
720
|
+
max: z.ZodOptional<z.ZodString>;
|
|
721
|
+
}, z.core.$loose>;
|
|
722
|
+
}, z.core.$loose>;
|
|
723
|
+
}, z.core.$loose>>;
|
|
724
|
+
anyAsset: z.ZodObject<{
|
|
725
|
+
source: z.ZodBoolean;
|
|
726
|
+
destination: z.ZodBoolean;
|
|
727
|
+
}, z.core.$loose>;
|
|
706
728
|
}, z.core.$loose>>;
|
|
729
|
+
updatedAt: z.ZodNumber;
|
|
707
730
|
nextCursor: z.ZodNullable<z.ZodString>;
|
|
708
731
|
}, z.core.$loose>;
|
|
709
732
|
};
|
|
@@ -79,10 +79,12 @@ exports.V1_ENDPOINTS = {
|
|
|
79
79
|
'routes.list': {
|
|
80
80
|
method: 'GET',
|
|
81
81
|
path: '/v1/routes',
|
|
82
|
-
summary: '
|
|
82
|
+
summary: 'Chain pairs the caller can quote: token pairs served directly, with order-size limits, ' +
|
|
83
|
+
'and any-asset flags for the rest (DRAFT).',
|
|
83
84
|
tag: 'discovery',
|
|
84
85
|
stability: 'draft',
|
|
85
86
|
successStatus: 200,
|
|
87
|
+
query: routes_1.ROUTES_LIST_QUERY_SHAPE,
|
|
86
88
|
response: routes_1.RoutesResponseSchema,
|
|
87
89
|
},
|
|
88
90
|
'deposit-addresses.create': {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../src/v1/endpoints/registry.ts"],"names":[],"mappings":";;;AAEA,+CAAoD;AACpD,qCAAyE;AACzE,2DAK6B;AAC7B,qCAAmE;AACnE,
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../src/v1/endpoints/registry.ts"],"names":[],"mappings":";;;AAEA,+CAAoD;AACpD,qCAAyE;AACzE,2DAK6B;AAC7B,qCAAmE;AACnE,qCAAyE;AACzE,qCAIkB;AAClB,qCAOkB;AAClB,qCAAyE;AAmDzE,MAAM,cAAc,GAAG,CACrB,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B,aAAa,EAAE,GAAG;QAKlB,KAAK,EAAE,sDAAkC;QACzC,QAAQ,EAAE,sDAAkC;KAC7C;CACsD,CAAC;AAK7C,QAAA,wBAAwB,GAAG,yBAAe,CAAC"}
|
|
@@ -1,37 +1,127 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const ROUTES_STABILITY: "draft";
|
|
3
|
+
export declare const ROUTES_CURSOR_MAX_LENGTH = 512;
|
|
4
|
+
export declare const ROUTES_LIST_QUERY_SHAPE: {
|
|
5
|
+
sourceChainId: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
6
|
+
destinationChainId: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
7
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
8
|
+
};
|
|
9
|
+
export declare const RoutesListQuerySchema: z.ZodObject<{
|
|
10
|
+
sourceChainId: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
11
|
+
destinationChainId: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
12
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
export type RoutesListQuery = z.infer<typeof RoutesListQuerySchema>;
|
|
15
|
+
export declare const RouteLimitsSchema: z.ZodObject<{
|
|
16
|
+
min: z.ZodOptional<z.ZodString>;
|
|
17
|
+
max: z.ZodOptional<z.ZodString>;
|
|
18
|
+
}, z.core.$loose>;
|
|
19
|
+
export declare const RoutePairLegSchema: z.ZodObject<{
|
|
20
|
+
token: z.ZodUnion<readonly [z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodString]>, z.ZodString]>;
|
|
21
|
+
symbol: z.ZodString;
|
|
22
|
+
decimals: z.ZodNumber;
|
|
23
|
+
limits: z.ZodObject<{
|
|
24
|
+
min: z.ZodOptional<z.ZodString>;
|
|
25
|
+
max: z.ZodOptional<z.ZodString>;
|
|
26
|
+
}, z.core.$loose>;
|
|
27
|
+
}, z.core.$loose>;
|
|
28
|
+
export declare const RoutePairSchema: z.ZodObject<{
|
|
29
|
+
baseline: z.ZodBoolean;
|
|
30
|
+
source: z.ZodObject<{
|
|
31
|
+
token: z.ZodUnion<readonly [z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodString]>, z.ZodString]>;
|
|
32
|
+
symbol: z.ZodString;
|
|
33
|
+
decimals: z.ZodNumber;
|
|
34
|
+
limits: z.ZodObject<{
|
|
35
|
+
min: z.ZodOptional<z.ZodString>;
|
|
36
|
+
max: z.ZodOptional<z.ZodString>;
|
|
37
|
+
}, z.core.$loose>;
|
|
38
|
+
}, z.core.$loose>;
|
|
39
|
+
destination: z.ZodObject<{
|
|
40
|
+
token: z.ZodUnion<readonly [z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodString]>, z.ZodString]>;
|
|
41
|
+
symbol: z.ZodString;
|
|
42
|
+
decimals: z.ZodNumber;
|
|
43
|
+
limits: z.ZodObject<{
|
|
44
|
+
min: z.ZodOptional<z.ZodString>;
|
|
45
|
+
max: z.ZodOptional<z.ZodString>;
|
|
46
|
+
}, z.core.$loose>;
|
|
47
|
+
}, z.core.$loose>;
|
|
48
|
+
}, z.core.$loose>;
|
|
49
|
+
export declare const RouteChainSchema: z.ZodObject<{
|
|
50
|
+
chainId: z.ZodNumber;
|
|
51
|
+
}, z.core.$loose>;
|
|
52
|
+
export declare const RouteAnyAssetSchema: z.ZodObject<{
|
|
53
|
+
source: z.ZodBoolean;
|
|
54
|
+
destination: z.ZodBoolean;
|
|
55
|
+
}, z.core.$loose>;
|
|
3
56
|
export declare const RouteEntrySchema: z.ZodObject<{
|
|
4
57
|
source: z.ZodObject<{
|
|
5
58
|
chainId: z.ZodNumber;
|
|
6
|
-
token: z.ZodUnion<readonly [z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodString]>, z.ZodString]>;
|
|
7
59
|
}, z.core.$loose>;
|
|
8
60
|
destination: z.ZodObject<{
|
|
9
61
|
chainId: z.ZodNumber;
|
|
10
|
-
token: z.ZodUnion<readonly [z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodString]>, z.ZodString]>;
|
|
11
62
|
}, z.core.$loose>;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
63
|
+
pairs: z.ZodArray<z.ZodObject<{
|
|
64
|
+
baseline: z.ZodBoolean;
|
|
65
|
+
source: z.ZodObject<{
|
|
66
|
+
token: z.ZodUnion<readonly [z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodString]>, z.ZodString]>;
|
|
67
|
+
symbol: z.ZodString;
|
|
68
|
+
decimals: z.ZodNumber;
|
|
69
|
+
limits: z.ZodObject<{
|
|
70
|
+
min: z.ZodOptional<z.ZodString>;
|
|
71
|
+
max: z.ZodOptional<z.ZodString>;
|
|
72
|
+
}, z.core.$loose>;
|
|
73
|
+
}, z.core.$loose>;
|
|
74
|
+
destination: z.ZodObject<{
|
|
75
|
+
token: z.ZodUnion<readonly [z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodString]>, z.ZodString]>;
|
|
76
|
+
symbol: z.ZodString;
|
|
77
|
+
decimals: z.ZodNumber;
|
|
78
|
+
limits: z.ZodObject<{
|
|
79
|
+
min: z.ZodOptional<z.ZodString>;
|
|
80
|
+
max: z.ZodOptional<z.ZodString>;
|
|
81
|
+
}, z.core.$loose>;
|
|
82
|
+
}, z.core.$loose>;
|
|
83
|
+
}, z.core.$loose>>;
|
|
84
|
+
anyAsset: z.ZodObject<{
|
|
85
|
+
source: z.ZodBoolean;
|
|
86
|
+
destination: z.ZodBoolean;
|
|
87
|
+
}, z.core.$loose>;
|
|
18
88
|
}, z.core.$loose>;
|
|
89
|
+
export type RouteEntry = z.input<typeof RouteEntrySchema>;
|
|
19
90
|
export declare const RoutesResponseSchema: z.ZodObject<{
|
|
20
91
|
routes: z.ZodArray<z.ZodObject<{
|
|
21
92
|
source: z.ZodObject<{
|
|
22
93
|
chainId: z.ZodNumber;
|
|
23
|
-
token: z.ZodUnion<readonly [z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodString]>, z.ZodString]>;
|
|
24
94
|
}, z.core.$loose>;
|
|
25
95
|
destination: z.ZodObject<{
|
|
26
96
|
chainId: z.ZodNumber;
|
|
27
|
-
token: z.ZodUnion<readonly [z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodString]>, z.ZodString]>;
|
|
28
97
|
}, z.core.$loose>;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
98
|
+
pairs: z.ZodArray<z.ZodObject<{
|
|
99
|
+
baseline: z.ZodBoolean;
|
|
100
|
+
source: z.ZodObject<{
|
|
101
|
+
token: z.ZodUnion<readonly [z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodString]>, z.ZodString]>;
|
|
102
|
+
symbol: z.ZodString;
|
|
103
|
+
decimals: z.ZodNumber;
|
|
104
|
+
limits: z.ZodObject<{
|
|
105
|
+
min: z.ZodOptional<z.ZodString>;
|
|
106
|
+
max: z.ZodOptional<z.ZodString>;
|
|
107
|
+
}, z.core.$loose>;
|
|
108
|
+
}, z.core.$loose>;
|
|
109
|
+
destination: z.ZodObject<{
|
|
110
|
+
token: z.ZodUnion<readonly [z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodString]>, z.ZodString]>;
|
|
111
|
+
symbol: z.ZodString;
|
|
112
|
+
decimals: z.ZodNumber;
|
|
113
|
+
limits: z.ZodObject<{
|
|
114
|
+
min: z.ZodOptional<z.ZodString>;
|
|
115
|
+
max: z.ZodOptional<z.ZodString>;
|
|
116
|
+
}, z.core.$loose>;
|
|
117
|
+
}, z.core.$loose>;
|
|
118
|
+
}, z.core.$loose>>;
|
|
119
|
+
anyAsset: z.ZodObject<{
|
|
120
|
+
source: z.ZodBoolean;
|
|
121
|
+
destination: z.ZodBoolean;
|
|
122
|
+
}, z.core.$loose>;
|
|
35
123
|
}, z.core.$loose>>;
|
|
124
|
+
updatedAt: z.ZodNumber;
|
|
36
125
|
nextCursor: z.ZodNullable<z.ZodString>;
|
|
37
126
|
}, z.core.$loose>;
|
|
127
|
+
export type RoutesResponse = z.input<typeof RoutesResponseSchema>;
|
|
@@ -1,21 +1,47 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RoutesResponseSchema = exports.RouteEntrySchema = exports.ROUTES_STABILITY = void 0;
|
|
3
|
+
exports.RoutesResponseSchema = exports.RouteEntrySchema = exports.RouteAnyAssetSchema = exports.RouteChainSchema = exports.RoutePairSchema = exports.RoutePairLegSchema = exports.RouteLimitsSchema = exports.RoutesListQuerySchema = exports.ROUTES_LIST_QUERY_SHAPE = exports.ROUTES_CURSOR_MAX_LENGTH = exports.ROUTES_STABILITY = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const enums_1 = require("../enums");
|
|
6
5
|
const primitives_1 = require("../primitives");
|
|
7
6
|
exports.ROUTES_STABILITY = 'draft';
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
exports.ROUTES_CURSOR_MAX_LENGTH = 512;
|
|
8
|
+
exports.ROUTES_LIST_QUERY_SHAPE = {
|
|
9
|
+
sourceChainId: primitives_1.ChainIdParam.optional(),
|
|
10
|
+
destinationChainId: primitives_1.ChainIdParam.optional(),
|
|
11
|
+
cursor: zod_1.z.string().min(1).max(exports.ROUTES_CURSOR_MAX_LENGTH).optional(),
|
|
12
|
+
};
|
|
13
|
+
exports.RoutesListQuerySchema = zod_1.z.object(exports.ROUTES_LIST_QUERY_SHAPE);
|
|
14
|
+
exports.RouteLimitsSchema = zod_1.z.looseObject({
|
|
15
|
+
min: primitives_1.UintString.optional(),
|
|
16
|
+
max: primitives_1.UintString.optional(),
|
|
17
|
+
});
|
|
18
|
+
exports.RoutePairLegSchema = zod_1.z.looseObject({
|
|
10
19
|
token: primitives_1.AnyAddress,
|
|
20
|
+
symbol: zod_1.z.string().min(1),
|
|
21
|
+
decimals: zod_1.z.number().int().nonnegative().max(255),
|
|
22
|
+
limits: exports.RouteLimitsSchema,
|
|
23
|
+
});
|
|
24
|
+
exports.RoutePairSchema = zod_1.z.looseObject({
|
|
25
|
+
baseline: zod_1.z.boolean(),
|
|
26
|
+
source: exports.RoutePairLegSchema,
|
|
27
|
+
destination: exports.RoutePairLegSchema,
|
|
28
|
+
});
|
|
29
|
+
exports.RouteChainSchema = zod_1.z.looseObject({
|
|
30
|
+
chainId: primitives_1.ChainId,
|
|
31
|
+
});
|
|
32
|
+
exports.RouteAnyAssetSchema = zod_1.z.looseObject({
|
|
33
|
+
source: zod_1.z.boolean(),
|
|
34
|
+
destination: zod_1.z.boolean(),
|
|
11
35
|
});
|
|
12
36
|
exports.RouteEntrySchema = zod_1.z.looseObject({
|
|
13
|
-
source:
|
|
14
|
-
destination:
|
|
15
|
-
|
|
37
|
+
source: exports.RouteChainSchema,
|
|
38
|
+
destination: exports.RouteChainSchema,
|
|
39
|
+
pairs: zod_1.z.array(exports.RoutePairSchema),
|
|
40
|
+
anyAsset: exports.RouteAnyAssetSchema,
|
|
16
41
|
});
|
|
17
42
|
exports.RoutesResponseSchema = zod_1.z.looseObject({
|
|
18
43
|
routes: zod_1.z.array(exports.RouteEntrySchema),
|
|
19
|
-
|
|
44
|
+
updatedAt: primitives_1.UnixSeconds,
|
|
45
|
+
nextCursor: zod_1.z.string().min(1).max(exports.ROUTES_CURSOR_MAX_LENGTH).nullable(),
|
|
20
46
|
});
|
|
21
47
|
//# sourceMappingURL=routes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.js","sourceRoot":"","sources":["../../../src/v1/endpoints/routes.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,
|
|
1
|
+
{"version":3,"file":"routes.js","sourceRoot":"","sources":["../../../src/v1/endpoints/routes.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,8CAA2F;AA2B9E,Q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,EAAE,OAAC,CAAC,OAAO,EAAE;CACzB,CAAC,CAAC;AAEU,QAAA,gBAAgB,GAAG,OAAC,CAAC,WAAW,CAAC;IAC5C,MAAM,EAAE,wBAAgB;IACxB,WAAW,EAAE,wBAAgB;IAC7B,KAAK,EAAE,OAAC,CAAC,KAAK,CAAC,uBAAe,CAAC;IAC/B,QAAQ,EAAE,2BAAmB;CAC9B,CAAC,CAAC;AAGU,QAAA,oBAAoB,GAAG,OAAC,CAAC,WAAW,CAAC;IAChD,MAAM,EAAE,OAAC,CAAC,KAAK,CAAC,wBAAgB,CAAC;IAEjC,SAAS,EAAE,wBAAW;IAEtB,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,gCAAwB,CAAC,CAAC,QAAQ,EAAE;CACvE,CAAC,CAAC"}
|
|
@@ -280,6 +280,13 @@ export declare const V1_ERROR_CATALOG: readonly [{
|
|
|
280
280
|
readonly type: string;
|
|
281
281
|
readonly audience: "read" | "write" | "all";
|
|
282
282
|
readonly legacyCodes: readonly LegacyCodeRef[];
|
|
283
|
+
}, {
|
|
284
|
+
readonly code: "maintenance";
|
|
285
|
+
readonly status: number;
|
|
286
|
+
readonly title: string;
|
|
287
|
+
readonly type: string;
|
|
288
|
+
readonly audience: "read" | "write" | "all";
|
|
289
|
+
readonly legacyCodes: readonly LegacyCodeRef[];
|
|
283
290
|
}];
|
|
284
291
|
export type V1ErrorCode = (typeof V1_ERROR_CATALOG)[number]['code'];
|
|
285
292
|
export declare function getErrorDefinition(code: V1ErrorCode): V1ErrorDefinition;
|
|
@@ -109,6 +109,7 @@ exports.V1_ERROR_CATALOG = [
|
|
|
109
109
|
]),
|
|
110
110
|
define('solver-error', 502, 'An upstream solver rejected or failed the quote request', 'all'),
|
|
111
111
|
define('service-unavailable', 503, 'Service temporarily unavailable', 'all'),
|
|
112
|
+
define('maintenance', 503, 'Scheduled maintenance: new quotes and deposit addresses are paused until the window ends', 'all'),
|
|
112
113
|
];
|
|
113
114
|
const BY_CODE = new Map(exports.V1_ERROR_CATALOG.map((e) => [e.code, e]));
|
|
114
115
|
function getErrorDefinition(code) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog.js","sourceRoot":"","sources":["../../../src/v1/errors/catalog.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"catalog.js","sourceRoot":"","sources":["../../../src/v1/errors/catalog.ts"],"names":[],"mappings":";;;AAsTA,gDAIC;AAnSD,MAAM,OAAO,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,iCAAiC,IAAI,EAAE,CAAC;AAE1E,MAAM,MAAM,GAAG,CACb,IAAO,EACP,MAAc,EACd,KAAa,EACb,QAAkC,EAClC,cAAwC,EAAE,EAC1C,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAU,CAAC;AAEvE,QAAA,gBAAgB,GAAG;IAC9B,MAAM,CAAC,iBAAiB,EAAE,GAAG,EAAE,2BAA2B,EAAE,KAAK,EAAE,CAAC,iBAAiB,CAAC,CAAC;IACvF,MAAM,CAAC,mBAAmB,EAAE,GAAG,EAAE,iCAAiC,EAAE,KAAK,EAAE,CAAC,iBAAiB,CAAC,CAAC;IAC/F,MAAM,CAAC,mBAAmB,EAAE,GAAG,EAAE,8BAA8B,EAAE,KAAK,EAAE;QACtE,iBAAiB;QACjB,iBAAiB;QACjB,iBAAiB;QACjB,wBAAwB;KACzB,CAAC;IACF,MAAM,CACJ,wBAAwB,EACxB,GAAG,EACH,yEAAyE;QACvE,+CAA+C,EACjD,KAAK,CACN;IASD,MAAM,CACJ,0BAA0B,EAC1B,GAAG,EACH,8DAA8D,EAC9D,OAAO,CACR;IAWD,MAAM,CACJ,gBAAgB,EAChB,GAAG,EACH,mFAAmF,EACnF,OAAO,CACR;IACD,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F,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,EAAE,4CAA4C,EAAE;IACvF,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,EAAE,4CAA4C,EAAE;IACvF,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,EAAE,4CAA4C,EAAE;IACvF,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,EAAE,4CAA4C,EAAE;IACvF,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,EAAE,kDAAkD,EAAE;IAC7F;QACE,UAAU,EAAE,wBAAwB;QACpC,MAAM,EAAE,8EAA8E;KACvF;CACF,CAAC"}
|
package/dist/v1/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export * from './endpoints/tokens';
|
|
|
9
9
|
export * from './enums';
|
|
10
10
|
export * from './errors/catalog';
|
|
11
11
|
export * from './errors/problem';
|
|
12
|
+
export * from './maintenance/schema';
|
|
12
13
|
export * from './primitives';
|
|
13
14
|
export * from './signature';
|
|
14
15
|
export declare const V1_API_VERSION: "v1";
|
package/dist/v1/index.js
CHANGED
|
@@ -26,6 +26,7 @@ __exportStar(require("./endpoints/tokens"), exports);
|
|
|
26
26
|
__exportStar(require("./enums"), exports);
|
|
27
27
|
__exportStar(require("./errors/catalog"), exports);
|
|
28
28
|
__exportStar(require("./errors/problem"), exports);
|
|
29
|
+
__exportStar(require("./maintenance/schema"), exports);
|
|
29
30
|
__exportStar(require("./primitives"), exports);
|
|
30
31
|
__exportStar(require("./signature"), exports);
|
|
31
32
|
exports.V1_API_VERSION = 'v1';
|
package/dist/v1/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/v1/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qDAAmC;AACnC,gEAA8C;AAC9C,qDAAmC;AACnC,uDAAqC;AACrC,qDAAmC;AACnC,qDAAmC;AACnC,qDAAmC;AACnC,qDAAmC;AACnC,0CAAwB;AACxB,mDAAiC;AACjC,mDAAiC;AACjC,+CAA6B;AAC7B,8CAA4B;AAEf,QAAA,cAAc,GAAG,IAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/v1/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qDAAmC;AACnC,gEAA8C;AAC9C,qDAAmC;AACnC,uDAAqC;AACrC,qDAAmC;AACnC,qDAAmC;AACnC,qDAAmC;AACnC,qDAAmC;AACnC,0CAAwB;AACxB,mDAAiC;AACjC,mDAAiC;AACjC,uDAAqC;AACrC,+CAA6B;AAC7B,8CAA4B;AAEf,QAAA,cAAc,GAAG,IAAa,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const MAINTENANCE_MESSAGE_MAX_LENGTH = 200;
|
|
3
|
+
declare const MaintenanceWindowShape: z.ZodObject<{
|
|
4
|
+
startsAt: z.ZodString;
|
|
5
|
+
endsAt: z.ZodString;
|
|
6
|
+
message: z.ZodString;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
export declare const MaintenanceWindowSchema: z.ZodPreprocess<z.ZodObject<{
|
|
9
|
+
startsAt: z.ZodString;
|
|
10
|
+
endsAt: z.ZodString;
|
|
11
|
+
message: z.ZodString;
|
|
12
|
+
}, z.core.$strip>>;
|
|
13
|
+
export type MaintenanceWindow = z.infer<typeof MaintenanceWindowShape>;
|
|
14
|
+
declare const MaintenanceConfigShape: z.ZodObject<{
|
|
15
|
+
windows: z.ZodDefault<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
|
|
16
|
+
startsAt: z.ZodString;
|
|
17
|
+
endsAt: z.ZodString;
|
|
18
|
+
message: z.ZodString;
|
|
19
|
+
}, z.core.$strip>>>>;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
export declare const MaintenanceConfigSchema: z.ZodPreprocess<z.ZodObject<{
|
|
22
|
+
windows: z.ZodDefault<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
|
|
23
|
+
startsAt: z.ZodString;
|
|
24
|
+
endsAt: z.ZodString;
|
|
25
|
+
message: z.ZodString;
|
|
26
|
+
}, z.core.$strip>>>>;
|
|
27
|
+
}, z.core.$strip>>;
|
|
28
|
+
export type MaintenanceConfig = z.infer<typeof MaintenanceConfigShape>;
|
|
29
|
+
export type MaintenanceConfigInput = z.input<typeof MaintenanceConfigShape>;
|
|
30
|
+
export {};
|